@gapi/gcli 1.8.277 → 1.8.278
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/release/index.js
CHANGED
|
@@ -9498,19 +9498,19 @@ var require_Observable = __commonJS({
|
|
|
9498
9498
|
var config_1 = require_config();
|
|
9499
9499
|
var isFunction_1 = require_isFunction();
|
|
9500
9500
|
var errorContext_1 = require_errorContext();
|
|
9501
|
-
var
|
|
9502
|
-
function
|
|
9501
|
+
var Observable9 = (function() {
|
|
9502
|
+
function Observable10(subscribe) {
|
|
9503
9503
|
if (subscribe) {
|
|
9504
9504
|
this._subscribe = subscribe;
|
|
9505
9505
|
}
|
|
9506
9506
|
}
|
|
9507
|
-
|
|
9508
|
-
var observable = new
|
|
9507
|
+
Observable10.prototype.lift = function(operator) {
|
|
9508
|
+
var observable = new Observable10();
|
|
9509
9509
|
observable.source = this;
|
|
9510
9510
|
observable.operator = operator;
|
|
9511
9511
|
return observable;
|
|
9512
9512
|
};
|
|
9513
|
-
|
|
9513
|
+
Observable10.prototype.subscribe = function(observerOrNext, error48, complete) {
|
|
9514
9514
|
var _this = this;
|
|
9515
9515
|
var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new Subscriber_1.SafeSubscriber(observerOrNext, error48, complete);
|
|
9516
9516
|
errorContext_1.errorContext(function() {
|
|
@@ -9519,14 +9519,14 @@ var require_Observable = __commonJS({
|
|
|
9519
9519
|
});
|
|
9520
9520
|
return subscriber;
|
|
9521
9521
|
};
|
|
9522
|
-
|
|
9522
|
+
Observable10.prototype._trySubscribe = function(sink) {
|
|
9523
9523
|
try {
|
|
9524
9524
|
return this._subscribe(sink);
|
|
9525
9525
|
} catch (err) {
|
|
9526
9526
|
sink.error(err);
|
|
9527
9527
|
}
|
|
9528
9528
|
};
|
|
9529
|
-
|
|
9529
|
+
Observable10.prototype.forEach = function(next, promiseCtor) {
|
|
9530
9530
|
var _this = this;
|
|
9531
9531
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
9532
9532
|
return new promiseCtor(function(resolve2, reject) {
|
|
@@ -9545,21 +9545,21 @@ var require_Observable = __commonJS({
|
|
|
9545
9545
|
_this.subscribe(subscriber);
|
|
9546
9546
|
});
|
|
9547
9547
|
};
|
|
9548
|
-
|
|
9548
|
+
Observable10.prototype._subscribe = function(subscriber) {
|
|
9549
9549
|
var _a2;
|
|
9550
9550
|
return (_a2 = this.source) === null || _a2 === void 0 ? void 0 : _a2.subscribe(subscriber);
|
|
9551
9551
|
};
|
|
9552
|
-
|
|
9552
|
+
Observable10.prototype[observable_1.observable] = function() {
|
|
9553
9553
|
return this;
|
|
9554
9554
|
};
|
|
9555
|
-
|
|
9555
|
+
Observable10.prototype.pipe = function() {
|
|
9556
9556
|
var operations = [];
|
|
9557
9557
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9558
9558
|
operations[_i] = arguments[_i];
|
|
9559
9559
|
}
|
|
9560
9560
|
return pipe_1.pipeFromArray(operations)(this);
|
|
9561
9561
|
};
|
|
9562
|
-
|
|
9562
|
+
Observable10.prototype.toPromise = function(promiseCtor) {
|
|
9563
9563
|
var _this = this;
|
|
9564
9564
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
9565
9565
|
return new promiseCtor(function(resolve2, reject) {
|
|
@@ -9573,12 +9573,12 @@ var require_Observable = __commonJS({
|
|
|
9573
9573
|
});
|
|
9574
9574
|
});
|
|
9575
9575
|
};
|
|
9576
|
-
|
|
9577
|
-
return new
|
|
9576
|
+
Observable10.create = function(subscribe) {
|
|
9577
|
+
return new Observable10(subscribe);
|
|
9578
9578
|
};
|
|
9579
|
-
return
|
|
9579
|
+
return Observable10;
|
|
9580
9580
|
})();
|
|
9581
|
-
exports2.Observable =
|
|
9581
|
+
exports2.Observable = Observable9;
|
|
9582
9582
|
function getPromiseCtor(promiseCtor) {
|
|
9583
9583
|
var _a2;
|
|
9584
9584
|
return (_a2 = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config_1.config.Promise) !== null && _a2 !== void 0 ? _a2 : Promise;
|
|
@@ -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 of20() {
|
|
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 = of20;
|
|
12260
12260
|
}
|
|
12261
12261
|
});
|
|
12262
12262
|
|
|
@@ -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 map33(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 = map33;
|
|
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 concat4() {
|
|
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 = concat4;
|
|
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 catchError16(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, catchError16(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 = catchError16;
|
|
14302
14302
|
}
|
|
14303
14303
|
});
|
|
14304
14304
|
|
|
@@ -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 concat4() {
|
|
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 = concat4;
|
|
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 switchMap54(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 = switchMap54;
|
|
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 tap54(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 = tap54;
|
|
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 map33(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 = map33;
|
|
20466
20466
|
exports2.querystring = querystring;
|
|
20467
20467
|
exports2.querystringDecode = querystringDecode;
|
|
20468
20468
|
exports2.safeGet = safeGet;
|
|
@@ -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[of20] || 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 of20 = "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[of20] = 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 concat4(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 concat4(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(map33, options, encode3) {
|
|
35488
|
+
const acc = [getHeader(map33.size, 128, 222)];
|
|
35489
|
+
const keys = [...map33.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(map33.get(key)));
|
|
35497
35497
|
});
|
|
35498
35498
|
return bl(acc);
|
|
35499
35499
|
}
|
|
@@ -39526,22 +39526,22 @@ var require_source_map_generator = __commonJS({
|
|
|
39526
39526
|
}, this);
|
|
39527
39527
|
};
|
|
39528
39528
|
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
|
|
39529
|
-
var
|
|
39529
|
+
var map33 = {
|
|
39530
39530
|
version: this._version,
|
|
39531
39531
|
sources: this._sources.toArray(),
|
|
39532
39532
|
names: this._names.toArray(),
|
|
39533
39533
|
mappings: this._serializeMappings()
|
|
39534
39534
|
};
|
|
39535
39535
|
if (this._file != null) {
|
|
39536
|
-
|
|
39536
|
+
map33.file = this._file;
|
|
39537
39537
|
}
|
|
39538
39538
|
if (this._sourceRoot != null) {
|
|
39539
|
-
|
|
39539
|
+
map33.sourceRoot = this._sourceRoot;
|
|
39540
39540
|
}
|
|
39541
39541
|
if (this._sourcesContents) {
|
|
39542
|
-
|
|
39542
|
+
map33.sourcesContent = this._generateSourcesContent(map33.sources, map33.sourceRoot);
|
|
39543
39543
|
}
|
|
39544
|
-
return
|
|
39544
|
+
return map33;
|
|
39545
39545
|
};
|
|
39546
39546
|
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
|
|
39547
39547
|
return JSON.stringify(this.toJSON());
|
|
@@ -40434,7 +40434,7 @@ var require_source_node = __commonJS({
|
|
|
40434
40434
|
line: 1,
|
|
40435
40435
|
column: 0
|
|
40436
40436
|
};
|
|
40437
|
-
var
|
|
40437
|
+
var map33 = new SourceMapGenerator(aArgs);
|
|
40438
40438
|
var sourceMappingActive = false;
|
|
40439
40439
|
var lastOriginalSource = null;
|
|
40440
40440
|
var lastOriginalLine = null;
|
|
@@ -40444,7 +40444,7 @@ var require_source_node = __commonJS({
|
|
|
40444
40444
|
generated.code += chunk;
|
|
40445
40445
|
if (original.source !== null && original.line !== null && original.column !== null) {
|
|
40446
40446
|
if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
|
|
40447
|
-
|
|
40447
|
+
map33.addMapping({
|
|
40448
40448
|
source: original.source,
|
|
40449
40449
|
original: {
|
|
40450
40450
|
line: original.line,
|
|
@@ -40463,7 +40463,7 @@ var require_source_node = __commonJS({
|
|
|
40463
40463
|
lastOriginalName = original.name;
|
|
40464
40464
|
sourceMappingActive = true;
|
|
40465
40465
|
} else if (sourceMappingActive) {
|
|
40466
|
-
|
|
40466
|
+
map33.addMapping({
|
|
40467
40467
|
generated: {
|
|
40468
40468
|
line: generated.line,
|
|
40469
40469
|
column: generated.column
|
|
@@ -40480,7 +40480,7 @@ var require_source_node = __commonJS({
|
|
|
40480
40480
|
lastOriginalSource = null;
|
|
40481
40481
|
sourceMappingActive = false;
|
|
40482
40482
|
} else if (sourceMappingActive) {
|
|
40483
|
-
|
|
40483
|
+
map33.addMapping({
|
|
40484
40484
|
source: original.source,
|
|
40485
40485
|
original: {
|
|
40486
40486
|
line: original.line,
|
|
@@ -40499,9 +40499,9 @@ var require_source_node = __commonJS({
|
|
|
40499
40499
|
}
|
|
40500
40500
|
});
|
|
40501
40501
|
this.walkSourceContents(function(sourceFile, sourceContent) {
|
|
40502
|
-
|
|
40502
|
+
map33.setSourceContent(sourceFile, sourceContent);
|
|
40503
40503
|
});
|
|
40504
|
-
return { code: generated.code, map:
|
|
40504
|
+
return { code: generated.code, map: map33 };
|
|
40505
40505
|
};
|
|
40506
40506
|
exports2.SourceNode = SourceNode;
|
|
40507
40507
|
}
|
|
@@ -42841,7 +42841,7 @@ var require_typescript = __commonJS({
|
|
|
42841
42841
|
makeImport: () => makeImport,
|
|
42842
42842
|
makeStringLiteral: () => makeStringLiteral,
|
|
42843
42843
|
mangleScopedPackageName: () => mangleScopedPackageName,
|
|
42844
|
-
map: () =>
|
|
42844
|
+
map: () => map33,
|
|
42845
42845
|
mapAllOrFail: () => mapAllOrFail,
|
|
42846
42846
|
mapDefined: () => mapDefined,
|
|
42847
42847
|
mapDefinedIterator: () => mapDefinedIterator,
|
|
@@ -43485,7 +43485,7 @@ var require_typescript = __commonJS({
|
|
|
43485
43485
|
function clear(array2) {
|
|
43486
43486
|
array2.length = 0;
|
|
43487
43487
|
}
|
|
43488
|
-
function
|
|
43488
|
+
function map33(array2, f3) {
|
|
43489
43489
|
let result;
|
|
43490
43490
|
if (array2 !== void 0) {
|
|
43491
43491
|
result = [];
|
|
@@ -45014,7 +45014,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
45014
45014
|
}
|
|
45015
45015
|
Debug2.getFunctionName = getFunctionName;
|
|
45016
45016
|
function formatSymbol(symbol2) {
|
|
45017
|
-
return `{ name: ${unescapeLeadingUnderscores(symbol2.escapedName)}; flags: ${formatSymbolFlags(symbol2.flags)}; declarations: ${
|
|
45017
|
+
return `{ name: ${unescapeLeadingUnderscores(symbol2.escapedName)}; flags: ${formatSymbolFlags(symbol2.flags)}; declarations: ${map33(symbol2.declarations, (node) => formatSyntaxKind(node.kind))} }`;
|
|
45018
45018
|
}
|
|
45019
45019
|
Debug2.formatSymbol = formatSymbol;
|
|
45020
45020
|
function formatEnum(value = 0, enumObject, isFlags) {
|
|
@@ -45440,7 +45440,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
45440
45440
|
case 1:
|
|
45441
45441
|
return zipWith(
|
|
45442
45442
|
this.sources,
|
|
45443
|
-
this.targets ||
|
|
45443
|
+
this.targets || map33(this.sources, () => "any"),
|
|
45444
45444
|
(s2, t2) => `${s2.__debugTypeToString()} -> ${typeof t2 === "string" ? t2 : t2.__debugTypeToString()}`
|
|
45445
45445
|
).join(", ");
|
|
45446
45446
|
case 2:
|
|
@@ -46075,10 +46075,10 @@ ${lanes.join("\n")}
|
|
|
46075
46075
|
}
|
|
46076
46076
|
}
|
|
46077
46077
|
function formatDisjunction(alternatives) {
|
|
46078
|
-
return
|
|
46078
|
+
return map33(alternatives, formatAlternative).join(" || ") || "*";
|
|
46079
46079
|
}
|
|
46080
46080
|
function formatAlternative(comparators) {
|
|
46081
|
-
return
|
|
46081
|
+
return map33(comparators, formatComparator).join(" ");
|
|
46082
46082
|
}
|
|
46083
46083
|
function formatComparator(comparator) {
|
|
46084
46084
|
return `${comparator.operator}${comparator.operand}`;
|
|
@@ -64005,7 +64005,7 @@ ${lanes.join("\n")}
|
|
|
64005
64005
|
currentDirectory = normalizePath(currentDirectory);
|
|
64006
64006
|
const absolutePath = combinePaths(currentDirectory, path2);
|
|
64007
64007
|
return {
|
|
64008
|
-
includeFilePatterns:
|
|
64008
|
+
includeFilePatterns: map33(getRegularExpressionsForWildcards(includes, absolutePath, "files"), (pattern) => `^${pattern}$`),
|
|
64009
64009
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
64010
64010
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
64011
64011
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
@@ -66515,7 +66515,7 @@ ${lanes.join("\n")}
|
|
|
66515
66515
|
if (isObjectBindingPattern(node)) {
|
|
66516
66516
|
return setOriginalNode(
|
|
66517
66517
|
setTextRange(
|
|
66518
|
-
factory2.createObjectLiteralExpression(
|
|
66518
|
+
factory2.createObjectLiteralExpression(map33(node.elements, convertToObjectAssignmentElement)),
|
|
66519
66519
|
node
|
|
66520
66520
|
),
|
|
66521
66521
|
node
|
|
@@ -66527,7 +66527,7 @@ ${lanes.join("\n")}
|
|
|
66527
66527
|
if (isArrayBindingPattern(node)) {
|
|
66528
66528
|
return setOriginalNode(
|
|
66529
66529
|
setTextRange(
|
|
66530
|
-
factory2.createArrayLiteralExpression(
|
|
66530
|
+
factory2.createArrayLiteralExpression(map33(node.elements, convertToArrayAssignmentElement)),
|
|
66531
66531
|
node
|
|
66532
66532
|
),
|
|
66533
66533
|
node
|
|
@@ -74349,7 +74349,7 @@ ${lanes.join("\n")}
|
|
|
74349
74349
|
if (some(helperNames)) {
|
|
74350
74350
|
helperNames.sort(compareStringsCaseSensitive);
|
|
74351
74351
|
const namedBindings = nodeFactory.createNamedImports(
|
|
74352
|
-
|
|
74352
|
+
map33(helperNames, (name2) => isFileLevelUniqueName(sourceFile, name2) ? nodeFactory.createImportSpecifier(
|
|
74353
74353
|
/*isTypeOnly*/
|
|
74354
74354
|
false,
|
|
74355
74355
|
/*propertyName*/
|
|
@@ -84552,7 +84552,7 @@ ${lanes.join("\n")}
|
|
|
84552
84552
|
break;
|
|
84553
84553
|
}
|
|
84554
84554
|
case "amd-dependency": {
|
|
84555
|
-
context.amdDependencies =
|
|
84555
|
+
context.amdDependencies = map33(
|
|
84556
84556
|
toArray3(entryOrList),
|
|
84557
84557
|
(x2) => ({ name: x2.arguments.name, path: x2.arguments.path })
|
|
84558
84558
|
);
|
|
@@ -86901,7 +86901,7 @@ ${lanes.join("\n")}
|
|
|
86901
86901
|
function convertToTSConfig(configParseResult, configFileName, host) {
|
|
86902
86902
|
var _a2, _b, _c;
|
|
86903
86903
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames);
|
|
86904
|
-
const files =
|
|
86904
|
+
const files = map33(
|
|
86905
86905
|
filter6(
|
|
86906
86906
|
configParseResult.fileNames,
|
|
86907
86907
|
!((_b = (_a2 = configParseResult.options.configFile) == null ? void 0 : _a2.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs) ? returnTrue : matchesSpecs(
|
|
@@ -86931,7 +86931,7 @@ ${lanes.join("\n")}
|
|
|
86931
86931
|
version: void 0
|
|
86932
86932
|
},
|
|
86933
86933
|
watchOptions: watchOptionMap && optionMapToObject(watchOptionMap),
|
|
86934
|
-
references:
|
|
86934
|
+
references: map33(configParseResult.projectReferences, (r2) => ({ ...r2, path: r2.originalPath ? r2.originalPath : "", originalPath: void 0 })),
|
|
86935
86935
|
files: length(files) ? files : void 0,
|
|
86936
86936
|
...((_c = configParseResult.options.configFile) == null ? void 0 : _c.configFileSpecs) ? {
|
|
86937
86937
|
include: filterSameAsDefaultInclude(configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs),
|
|
@@ -87221,8 +87221,8 @@ ${lanes.join("\n")}
|
|
|
87221
87221
|
if (!option) Debug.fail(`No option named ${settingName}?`);
|
|
87222
87222
|
const map210 = option.type instanceof Map ? option.type : void 0;
|
|
87223
87223
|
if (isArray(value)) {
|
|
87224
|
-
const
|
|
87225
|
-
return `[${value.map((v) => formatSingleValue(v,
|
|
87224
|
+
const map34 = "element" in option && option.element.type instanceof Map ? option.element.type : void 0;
|
|
87225
|
+
return `[${value.map((v) => formatSingleValue(v, map34)).join(", ")}]`;
|
|
87226
87226
|
} else {
|
|
87227
87227
|
return formatSingleValue(value, map210);
|
|
87228
87228
|
}
|
|
@@ -87620,7 +87620,7 @@ ${lanes.join("\n")}
|
|
|
87620
87620
|
const setPropertyInResultIfNotUndefined = (propertyName) => {
|
|
87621
87621
|
if (ownConfig.raw[propertyName]) return;
|
|
87622
87622
|
if (extendsRaw[propertyName]) {
|
|
87623
|
-
result[propertyName] =
|
|
87623
|
+
result[propertyName] = map33(extendsRaw[propertyName], (path2) => startsWithConfigDirTemplate(path2) || isRootedDiskPath(path2) ? path2 : combinePaths(
|
|
87624
87624
|
relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames))),
|
|
87625
87625
|
path2
|
|
87626
87626
|
));
|
|
@@ -87929,7 +87929,7 @@ ${lanes.join("\n")}
|
|
|
87929
87929
|
}
|
|
87930
87930
|
}
|
|
87931
87931
|
function convertJsonOptionOfListType(option, values, basePath, errors, propertyAssignment, valueExpression, sourceFile) {
|
|
87932
|
-
return filter6(
|
|
87932
|
+
return filter6(map33(values, (v, index) => convertJsonOption(option.element, v, basePath, errors, propertyAssignment, valueExpression == null ? void 0 : valueExpression.elements[index], sourceFile)), (v) => option.listPreserveFalsyValues ? true : !!v);
|
|
87933
87933
|
}
|
|
87934
87934
|
var invalidTrailingRecursionPattern = /(?:^|\/)\*\*\/?$/;
|
|
87935
87935
|
var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/;
|
|
@@ -87969,7 +87969,7 @@ ${lanes.join("\n")}
|
|
|
87969
87969
|
".json"
|
|
87970
87970
|
/* Json */
|
|
87971
87971
|
));
|
|
87972
|
-
const includeFilePatterns =
|
|
87972
|
+
const includeFilePatterns = map33(getRegularExpressionsForWildcards(includes, basePath, "files"), (pattern) => `^${pattern}$`);
|
|
87973
87973
|
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, host.useCaseSensitiveFileNames)) : emptyArray;
|
|
87974
87974
|
}
|
|
87975
87975
|
const includeIndex = findIndex(jsonOnlyIncludeRegexes, (re) => re.test(file2));
|
|
@@ -95269,7 +95269,7 @@ ${lanes.join("\n")}
|
|
|
95269
95269
|
}
|
|
95270
95270
|
const normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
|
|
95271
95271
|
const relativePaths = flatMap(normalizedSourcePaths, (sourcePath) => {
|
|
95272
|
-
return
|
|
95272
|
+
return map33(normalizedTargetPaths, (targetPath) => ensurePathIsNonModuleName(getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName)));
|
|
95273
95273
|
});
|
|
95274
95274
|
const shortest = min(relativePaths, compareNumberOfDirectorySeparators);
|
|
95275
95275
|
if (!shortest) {
|
|
@@ -98314,7 +98314,7 @@ ${lanes.join("\n")}
|
|
|
98314
98314
|
const exportedSymbol = exports22 ? find(symbolsToArray(exports22), (symbol2) => !!getSymbolIfSameReference(symbol2, localSymbol)) : void 0;
|
|
98315
98315
|
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);
|
|
98316
98316
|
if (localSymbol.declarations) {
|
|
98317
|
-
addRelatedInfo(diagnostic, ...
|
|
98317
|
+
addRelatedInfo(diagnostic, ...map33(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)));
|
|
98318
98318
|
}
|
|
98319
98319
|
}
|
|
98320
98320
|
} else {
|
|
@@ -101095,7 +101095,7 @@ ${lanes.join("\n")}
|
|
|
101095
101095
|
const types3 = type.types;
|
|
101096
101096
|
const templateHead = factory.createTemplateHead(texts[0]);
|
|
101097
101097
|
const templateSpans = factory.createNodeArray(
|
|
101098
|
-
|
|
101098
|
+
map33(types3, (t2, i2) => factory.createTemplateLiteralTypeSpan(
|
|
101099
101099
|
typeToTypeNodeHelper(t2, context),
|
|
101100
101100
|
(i2 < types3.length - 1 ? factory.createTemplateMiddle : factory.createTemplateTail)(texts[i2 + 1])
|
|
101101
101101
|
))
|
|
@@ -101464,7 +101464,7 @@ ${lanes.join("\n")}
|
|
|
101464
101464
|
}
|
|
101465
101465
|
const abstractSignatures = filter6(resolved.constructSignatures, (signature) => !!(signature.flags & 4));
|
|
101466
101466
|
if (some(abstractSignatures)) {
|
|
101467
|
-
const types3 =
|
|
101467
|
+
const types3 = map33(abstractSignatures, getOrCreateTypeFromSignature);
|
|
101468
101468
|
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
|
|
101469
101469
|
// the logic in `createTypeNodesFromResolvedType`.
|
|
101470
101470
|
(context.flags & 2048 ? countWhere(resolved.properties, (p) => !(p.flags & 4194304)) : length(resolved.properties));
|
|
@@ -101682,7 +101682,7 @@ ${lanes.join("\n")}
|
|
|
101682
101682
|
const newComponents = filter6(indexInfo.components, (e2) => {
|
|
101683
101683
|
return !hasLateBindableName(e2);
|
|
101684
101684
|
});
|
|
101685
|
-
return
|
|
101685
|
+
return map33(newComponents, (e2) => {
|
|
101686
101686
|
trackComputedName(e2.name.expression, context2.enclosingDeclaration, context2);
|
|
101687
101687
|
return setTextRange2(
|
|
101688
101688
|
context2,
|
|
@@ -102491,7 +102491,7 @@ ${lanes.join("\n")}
|
|
|
102491
102491
|
const parameterDeclaration = getEffectiveParameterDeclaration(parameterSymbol);
|
|
102492
102492
|
const parameterType = getTypeOfSymbol(parameterSymbol);
|
|
102493
102493
|
const parameterTypeNode = serializeTypeForDeclaration(context, parameterDeclaration, parameterType, parameterSymbol);
|
|
102494
|
-
const modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ?
|
|
102494
|
+
const modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map33(getModifiers(parameterDeclaration), factory.cloneNode) : void 0;
|
|
102495
102495
|
const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768;
|
|
102496
102496
|
const dotDotDotToken = isRest ? factory.createToken(
|
|
102497
102497
|
26
|
|
@@ -102689,7 +102689,7 @@ ${lanes.join("\n")}
|
|
|
102689
102689
|
let typeParameterNodes;
|
|
102690
102690
|
const targetSymbol = getTargetSymbol(symbol2);
|
|
102691
102691
|
if (targetSymbol.flags & (32 | 64 | 524288)) {
|
|
102692
|
-
typeParameterNodes = factory.createNodeArray(
|
|
102692
|
+
typeParameterNodes = factory.createNodeArray(map33(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol2), (tp) => typeParameterToDeclaration(tp, context)));
|
|
102693
102693
|
}
|
|
102694
102694
|
return typeParameterNodes;
|
|
102695
102695
|
}
|
|
@@ -102714,7 +102714,7 @@ ${lanes.join("\n")}
|
|
|
102714
102714
|
const params = getTypeParametersOfClassOrInterface(
|
|
102715
102715
|
parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol
|
|
102716
102716
|
);
|
|
102717
|
-
typeParameterNodes = mapToTypeNodes(
|
|
102717
|
+
typeParameterNodes = mapToTypeNodes(map33(params, (t2) => getMappedType(t2, nextSymbol.links.mapper)), context);
|
|
102718
102718
|
} else {
|
|
102719
102719
|
typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol2, context);
|
|
102720
102720
|
}
|
|
@@ -103537,7 +103537,7 @@ ${lanes.join("\n")}
|
|
|
103537
103537
|
}
|
|
103538
103538
|
function getNamesOfDeclaration(statement) {
|
|
103539
103539
|
if (isVariableStatement(statement)) {
|
|
103540
|
-
return filter6(
|
|
103540
|
+
return filter6(map33(statement.declarationList.declarations, getNameOfDeclaration), isIdentifierAndNotUndefined);
|
|
103541
103541
|
}
|
|
103542
103542
|
return filter6([getNameOfDeclaration(statement)], isIdentifierAndNotUndefined);
|
|
103543
103543
|
}
|
|
@@ -103563,7 +103563,7 @@ ${lanes.join("\n")}
|
|
|
103563
103563
|
void 0,
|
|
103564
103564
|
/*isTypeOnly*/
|
|
103565
103565
|
false,
|
|
103566
|
-
factory.createNamedExports(
|
|
103566
|
+
factory.createNamedExports(map33(flatMap(excessExports, (e2) => getNamesOfDeclaration(e2)), (id) => factory.createExportSpecifier(
|
|
103567
103567
|
/*isTypeOnly*/
|
|
103568
103568
|
false,
|
|
103569
103569
|
/*propertyName*/
|
|
@@ -103983,7 +103983,7 @@ ${lanes.join("\n")}
|
|
|
103983
103983
|
var _a22;
|
|
103984
103984
|
const aliasType = getDeclaredTypeOfTypeAlias(symbol2);
|
|
103985
103985
|
const typeParams = getSymbolLinks(symbol2).typeParameters;
|
|
103986
|
-
const typeParamDecls =
|
|
103986
|
+
const typeParamDecls = map33(typeParams, (p) => typeParameterToDeclaration(p, context));
|
|
103987
103987
|
const jsdocAliasDecl = (_a22 = symbol2.declarations) == null ? void 0 : _a22.find(isJSDocTypeAlias);
|
|
103988
103988
|
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
|
|
103989
103989
|
const restoreFlags = saveRestoreFlags(context);
|
|
@@ -104014,7 +104014,7 @@ ${lanes.join("\n")}
|
|
|
104014
104014
|
context.approximateLength += 14 + internalSymbolName.length;
|
|
104015
104015
|
const interfaceType = getDeclaredTypeOfClassOrInterface(symbol2);
|
|
104016
104016
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol2);
|
|
104017
|
-
const typeParamDecls =
|
|
104017
|
+
const typeParamDecls = map33(localParams, (p) => typeParameterToDeclaration(p, context));
|
|
104018
104018
|
const baseTypes = getBaseTypes(interfaceType);
|
|
104019
104019
|
const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0;
|
|
104020
104020
|
const members = serializePropertySymbolsForClassOrInterface(
|
|
@@ -104327,7 +104327,7 @@ ${lanes.join("\n")}
|
|
|
104327
104327
|
addingDeclare = oldAddingDeclare;
|
|
104328
104328
|
const declarations = results;
|
|
104329
104329
|
results = oldResults;
|
|
104330
|
-
const defaultReplaced =
|
|
104330
|
+
const defaultReplaced = map33(declarations, (d) => isExportAssignment(d) && !d.isExportEquals && isIdentifier(d.expression) ? factory.createExportDeclaration(
|
|
104331
104331
|
/*modifiers*/
|
|
104332
104332
|
void 0,
|
|
104333
104333
|
/*isTypeOnly*/
|
|
@@ -104346,7 +104346,7 @@ ${lanes.join("\n")}
|
|
|
104346
104346
|
d,
|
|
104347
104347
|
32
|
|
104348
104348
|
/* Export */
|
|
104349
|
-
)) ?
|
|
104349
|
+
)) ? map33(defaultReplaced, removeExportModifier) : defaultReplaced;
|
|
104350
104350
|
fakespace = factory.updateModuleDeclaration(
|
|
104351
104351
|
fakespace,
|
|
104352
104352
|
fakespace.modifiers,
|
|
@@ -104394,7 +104394,7 @@ ${lanes.join("\n")}
|
|
|
104394
104394
|
}
|
|
104395
104395
|
return cleanup(factory.createExpressionWithTypeArguments(
|
|
104396
104396
|
expr,
|
|
104397
|
-
|
|
104397
|
+
map33(e2.typeArguments, (a) => syntacticNodeBuilder.tryReuseExistingTypeNode(context, a) || typeToTypeNodeHelper(getTypeFromTypeNode2(context, a), context))
|
|
104398
104398
|
));
|
|
104399
104399
|
function cleanup(result2) {
|
|
104400
104400
|
context.enclosingDeclaration = oldEnclosing;
|
|
@@ -104413,7 +104413,7 @@ ${lanes.join("\n")}
|
|
|
104413
104413
|
const oldEnclosing = context.enclosingDeclaration;
|
|
104414
104414
|
context.enclosingDeclaration = originalDecl || oldEnclosing;
|
|
104415
104415
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol2);
|
|
104416
|
-
const typeParamDecls =
|
|
104416
|
+
const typeParamDecls = map33(localParams, (p) => typeParameterToDeclaration(p, context));
|
|
104417
104417
|
forEach(localParams, (p) => context.approximateLength += symbolName(p.symbol).length);
|
|
104418
104418
|
const classType = getTypeWithThisArgument(getDeclaredTypeOfClassOrInterface(symbol2));
|
|
104419
104419
|
const baseTypes = getBaseTypes(classType);
|
|
@@ -104424,7 +104424,7 @@ ${lanes.join("\n")}
|
|
|
104424
104424
|
const staticBaseType = isClass ? getBaseConstructorTypeOfClass(staticType) : anyType2;
|
|
104425
104425
|
context.approximateLength += (length(baseTypes) ? 8 : 0) + (length(implementsExpressions) ? 11 : 0);
|
|
104426
104426
|
const heritageClauses = [
|
|
104427
|
-
...!length(baseTypes) ? [] : [factory.createHeritageClause(96,
|
|
104427
|
+
...!length(baseTypes) ? [] : [factory.createHeritageClause(96, map33(baseTypes, (b) => serializeBaseType(b, staticBaseType, localName)))],
|
|
104428
104428
|
...!length(implementsExpressions) ? [] : [factory.createHeritageClause(119, implementsExpressions)]
|
|
104429
104429
|
];
|
|
104430
104430
|
const symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
|
|
@@ -105253,7 +105253,7 @@ ${lanes.join("\n")}
|
|
|
105253
105253
|
let typeArgs;
|
|
105254
105254
|
let reference;
|
|
105255
105255
|
if (t2.target && isSymbolAccessibleByFlags(t2.target.symbol, enclosingDeclaration, flags)) {
|
|
105256
|
-
typeArgs =
|
|
105256
|
+
typeArgs = map33(getTypeArguments(t2), (t22) => typeToTypeNodeHelper(t22, context));
|
|
105257
105257
|
reference = symbolToExpression(
|
|
105258
105258
|
t2.target.symbol,
|
|
105259
105259
|
context,
|
|
@@ -105717,7 +105717,7 @@ ${lanes.join("\n")}
|
|
|
105717
105717
|
}
|
|
105718
105718
|
function getTypeOfPrototypeProperty(prototype) {
|
|
105719
105719
|
const classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype));
|
|
105720
|
-
return classType.typeParameters ? createTypeReference(classType,
|
|
105720
|
+
return classType.typeParameters ? createTypeReference(classType, map33(classType.typeParameters, (_2) => anyType2)) : classType;
|
|
105721
105721
|
}
|
|
105722
105722
|
function getTypeOfPropertyOfType(type, name2) {
|
|
105723
105723
|
const prop = getPropertyOfType(type, name2);
|
|
@@ -105765,7 +105765,7 @@ ${lanes.join("\n")}
|
|
|
105765
105765
|
if (source.flags & 1048576) {
|
|
105766
105766
|
return mapType2(source, (t2) => getRestType(t2, properties, symbol2));
|
|
105767
105767
|
}
|
|
105768
|
-
let omitKeyType = getUnionType(
|
|
105768
|
+
let omitKeyType = getUnionType(map33(properties, getLiteralTypeFromPropertyName));
|
|
105769
105769
|
const spreadableProperties = [];
|
|
105770
105770
|
const unspreadableToRestKeys = [];
|
|
105771
105771
|
for (const prop of getPropertiesOfType(source)) {
|
|
@@ -106491,9 +106491,9 @@ ${lanes.join("\n")}
|
|
|
106491
106491
|
if (elements.length === 0 || elements.length === 1 && restElement) {
|
|
106492
106492
|
return languageVersion >= 2 ? createIterableType(anyType2) : anyArrayType;
|
|
106493
106493
|
}
|
|
106494
|
-
const elementTypes =
|
|
106494
|
+
const elementTypes = map33(elements, (e2) => isOmittedExpression(e2) ? anyType2 : getTypeFromBindingElement(e2, includePatternInType, reportErrors2));
|
|
106495
106495
|
const minLength = findLastIndex(elements, (e2) => !(e2 === restElement || isOmittedExpression(e2) || hasDefaultValue(e2)), elements.length - 1) + 1;
|
|
106496
|
-
const elementFlags =
|
|
106496
|
+
const elementFlags = map33(
|
|
106497
106497
|
elements,
|
|
106498
106498
|
(e2, i2) => e2 === restElement ? 4 : i2 >= minLength ? 2 : 1
|
|
106499
106499
|
/* Required */
|
|
@@ -107175,7 +107175,7 @@ ${lanes.join("\n")}
|
|
|
107175
107175
|
}
|
|
107176
107176
|
function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) {
|
|
107177
107177
|
const signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location);
|
|
107178
|
-
const typeArguments =
|
|
107178
|
+
const typeArguments = map33(typeArgumentNodes, getTypeFromTypeNode);
|
|
107179
107179
|
return sameMap(signatures, (sig) => some(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments, isInJSFile(location)) : sig);
|
|
107180
107180
|
}
|
|
107181
107181
|
function getBaseConstructorTypeOfClass(type) {
|
|
@@ -108006,14 +108006,14 @@ ${lanes.join("\n")}
|
|
|
108006
108006
|
if (isTupleType(restType)) {
|
|
108007
108007
|
return [expandSignatureParametersWithTupleMembers(restType, restIndex, restSymbol)];
|
|
108008
108008
|
} else if (!skipUnionExpanding && restType.flags & 1048576 && every(restType.types, isTupleType)) {
|
|
108009
|
-
return
|
|
108009
|
+
return map33(restType.types, (t2) => expandSignatureParametersWithTupleMembers(t2, restIndex, restSymbol));
|
|
108010
108010
|
}
|
|
108011
108011
|
}
|
|
108012
108012
|
return [sig.parameters];
|
|
108013
108013
|
function expandSignatureParametersWithTupleMembers(restType, restIndex, restSymbol) {
|
|
108014
108014
|
const elementTypes = getTypeArguments(restType);
|
|
108015
108015
|
const associatedNames = getUniqAssociatedNamesFromTupleType(restType, restSymbol);
|
|
108016
|
-
const restParams =
|
|
108016
|
+
const restParams = map33(elementTypes, (t2, i2) => {
|
|
108017
108017
|
const name2 = associatedNames && associatedNames[i2] ? associatedNames[i2] : getParameterNameAtPosition(sig, restIndex + i2, restType);
|
|
108018
108018
|
const flags = restType.target.elementFlags[i2];
|
|
108019
108019
|
const checkFlags = flags & 12 ? 32768 : flags & 2 ? 16384 : 0;
|
|
@@ -108024,7 +108024,7 @@ ${lanes.join("\n")}
|
|
|
108024
108024
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
108025
108025
|
}
|
|
108026
108026
|
function getUniqAssociatedNamesFromTupleType(type, restSymbol) {
|
|
108027
|
-
const names =
|
|
108027
|
+
const names = map33(type.target.labeledElementDeclarations, (labeledElement, i2) => getTupleElementLabel(labeledElement, i2, type.target.elementFlags[i2], restSymbol));
|
|
108028
108028
|
if (names) {
|
|
108029
108029
|
const duplicates = [];
|
|
108030
108030
|
const uniqueNames = /* @__PURE__ */ new Set();
|
|
@@ -108195,7 +108195,7 @@ ${lanes.join("\n")}
|
|
|
108195
108195
|
if (signatures !== masterList) {
|
|
108196
108196
|
const signature = signatures[0];
|
|
108197
108197
|
Debug.assert(!!signature, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass");
|
|
108198
|
-
results = !!signature.typeParameters && some(results, (s2) => !!s2.typeParameters && !compareTypeParametersIdentical(signature.typeParameters, s2.typeParameters)) ? void 0 :
|
|
108198
|
+
results = !!signature.typeParameters && some(results, (s2) => !!s2.typeParameters && !compareTypeParametersIdentical(signature.typeParameters, s2.typeParameters)) ? void 0 : map33(results, (sig) => combineSignaturesOfUnionMembers(sig, signature));
|
|
108199
108199
|
if (!results) {
|
|
108200
108200
|
break;
|
|
108201
108201
|
}
|
|
@@ -108318,7 +108318,7 @@ ${lanes.join("\n")}
|
|
|
108318
108318
|
for (const info of sourceInfos) {
|
|
108319
108319
|
const indexType = info.keyType;
|
|
108320
108320
|
if (every(types3, (t2) => !!getIndexInfoOfType(t2, indexType))) {
|
|
108321
|
-
result.push(createIndexInfo(indexType, getUnionType(
|
|
108321
|
+
result.push(createIndexInfo(indexType, getUnionType(map33(types3, (t2) => getIndexTypeOfType(t2, indexType))), some(types3, (t2) => getIndexInfoOfType(t2, indexType).isReadonly)));
|
|
108322
108322
|
}
|
|
108323
108323
|
}
|
|
108324
108324
|
return result;
|
|
@@ -108326,12 +108326,12 @@ ${lanes.join("\n")}
|
|
|
108326
108326
|
return emptyArray;
|
|
108327
108327
|
}
|
|
108328
108328
|
function resolveUnionTypeMembers(type) {
|
|
108329
|
-
const callSignatures = getUnionSignatures(
|
|
108329
|
+
const callSignatures = getUnionSignatures(map33(type.types, (t2) => t2 === globalFunctionType ? [unknownSignature] : getSignaturesOfType(
|
|
108330
108330
|
t2,
|
|
108331
108331
|
0
|
|
108332
108332
|
/* Call */
|
|
108333
108333
|
)));
|
|
108334
|
-
const constructSignatures = getUnionSignatures(
|
|
108334
|
+
const constructSignatures = getUnionSignatures(map33(type.types, (t2) => getSignaturesOfType(
|
|
108335
108335
|
t2,
|
|
108336
108336
|
1
|
|
108337
108337
|
/* Construct */
|
|
@@ -108348,7 +108348,7 @@ ${lanes.join("\n")}
|
|
|
108348
108348
|
1
|
|
108349
108349
|
/* Construct */
|
|
108350
108350
|
).length > 0);
|
|
108351
|
-
const mixinFlags =
|
|
108351
|
+
const mixinFlags = map33(types3, isMixinConstructorType);
|
|
108352
108352
|
if (constructorTypeCount > 0 && constructorTypeCount === countWhere(mixinFlags, (b) => b)) {
|
|
108353
108353
|
const firstMixinIndex = mixinFlags.indexOf(
|
|
108354
108354
|
/*searchElement*/
|
|
@@ -108389,7 +108389,7 @@ ${lanes.join("\n")}
|
|
|
108389
108389
|
/* Construct */
|
|
108390
108390
|
);
|
|
108391
108391
|
if (signatures.length && mixinCount > 0) {
|
|
108392
|
-
signatures =
|
|
108392
|
+
signatures = map33(signatures, (s2) => {
|
|
108393
108393
|
const clone22 = cloneSignature(s2);
|
|
108394
108394
|
clone22.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s2), types3, mixinFlags, i2);
|
|
108395
108395
|
return clone22;
|
|
@@ -109178,7 +109178,7 @@ ${lanes.join("\n")}
|
|
|
109178
109178
|
return getBaseConstraint(getSubstitutionIntersection(t2));
|
|
109179
109179
|
}
|
|
109180
109180
|
if (isGenericTupleType(t2)) {
|
|
109181
|
-
const newElements =
|
|
109181
|
+
const newElements = map33(getElementTypes(t2), (v, i2) => {
|
|
109182
109182
|
const constraint = v.flags & 262144 && t2.target.elementFlags[i2] & 8 && getBaseConstraint(v) || v;
|
|
109183
109183
|
return constraint !== v && everyType(constraint, (c) => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v;
|
|
109184
109184
|
});
|
|
@@ -109614,7 +109614,7 @@ ${lanes.join("\n")}
|
|
|
109614
109614
|
}
|
|
109615
109615
|
}
|
|
109616
109616
|
}
|
|
109617
|
-
return applicableInfos ? createIndexInfo(unknownType2, getIntersectionType(
|
|
109617
|
+
return applicableInfos ? createIndexInfo(unknownType2, getIntersectionType(map33(applicableInfos, (info) => info.type)), reduceLeft(
|
|
109618
109618
|
applicableInfos,
|
|
109619
109619
|
(isReadonly, info) => isReadonly && info.isReadonly,
|
|
109620
109620
|
/*initial*/
|
|
@@ -110014,7 +110014,7 @@ ${lanes.join("\n")}
|
|
|
110014
110014
|
return errorType;
|
|
110015
110015
|
}
|
|
110016
110016
|
let type = signature.target ? instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper) : signature.compositeSignatures ? instantiateType(getUnionOrIntersectionType(
|
|
110017
|
-
|
|
110017
|
+
map33(signature.compositeSignatures, getReturnTypeOfSignature),
|
|
110018
110018
|
signature.compositeKind,
|
|
110019
110019
|
2
|
|
110020
110020
|
/* Subtype */
|
|
@@ -110153,7 +110153,7 @@ ${lanes.join("\n")}
|
|
|
110153
110153
|
function createCanonicalSignature(signature) {
|
|
110154
110154
|
return getSignatureInstantiation(
|
|
110155
110155
|
signature,
|
|
110156
|
-
|
|
110156
|
+
map33(signature.typeParameters, (tp) => tp.target && !getConstraintOfTypeParameter(tp.target) ? tp.target : tp),
|
|
110157
110157
|
isInJSFile(signature.declaration)
|
|
110158
110158
|
);
|
|
110159
110159
|
}
|
|
@@ -110164,8 +110164,8 @@ ${lanes.join("\n")}
|
|
|
110164
110164
|
return signature.baseSignatureCache;
|
|
110165
110165
|
}
|
|
110166
110166
|
const typeEraser = createTypeEraser(typeParameters);
|
|
110167
|
-
const baseConstraintMapper = createTypeMapper(typeParameters,
|
|
110168
|
-
let baseConstraints =
|
|
110167
|
+
const baseConstraintMapper = createTypeMapper(typeParameters, map33(typeParameters, (tp) => getConstraintOfTypeParameter(tp) || unknownType2));
|
|
110168
|
+
let baseConstraints = map33(typeParameters, (tp) => instantiateType(tp, baseConstraintMapper) || unknownType2);
|
|
110169
110169
|
for (let i2 = 0; i2 < typeParameters.length - 1; i2++) {
|
|
110170
110170
|
baseConstraints = instantiateTypes(baseConstraints, baseConstraintMapper);
|
|
110171
110171
|
}
|
|
@@ -110435,7 +110435,7 @@ ${lanes.join("\n")}
|
|
|
110435
110435
|
return concatenate(type.target.outerTypeParameters, (_a2 = type.target.localTypeParameters) == null ? void 0 : _a2.map(() => errorType)) || emptyArray;
|
|
110436
110436
|
}
|
|
110437
110437
|
const node = type.node;
|
|
110438
|
-
const typeArguments = !node ? emptyArray : node.kind === 184 ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 189 ? [getTypeFromTypeNode(node.elementType)] :
|
|
110438
|
+
const typeArguments = !node ? emptyArray : node.kind === 184 ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 189 ? [getTypeFromTypeNode(node.elementType)] : map33(node.elements, getTypeFromTypeNode);
|
|
110439
110439
|
if (popTypeResolution()) {
|
|
110440
110440
|
type.resolvedTypeArguments ?? (type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments);
|
|
110441
110441
|
} else {
|
|
@@ -110841,7 +110841,7 @@ ${lanes.join("\n")}
|
|
|
110841
110841
|
return links.resolvedType;
|
|
110842
110842
|
}
|
|
110843
110843
|
function typeArgumentsFromTypeReferenceNode(node) {
|
|
110844
|
-
return
|
|
110844
|
+
return map33(node.typeArguments, getTypeFromTypeNode);
|
|
110845
110845
|
}
|
|
110846
110846
|
function getTypeFromTypeQueryNode(node) {
|
|
110847
110847
|
const links = getNodeLinks(node);
|
|
@@ -111314,8 +111314,8 @@ ${lanes.join("\n")}
|
|
|
111314
111314
|
if (elementType) {
|
|
111315
111315
|
return readonly2 ? globalReadonlyArrayType : globalArrayType;
|
|
111316
111316
|
}
|
|
111317
|
-
const elementFlags =
|
|
111318
|
-
return getTupleTargetType(elementFlags, readonly2,
|
|
111317
|
+
const elementFlags = map33(node.elements, getTupleElementFlags);
|
|
111318
|
+
return getTupleTargetType(elementFlags, readonly2, map33(node.elements, memberIfLabeledElementDeclaration));
|
|
111319
111319
|
}
|
|
111320
111320
|
function memberIfLabeledElementDeclaration(member) {
|
|
111321
111321
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
@@ -111388,7 +111388,7 @@ ${lanes.join("\n")}
|
|
|
111388
111388
|
void 0
|
|
111389
111389
|
);
|
|
111390
111390
|
} else {
|
|
111391
|
-
const elementTypes = node.kind === 189 ? [getTypeFromTypeNode(node.elementType)] :
|
|
111391
|
+
const elementTypes = node.kind === 189 ? [getTypeFromTypeNode(node.elementType)] : map33(node.elements, getTypeFromTypeNode);
|
|
111392
111392
|
links.resolvedType = createNormalizedTypeReference(target, elementTypes);
|
|
111393
111393
|
}
|
|
111394
111394
|
}
|
|
@@ -111398,7 +111398,7 @@ ${lanes.join("\n")}
|
|
|
111398
111398
|
return isTypeOperatorNode(node) && node.operator === 148;
|
|
111399
111399
|
}
|
|
111400
111400
|
function createTupleType(elementTypes, elementFlags, readonly2 = false, namedMemberDeclarations = []) {
|
|
111401
|
-
const tupleTarget = getTupleTargetType(elementFlags ||
|
|
111401
|
+
const tupleTarget = getTupleTargetType(elementFlags || map33(
|
|
111402
111402
|
elementTypes,
|
|
111403
111403
|
(_2) => 1
|
|
111404
111404
|
/* Required */
|
|
@@ -111409,7 +111409,7 @@ ${lanes.join("\n")}
|
|
|
111409
111409
|
if (elementFlags.length === 1 && elementFlags[0] & 4) {
|
|
111410
111410
|
return readonly2 ? globalReadonlyArrayType : globalArrayType;
|
|
111411
111411
|
}
|
|
111412
|
-
const key =
|
|
111412
|
+
const key = map33(elementFlags, (f3) => f3 & 1 ? "#" : f3 & 2 ? "?" : f3 & 4 ? "." : "*").join() + (readonly2 ? "R" : "") + (some(namedMemberDeclarations, (node) => !!node) ? "," + map33(namedMemberDeclarations, (node) => node ? getNodeId(node) : "_").join(",") : "");
|
|
111413
111413
|
let type = tupleTypes.get(key);
|
|
111414
111414
|
if (!type) {
|
|
111415
111415
|
tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly2, namedMemberDeclarations));
|
|
@@ -111484,7 +111484,7 @@ ${lanes.join("\n")}
|
|
|
111484
111484
|
if (target.combinedFlags & 8) {
|
|
111485
111485
|
const unionIndex = findIndex(elementTypes, (t2, i2) => !!(target.elementFlags[i2] & 8 && t2.flags & (131072 | 1048576)));
|
|
111486
111486
|
if (unionIndex >= 0) {
|
|
111487
|
-
return checkCrossProductUnion(
|
|
111487
|
+
return checkCrossProductUnion(map33(elementTypes, (t2, i2) => target.elementFlags[i2] & 8 ? t2 : unknownType2)) ? mapType2(elementTypes[unionIndex], (t2) => createNormalizedTupleType(target, replaceElement(elementTypes, unionIndex, t2))) : errorType;
|
|
111488
111488
|
}
|
|
111489
111489
|
}
|
|
111490
111490
|
const expandedTypes = [];
|
|
@@ -111654,7 +111654,7 @@ ${lanes.join("\n")}
|
|
|
111654
111654
|
const source = types3[i2];
|
|
111655
111655
|
if (hasEmptyObject || source.flags & 469499904) {
|
|
111656
111656
|
if (source.flags & 262144 && getBaseConstraintOrType(source).flags & 1048576) {
|
|
111657
|
-
if (isTypeRelatedTo(source, getUnionType(
|
|
111657
|
+
if (isTypeRelatedTo(source, getUnionType(map33(types3, (t2) => t2 === source ? neverType2 : t2)), strictSubtypeRelation)) {
|
|
111658
111658
|
orderedRemoveItemAt(types3, i2);
|
|
111659
111659
|
}
|
|
111660
111660
|
continue;
|
|
@@ -111917,7 +111917,7 @@ ${lanes.join("\n")}
|
|
|
111917
111917
|
const links = getNodeLinks(node);
|
|
111918
111918
|
if (!links.resolvedType) {
|
|
111919
111919
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
111920
|
-
links.resolvedType = getUnionType(
|
|
111920
|
+
links.resolvedType = getUnionType(map33(node.types, getTypeFromTypeNode), 1, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
111921
111921
|
}
|
|
111922
111922
|
return links.resolvedType;
|
|
111923
111923
|
}
|
|
@@ -112200,7 +112200,7 @@ ${lanes.join("\n")}
|
|
|
112200
112200
|
const links = getNodeLinks(node);
|
|
112201
112201
|
if (!links.resolvedType) {
|
|
112202
112202
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
112203
|
-
const types3 =
|
|
112203
|
+
const types3 = map33(node.types, getTypeFromTypeNode);
|
|
112204
112204
|
const emptyIndex = types3.length === 2 ? types3.indexOf(emptyTypeLiteralType) : -1;
|
|
112205
112205
|
const t2 = emptyIndex >= 0 ? types3[1 - emptyIndex] : unknownType2;
|
|
112206
112206
|
const noSupertypeReduction = !!(t2.flags & (4 | 8 | 64) || t2.flags & 134217728 && isPatternLiteralType(t2));
|
|
@@ -112309,8 +112309,8 @@ ${lanes.join("\n")}
|
|
|
112309
112309
|
}
|
|
112310
112310
|
function getLiteralTypeFromProperties(type, include, includeOrigin) {
|
|
112311
112311
|
const origin = includeOrigin && (getObjectFlags(type) & (3 | 4) || type.aliasSymbol) ? createOriginIndexType(type) : void 0;
|
|
112312
|
-
const propertyTypes =
|
|
112313
|
-
const indexKeyTypes =
|
|
112312
|
+
const propertyTypes = map33(getPropertiesOfType(type), (prop) => getLiteralTypeFromProperty(prop, include));
|
|
112313
|
+
const indexKeyTypes = map33(getIndexInfosOfType(type), (info) => info !== enumNumberIndexInfo && isKeyTypeIncluded(info.keyType, include) ? info.keyType === stringType2 && include & 8 ? stringOrNumberType : info.keyType : neverType2);
|
|
112314
112314
|
return getUnionType(
|
|
112315
112315
|
concatenate(propertyTypes, indexKeyTypes),
|
|
112316
112316
|
1,
|
|
@@ -112330,7 +112330,7 @@ ${lanes.join("\n")}
|
|
|
112330
112330
|
}
|
|
112331
112331
|
function getIndexType(type, indexFlags = 0) {
|
|
112332
112332
|
type = getReducedType(type);
|
|
112333
|
-
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 ? getIntersectionType(
|
|
112333
|
+
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 ? getIntersectionType(map33(type.types, (t2) => getIndexType(t2, indexFlags))) : type.flags & 2097152 ? getUnionType(map33(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(
|
|
112334
112334
|
type,
|
|
112335
112335
|
(indexFlags & 2 ? 128 : 402653316) | (indexFlags & 1 ? 0 : 296 | 12288),
|
|
112336
112336
|
indexFlags === 0
|
|
@@ -112368,8 +112368,8 @@ ${lanes.join("\n")}
|
|
|
112368
112368
|
const links = getNodeLinks(node);
|
|
112369
112369
|
if (!links.resolvedType) {
|
|
112370
112370
|
links.resolvedType = getTemplateLiteralType(
|
|
112371
|
-
[node.head.text, ...
|
|
112372
|
-
|
|
112371
|
+
[node.head.text, ...map33(node.templateSpans, (span) => span.literal.text)],
|
|
112372
|
+
map33(node.templateSpans, (span) => getTypeFromTypeNode(span.type))
|
|
112373
112373
|
);
|
|
112374
112374
|
}
|
|
112375
112375
|
return links.resolvedType;
|
|
@@ -112400,7 +112400,7 @@ ${lanes.join("\n")}
|
|
|
112400
112400
|
return newTypes[0];
|
|
112401
112401
|
}
|
|
112402
112402
|
}
|
|
112403
|
-
const id = `${getTypeListId(newTypes)}|${
|
|
112403
|
+
const id = `${getTypeListId(newTypes)}|${map33(newTexts, (t2) => t2.length).join(",")}|${newTexts.join("")}`;
|
|
112404
112404
|
let type = templateLiteralTypes.get(id);
|
|
112405
112405
|
if (!type) {
|
|
112406
112406
|
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
|
|
@@ -112630,7 +112630,7 @@ ${lanes.join("\n")}
|
|
|
112630
112630
|
diagnostics.add(createDiagnosticForNode(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType2)));
|
|
112631
112631
|
return undefinedType2;
|
|
112632
112632
|
} else if (indexType.flags & (8 | 4)) {
|
|
112633
|
-
const types3 =
|
|
112633
|
+
const types3 = map33(objectType2.properties, (property) => {
|
|
112634
112634
|
return getTypeOfSymbol(property);
|
|
112635
112635
|
});
|
|
112636
112636
|
return getUnionType(append(types3, undefinedType2));
|
|
@@ -112791,13 +112791,13 @@ ${lanes.join("\n")}
|
|
|
112791
112791
|
}
|
|
112792
112792
|
function distributeIndexOverObjectType(objectType2, indexType, writing) {
|
|
112793
112793
|
if (objectType2.flags & 1048576 || objectType2.flags & 2097152 && !shouldDeferIndexType(objectType2)) {
|
|
112794
|
-
const types3 =
|
|
112794
|
+
const types3 = map33(objectType2.types, (t2) => getSimplifiedType(getIndexedAccessType(t2, indexType), writing));
|
|
112795
112795
|
return objectType2.flags & 2097152 || writing ? getIntersectionType(types3) : getUnionType(types3);
|
|
112796
112796
|
}
|
|
112797
112797
|
}
|
|
112798
112798
|
function distributeObjectOverIndexType(objectType2, indexType, writing) {
|
|
112799
112799
|
if (indexType.flags & 1048576) {
|
|
112800
|
-
const types3 =
|
|
112800
|
+
const types3 = map33(indexType.types, (t2) => getSimplifiedType(getIndexedAccessType(objectType2, t2), writing));
|
|
112801
112801
|
return writing ? getIntersectionType(types3) : getUnionType(types3);
|
|
112802
112802
|
}
|
|
112803
112803
|
}
|
|
@@ -113080,7 +113080,7 @@ ${lanes.join("\n")}
|
|
|
113080
113080
|
const newRoot = newType.root;
|
|
113081
113081
|
if (newRoot.outerTypeParameters) {
|
|
113082
113082
|
const typeParamMapper = combineTypeMappers(newType.mapper, newMapper);
|
|
113083
|
-
const typeArguments =
|
|
113083
|
+
const typeArguments = map33(newRoot.outerTypeParameters, (t2) => getMappedType(t2, typeParamMapper));
|
|
113084
113084
|
const newRootMapper = createTypeMapper(newRoot.outerTypeParameters, typeArguments);
|
|
113085
113085
|
const newCheckType = newRoot.isDistributive ? getMappedType(newRoot.checkType, newRootMapper) : void 0;
|
|
113086
113086
|
if (!newCheckType || newCheckType === newRoot.checkType || !(newCheckType.flags & (1048576 | 131072))) {
|
|
@@ -113741,7 +113741,7 @@ ${lanes.join("\n")}
|
|
|
113741
113741
|
}
|
|
113742
113742
|
function createBackreferenceMapper(context, index) {
|
|
113743
113743
|
const forwardInferences = context.inferences.slice(index);
|
|
113744
|
-
return createTypeMapper(
|
|
113744
|
+
return createTypeMapper(map33(forwardInferences, (i2) => i2.typeParameter), map33(forwardInferences, () => unknownType2));
|
|
113745
113745
|
}
|
|
113746
113746
|
function createOuterReturnMapper(context) {
|
|
113747
113747
|
return context.outerReturnMapper ?? (context.outerReturnMapper = mergeTypeMappers(context.returnMapper, cloneInferenceContext(context).mapper));
|
|
@@ -113772,7 +113772,7 @@ ${lanes.join("\n")}
|
|
|
113772
113772
|
function instantiateSignature(signature, mapper, eraseTypeParameters) {
|
|
113773
113773
|
let freshTypeParameters;
|
|
113774
113774
|
if (signature.typeParameters && !eraseTypeParameters) {
|
|
113775
|
-
freshTypeParameters =
|
|
113775
|
+
freshTypeParameters = map33(signature.typeParameters, cloneTypeParameter);
|
|
113776
113776
|
mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper);
|
|
113777
113777
|
for (const tp of freshTypeParameters) {
|
|
113778
113778
|
tp.mapper = mapper;
|
|
@@ -113844,7 +113844,7 @@ ${lanes.join("\n")}
|
|
|
113844
113844
|
}
|
|
113845
113845
|
if (typeParameters.length) {
|
|
113846
113846
|
const combinedMapper = combineTypeMappers(type.mapper, mapper);
|
|
113847
|
-
const typeArguments =
|
|
113847
|
+
const typeArguments = map33(typeParameters, (t2) => getMappedType(t2, combinedMapper));
|
|
113848
113848
|
const newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
113849
113849
|
const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
113850
113850
|
const id = getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments);
|
|
@@ -113956,7 +113956,7 @@ ${lanes.join("\n")}
|
|
|
113956
113956
|
return instantiateMappedTupleType(t2, type, typeVariable, mapper);
|
|
113957
113957
|
}
|
|
113958
113958
|
if (isArrayOrTupleOrIntersection(t2)) {
|
|
113959
|
-
return getIntersectionType(
|
|
113959
|
+
return getIntersectionType(map33(t2.types, instantiateConstituent));
|
|
113960
113960
|
}
|
|
113961
113961
|
}
|
|
113962
113962
|
return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t2, mapper));
|
|
@@ -113971,12 +113971,12 @@ ${lanes.join("\n")}
|
|
|
113971
113971
|
const elementFlags = tupleType2.target.elementFlags;
|
|
113972
113972
|
const fixedLength = tupleType2.target.fixedLength;
|
|
113973
113973
|
const fixedMapper = fixedLength ? prependTypeMapping(typeVariable, tupleType2, mapper) : mapper;
|
|
113974
|
-
const newElementTypes =
|
|
113974
|
+
const newElementTypes = map33(getElementTypes(tupleType2), (type, i2) => {
|
|
113975
113975
|
const flags = elementFlags[i2];
|
|
113976
113976
|
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;
|
|
113977
113977
|
});
|
|
113978
113978
|
const modifiers = getMappedTypeModifiers(mappedType);
|
|
113979
|
-
const newElementFlags = modifiers & 4 ?
|
|
113979
|
+
const newElementFlags = modifiers & 4 ? map33(elementFlags, (f3) => f3 & 1 ? 2 : f3) : modifiers & 8 ? map33(elementFlags, (f3) => f3 & 2 ? 1 : f3) : elementFlags;
|
|
113980
113980
|
const newReadonly = getModifiedReadonlyState(tupleType2.target.readonly, getMappedTypeModifiers(mappedType));
|
|
113981
113981
|
return contains(newElementTypes, errorType) ? errorType : createTupleType(newElementTypes, newElementFlags, newReadonly, tupleType2.target.labeledElementDeclarations);
|
|
113982
113982
|
}
|
|
@@ -114032,7 +114032,7 @@ ${lanes.join("\n")}
|
|
|
114032
114032
|
function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
|
114033
114033
|
const root = type.root;
|
|
114034
114034
|
if (root.outerTypeParameters) {
|
|
114035
|
-
const typeArguments =
|
|
114035
|
+
const typeArguments = map33(root.outerTypeParameters, (t2) => getMappedType(t2, mapper));
|
|
114036
114036
|
const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
114037
114037
|
let result = root.instantiations.get(id);
|
|
114038
114038
|
if (!result) {
|
|
@@ -114264,7 +114264,7 @@ ${lanes.join("\n")}
|
|
|
114264
114264
|
return result;
|
|
114265
114265
|
}
|
|
114266
114266
|
} else if (type.flags & 2097152) {
|
|
114267
|
-
return getIntersectionType(
|
|
114267
|
+
return getIntersectionType(map33(type.types, getTypeWithoutSignatures));
|
|
114268
114268
|
}
|
|
114269
114269
|
return type;
|
|
114270
114270
|
}
|
|
@@ -114420,7 +114420,7 @@ ${lanes.join("\n")}
|
|
|
114420
114420
|
}
|
|
114421
114421
|
const returnExpression = node.body;
|
|
114422
114422
|
const sourceReturn = getReturnTypeOfSignature(sourceSig);
|
|
114423
|
-
const targetReturn = getUnionType(
|
|
114423
|
+
const targetReturn = getUnionType(map33(targetSignatures, getReturnTypeOfSignature));
|
|
114424
114424
|
if (!checkTypeRelatedTo(
|
|
114425
114425
|
sourceReturn,
|
|
114426
114426
|
targetReturn,
|
|
@@ -117259,9 +117259,9 @@ ${lanes.join("\n")}
|
|
|
117259
117259
|
false
|
|
117260
117260
|
)) {
|
|
117261
117261
|
if (props.length > 5) {
|
|
117262
|
-
reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source2), typeToString(target2),
|
|
117262
|
+
reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source2), typeToString(target2), map33(props.slice(0, 4), (p) => symbolToString(p)).join(", "), props.length - 4);
|
|
117263
117263
|
} else {
|
|
117264
|
-
reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source2), typeToString(target2),
|
|
117264
|
+
reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source2), typeToString(target2), map33(props, (p) => symbolToString(p)).join(", "));
|
|
117265
117265
|
}
|
|
117266
117266
|
if (shouldSkipElaboration && errorInfo) {
|
|
117267
117267
|
overrideNextErrorInfo++;
|
|
@@ -118838,7 +118838,7 @@ ${lanes.join("\n")}
|
|
|
118838
118838
|
return createInferenceContextWorker(typeParameters.map(createInferenceInfo), signature, flags, compareTypes || compareTypesAssignable);
|
|
118839
118839
|
}
|
|
118840
118840
|
function cloneInferenceContext(context, extraFlags = 0) {
|
|
118841
|
-
return context && createInferenceContextWorker(
|
|
118841
|
+
return context && createInferenceContextWorker(map33(context.inferences, cloneInferenceInfo), context.signature, context.flags | extraFlags, context.compareTypes);
|
|
118842
118842
|
}
|
|
118843
118843
|
function createInferenceContextWorker(inferences, signature, flags, compareTypes) {
|
|
118844
118844
|
const context = {
|
|
@@ -118856,8 +118856,8 @@ ${lanes.join("\n")}
|
|
|
118856
118856
|
}
|
|
118857
118857
|
function makeFixingMapperForContext(context) {
|
|
118858
118858
|
return makeDeferredTypeMapper(
|
|
118859
|
-
|
|
118860
|
-
|
|
118859
|
+
map33(context.inferences, (i2) => i2.typeParameter),
|
|
118860
|
+
map33(context.inferences, (inference, i2) => () => {
|
|
118861
118861
|
if (!inference.isFixed) {
|
|
118862
118862
|
inferFromIntraExpressionSites(context);
|
|
118863
118863
|
clearCachedInferences(context.inferences);
|
|
@@ -118869,8 +118869,8 @@ ${lanes.join("\n")}
|
|
|
118869
118869
|
}
|
|
118870
118870
|
function makeNonFixingMapperForContext(context) {
|
|
118871
118871
|
return makeDeferredTypeMapper(
|
|
118872
|
-
|
|
118873
|
-
|
|
118872
|
+
map33(context.inferences, (i2) => i2.typeParameter),
|
|
118873
|
+
map33(context.inferences, (_2, i2) => () => {
|
|
118874
118874
|
return getInferredType(context, i2);
|
|
118875
118875
|
})
|
|
118876
118876
|
);
|
|
@@ -118930,7 +118930,7 @@ ${lanes.join("\n")}
|
|
|
118930
118930
|
}
|
|
118931
118931
|
function cloneInferredPartOfContext(context) {
|
|
118932
118932
|
const inferences = filter6(context.inferences, hasInferenceCandidates);
|
|
118933
|
-
return inferences.length ? createInferenceContextWorker(
|
|
118933
|
+
return inferences.length ? createInferenceContextWorker(map33(inferences, cloneInferenceInfo), context.signature, context.flags, context.compareTypes) : void 0;
|
|
118934
118934
|
}
|
|
118935
118935
|
function getMapperFromContext(context) {
|
|
118936
118936
|
return context && context.mapper;
|
|
@@ -119018,7 +119018,7 @@ ${lanes.join("\n")}
|
|
|
119018
119018
|
return createArrayType(elementType, isReadonlyArrayType(source));
|
|
119019
119019
|
}
|
|
119020
119020
|
if (isTupleType(source)) {
|
|
119021
|
-
const elementTypes =
|
|
119021
|
+
const elementTypes = map33(getElementTypes(source), (t2) => inferReverseMappedType(t2, target, constraint));
|
|
119022
119022
|
if (!every(elementTypes, (t2) => !!t2)) {
|
|
119023
119023
|
return void 0;
|
|
119024
119024
|
}
|
|
@@ -119188,7 +119188,7 @@ ${lanes.join("\n")}
|
|
|
119188
119188
|
return false;
|
|
119189
119189
|
}
|
|
119190
119190
|
function inferTypesFromTemplateLiteralType(source, target) {
|
|
119191
|
-
return source.flags & 128 ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 ? arrayIsEqualTo(source.texts, target.texts) ?
|
|
119191
|
+
return source.flags & 128 ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 ? arrayIsEqualTo(source.texts, target.texts) ? map33(source.types, (s2, i2) => {
|
|
119192
119192
|
return isTypeAssignableTo(getBaseConstraintOrType(s2), getBaseConstraintOrType(target.types[i2])) ? s2 : getStringLikeTypeForType(s2);
|
|
119193
119193
|
}) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0;
|
|
119194
119194
|
}
|
|
@@ -119652,8 +119652,8 @@ ${lanes.join("\n")}
|
|
|
119652
119652
|
if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {
|
|
119653
119653
|
return true;
|
|
119654
119654
|
}
|
|
119655
|
-
const propTypes =
|
|
119656
|
-
const indexTypes =
|
|
119655
|
+
const propTypes = map33(getPropertiesOfType(source), getTypeOfSymbol);
|
|
119656
|
+
const indexTypes = map33(getIndexInfosOfType(source), (info) => info !== enumNumberIndexInfo ? info.type : neverType2);
|
|
119657
119657
|
inferFromTypes(getUnionType(concatenate(propTypes, indexTypes)), getTemplateTypeFromMappedType(target));
|
|
119658
119658
|
return true;
|
|
119659
119659
|
}
|
|
@@ -120740,7 +120740,7 @@ ${lanes.join("\n")}
|
|
|
120740
120740
|
) : type;
|
|
120741
120741
|
}
|
|
120742
120742
|
function mapTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
120743
|
-
return type.flags & 1048576 && aliasSymbol ? getUnionType(
|
|
120743
|
+
return type.flags & 1048576 && aliasSymbol ? getUnionType(map33(type.types, mapper), 1, aliasSymbol, aliasTypeArguments) : mapType2(type, mapper);
|
|
120744
120744
|
}
|
|
120745
120745
|
function extractTypesOfKind(type, kind) {
|
|
120746
120746
|
return filterType(type, (t2) => (t2.flags & kind) !== 0);
|
|
@@ -121508,7 +121508,7 @@ ${lanes.join("\n")}
|
|
|
121508
121508
|
}
|
|
121509
121509
|
function getUnionOrEvolvingArrayType(types3, subtypeReduction) {
|
|
121510
121510
|
if (isEvolvingArrayTypeList(types3)) {
|
|
121511
|
-
return getEvolvingArrayType(getUnionType(
|
|
121511
|
+
return getEvolvingArrayType(getUnionType(map33(types3, getElementTypeOfEvolvingArrayType)));
|
|
121512
121512
|
}
|
|
121513
121513
|
const result = recombineUnknownType(getUnionType(sameMap(types3, finalizeEvolvingArrayType), subtypeReduction));
|
|
121514
121514
|
if (result !== declaredType && result.flags & declaredType.flags & 1048576 && arrayIsEqualTo(result.types, declaredType.types)) {
|
|
@@ -121602,7 +121602,7 @@ ${lanes.join("\n")}
|
|
|
121602
121602
|
function narrowTypeBySwitchOnDiscriminantProperty(type, access, data) {
|
|
121603
121603
|
if (data.clauseStart < data.clauseEnd && type.flags & 1048576 && getKeyPropertyName(type) === getAccessedPropertyName(access)) {
|
|
121604
121604
|
const clauseTypes = getSwitchClauseTypes(data.switchStatement).slice(data.clauseStart, data.clauseEnd);
|
|
121605
|
-
const candidate = getUnionType(
|
|
121605
|
+
const candidate = getUnionType(map33(clauseTypes, (t2) => getConstituentTypeForKeyType(type, t2) || unknownType2));
|
|
121606
121606
|
if (candidate !== unknownType2) {
|
|
121607
121607
|
return candidate;
|
|
121608
121608
|
}
|
|
@@ -122030,7 +122030,7 @@ ${lanes.join("\n")}
|
|
|
122030
122030
|
return filterType(type, (t2) => getTypeFacts(t2, notEqualFacts) === notEqualFacts);
|
|
122031
122031
|
}
|
|
122032
122032
|
const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd);
|
|
122033
|
-
return getUnionType(
|
|
122033
|
+
return getUnionType(map33(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType2));
|
|
122034
122034
|
}
|
|
122035
122035
|
function narrowTypeBySwitchOnTrue(type, { switchStatement, clauseStart, clauseEnd }) {
|
|
122036
122036
|
const defaultIndex = findIndex(
|
|
@@ -122065,7 +122065,7 @@ ${lanes.join("\n")}
|
|
|
122065
122065
|
return type;
|
|
122066
122066
|
}
|
|
122067
122067
|
const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
|
|
122068
|
-
return getUnionType(
|
|
122068
|
+
return getUnionType(map33(clauses, (clause) => clause.kind === 297 ? narrowType(
|
|
122069
122069
|
type,
|
|
122070
122070
|
clause.expression,
|
|
122071
122071
|
/*assumeTrue*/
|
|
@@ -122157,7 +122157,7 @@ ${lanes.join("\n")}
|
|
|
122157
122157
|
/* Construct */
|
|
122158
122158
|
);
|
|
122159
122159
|
if (constructSignatures.length) {
|
|
122160
|
-
return getUnionType(
|
|
122160
|
+
return getUnionType(map33(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature))));
|
|
122161
122161
|
}
|
|
122162
122162
|
return emptyObjectType;
|
|
122163
122163
|
}
|
|
@@ -124327,7 +124327,7 @@ ${lanes.join("\n")}
|
|
|
124327
124327
|
getMatchingUnionConstituentForObjectLiteral(contextualType, node) ?? discriminateTypeByDiscriminableItems(
|
|
124328
124328
|
contextualType,
|
|
124329
124329
|
concatenate(
|
|
124330
|
-
|
|
124330
|
+
map33(
|
|
124331
124331
|
filter6(node.properties, (p) => {
|
|
124332
124332
|
if (!p.symbol) {
|
|
124333
124333
|
return false;
|
|
@@ -124342,7 +124342,7 @@ ${lanes.join("\n")}
|
|
|
124342
124342
|
}),
|
|
124343
124343
|
(prop) => [() => getContextFreeTypeOfExpression(prop.kind === 304 ? prop.initializer : prop.name), prop.symbol.escapedName]
|
|
124344
124344
|
),
|
|
124345
|
-
|
|
124345
|
+
map33(
|
|
124346
124346
|
filter6(getPropertiesOfType(contextualType), (s2) => {
|
|
124347
124347
|
var _a2;
|
|
124348
124348
|
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);
|
|
@@ -124364,11 +124364,11 @@ ${lanes.join("\n")}
|
|
|
124364
124364
|
discriminateTypeByDiscriminableItems(
|
|
124365
124365
|
contextualType,
|
|
124366
124366
|
concatenate(
|
|
124367
|
-
|
|
124367
|
+
map33(
|
|
124368
124368
|
filter6(node.properties, (p) => !!p.symbol && p.kind === 292 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
|
|
124369
124369
|
(prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
|
|
124370
124370
|
),
|
|
124371
|
-
|
|
124371
|
+
map33(
|
|
124372
124372
|
filter6(getPropertiesOfType(contextualType), (s2) => {
|
|
124373
124373
|
var _a2;
|
|
124374
124374
|
if (!(s2.flags & 16777216) || !((_a2 = node == null ? void 0 : node.symbol) == null ? void 0 : _a2.members)) {
|
|
@@ -124427,13 +124427,13 @@ ${lanes.join("\n")}
|
|
|
124427
124427
|
}
|
|
124428
124428
|
if (type.flags & 1048576) {
|
|
124429
124429
|
return getUnionType(
|
|
124430
|
-
|
|
124430
|
+
map33(type.types, (t2) => instantiateInstantiableTypes(t2, mapper)),
|
|
124431
124431
|
0
|
|
124432
124432
|
/* None */
|
|
124433
124433
|
);
|
|
124434
124434
|
}
|
|
124435
124435
|
if (type.flags & 2097152) {
|
|
124436
|
-
return getIntersectionType(
|
|
124436
|
+
return getIntersectionType(map33(type.types, (t2) => instantiateInstantiableTypes(t2, mapper)));
|
|
124437
124437
|
}
|
|
124438
124438
|
return type;
|
|
124439
124439
|
}
|
|
@@ -125763,7 +125763,7 @@ ${lanes.join("\n")}
|
|
|
125763
125763
|
);
|
|
125764
125764
|
}
|
|
125765
125765
|
if (signatures.length === 0 && apparentElemType.flags & 1048576) {
|
|
125766
|
-
signatures = getUnionSignatures(
|
|
125766
|
+
signatures = getUnionSignatures(map33(apparentElemType.types, (t2) => getUninstantiatedJsxSignaturesOfType(t2, caller)));
|
|
125767
125767
|
}
|
|
125768
125768
|
return signatures;
|
|
125769
125769
|
}
|
|
@@ -127237,7 +127237,7 @@ ${lanes.join("\n")}
|
|
|
127237
127237
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
127238
127238
|
const isJavascript = isInJSFile(signature.declaration);
|
|
127239
127239
|
const typeParameters = signature.typeParameters;
|
|
127240
|
-
const typeArgumentTypes = fillMissingTypeArguments(
|
|
127240
|
+
const typeArgumentTypes = fillMissingTypeArguments(map33(typeArgumentNodes, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript);
|
|
127241
127241
|
let mapper;
|
|
127242
127242
|
for (let i2 = 0; i2 < typeArgumentNodes.length; i2++) {
|
|
127243
127243
|
Debug.assert(typeParameters[i2] !== void 0, "Should not call checkTypeArguments with too many type arguments");
|
|
@@ -127918,7 +127918,7 @@ ${lanes.join("\n")}
|
|
|
127918
127918
|
const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics);
|
|
127919
127919
|
Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
127920
127920
|
let chain = chainDiagnosticMessages(
|
|
127921
|
-
|
|
127921
|
+
map33(diags, createDiagnosticMessageChainFromDiagnostic),
|
|
127922
127922
|
Diagnostics.No_overload_matches_this_call
|
|
127923
127923
|
);
|
|
127924
127924
|
if (headMessage) {
|
|
@@ -132486,7 +132486,7 @@ ${lanes.join("\n")}
|
|
|
132486
132486
|
if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, hasInferenceCandidates)) {
|
|
132487
132487
|
const uniqueTypeParameters = getUniqueTypeParameters(context, signature.typeParameters);
|
|
132488
132488
|
const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters);
|
|
132489
|
-
const inferences =
|
|
132489
|
+
const inferences = map33(context.inferences, (info) => createInferenceInfo(info.typeParameter));
|
|
132490
132490
|
applyToParameterTypes(instantiatedSignature, contextualSignature, (source, target) => {
|
|
132491
132491
|
inferTypes(
|
|
132492
132492
|
inferences,
|
|
@@ -133434,7 +133434,7 @@ ${lanes.join("\n")}
|
|
|
133434
133434
|
return getEffectiveTypeArguments2(node, typeParameters)[index];
|
|
133435
133435
|
}
|
|
133436
133436
|
function getEffectiveTypeArguments2(node, typeParameters) {
|
|
133437
|
-
return fillMissingTypeArguments(
|
|
133437
|
+
return fillMissingTypeArguments(map33(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(node));
|
|
133438
133438
|
}
|
|
133439
133439
|
function checkTypeArgumentConstraints(node, typeParameters) {
|
|
133440
133440
|
let typeArguments;
|
|
@@ -134080,7 +134080,7 @@ ${lanes.join("\n")}
|
|
|
134080
134080
|
return void 0;
|
|
134081
134081
|
}
|
|
134082
134082
|
const onfulfilledParameterType = getTypeWithFacts(
|
|
134083
|
-
getUnionType(
|
|
134083
|
+
getUnionType(map33(candidates, getTypeOfFirstParameterOfSignature)),
|
|
134084
134084
|
2097152
|
|
134085
134085
|
/* NEUndefinedOrNull */
|
|
134086
134086
|
);
|
|
@@ -134099,7 +134099,7 @@ ${lanes.join("\n")}
|
|
|
134099
134099
|
return void 0;
|
|
134100
134100
|
}
|
|
134101
134101
|
return typeAsPromise.promisedTypeOfPromise = getUnionType(
|
|
134102
|
-
|
|
134102
|
+
map33(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature),
|
|
134103
134103
|
2
|
|
134104
134104
|
/* Subtype */
|
|
134105
134105
|
);
|
|
@@ -136098,7 +136098,7 @@ ${lanes.join("\n")}
|
|
|
136098
136098
|
}
|
|
136099
136099
|
return noCache ? noIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes);
|
|
136100
136100
|
}
|
|
136101
|
-
const iteratorType = getIntersectionType(
|
|
136101
|
+
const iteratorType = getIntersectionType(map33(validSignatures, getReturnTypeOfSignature));
|
|
136102
136102
|
const iterationTypes = getIterationTypesOfIteratorWorker(iteratorType, resolver, errorNode, errorOutputContainer, noCache) ?? noIterationTypes;
|
|
136103
136103
|
return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes);
|
|
136104
136104
|
}
|
|
@@ -137317,7 +137317,7 @@ ${lanes.join("\n")}
|
|
|
137317
137317
|
error210(errorNode, Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, memberInfo.typeName, first2(memberInfo.missedProperties), memberInfo.baseTypeName);
|
|
137318
137318
|
}
|
|
137319
137319
|
} else if (length(memberInfo.missedProperties) > 5) {
|
|
137320
|
-
const missedProperties =
|
|
137320
|
+
const missedProperties = map33(memberInfo.missedProperties.slice(0, 4), (prop) => `'${prop}'`).join(", ");
|
|
137321
137321
|
const remainingMissedProperties = length(memberInfo.missedProperties) - 4;
|
|
137322
137322
|
if (isClassExpression(errorNode)) {
|
|
137323
137323
|
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);
|
|
@@ -137325,7 +137325,7 @@ ${lanes.join("\n")}
|
|
|
137325
137325
|
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);
|
|
137326
137326
|
}
|
|
137327
137327
|
} else {
|
|
137328
|
-
const missedProperties =
|
|
137328
|
+
const missedProperties = map33(memberInfo.missedProperties, (prop) => `'${prop}'`).join(", ");
|
|
137329
137329
|
if (isClassExpression(errorNode)) {
|
|
137330
137330
|
error210(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1, memberInfo.baseTypeName, missedProperties);
|
|
137331
137331
|
} else {
|
|
@@ -139440,7 +139440,7 @@ ${lanes.join("\n")}
|
|
|
139440
139440
|
} else if (symbol2) {
|
|
139441
139441
|
const symbolLinks2 = getSymbolLinks(symbol2);
|
|
139442
139442
|
const declarationList = mapDefined(infos, (i2) => i2.declaration);
|
|
139443
|
-
const nodeListId =
|
|
139443
|
+
const nodeListId = map33(declarationList, getNodeId).join(",");
|
|
139444
139444
|
if (!symbolLinks2.filteredIndexSymbolCache) {
|
|
139445
139445
|
symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
|
|
139446
139446
|
}
|
|
@@ -140696,7 +140696,7 @@ ${lanes.join("\n")}
|
|
|
140696
140696
|
const newComponents = filter6(info.components, (e2) => {
|
|
140697
140697
|
return !hasLateBindableName(e2);
|
|
140698
140698
|
});
|
|
140699
|
-
result.push(...
|
|
140699
|
+
result.push(...map33(newComponents, (e2) => {
|
|
140700
140700
|
trackComputedName(e2.name.expression);
|
|
140701
140701
|
const mods = infoList === staticInfos ? [factory.createModifier(
|
|
140702
140702
|
126
|
|
@@ -142659,7 +142659,7 @@ ${lanes.join("\n")}
|
|
|
142659
142659
|
if (sourceProperties) {
|
|
142660
142660
|
const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target);
|
|
142661
142661
|
if (sourcePropertiesFiltered) {
|
|
142662
|
-
const discriminated = discriminateTypeByDiscriminableItems(target,
|
|
142662
|
+
const discriminated = discriminateTypeByDiscriminableItems(target, map33(sourcePropertiesFiltered, (p) => [() => getTypeOfSymbol(p), p.escapedName]), isRelatedTo);
|
|
142663
142663
|
if (discriminated !== target) {
|
|
142664
142664
|
return discriminated;
|
|
142665
142665
|
}
|
|
@@ -145147,7 +145147,7 @@ ${lanes.join("\n")}
|
|
|
145147
145147
|
return node.kind === 308 ? transformSourceFile(node) : transformBundle(node);
|
|
145148
145148
|
}
|
|
145149
145149
|
function transformBundle(node) {
|
|
145150
|
-
return context.factory.createBundle(
|
|
145150
|
+
return context.factory.createBundle(map33(node.sourceFiles, transformSourceFile));
|
|
145151
145151
|
}
|
|
145152
145152
|
}
|
|
145153
145153
|
function getExportNeedsImportStarHelper(node) {
|
|
@@ -146096,7 +146096,7 @@ ${lanes.join("\n")}
|
|
|
146096
146096
|
}
|
|
146097
146097
|
function makeArrayAssignmentPattern(factory2, elements) {
|
|
146098
146098
|
Debug.assertEachNode(elements, isArrayBindingOrAssignmentElement);
|
|
146099
|
-
return factory2.createArrayLiteralExpression(
|
|
146099
|
+
return factory2.createArrayLiteralExpression(map33(elements, factory2.converters.convertToArrayAssignmentElement));
|
|
146100
146100
|
}
|
|
146101
146101
|
function makeObjectBindingPattern(factory2, elements) {
|
|
146102
146102
|
Debug.assertEachNode(elements, isBindingElement);
|
|
@@ -146104,7 +146104,7 @@ ${lanes.join("\n")}
|
|
|
146104
146104
|
}
|
|
146105
146105
|
function makeObjectAssignmentPattern(factory2, elements) {
|
|
146106
146106
|
Debug.assertEachNode(elements, isObjectBindingOrAssignmentElement);
|
|
146107
|
-
return factory2.createObjectLiteralExpression(
|
|
146107
|
+
return factory2.createObjectLiteralExpression(map33(elements, factory2.converters.convertToObjectAssignmentElement));
|
|
146108
146108
|
}
|
|
146109
146109
|
function makeBindingElement(factory2, name2) {
|
|
146110
146110
|
return factory2.createBindingElement(
|
|
@@ -147550,7 +147550,7 @@ ${lanes.join("\n")}
|
|
|
147550
147550
|
return setTextRange(
|
|
147551
147551
|
factory2.createExpressionStatement(
|
|
147552
147552
|
factory2.inlineExpressions(
|
|
147553
|
-
|
|
147553
|
+
map33(variables, transformInitializedVariable)
|
|
147554
147554
|
)
|
|
147555
147555
|
),
|
|
147556
147556
|
node
|
|
@@ -147756,7 +147756,7 @@ ${lanes.join("\n")}
|
|
|
147756
147756
|
currentNamespaceContainerName = localName;
|
|
147757
147757
|
const statements = [];
|
|
147758
147758
|
startLexicalEnvironment();
|
|
147759
|
-
const members =
|
|
147759
|
+
const members = map33(node.members, transformEnumMember);
|
|
147760
147760
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
147761
147761
|
addRange(statements, members);
|
|
147762
147762
|
currentNamespaceContainerName = savedCurrentNamespaceLocalName;
|
|
@@ -149667,7 +149667,7 @@ ${lanes.join("\n")}
|
|
|
149667
149667
|
if (isDecoratedClassDeclaration) {
|
|
149668
149668
|
Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration.");
|
|
149669
149669
|
if (some(pendingExpressions)) {
|
|
149670
|
-
addRange(pendingStatements,
|
|
149670
|
+
addRange(pendingStatements, map33(pendingExpressions, factory2.createExpressionStatement));
|
|
149671
149671
|
}
|
|
149672
149672
|
if (some(staticPropertiesOrClassStaticBlocks)) {
|
|
149673
149673
|
addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, ((_b = node.emitNode) == null ? void 0 : _b.classThis) ?? factory2.getInternalName(node));
|
|
@@ -151456,13 +151456,13 @@ ${lanes.join("\n")}
|
|
|
151456
151456
|
}
|
|
151457
151457
|
const { false: decorators, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator);
|
|
151458
151458
|
const decoratorExpressions = [];
|
|
151459
|
-
addRange(decoratorExpressions,
|
|
151459
|
+
addRange(decoratorExpressions, map33(decorators, transformDecorator));
|
|
151460
151460
|
addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter));
|
|
151461
|
-
addRange(decoratorExpressions,
|
|
151461
|
+
addRange(decoratorExpressions, map33(metadata, transformDecorator));
|
|
151462
151462
|
return decoratorExpressions;
|
|
151463
151463
|
}
|
|
151464
151464
|
function addClassElementDecorationStatements(statements, node, isStatic2) {
|
|
151465
|
-
addRange(statements,
|
|
151465
|
+
addRange(statements, map33(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr)));
|
|
151466
151466
|
}
|
|
151467
151467
|
function isDecoratedClassElement(member, isStaticElement, parent2) {
|
|
151468
151468
|
return nodeOrChildIsDecorated(
|
|
@@ -153367,7 +153367,7 @@ ${lanes.join("\n")}
|
|
|
153367
153367
|
return void 0;
|
|
153368
153368
|
}
|
|
153369
153369
|
const decoratorExpressions = [];
|
|
153370
|
-
addRange(decoratorExpressions,
|
|
153370
|
+
addRange(decoratorExpressions, map33(allDecorators.decorators, transformDecorator));
|
|
153371
153371
|
return decoratorExpressions;
|
|
153372
153372
|
}
|
|
153373
153373
|
function transformDecorator(decorator) {
|
|
@@ -154040,7 +154040,7 @@ ${lanes.join("\n")}
|
|
|
154040
154040
|
}
|
|
154041
154041
|
return void 0;
|
|
154042
154042
|
}
|
|
154043
|
-
return factory2.inlineExpressions(
|
|
154043
|
+
return factory2.inlineExpressions(map33(variables, transformInitializedVariable));
|
|
154044
154044
|
}
|
|
154045
154045
|
function hoistVariableDeclarationList(node) {
|
|
154046
154046
|
forEach(node.declarations, hoistVariable);
|
|
@@ -157456,7 +157456,7 @@ ${lanes.join("\n")}
|
|
|
157456
157456
|
return target && target >= 5 ? factory2.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children);
|
|
157457
157457
|
}
|
|
157458
157458
|
function transformJsxAttributesToProps(attrs, children) {
|
|
157459
|
-
const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(
|
|
157459
|
+
const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(map33(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToProps(attr) : transformJsxAttributeToObjectLiteralElement(attr)))));
|
|
157460
157460
|
if (children) {
|
|
157461
157461
|
props.push(children);
|
|
157462
157462
|
}
|
|
@@ -160745,7 +160745,7 @@ ${lanes.join("\n")}
|
|
|
160745
160745
|
/* NoHoisting */
|
|
160746
160746
|
)
|
|
160747
160747
|
);
|
|
160748
|
-
const part = factory2.createVariableDeclarationList(
|
|
160748
|
+
const part = factory2.createVariableDeclarationList(map33(currentState.loopOutParameters, createOutVariable));
|
|
160749
160749
|
return { functionName, containsYield, functionDeclaration, part };
|
|
160750
160750
|
}
|
|
160751
160751
|
function createFunctionForBodyOfIterationStatement(node, currentState, outerState) {
|
|
@@ -160873,7 +160873,7 @@ ${lanes.join("\n")}
|
|
|
160873
160873
|
loopFunctionExpressionName,
|
|
160874
160874
|
/*typeArguments*/
|
|
160875
160875
|
void 0,
|
|
160876
|
-
|
|
160876
|
+
map33(state.loopParameters, (p) => p.name)
|
|
160877
160877
|
);
|
|
160878
160878
|
const callResult = containsYield ? factory2.createYieldExpression(
|
|
160879
160879
|
factory2.createToken(
|
|
@@ -161451,7 +161451,7 @@ ${lanes.join("\n")}
|
|
|
161451
161451
|
return isSpreadElement(node) ? visitSpanOfSpreads : visitSpanOfNonSpreads;
|
|
161452
161452
|
}
|
|
161453
161453
|
function visitSpanOfSpreads(chunk) {
|
|
161454
|
-
return
|
|
161454
|
+
return map33(chunk, visitExpressionOfSpread);
|
|
161455
161455
|
}
|
|
161456
161456
|
function visitExpressionOfSpread(node) {
|
|
161457
161457
|
Debug.assertNode(node, isSpreadElement);
|
|
@@ -162023,7 +162023,7 @@ ${lanes.join("\n")}
|
|
|
162023
162023
|
return setSourceMapRange(
|
|
162024
162024
|
factory2.createExpressionStatement(
|
|
162025
162025
|
factory2.inlineExpressions(
|
|
162026
|
-
|
|
162026
|
+
map33(variables, transformInitializedVariable)
|
|
162027
162027
|
)
|
|
162028
162028
|
),
|
|
162029
162029
|
node
|
|
@@ -162581,7 +162581,7 @@ ${lanes.join("\n")}
|
|
|
162581
162581
|
const variables = getInitializedVariables(initializer3);
|
|
162582
162582
|
node = factory2.updateForStatement(
|
|
162583
162583
|
node,
|
|
162584
|
-
variables.length > 0 ? factory2.inlineExpressions(
|
|
162584
|
+
variables.length > 0 ? factory2.inlineExpressions(map33(variables, transformInitializedVariable)) : void 0,
|
|
162585
162585
|
visitNode3(node.condition, visitor, isExpression),
|
|
162586
162586
|
visitNode3(node.incrementor, visitor, isExpression),
|
|
162587
162587
|
visitIterationBody(node.statement, visitor, context)
|
|
@@ -165907,7 +165907,7 @@ ${lanes.join("\n")}
|
|
|
165907
165907
|
moduleBodyBlock
|
|
165908
165908
|
);
|
|
165909
165909
|
const moduleName = tryGetModuleNameFromFile(factory2, node, host, compilerOptions);
|
|
165910
|
-
const dependencies = factory2.createArrayLiteralExpression(
|
|
165910
|
+
const dependencies = factory2.createArrayLiteralExpression(map33(dependencyGroups, (dependencyGroup) => dependencyGroup.name));
|
|
165911
165911
|
const updated = setEmitFlags(
|
|
165912
165912
|
factory2.updateSourceFile(
|
|
165913
165913
|
node,
|
|
@@ -167637,7 +167637,7 @@ ${lanes.join("\n")}
|
|
|
167637
167637
|
return node.kind === 308 ? transformSourceFile(node) : transformBundle(node);
|
|
167638
167638
|
}
|
|
167639
167639
|
function transformBundle(node) {
|
|
167640
|
-
return context.factory.createBundle(
|
|
167640
|
+
return context.factory.createBundle(map33(node.sourceFiles, transformSourceFile));
|
|
167641
167641
|
}
|
|
167642
167642
|
}
|
|
167643
167643
|
function canProduceDiagnostics(node) {
|
|
@@ -168385,7 +168385,7 @@ ${lanes.join("\n")}
|
|
|
168385
168385
|
rawLibReferenceDirectives = [];
|
|
168386
168386
|
let hasNoDefaultLib = false;
|
|
168387
168387
|
const bundle = factory2.createBundle(
|
|
168388
|
-
|
|
168388
|
+
map33(node.sourceFiles, (sourceFile) => {
|
|
168389
168389
|
if (sourceFile.isDeclarationFile) return void 0;
|
|
168390
168390
|
hasNoDefaultLib = hasNoDefaultLib || sourceFile.hasNoDefaultLib;
|
|
168391
168391
|
currentSourceFile = sourceFile;
|
|
@@ -168496,7 +168496,7 @@ ${lanes.join("\n")}
|
|
|
168496
168496
|
getLibReferences()
|
|
168497
168497
|
);
|
|
168498
168498
|
function collectFileReferences(sourceFile) {
|
|
168499
|
-
rawReferencedFiles = concatenate(rawReferencedFiles,
|
|
168499
|
+
rawReferencedFiles = concatenate(rawReferencedFiles, map33(sourceFile.referencedFiles, (f3) => [sourceFile, f3]));
|
|
168500
168500
|
rawTypeReferenceDirectives = concatenate(rawTypeReferenceDirectives, sourceFile.typeReferenceDirectives);
|
|
168501
168501
|
rawLibReferenceDirectives = concatenate(rawLibReferenceDirectives, sourceFile.libReferenceDirectives);
|
|
168502
168502
|
}
|
|
@@ -168710,7 +168710,7 @@ ${lanes.join("\n")}
|
|
|
168710
168710
|
)) {
|
|
168711
168711
|
return factory2.createNodeArray();
|
|
168712
168712
|
}
|
|
168713
|
-
const newParams =
|
|
168713
|
+
const newParams = map33(params, (p) => ensureParameter(p, modifierMask));
|
|
168714
168714
|
if (!newParams) {
|
|
168715
168715
|
return factory2.createNodeArray();
|
|
168716
168716
|
}
|
|
@@ -169462,7 +169462,7 @@ ${lanes.join("\n")}
|
|
|
169462
169462
|
void 0,
|
|
169463
169463
|
/*isTypeOnly*/
|
|
169464
169464
|
false,
|
|
169465
|
-
factory2.createNamedExports(
|
|
169465
|
+
factory2.createNamedExports(map33(exportMappings, ([gen, exp]) => {
|
|
169466
169466
|
return factory2.createExportSpecifier(
|
|
169467
169467
|
/*isTypeOnly*/
|
|
169468
169468
|
false,
|
|
@@ -169670,11 +169670,11 @@ ${lanes.join("\n")}
|
|
|
169670
169670
|
2
|
|
169671
169671
|
/* Const */
|
|
169672
169672
|
));
|
|
169673
|
-
const heritageClauses = factory2.createNodeArray(
|
|
169673
|
+
const heritageClauses = factory2.createNodeArray(map33(input.heritageClauses, (clause) => {
|
|
169674
169674
|
if (clause.token === 96) {
|
|
169675
169675
|
const oldDiag2 = getSymbolAccessibilityDiagnostic;
|
|
169676
169676
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]);
|
|
169677
|
-
const newClause = factory2.updateHeritageClause(clause,
|
|
169677
|
+
const newClause = factory2.updateHeritageClause(clause, map33(clause.types, (t2) => factory2.updateExpressionWithTypeArguments(t2, newId, visitNodes2(t2.typeArguments, visitDeclarationSubtree, isTypeNode))));
|
|
169678
169678
|
getSymbolAccessibilityDiagnostic = oldDiag2;
|
|
169679
169679
|
return newClause;
|
|
169680
169680
|
}
|
|
@@ -169836,7 +169836,7 @@ ${lanes.join("\n")}
|
|
|
169836
169836
|
}
|
|
169837
169837
|
function transformHeritageClauses(nodes) {
|
|
169838
169838
|
return factory2.createNodeArray(filter6(
|
|
169839
|
-
|
|
169839
|
+
map33(nodes, (clause) => factory2.updateHeritageClause(
|
|
169840
169840
|
clause,
|
|
169841
169841
|
visitNodes2(
|
|
169842
169842
|
factory2.createNodeArray(filter6(clause.types, (t2) => {
|
|
@@ -169958,7 +169958,7 @@ ${lanes.join("\n")}
|
|
|
169958
169958
|
const moduleKind = getEmitModuleKind(compilerOptions);
|
|
169959
169959
|
const useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
169960
169960
|
const transformers = [];
|
|
169961
|
-
addRange(transformers, customTransformers &&
|
|
169961
|
+
addRange(transformers, customTransformers && map33(customTransformers.before, wrapScriptTransformerFactory));
|
|
169962
169962
|
transformers.push(transformTypeScript);
|
|
169963
169963
|
if (compilerOptions.experimentalDecorators) {
|
|
169964
169964
|
transformers.push(transformLegacyDecorators);
|
|
@@ -169996,13 +169996,13 @@ ${lanes.join("\n")}
|
|
|
169996
169996
|
transformers.push(transformGenerators);
|
|
169997
169997
|
}
|
|
169998
169998
|
transformers.push(getModuleTransformer(moduleKind));
|
|
169999
|
-
addRange(transformers, customTransformers &&
|
|
169999
|
+
addRange(transformers, customTransformers && map33(customTransformers.after, wrapScriptTransformerFactory));
|
|
170000
170000
|
return transformers;
|
|
170001
170001
|
}
|
|
170002
170002
|
function getDeclarationTransformers(customTransformers) {
|
|
170003
170003
|
const transformers = [];
|
|
170004
170004
|
transformers.push(transformDeclarations);
|
|
170005
|
-
addRange(transformers, customTransformers &&
|
|
170005
|
+
addRange(transformers, customTransformers && map33(customTransformers.afterDeclarations, wrapDeclarationTransformerFactory));
|
|
170006
170006
|
return transformers;
|
|
170007
170007
|
}
|
|
170008
170008
|
function wrapCustomTransformer(transformer) {
|
|
@@ -175778,7 +175778,7 @@ ${lanes.join("\n")}
|
|
|
175778
175778
|
var _a2;
|
|
175779
175779
|
if (!host.realpath || ensureTrailingDirectorySeparator(toPath3(host.realpath(rootDir))) === rootDirPath) {
|
|
175780
175780
|
const resultFromHost = {
|
|
175781
|
-
files:
|
|
175781
|
+
files: map33(host.readDirectory(
|
|
175782
175782
|
rootDir,
|
|
175783
175783
|
/*extensions*/
|
|
175784
175784
|
void 0,
|
|
@@ -175877,7 +175877,7 @@ ${lanes.join("\n")}
|
|
|
175877
175877
|
function getFileSystemEntriesFromHost(dir, path2) {
|
|
175878
175878
|
if (rootSymLinkResult && path2 === rootDirPath) return rootSymLinkResult;
|
|
175879
175879
|
const result = {
|
|
175880
|
-
files:
|
|
175880
|
+
files: map33(host.readDirectory(
|
|
175881
175881
|
dir,
|
|
175882
175882
|
/*extensions*/
|
|
175883
175883
|
void 0,
|
|
@@ -182191,7 +182191,7 @@ ${lanes.join("\n")}
|
|
|
182191
182191
|
let filePathsSetList;
|
|
182192
182192
|
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
182193
182193
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
182194
|
-
const changedFilesSet = new Set(
|
|
182194
|
+
const changedFilesSet = new Set(map33(buildInfo.changeFileSet, toFilePath));
|
|
182195
182195
|
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
182196
182196
|
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
182197
182197
|
const path2 = toFilePath(index + 1);
|
|
@@ -188116,7 +188116,7 @@ ${lanes.join("\n")}
|
|
|
188116
188116
|
return factory.createArrayTypeNode(visitNode3(node.type, visitExistingNodeTreeSymbols, isTypeNode));
|
|
188117
188117
|
}
|
|
188118
188118
|
if (isJSDocTypeLiteral(node)) {
|
|
188119
|
-
return factory.createTypeLiteralNode(
|
|
188119
|
+
return factory.createTypeLiteralNode(map33(node.jsDocPropertyTags, (t2) => {
|
|
188120
188120
|
const name2 = visitNode3(isIdentifier(t2.name) ? t2.name : t2.name.right, visitExistingNodeTreeSymbols, isIdentifier);
|
|
188121
188121
|
const overrideTypeNode = resolver.getJsDocPropertyOverride(context, node, t2);
|
|
188122
188122
|
return factory.createPropertySignature(
|
|
@@ -188182,7 +188182,7 @@ ${lanes.join("\n")}
|
|
|
188182
188182
|
} else {
|
|
188183
188183
|
return factory.createFunctionTypeNode(
|
|
188184
188184
|
visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration),
|
|
188185
|
-
|
|
188185
|
+
map33(node.parameters, (p, i2) => factory.createParameterDeclaration(
|
|
188186
188186
|
/*modifiers*/
|
|
188187
188187
|
void 0,
|
|
188188
188188
|
getEffectiveDotDotDotForParameter(p),
|
|
@@ -192465,7 +192465,7 @@ ${lanes.join("\n")}
|
|
|
192465
192465
|
return expression;
|
|
192466
192466
|
}
|
|
192467
192467
|
function mapOneOrMany(valueOrArray, f3, resultSelector = identity) {
|
|
192468
|
-
return valueOrArray ? isArray(valueOrArray) ? resultSelector(
|
|
192468
|
+
return valueOrArray ? isArray(valueOrArray) ? resultSelector(map33(valueOrArray, f3)) : f3(valueOrArray, 0) : void 0;
|
|
192469
192469
|
}
|
|
192470
192470
|
function firstOrOnly(valueOrArray) {
|
|
192471
192471
|
return isArray(valueOrArray) ? first2(valueOrArray) : valueOrArray;
|
|
@@ -196399,7 +196399,7 @@ interface Symbol {
|
|
|
196399
196399
|
curCancellationToken = cancellationToken;
|
|
196400
196400
|
curSourceFile = sourceFile;
|
|
196401
196401
|
try {
|
|
196402
|
-
return
|
|
196402
|
+
return map33(primaryNavBarMenuItems(rootNavigationBarNode(sourceFile)), convertToPrimaryNavBarMenuItem);
|
|
196403
196403
|
} finally {
|
|
196404
196404
|
reset();
|
|
196405
196405
|
}
|
|
@@ -197052,7 +197052,7 @@ interface Symbol {
|
|
|
197052
197052
|
kindModifiers: getModifiers2(n.node),
|
|
197053
197053
|
spans: getSpans(n),
|
|
197054
197054
|
nameSpan: n.name && getNodeSpan(n.name),
|
|
197055
|
-
childItems:
|
|
197055
|
+
childItems: map33(n.children, convertToTree)
|
|
197056
197056
|
};
|
|
197057
197057
|
}
|
|
197058
197058
|
function convertToPrimaryNavBarMenuItem(n) {
|
|
@@ -197061,7 +197061,7 @@ interface Symbol {
|
|
|
197061
197061
|
kind: getNodeKind(n.node),
|
|
197062
197062
|
kindModifiers: getModifiers2(n.node),
|
|
197063
197063
|
spans: getSpans(n),
|
|
197064
|
-
childItems:
|
|
197064
|
+
childItems: map33(n.children, convertToSecondaryNavBarMenuItem) || emptyChildItemArray,
|
|
197065
197065
|
indent: n.indent,
|
|
197066
197066
|
bolded: false,
|
|
197067
197067
|
grayed: false
|
|
@@ -199289,12 +199289,12 @@ interface Symbol {
|
|
|
199289
199289
|
"args",
|
|
199290
199290
|
/*questionToken*/
|
|
199291
199291
|
void 0,
|
|
199292
|
-
factory.createUnionTypeNode(
|
|
199292
|
+
factory.createUnionTypeNode(map33(signatureDeclarations, convertSignatureParametersToTuple))
|
|
199293
199293
|
)
|
|
199294
199294
|
]);
|
|
199295
199295
|
}
|
|
199296
199296
|
function convertSignatureParametersToTuple(decl) {
|
|
199297
|
-
const members =
|
|
199297
|
+
const members = map33(decl.parameters, convertParameterToNamedTupleMember);
|
|
199298
199298
|
return setEmitFlags(
|
|
199299
199299
|
factory.createTupleTypeNode(members),
|
|
199300
199300
|
some(members, (m2) => !!length(getSyntheticLeadingComments(m2))) ? 0 : 1
|
|
@@ -199774,9 +199774,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
199774
199774
|
}
|
|
199775
199775
|
function doChange5(sourceFile, program2, host, changes, functionDeclaration, groupedReferences) {
|
|
199776
199776
|
const signature = groupedReferences.signature;
|
|
199777
|
-
const newFunctionDeclarationParams =
|
|
199777
|
+
const newFunctionDeclarationParams = map33(createNewParameters(functionDeclaration, program2, host), (param) => getSynthesizedDeepClone(param));
|
|
199778
199778
|
if (signature) {
|
|
199779
|
-
const newSignatureParams =
|
|
199779
|
+
const newSignatureParams = map33(createNewParameters(signature, program2, host), (param) => getSynthesizedDeepClone(param));
|
|
199780
199780
|
replaceParameters(signature, newSignatureParams);
|
|
199781
199781
|
}
|
|
199782
199782
|
replaceParameters(functionDeclaration, newFunctionDeclarationParams);
|
|
@@ -199839,10 +199839,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
199839
199839
|
function groupReferences(referenceEntries) {
|
|
199840
199840
|
const classReferences = { accessExpressions: [], typeUsages: [] };
|
|
199841
199841
|
const groupedReferences2 = { functionCalls: [], declarations: [], classReferences, valid: true };
|
|
199842
|
-
const functionSymbols =
|
|
199843
|
-
const classSymbols =
|
|
199842
|
+
const functionSymbols = map33(functionNames, getSymbolTargetAtLocation);
|
|
199843
|
+
const classSymbols = map33(classNames, getSymbolTargetAtLocation);
|
|
199844
199844
|
const isConstructor = isConstructorDeclaration(functionDeclaration);
|
|
199845
|
-
const contextualSymbols =
|
|
199845
|
+
const contextualSymbols = map33(functionNames, (name2) => getSymbolForContextualType(name2, checker));
|
|
199846
199846
|
for (const entry of referenceEntries) {
|
|
199847
199847
|
if (entry.kind === ts_FindAllReferences_exports.EntryKind.Span) {
|
|
199848
199848
|
groupedReferences2.valid = false;
|
|
@@ -200106,7 +200106,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200106
200106
|
const parameters = getRefactorableParameters(functionDeclaration.parameters);
|
|
200107
200107
|
const hasRestParameter2 = isRestParameter(last(parameters));
|
|
200108
200108
|
const nonRestArguments = hasRestParameter2 ? functionArguments.slice(0, parameters.length - 1) : functionArguments;
|
|
200109
|
-
const properties =
|
|
200109
|
+
const properties = map33(nonRestArguments, (arg, i2) => {
|
|
200110
200110
|
const parameterName = getParameterName(parameters[i2]);
|
|
200111
200111
|
const property = createPropertyOrShorthandAssignment(parameterName, arg);
|
|
200112
200112
|
suppressLeadingAndTrailingTrivia(property.name);
|
|
@@ -200129,7 +200129,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200129
200129
|
function createNewParameters(functionDeclaration, program2, host) {
|
|
200130
200130
|
const checker = program2.getTypeChecker();
|
|
200131
200131
|
const refactorableParameters = getRefactorableParameters(functionDeclaration.parameters);
|
|
200132
|
-
const bindingElements =
|
|
200132
|
+
const bindingElements = map33(refactorableParameters, createBindingElementFromParameterDeclaration);
|
|
200133
200133
|
const objectParameterName = factory.createObjectBindingPattern(bindingElements);
|
|
200134
200134
|
const objectParameterType = createParameterTypeNode(refactorableParameters);
|
|
200135
200135
|
let objectInitializer;
|
|
@@ -200184,7 +200184,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200184
200184
|
return element;
|
|
200185
200185
|
}
|
|
200186
200186
|
function createParameterTypeNode(parameters) {
|
|
200187
|
-
const members =
|
|
200187
|
+
const members = map33(parameters, createPropertySignatureFromParameterDeclaration);
|
|
200188
200188
|
const typeNode = addEmitFlags(
|
|
200189
200189
|
factory.createTypeLiteralNode(members),
|
|
200190
200190
|
1
|
|
@@ -200459,7 +200459,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200459
200459
|
i2 = newIndex - 1;
|
|
200460
200460
|
const isLast = i2 === nodes.length - 1;
|
|
200461
200461
|
if (isTemplateExpression(currentNode)) {
|
|
200462
|
-
const spans =
|
|
200462
|
+
const spans = map33(currentNode.templateSpans, (span, index) => {
|
|
200463
200463
|
copyExpressionComments(span);
|
|
200464
200464
|
const isLastSpan = index === currentNode.templateSpans.length - 1;
|
|
200465
200465
|
const text = span.literal.text + (isLastSpan ? subsequentText : "");
|
|
@@ -202086,8 +202086,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202086
202086
|
}
|
|
202087
202087
|
}
|
|
202088
202088
|
function getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes) {
|
|
202089
|
-
const variableAssignments =
|
|
202090
|
-
const writeAssignments =
|
|
202089
|
+
const variableAssignments = map33(exposedVariableDeclarations, (v) => factory.createShorthandPropertyAssignment(v.symbol.name));
|
|
202090
|
+
const writeAssignments = map33(writes, (w) => factory.createShorthandPropertyAssignment(w.symbol.name));
|
|
202091
202091
|
return variableAssignments === void 0 ? writeAssignments : writeAssignments === void 0 ? variableAssignments : variableAssignments.concat(writeAssignments);
|
|
202092
202092
|
}
|
|
202093
202093
|
function isReadonlyArray(v) {
|
|
@@ -203612,7 +203612,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
203612
203612
|
}
|
|
203613
203613
|
function displayPartsToString(displayParts) {
|
|
203614
203614
|
if (displayParts) {
|
|
203615
|
-
return
|
|
203615
|
+
return map33(displayParts, (displayPart2) => displayPart2.text).join("");
|
|
203616
203616
|
}
|
|
203617
203617
|
return "";
|
|
203618
203618
|
}
|
|
@@ -204975,7 +204975,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
204975
204975
|
const multiLineCommentStart = /(?:\/\*+\s*)/.source;
|
|
204976
204976
|
const anyNumberOfSpacesAndAsterisksAtStartOfLine = /(?:^(?:\s|\*)*)/.source;
|
|
204977
204977
|
const preamble = "(" + anyNumberOfSpacesAndAsterisksAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")";
|
|
204978
|
-
const literals = "(?:" +
|
|
204978
|
+
const literals = "(?:" + map33(descriptors, (d) => "(" + escapeRegExp(d.text) + ")").join("|") + ")";
|
|
204979
204979
|
const endOfLineOrEndOfComment = /(?:$|\*\/)/.source;
|
|
204980
204980
|
const messageRemainder = /(?:.*?)/.source;
|
|
204981
204981
|
const messagePortion = "(" + literals + messageRemainder + ")";
|
|
@@ -205914,9 +205914,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
205914
205914
|
let declarations;
|
|
205915
205915
|
if (symbol2 && symbol2.declarations) {
|
|
205916
205916
|
const indices = indicesOf(symbol2.declarations);
|
|
205917
|
-
const keys =
|
|
205917
|
+
const keys = map33(symbol2.declarations, (decl) => ({ file: decl.getSourceFile().fileName, pos: decl.pos }));
|
|
205918
205918
|
indices.sort((a, b) => compareStringsCaseSensitive(keys[a].file, keys[b].file) || keys[a].pos - keys[b].pos);
|
|
205919
|
-
const sortedDeclarations =
|
|
205919
|
+
const sortedDeclarations = map33(indices, (i2) => symbol2.declarations[i2]);
|
|
205920
205920
|
let lastDecl;
|
|
205921
205921
|
for (const decl of sortedDeclarations) {
|
|
205922
205922
|
if (isValidCallHierarchyDeclaration(decl)) {
|
|
@@ -206052,7 +206052,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
206052
206052
|
return { from: from18, fromSpans };
|
|
206053
206053
|
}
|
|
206054
206054
|
function convertCallSiteGroupToIncomingCall(program2, entries) {
|
|
206055
|
-
return createCallHierarchyIncomingCall(createCallHierarchyItem(program2, entries[0].declaration),
|
|
206055
|
+
return createCallHierarchyIncomingCall(createCallHierarchyItem(program2, entries[0].declaration), map33(entries, (entry) => createTextSpanFromRange(entry.range)));
|
|
206056
206056
|
}
|
|
206057
206057
|
function getIncomingCalls(program2, declaration, cancellationToken) {
|
|
206058
206058
|
if (isSourceFile(declaration) || isModuleDeclaration(declaration) || isClassStaticBlockDeclaration(declaration)) {
|
|
@@ -206238,7 +206238,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
206238
206238
|
return { to, fromSpans };
|
|
206239
206239
|
}
|
|
206240
206240
|
function convertCallSiteGroupToOutgoingCall(program2, entries) {
|
|
206241
|
-
return createCallHierarchyOutgoingCall(createCallHierarchyItem(program2, entries[0].declaration),
|
|
206241
|
+
return createCallHierarchyOutgoingCall(createCallHierarchyItem(program2, entries[0].declaration), map33(entries, (entry) => createTextSpanFromRange(entry.range)));
|
|
206242
206242
|
}
|
|
206243
206243
|
function getOutgoingCalls(program2, declaration) {
|
|
206244
206244
|
if (declaration.flags & 33554432 || isMethodSignature(declaration)) {
|
|
@@ -206351,7 +206351,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
206351
206351
|
function getFixes(context) {
|
|
206352
206352
|
const diagnostics = getDiagnostics(context);
|
|
206353
206353
|
const registrations = errorCodeToFixes.get(String(context.errorCode));
|
|
206354
|
-
return flatMap(registrations, (f3) =>
|
|
206354
|
+
return flatMap(registrations, (f3) => map33(f3.getCodeActions(context), removeFixIdIfFixAllUnavailable(f3, diagnostics)));
|
|
206355
206355
|
}
|
|
206356
206356
|
function getAllFixes(context) {
|
|
206357
206357
|
return fixIdToRegistration.get(cast(context.fixId, isString)).getAllCodeActions(context);
|
|
@@ -207187,7 +207187,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
207187
207187
|
}
|
|
207188
207188
|
}
|
|
207189
207189
|
function transformJSDocTypeLiteral(node) {
|
|
207190
|
-
const typeNode = factory.createTypeLiteralNode(
|
|
207190
|
+
const typeNode = factory.createTypeLiteralNode(map33(node.jsDocPropertyTags, (tag) => factory.createPropertySignature(
|
|
207191
207191
|
/*modifiers*/
|
|
207192
207192
|
void 0,
|
|
207193
207193
|
isIdentifier(tag.name) ? tag.name : tag.name.right,
|
|
@@ -208458,7 +208458,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
208458
208458
|
function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) {
|
|
208459
208459
|
const { declarationList } = statement;
|
|
208460
208460
|
let foundImport = false;
|
|
208461
|
-
const converted =
|
|
208461
|
+
const converted = map33(declarationList.declarations, (decl) => {
|
|
208462
208462
|
const { name: name2, initializer: initializer3 } = decl;
|
|
208463
208463
|
if (initializer3) {
|
|
208464
208464
|
if (isExportsOrModuleExportsOrAlias(sourceFile, initializer3)) {
|
|
@@ -211583,7 +211583,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
211583
211583
|
));
|
|
211584
211584
|
}
|
|
211585
211585
|
function createExportSpecifiers(names, allowTypeModifier) {
|
|
211586
|
-
return factory.createNodeArray(
|
|
211586
|
+
return factory.createNodeArray(map33(names, (n) => factory.createExportSpecifier(
|
|
211587
211587
|
allowTypeModifier && n.isTypeOnly,
|
|
211588
211588
|
/*propertyName*/
|
|
211589
211589
|
void 0,
|
|
@@ -212469,7 +212469,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212469
212469
|
const checker = context.program.getTypeChecker();
|
|
212470
212470
|
const jsxAttributesNode = info.parentDeclaration.attributes;
|
|
212471
212471
|
const hasSpreadAttribute = some(jsxAttributesNode.properties, isJsxSpreadAttribute);
|
|
212472
|
-
const attrs =
|
|
212472
|
+
const attrs = map33(info.attributes, (attr) => {
|
|
212473
212473
|
const value = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr), info.parentDeclaration);
|
|
212474
212474
|
const name2 = factory.createIdentifier(attr.name);
|
|
212475
212475
|
const jsxAttribute = factory.createJsxAttribute(name2, factory.createJsxExpression(
|
|
@@ -212490,7 +212490,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212490
212490
|
const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
|
|
212491
212491
|
const target = getEmitScriptTarget(context.program.getCompilerOptions());
|
|
212492
212492
|
const checker = context.program.getTypeChecker();
|
|
212493
|
-
const props =
|
|
212493
|
+
const props = map33(info.properties, (prop) => {
|
|
212494
212494
|
const initializer3 = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), info.parentDeclaration);
|
|
212495
212495
|
return factory.createPropertyAssignment(createPropertyNameFromSymbol(prop, target, quotePreference, checker), initializer3);
|
|
212496
212496
|
});
|
|
@@ -212572,7 +212572,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212572
212572
|
return factory.createArrayLiteralExpression();
|
|
212573
212573
|
}
|
|
212574
212574
|
if (isObjectLiteralType(type)) {
|
|
212575
|
-
const props =
|
|
212575
|
+
const props = map33(checker.getPropertiesOfType(type), (prop) => {
|
|
212576
212576
|
const initializer3 = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), enclosingDeclaration);
|
|
212577
212577
|
return factory.createPropertyAssignment(prop.name, initializer3);
|
|
212578
212578
|
});
|
|
@@ -212910,7 +212910,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212910
212910
|
}
|
|
212911
212911
|
}
|
|
212912
212912
|
function updateParameters(importAdder, scriptTarget, node, newParameters) {
|
|
212913
|
-
const parameters =
|
|
212913
|
+
const parameters = map33(node.parameters, (p) => factory.createParameterDeclaration(
|
|
212914
212914
|
p.modifiers,
|
|
212915
212915
|
p.dotDotDotToken,
|
|
212916
212916
|
p.name,
|
|
@@ -213488,7 +213488,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
213488
213488
|
jsDocParameterTag.isNameFirst,
|
|
213489
213489
|
jsDocParameterTag.comment
|
|
213490
213490
|
);
|
|
213491
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost,
|
|
213491
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map33(tags, (t2) => t2 === jsDocParameterTag ? newJSDocParameterTag : t2)));
|
|
213492
213492
|
return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name2.getText(sourceFile), parameterName]);
|
|
213493
213493
|
}
|
|
213494
213494
|
function getInfo14(sourceFile, pos) {
|
|
@@ -213604,7 +213604,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
213604
213604
|
const elements = token.parent.elements;
|
|
213605
213605
|
const diagnostic = [
|
|
213606
213606
|
elements.length > 1 ? Diagnostics.Remove_unused_declarations_for_Colon_0 : Diagnostics.Remove_unused_declaration_for_Colon_0,
|
|
213607
|
-
|
|
213607
|
+
map33(elements, (e2) => e2.getText(sourceFile)).join(", ")
|
|
213608
213608
|
];
|
|
213609
213609
|
return [
|
|
213610
213610
|
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t2) => deleteDestructuringElements(t2, sourceFile, token.parent)), diagnostic)
|
|
@@ -215565,7 +215565,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
215565
215565
|
));
|
|
215566
215566
|
}
|
|
215567
215567
|
} else {
|
|
215568
|
-
const paramTags =
|
|
215568
|
+
const paramTags = map33(inferences, ({ name: name2, typeNode, isOptional }) => factory.createJSDocParameterTag(
|
|
215569
215569
|
/*tagName*/
|
|
215570
215570
|
void 0,
|
|
215571
215571
|
name2,
|
|
@@ -216699,8 +216699,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
216699
216699
|
const isJs = isInJSFile(contextNode);
|
|
216700
216700
|
const { typeArguments, arguments: args, parent: parent2 } = call;
|
|
216701
216701
|
const contextualType = isJs ? void 0 : checker.getContextualType(call);
|
|
216702
|
-
const names =
|
|
216703
|
-
const instanceTypes = isJs ? [] :
|
|
216702
|
+
const names = map33(args, (arg) => isIdentifier(arg) ? arg.text : isPropertyAccessExpression(arg) && isIdentifier(arg.name) ? arg.name.text : void 0);
|
|
216703
|
+
const instanceTypes = isJs ? [] : map33(args, (arg) => checker.getTypeAtLocation(arg));
|
|
216704
216704
|
const { argumentTypeNodes, argumentTypeParameters } = getArgumentTypesAndTypeParameters(
|
|
216705
216705
|
checker,
|
|
216706
216706
|
importAdder,
|
|
@@ -217008,7 +217008,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
217008
217008
|
}
|
|
217009
217009
|
function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) {
|
|
217010
217010
|
if (length(signatures)) {
|
|
217011
|
-
const type = checker.getUnionType(
|
|
217011
|
+
const type = checker.getUnionType(map33(signatures, checker.getReturnTypeOfSignature));
|
|
217012
217012
|
return checker.typeToTypeNode(type, enclosingDeclaration, 1, 8, getNoopSymbolTrackerWithResolver(context));
|
|
217013
217013
|
}
|
|
217014
217014
|
}
|
|
@@ -219013,7 +219013,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
219013
219013
|
if (elements.length === 0) {
|
|
219014
219014
|
return void 0;
|
|
219015
219015
|
}
|
|
219016
|
-
const newClauses =
|
|
219016
|
+
const newClauses = map33(elements, (element) => factory.createCaseClause(element, []));
|
|
219017
219017
|
const newLineChar = getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options);
|
|
219018
219018
|
const printer = createSnippetPrinter({
|
|
219019
219019
|
removeComments: true,
|
|
@@ -219023,7 +219023,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
219023
219023
|
newLine: getNewLineKind(newLineChar)
|
|
219024
219024
|
});
|
|
219025
219025
|
const printNode = formatContext ? (node) => printer.printAndFormatNode(4, node, sourceFile, formatContext) : (node) => printer.printNode(4, node, sourceFile);
|
|
219026
|
-
const insertText =
|
|
219026
|
+
const insertText = map33(newClauses, (clause, i2) => {
|
|
219027
219027
|
if (preferences.includeCompletionsWithSnippetText) {
|
|
219028
219028
|
return `${printNode(clause)}$${i2 + 1}`;
|
|
219029
219029
|
}
|
|
@@ -224250,7 +224250,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
224250
224250
|
}
|
|
224251
224251
|
}
|
|
224252
224252
|
const checker = program2.getTypeChecker();
|
|
224253
|
-
return
|
|
224253
|
+
return map33(referenceEntries, (entry) => toImplementationLocation(entry, checker));
|
|
224254
224254
|
}
|
|
224255
224255
|
function getImplementationReferenceEntries(program2, cancellationToken, sourceFiles, node, position) {
|
|
224256
224256
|
if (node.kind === 308) {
|
|
@@ -224273,7 +224273,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
224273
224273
|
}
|
|
224274
224274
|
}
|
|
224275
224275
|
function findReferenceOrRenameEntries(program2, cancellationToken, sourceFiles, node, position, options, convertEntry) {
|
|
224276
|
-
return
|
|
224276
|
+
return map33(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program2, sourceFiles, cancellationToken, options)), (entry) => convertEntry(entry, node, program2.getTypeChecker()));
|
|
224277
224277
|
}
|
|
224278
224278
|
function getReferenceEntriesForNode(position, node, program2, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f3) => f3.fileName))) {
|
|
224279
224279
|
return flattenEntries(Core.getReferencedSymbolsForNode(position, node, program2, sourceFiles, cancellationToken, options, sourceFilesSet));
|
|
@@ -226153,7 +226153,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
226153
226153
|
const staticBlocks = filter6(classDecl.members, isClassStaticBlockDeclaration);
|
|
226154
226154
|
const containerName = symbol22 ? typeChecker.symbolToString(symbol22, classDecl) : "";
|
|
226155
226155
|
const sourceFile2 = node.getSourceFile();
|
|
226156
|
-
return
|
|
226156
|
+
return map33(staticBlocks, (staticBlock) => {
|
|
226157
226157
|
let { pos } = moveRangePastModifiers(staticBlock);
|
|
226158
226158
|
pos = skipTrivia(sourceFile2.text, pos);
|
|
226159
226159
|
return createDefinitionInfoFromName(
|
|
@@ -226493,7 +226493,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
226493
226493
|
}
|
|
226494
226494
|
const withoutExpandos = filter6(filteredDeclarations, (d) => !isExpandoDeclaration(d));
|
|
226495
226495
|
const results = some(withoutExpandos) ? withoutExpandos : filteredDeclarations;
|
|
226496
|
-
return
|
|
226496
|
+
return map33(results, (declaration) => createDefinitionInfo(
|
|
226497
226497
|
declaration,
|
|
226498
226498
|
typeChecker,
|
|
226499
226499
|
symbol2,
|
|
@@ -227720,7 +227720,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
227720
227720
|
}
|
|
227721
227721
|
}
|
|
227722
227722
|
function getJSDocTagNameCompletions() {
|
|
227723
|
-
return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries =
|
|
227723
|
+
return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = map33(jsDocTagNames, (tagName) => {
|
|
227724
227724
|
return {
|
|
227725
227725
|
name: tagName,
|
|
227726
227726
|
kind: "keyword",
|
|
@@ -227731,7 +227731,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
227731
227731
|
}
|
|
227732
227732
|
var getJSDocTagNameCompletionDetails = getJSDocTagCompletionDetails;
|
|
227733
227733
|
function getJSDocTagCompletions() {
|
|
227734
|
-
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries =
|
|
227734
|
+
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = map33(jsDocTagNames, (tagName) => {
|
|
227735
227735
|
return {
|
|
227736
227736
|
name: `@${tagName}`,
|
|
227737
227737
|
kind: "keyword",
|
|
@@ -228563,7 +228563,7 @@ ${content}
|
|
|
228563
228563
|
return isString(moduleSpecifierText) && some(sourceFile.moduleAugmentations, (moduleName) => isStringLiteral(moduleName) && moduleName.text === moduleSpecifierText);
|
|
228564
228564
|
}
|
|
228565
228565
|
function getNewImportSpecifiers(namedImports) {
|
|
228566
|
-
return flatMap(namedImports, (namedImport) =>
|
|
228566
|
+
return flatMap(namedImports, (namedImport) => map33(tryGetNamedBindingElements(namedImport), (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && moduleExportNameTextEscaped(importSpecifier.name) === moduleExportNameTextEscaped(importSpecifier.propertyName) ? factory.updateImportSpecifier(
|
|
228567
228567
|
importSpecifier,
|
|
228568
228568
|
importSpecifier.isTypeOnly,
|
|
228569
228569
|
/*propertyName*/
|
|
@@ -229729,7 +229729,7 @@ ${content}
|
|
|
229729
229729
|
/*meaning*/
|
|
229730
229730
|
void 0
|
|
229731
229731
|
) : emptyArray;
|
|
229732
|
-
const items =
|
|
229732
|
+
const items = map33(candidates, (candidateSignature) => getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, typeChecker, enclosingDeclaration, sourceFile));
|
|
229733
229733
|
let selectedItemIndex = 0;
|
|
229734
229734
|
let itemsSeen = 0;
|
|
229735
229735
|
for (let i2 = 0; i2 < items.length; i2++) {
|
|
@@ -229789,7 +229789,7 @@ ${content}
|
|
|
229789
229789
|
), spacePart()];
|
|
229790
229790
|
function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) {
|
|
229791
229791
|
const infos = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile);
|
|
229792
|
-
return
|
|
229792
|
+
return map33(infos, ({ isVariadic, parameters, prefix, suffix }) => {
|
|
229793
229793
|
const prefixDisplayParts = [...callTargetDisplayParts, ...prefix];
|
|
229794
229794
|
const suffixDisplayParts = [...suffix, ...returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker)];
|
|
229795
229795
|
const documentation = candidateSignature.getDocumentationComment(checker);
|
|
@@ -229827,7 +229827,7 @@ ${content}
|
|
|
229827
229827
|
const parameters = (typeParameters || emptyArray).map((t2) => createSignatureHelpParameterForTypeParameter(t2, checker, enclosingDeclaration, sourceFile, printer));
|
|
229828
229828
|
const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
|
|
229829
229829
|
return checker.getExpandedParameters(candidateSignature).map((paramList) => {
|
|
229830
|
-
const params = factory.createNodeArray([...thisParameter, ...
|
|
229830
|
+
const params = factory.createNodeArray([...thisParameter, ...map33(paramList, (param) => checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags))]);
|
|
229831
229831
|
const parameterParts = mapToDisplayParts((writer) => {
|
|
229832
229832
|
printer.writeList(2576, params, sourceFile, writer);
|
|
229833
229833
|
});
|
|
@@ -238344,7 +238344,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
238344
238344
|
makeImport: () => makeImport,
|
|
238345
238345
|
makeStringLiteral: () => makeStringLiteral,
|
|
238346
238346
|
mangleScopedPackageName: () => mangleScopedPackageName,
|
|
238347
|
-
map: () =>
|
|
238347
|
+
map: () => map33,
|
|
238348
238348
|
mapAllOrFail: () => mapAllOrFail,
|
|
238349
238349
|
mapDefined: () => mapDefined,
|
|
238350
238350
|
mapDefinedIterator: () => mapDefinedIterator,
|
|
@@ -241019,7 +241019,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
241019
241019
|
if (!this.languageServiceEnabled) {
|
|
241020
241020
|
return this.getRootScriptInfos();
|
|
241021
241021
|
}
|
|
241022
|
-
return
|
|
241022
|
+
return map33(this.program.getSourceFiles(), (sourceFile) => {
|
|
241023
241023
|
const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.resolvedPath);
|
|
241024
241024
|
Debug.assert(!!scriptInfo, "getScriptInfo", () => `scriptInfo for a file '${sourceFile.fileName}' Path: '${sourceFile.path}' / '${sourceFile.resolvedPath}' is missing.`);
|
|
241025
241025
|
return scriptInfo;
|
|
@@ -246510,7 +246510,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
246510
246510
|
async enableRequestedPluginsWorker(pendingPlugins) {
|
|
246511
246511
|
Debug.assert(this.currentPluginEnablementPromise === void 0);
|
|
246512
246512
|
let sendProjectsUpdatedInBackgroundEvent = false;
|
|
246513
|
-
await Promise.all(
|
|
246513
|
+
await Promise.all(map33(pendingPlugins, async ([project, promises]) => {
|
|
246514
246514
|
const results = await Promise.all(promises);
|
|
246515
246515
|
if (project.isClosed() || isProjectDeferredClose(project)) {
|
|
246516
246516
|
this.logger.info(`Cancelling plugin enabling for ${project.getProjectName()} as it is ${project.isClosed() ? "closed" : "deferred close"}`);
|
|
@@ -246846,7 +246846,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
246846
246846
|
reportsUnnecessary: diag2.reportsUnnecessary,
|
|
246847
246847
|
reportsDeprecated: diag2.reportsDeprecated,
|
|
246848
246848
|
source: diag2.source,
|
|
246849
|
-
relatedInformation:
|
|
246849
|
+
relatedInformation: map33(diag2.relatedInformation, formatRelatedInformation)
|
|
246850
246850
|
};
|
|
246851
246851
|
}
|
|
246852
246852
|
function formatRelatedInformation(info) {
|
|
@@ -246887,7 +246887,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
246887
246887
|
reportsUnnecessary: diag2.reportsUnnecessary,
|
|
246888
246888
|
reportsDeprecated: diag2.reportsDeprecated,
|
|
246889
246889
|
source,
|
|
246890
|
-
relatedInformation:
|
|
246890
|
+
relatedInformation: map33(diag2.relatedInformation, formatRelatedInformation)
|
|
246891
246891
|
};
|
|
246892
246892
|
return includeFileName ? { ...common, fileName: diag2.file && diag2.file.fileName } : common;
|
|
246893
246893
|
}
|
|
@@ -247400,7 +247400,7 @@ ${json2}${newLine}`;
|
|
|
247400
247400
|
if (!result.some((p) => p.projectErrors && p.projectErrors.length !== 0)) {
|
|
247401
247401
|
return this.requiredResponse(result);
|
|
247402
247402
|
}
|
|
247403
|
-
const converted =
|
|
247403
|
+
const converted = map33(result, (p) => {
|
|
247404
247404
|
if (!p.projectErrors || p.projectErrors.length === 0) {
|
|
247405
247405
|
return p;
|
|
247406
247406
|
}
|
|
@@ -248472,7 +248472,7 @@ ${json2}${newLine}`;
|
|
|
248472
248472
|
this.event({
|
|
248473
248473
|
triggerFile: event.data.triggerFile,
|
|
248474
248474
|
configFile: event.data.configFileName,
|
|
248475
|
-
diagnostics:
|
|
248475
|
+
diagnostics: map33(event.data.diagnostics, (diagnostic) => formatDiagnosticToProtocol(
|
|
248476
248476
|
diagnostic,
|
|
248477
248477
|
/*includeFileName*/
|
|
248478
248478
|
true
|
|
@@ -248813,7 +248813,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
248813
248813
|
concatenate(projectErrors, optionsErrors),
|
|
248814
248814
|
(diagnostic) => !!diagnostic.file && diagnostic.file.fileName === configFile
|
|
248815
248815
|
);
|
|
248816
|
-
return includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnosticsForConfigFile) :
|
|
248816
|
+
return includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnosticsForConfigFile) : map33(
|
|
248817
248817
|
diagnosticsForConfigFile,
|
|
248818
248818
|
(diagnostic) => formatDiagnosticToProtocol(
|
|
248819
248819
|
diagnostic,
|
|
@@ -248838,7 +248838,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
248838
248838
|
// TODO: GH#18217
|
|
248839
248839
|
reportsUnnecessary: d.reportsUnnecessary,
|
|
248840
248840
|
reportsDeprecated: d.reportsDeprecated,
|
|
248841
|
-
relatedInformation:
|
|
248841
|
+
relatedInformation: map33(d.relatedInformation, formatRelatedInformation)
|
|
248842
248842
|
}));
|
|
248843
248843
|
}
|
|
248844
248844
|
getCompilerOptionsDiagnostics(args) {
|
|
@@ -248866,7 +248866,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
248866
248866
|
endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length),
|
|
248867
248867
|
reportsUnnecessary: d.reportsUnnecessary,
|
|
248868
248868
|
reportsDeprecated: d.reportsDeprecated,
|
|
248869
|
-
relatedInformation:
|
|
248869
|
+
relatedInformation: map33(d.relatedInformation, formatRelatedInformation)
|
|
248870
248870
|
})
|
|
248871
248871
|
);
|
|
248872
248872
|
}
|
|
@@ -249773,7 +249773,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
249773
249773
|
false
|
|
249774
249774
|
) })) : result.map((details) => ({
|
|
249775
249775
|
...details,
|
|
249776
|
-
codeActions:
|
|
249776
|
+
codeActions: map33(details.codeActions, (action) => this.mapCodeAction(action)),
|
|
249777
249777
|
documentation: this.mapDisplayParts(details.documentation, project),
|
|
249778
249778
|
tags: this.mapJSDocTagInfo(details.tags, project, useDisplayParts)
|
|
249779
249779
|
}));
|
|
@@ -249913,7 +249913,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
249913
249913
|
this.projectService.closeClientFile(file2);
|
|
249914
249914
|
}
|
|
249915
249915
|
mapLocationNavigationBarItems(items, scriptInfo) {
|
|
249916
|
-
return
|
|
249916
|
+
return map33(items, (item) => ({
|
|
249917
249917
|
text: item.text,
|
|
249918
249918
|
kind: item.kind,
|
|
249919
249919
|
kindModifiers: item.kindModifiers,
|
|
@@ -249934,7 +249934,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
249934
249934
|
kindModifiers: tree.kindModifiers,
|
|
249935
249935
|
spans: tree.spans.map((span) => toProtocolTextSpan(span, scriptInfo)),
|
|
249936
249936
|
nameSpan: tree.nameSpan && toProtocolTextSpan(tree.nameSpan, scriptInfo),
|
|
249937
|
-
childItems:
|
|
249937
|
+
childItems: map33(tree.childItems, (item) => this.toLocationNavigationTree(item, scriptInfo))
|
|
249938
249938
|
};
|
|
249939
249939
|
}
|
|
249940
249940
|
getNavigationTree(args, simplifiedResult) {
|
|
@@ -250326,7 +250326,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
250326
250326
|
const { locations } = args;
|
|
250327
250327
|
const { file: file2, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args);
|
|
250328
250328
|
const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file2));
|
|
250329
|
-
return
|
|
250329
|
+
return map33(locations, (location) => {
|
|
250330
250330
|
const pos = this.getPosition(location, scriptInfo);
|
|
250331
250331
|
const selectionRange = languageService.getSmartSelectionRange(file2, pos);
|
|
250332
250332
|
return simplifiedResult ? this.mapSelectionRange(selectionRange, scriptInfo) : selectionRange;
|
|
@@ -253705,7 +253705,7 @@ function build(state, object3) {
|
|
|
253705
253705
|
}
|
|
253706
253706
|
return node2;
|
|
253707
253707
|
}
|
|
253708
|
-
const
|
|
253708
|
+
const map33 = tag.represent(object3);
|
|
253709
253709
|
const style = new Style();
|
|
253710
253710
|
style.tagged = !implicitTag;
|
|
253711
253711
|
const node = {
|
|
@@ -253715,7 +253715,7 @@ function build(state, object3) {
|
|
|
253715
253715
|
items: []
|
|
253716
253716
|
};
|
|
253717
253717
|
if (!state.noRefs) state.refs.set(object3, node);
|
|
253718
|
-
for (const [objectKey, objectValue] of
|
|
253718
|
+
for (const [objectKey, objectValue] of map33) {
|
|
253719
253719
|
const key = build(state, objectKey);
|
|
253720
253720
|
if (key === INVALID) continue;
|
|
253721
253721
|
const value = build(state, objectValue);
|
|
@@ -254536,9 +254536,9 @@ var init_js_yaml = __esm({
|
|
|
254536
254536
|
create: () => ({}),
|
|
254537
254537
|
identify: isPlainObject,
|
|
254538
254538
|
represent: (o) => {
|
|
254539
|
-
const
|
|
254540
|
-
for (const key of Object.keys(o))
|
|
254541
|
-
return
|
|
254539
|
+
const map33 = /* @__PURE__ */ new Map();
|
|
254540
|
+
for (const key of Object.keys(o)) map33.set(key, o[key]);
|
|
254541
|
+
return map33;
|
|
254542
254542
|
},
|
|
254543
254543
|
addPair: (container, key, value) => {
|
|
254544
254544
|
if (key !== null && typeof key === "object") return "object-based map does not support complex keys";
|
|
@@ -254563,9 +254563,9 @@ var init_js_yaml = __esm({
|
|
|
254563
254563
|
create: () => /* @__PURE__ */ new Set(),
|
|
254564
254564
|
identify: (data) => data instanceof Set,
|
|
254565
254565
|
represent: (data) => {
|
|
254566
|
-
const
|
|
254567
|
-
for (const key of data)
|
|
254568
|
-
return
|
|
254566
|
+
const map33 = /* @__PURE__ */ new Map();
|
|
254567
|
+
for (const key of data) map33.set(key, null);
|
|
254568
|
+
return map33;
|
|
254569
254569
|
},
|
|
254570
254570
|
addPair: (container, key, value) => {
|
|
254571
254571
|
if (value !== null) return "cannot resolve a set item";
|
|
@@ -254678,19 +254678,19 @@ var init_js_yaml = __esm({
|
|
|
254678
254678
|
identify: (data) => data instanceof Map || isPlainObject(data),
|
|
254679
254679
|
represent: (data) => {
|
|
254680
254680
|
if (data instanceof Map) return data;
|
|
254681
|
-
const
|
|
254681
|
+
const map33 = /* @__PURE__ */ new Map();
|
|
254682
254682
|
const obj = data;
|
|
254683
|
-
for (const key of Object.keys(obj))
|
|
254684
|
-
return
|
|
254683
|
+
for (const key of Object.keys(obj)) map33.set(key, obj[key]);
|
|
254684
|
+
return map33;
|
|
254685
254685
|
}
|
|
254686
254686
|
});
|
|
254687
254687
|
legacyMapTag = defineMappingTag("tag:yaml.org,2002:map", {
|
|
254688
254688
|
create: () => ({}),
|
|
254689
254689
|
identify: isPlainObject,
|
|
254690
254690
|
represent: (o) => {
|
|
254691
|
-
const
|
|
254692
|
-
for (const key of Object.keys(o))
|
|
254693
|
-
return
|
|
254691
|
+
const map33 = /* @__PURE__ */ new Map();
|
|
254692
|
+
for (const key of Object.keys(o)) map33.set(key, o[key]);
|
|
254693
|
+
return map33;
|
|
254694
254694
|
},
|
|
254695
254695
|
addPair: (container, key, value) => {
|
|
254696
254696
|
const normalizedKey = normalizeKey(key);
|
|
@@ -269110,10 +269110,10 @@ var require_async3 = __commonJS({
|
|
|
269110
269110
|
return eachOfImplementation(coll, wrapAsync(iteratee), callback);
|
|
269111
269111
|
}
|
|
269112
269112
|
var eachOf$1 = awaitify(eachOf, 3);
|
|
269113
|
-
function
|
|
269113
|
+
function map33(coll, iteratee, callback) {
|
|
269114
269114
|
return _asyncMap(eachOf$1, coll, iteratee, callback);
|
|
269115
269115
|
}
|
|
269116
|
-
var map$1 = awaitify(
|
|
269116
|
+
var map$1 = awaitify(map33, 3);
|
|
269117
269117
|
var applyEach$1 = applyEach(map$1);
|
|
269118
269118
|
function eachOfSeries(coll, iteratee, callback) {
|
|
269119
269119
|
return eachOfLimit$2(coll, 1, iteratee, callback);
|
|
@@ -269691,10 +269691,10 @@ var require_async3 = __commonJS({
|
|
|
269691
269691
|
});
|
|
269692
269692
|
}
|
|
269693
269693
|
var concatLimit$1 = awaitify(concatLimit, 4);
|
|
269694
|
-
function
|
|
269694
|
+
function concat4(coll, iteratee, callback) {
|
|
269695
269695
|
return concatLimit$1(coll, Infinity, iteratee, callback);
|
|
269696
269696
|
}
|
|
269697
|
-
var concat$1 = awaitify(
|
|
269697
|
+
var concat$1 = awaitify(concat4, 3);
|
|
269698
269698
|
function concatSeries(coll, iteratee, callback) {
|
|
269699
269699
|
return concatLimit$1(coll, 1, iteratee, callback);
|
|
269700
269700
|
}
|
|
@@ -271582,7 +271582,7 @@ var require_BufferList2 = __commonJS({
|
|
|
271582
271582
|
}
|
|
271583
271583
|
return ret;
|
|
271584
271584
|
};
|
|
271585
|
-
BufferList.prototype.concat = function
|
|
271585
|
+
BufferList.prototype.concat = function concat4(n) {
|
|
271586
271586
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
271587
271587
|
if (this.length === 1) return this.head.data;
|
|
271588
271588
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
@@ -273923,8 +273923,8 @@ var require_lodash3 = __commonJS({
|
|
|
273923
273923
|
return apply(func, this, otherArgs);
|
|
273924
273924
|
};
|
|
273925
273925
|
}
|
|
273926
|
-
function getMapData(
|
|
273927
|
-
var data =
|
|
273926
|
+
function getMapData(map33, key) {
|
|
273927
|
+
var data = map33.__data__;
|
|
273928
273928
|
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
273929
273929
|
}
|
|
273930
273930
|
function getNative(object3, key) {
|
|
@@ -274328,8 +274328,8 @@ var require_lodash4 = __commonJS({
|
|
|
274328
274328
|
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop3 : function(values) {
|
|
274329
274329
|
return new Set2(values);
|
|
274330
274330
|
};
|
|
274331
|
-
function getMapData(
|
|
274332
|
-
var data =
|
|
274331
|
+
function getMapData(map33, key) {
|
|
274332
|
+
var data = map33.__data__;
|
|
274333
274333
|
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
274334
274334
|
}
|
|
274335
274335
|
function getNative(object3, key) {
|
|
@@ -276384,7 +276384,7 @@ var require_buffer_list3 = __commonJS({
|
|
|
276384
276384
|
}
|
|
276385
276385
|
}, {
|
|
276386
276386
|
key: "concat",
|
|
276387
|
-
value: function
|
|
276387
|
+
value: function concat4(n) {
|
|
276388
276388
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
276389
276389
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
276390
276390
|
var p = this.head;
|
|
@@ -279726,7 +279726,7 @@ var require_buffer_list4 = __commonJS({
|
|
|
279726
279726
|
}
|
|
279727
279727
|
}, {
|
|
279728
279728
|
key: "concat",
|
|
279729
|
-
value: function
|
|
279729
|
+
value: function concat4(n) {
|
|
279730
279730
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
279731
279731
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
279732
279732
|
var p = this.head;
|
|
@@ -282498,7 +282498,7 @@ var require_buffer_list5 = __commonJS({
|
|
|
282498
282498
|
}
|
|
282499
282499
|
}, {
|
|
282500
282500
|
key: "concat",
|
|
282501
|
-
value: function
|
|
282501
|
+
value: function concat4(n) {
|
|
282502
282502
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
282503
282503
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
282504
282504
|
var p = this.head;
|
|
@@ -285735,7 +285735,7 @@ var require_buffer_list6 = __commonJS({
|
|
|
285735
285735
|
}
|
|
285736
285736
|
}, {
|
|
285737
285737
|
key: "concat",
|
|
285738
|
-
value: function
|
|
285738
|
+
value: function concat4(n) {
|
|
285739
285739
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
285740
285740
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
285741
285741
|
var p = this.head;
|
|
@@ -288741,6 +288741,69 @@ var init_spread = __esm({
|
|
|
288741
288741
|
}
|
|
288742
288742
|
});
|
|
288743
288743
|
|
|
288744
|
+
// src/commands/lambda/helpers/time-trigger-sync.ts
|
|
288745
|
+
function timeTriggerPlan(lambdaName, desired, existing) {
|
|
288746
|
+
if (!desired?.triggerName || !desired?.cron) {
|
|
288747
|
+
return "none";
|
|
288748
|
+
}
|
|
288749
|
+
if (!existing) {
|
|
288750
|
+
return "create";
|
|
288751
|
+
}
|
|
288752
|
+
const sameName = existing.triggerName === storedTriggerName(lambdaName, desired.triggerName) || existing.triggerName === desired.triggerName;
|
|
288753
|
+
return sameName && existing.cron?.trim() === desired.cron.trim() ? "same" : "replace";
|
|
288754
|
+
}
|
|
288755
|
+
var import_rxjs35, import_operators18, storedTriggerName, syncTimeTrigger;
|
|
288756
|
+
var init_time_trigger_sync = __esm({
|
|
288757
|
+
"src/commands/lambda/helpers/time-trigger-sync.ts"() {
|
|
288758
|
+
import_rxjs35 = __toESM(require_cjs());
|
|
288759
|
+
import_operators18 = __toESM(require_operators());
|
|
288760
|
+
init_gql_client();
|
|
288761
|
+
init_log();
|
|
288762
|
+
storedTriggerName = (lambdaName, triggerName) => `${lambdaName}-${triggerName}`;
|
|
288763
|
+
syncTimeTrigger = (projectId, lambda, desired) => {
|
|
288764
|
+
if (!desired?.triggerName || !desired?.cron || !lambda?.id || !lambda.name) {
|
|
288765
|
+
return (0, import_rxjs35.of)("none");
|
|
288766
|
+
}
|
|
288767
|
+
const lambdaId = lambda.id;
|
|
288768
|
+
const lambdaName = lambda.name;
|
|
288769
|
+
const create = () => GraphqlClienAPI.createTimeTrigger({
|
|
288770
|
+
lambdaId,
|
|
288771
|
+
triggerName: desired.triggerName,
|
|
288772
|
+
cron: desired.cron
|
|
288773
|
+
});
|
|
288774
|
+
return GraphqlClienAPI.listProjectTimeTriggers(projectId).pipe(
|
|
288775
|
+
(0, import_operators18.map)((all) => (all ?? []).find((t2) => t2.lambdaId === lambdaId)),
|
|
288776
|
+
(0, import_operators18.switchMap)((existing) => {
|
|
288777
|
+
const plan = timeTriggerPlan(lambdaName, desired, existing);
|
|
288778
|
+
const run2 = plan === "create" ? create() : plan === "replace" ? (0, import_rxjs35.concat)(
|
|
288779
|
+
GraphqlClienAPI.deleteLambdaTimeTrigger(lambdaId),
|
|
288780
|
+
create()
|
|
288781
|
+
) : (0, import_rxjs35.of)(null);
|
|
288782
|
+
return run2.pipe(
|
|
288783
|
+
(0, import_operators18.map)(() => plan),
|
|
288784
|
+
(0, import_operators18.tap)((done) => {
|
|
288785
|
+
const label = `${storedTriggerName(lambdaName, desired.triggerName)} (${desired.cron})`;
|
|
288786
|
+
const text = {
|
|
288787
|
+
none: "",
|
|
288788
|
+
same: `Time trigger ${label} is up to date`,
|
|
288789
|
+
create: `Time trigger ${label} created`,
|
|
288790
|
+
replace: `Time trigger ${existing?.triggerName} (${existing?.cron}) replaced by ${label}`
|
|
288791
|
+
};
|
|
288792
|
+
if (text[done]) Logger.info(text[done]);
|
|
288793
|
+
})
|
|
288794
|
+
);
|
|
288795
|
+
}),
|
|
288796
|
+
(0, import_operators18.catchError)((e2) => {
|
|
288797
|
+
Logger.error(
|
|
288798
|
+
`triggers.time was not applied: ${e2?.message ?? e2} - run gcli cron:create`
|
|
288799
|
+
);
|
|
288800
|
+
return (0, import_rxjs35.of)("none");
|
|
288801
|
+
})
|
|
288802
|
+
);
|
|
288803
|
+
};
|
|
288804
|
+
}
|
|
288805
|
+
});
|
|
288806
|
+
|
|
288744
288807
|
// src/commands/lambda/helpers/index.ts
|
|
288745
288808
|
function streamToBufferPromise(file2) {
|
|
288746
288809
|
return new Promise((resolve2, reject) => {
|
|
@@ -288752,14 +288815,14 @@ function streamToBufferPromise(file2) {
|
|
|
288752
288815
|
});
|
|
288753
288816
|
});
|
|
288754
288817
|
}
|
|
288755
|
-
var import_form_data, import_fs6,
|
|
288818
|
+
var import_form_data, import_fs6, import_rxjs36, import_operators19, import_stream_to_buffer, ReadFile2, createOrUpdateLambda, printAddresses, createCommand;
|
|
288756
288819
|
var init_helpers2 = __esm({
|
|
288757
288820
|
"src/commands/lambda/helpers/index.ts"() {
|
|
288758
288821
|
import_form_data = __toESM(require_form_data());
|
|
288759
288822
|
import_fs6 = require("fs");
|
|
288760
288823
|
init_src();
|
|
288761
|
-
|
|
288762
|
-
|
|
288824
|
+
import_rxjs36 = __toESM(require_cjs());
|
|
288825
|
+
import_operators19 = __toESM(require_operators());
|
|
288763
288826
|
import_stream_to_buffer = __toESM(require_stream_to_buffer());
|
|
288764
288827
|
init_helpers();
|
|
288765
288828
|
init_gql_client();
|
|
@@ -288768,122 +288831,138 @@ var init_helpers2 = __esm({
|
|
|
288768
288831
|
init_load_spec();
|
|
288769
288832
|
init_read_file();
|
|
288770
288833
|
init_spread();
|
|
288771
|
-
|
|
288772
|
-
|
|
288773
|
-
|
|
288774
|
-
|
|
288775
|
-
|
|
288776
|
-
|
|
288777
|
-
(
|
|
288778
|
-
|
|
288779
|
-
|
|
288780
|
-
|
|
288781
|
-
|
|
288782
|
-
|
|
288783
|
-
|
|
288784
|
-
|
|
288785
|
-
|
|
288786
|
-
|
|
288787
|
-
|
|
288788
|
-
|
|
288789
|
-
|
|
288790
|
-
|
|
288791
|
-
|
|
288792
|
-
|
|
288793
|
-
|
|
288794
|
-
|
|
288795
|
-
|
|
288796
|
-
|
|
288797
|
-
|
|
288798
|
-
|
|
288799
|
-
|
|
288800
|
-
|
|
288801
|
-
|
|
288802
|
-
|
|
288803
|
-
|
|
288834
|
+
init_time_trigger_sync();
|
|
288835
|
+
ReadFile2 = (file2) => readFileAsObservable(file2).pipe((0, import_operators19.catchError)(() => (0, import_rxjs36.of)("")));
|
|
288836
|
+
createOrUpdateLambda = (cmd, type) => {
|
|
288837
|
+
let timeTrigger;
|
|
288838
|
+
let projectIdUsed = "";
|
|
288839
|
+
return (0, import_rxjs36.lastValueFrom)(
|
|
288840
|
+
parseProjectId(cmd.project).pipe(
|
|
288841
|
+
(0, import_operators19.switchMap)(
|
|
288842
|
+
(projectId) => GraphqlClienAPI.getProject(projectId).pipe(
|
|
288843
|
+
(0, import_operators19.map)(() => projectIdUsed = projectId)
|
|
288844
|
+
)
|
|
288845
|
+
),
|
|
288846
|
+
(0, import_operators19.switchMap)(async (projectId) => {
|
|
288847
|
+
const spec = await (0, import_rxjs36.lastValueFrom)(loadSpec(cmd.spec));
|
|
288848
|
+
timeTrigger = spec?.triggers?.time;
|
|
288849
|
+
return {
|
|
288850
|
+
projectId,
|
|
288851
|
+
...spec?.function ?? spec
|
|
288852
|
+
};
|
|
288853
|
+
}),
|
|
288854
|
+
/* Make zip archive */
|
|
288855
|
+
/* Get file id */
|
|
288856
|
+
(0, import_operators19.switchMap)(async (data) => {
|
|
288857
|
+
if (!data.uploadAsZip) {
|
|
288858
|
+
return { ...data, customUploadFileId: "" };
|
|
288859
|
+
}
|
|
288860
|
+
await package_default(cmd);
|
|
288861
|
+
const body = new import_form_data.default();
|
|
288862
|
+
body.append("file[]", (0, import_fs6.createReadStream)(`.gcache/${data.name}.zip`));
|
|
288863
|
+
const config2 = await (0, import_rxjs36.lastValueFrom)(GraphqlClienAPI.getConfig());
|
|
288864
|
+
return (0, import_rxjs36.lastValueFrom)(
|
|
288865
|
+
(0, import_rxjs36.from)(
|
|
288866
|
+
fetch2(config2.uploadUrl, {
|
|
288867
|
+
method: "POST",
|
|
288868
|
+
body,
|
|
288869
|
+
headers: {
|
|
288870
|
+
...body.getHeaders(),
|
|
288871
|
+
Authorization: config2.token,
|
|
288872
|
+
projectid: data.projectId,
|
|
288873
|
+
lambdaname: data.name
|
|
288874
|
+
}
|
|
288875
|
+
})
|
|
288876
|
+
).pipe(
|
|
288877
|
+
(0, import_operators19.switchMap)((res) => res.json()),
|
|
288878
|
+
(0, import_operators19.map)((file2) => ({
|
|
288879
|
+
...data,
|
|
288880
|
+
customUploadFileId: file2.id
|
|
288881
|
+
}))
|
|
288882
|
+
)
|
|
288883
|
+
);
|
|
288884
|
+
}),
|
|
288885
|
+
(0, import_operators19.switchMap)(async (payload) => {
|
|
288886
|
+
const clusterId = await (0, import_rxjs36.lastValueFrom)(
|
|
288887
|
+
resolveClusterId(payload.projectId, {
|
|
288888
|
+
clusterId: cmd.clusterId || payload.clusterId,
|
|
288889
|
+
clusterName: cmd.clusterName || payload.clusterName
|
|
288890
|
+
})
|
|
288891
|
+
);
|
|
288892
|
+
return (0, import_rxjs36.lastValueFrom)(
|
|
288893
|
+
GraphqlClienAPI[type]({
|
|
288894
|
+
code: cmd.code || await (0, import_rxjs36.lastValueFrom)(ReadFile2(cmd.file || payload.file)) || "",
|
|
288895
|
+
name: cmd.name || payload.name || "",
|
|
288896
|
+
projectId: payload.projectId,
|
|
288897
|
+
route: cmd.route || payload.route || "",
|
|
288898
|
+
buildBashScript: cmd.buildBashScript || await (0, import_rxjs36.lastValueFrom)(ReadFile2(cmd.script || payload.script)) || "",
|
|
288899
|
+
configs: cmd.configs || payload.configs || [],
|
|
288900
|
+
env: cmd.env || payload.env || "nodejs",
|
|
288901
|
+
method: cmd.method || payload.method || ["GET"],
|
|
288902
|
+
packageJson: cmd.packageJson || await (0, import_rxjs36.lastValueFrom)(ReadFile2(cmd.package || payload.package)) || "{}",
|
|
288903
|
+
params: cmd.params || payload.params || [],
|
|
288904
|
+
secrets: cmd.secrets || payload.secrets || [],
|
|
288905
|
+
envSecrets: cmd.envSecrets || payload.envSecrets || [],
|
|
288906
|
+
/* Only sent when set, so gcli still works against an API
|
|
288907
|
+
without the field. */
|
|
288908
|
+
...cmd.bodyLimit ?? payload.bodyLimit ? { bodyLimit: String(cmd.bodyLimit ?? payload.bodyLimit) } : {},
|
|
288909
|
+
clusterId,
|
|
288910
|
+
network: cmd.network || payload.network || ["public", "private"],
|
|
288911
|
+
federation: cmd.federation ?? !!payload.federation,
|
|
288912
|
+
subgraphs: cmd.subgraphs || payload.subgraphs || [],
|
|
288913
|
+
/* MCP server — operations/headers come from the spec (yaml/json); mcp/mcpGraph also accept flags */
|
|
288914
|
+
mcp: cmd.mcp ?? !!payload.mcp,
|
|
288915
|
+
mcpGraph: cmd.mcpGraph || payload.mcpGraph || "",
|
|
288916
|
+
mcpOperations: payload.mcpOperations || [],
|
|
288917
|
+
mcpHeaders: payload.mcpHeaders || [],
|
|
288918
|
+
mcpForwardHeaders: payload.mcpForwardHeaders || [],
|
|
288919
|
+
cache: cmd.cache || payload.cache || false,
|
|
288920
|
+
customUploadFileId: cmd.customUploadFileId || payload.customUploadFileId || "",
|
|
288921
|
+
scaleOptions: {
|
|
288922
|
+
executorType: cmd.executorType || payload.scaleOptions?.executorType || "poolmgr",
|
|
288923
|
+
maxCpu: cmd.maxCpu || payload.scaleOptions?.maxCpu || 0,
|
|
288924
|
+
maxMemory: cmd.maxMemory || payload.scaleOptions?.maxMemory || 0,
|
|
288925
|
+
maxScale: cmd.maxScale || payload.scaleOptions?.maxScale || 0,
|
|
288926
|
+
minCpu: cmd.minCpu || payload.scaleOptions?.minCpu || 0,
|
|
288927
|
+
minMemory: cmd.minMemory || payload.scaleOptions?.minMemory || 0,
|
|
288928
|
+
minScale: cmd.minScale || payload.scaleOptions?.minScale || 0,
|
|
288929
|
+
targetCpu: cmd.targetCpu || payload.scaleOptions?.targetCpu || 0,
|
|
288930
|
+
idleTimeout: cmd.idleTimeout || payload.scaleOptions?.idleTimeout || 120,
|
|
288931
|
+
// 0 = not set: the server fills these in within the project's
|
|
288932
|
+
// plan (concurrency <= 3, timeouts 60/120 s capped). A fixed
|
|
288933
|
+
// 500 / 60 / 120 here was refused on plans with lower maxima.
|
|
288934
|
+
concurrency: cmd.concurrency || payload.scaleOptions?.concurrency || 0,
|
|
288935
|
+
functionTimeout: cmd.functionTimeout || payload.scaleOptions?.functionTimeout || 0,
|
|
288936
|
+
specializationTimeout: cmd.specializationTimeout || payload.scaleOptions?.specializationTimeout || 0,
|
|
288937
|
+
...spreadScaleOptions(cmd, payload.scaleOptions)
|
|
288804
288938
|
}
|
|
288805
288939
|
})
|
|
288806
|
-
)
|
|
288807
|
-
|
|
288808
|
-
|
|
288809
|
-
|
|
288810
|
-
|
|
288811
|
-
|
|
288812
|
-
|
|
288813
|
-
)
|
|
288814
|
-
|
|
288815
|
-
|
|
288816
|
-
|
|
288817
|
-
|
|
288818
|
-
|
|
288819
|
-
|
|
288820
|
-
|
|
288821
|
-
|
|
288822
|
-
|
|
288823
|
-
GraphqlClienAPI[type]({
|
|
288824
|
-
code: cmd.code || await (0, import_rxjs35.lastValueFrom)(ReadFile2(cmd.file || payload.file)) || "",
|
|
288825
|
-
name: cmd.name || payload.name || "",
|
|
288826
|
-
projectId: payload.projectId,
|
|
288827
|
-
route: cmd.route || payload.route || "",
|
|
288828
|
-
buildBashScript: cmd.buildBashScript || await (0, import_rxjs35.lastValueFrom)(ReadFile2(cmd.script || payload.script)) || "",
|
|
288829
|
-
configs: cmd.configs || payload.configs || [],
|
|
288830
|
-
env: cmd.env || payload.env || "nodejs",
|
|
288831
|
-
method: cmd.method || payload.method || ["GET"],
|
|
288832
|
-
packageJson: cmd.packageJson || await (0, import_rxjs35.lastValueFrom)(ReadFile2(cmd.package || payload.package)) || "{}",
|
|
288833
|
-
params: cmd.params || payload.params || [],
|
|
288834
|
-
secrets: cmd.secrets || payload.secrets || [],
|
|
288835
|
-
envSecrets: cmd.envSecrets || payload.envSecrets || [],
|
|
288836
|
-
/* Only sent when set, so gcli still works against an API
|
|
288837
|
-
without the field. */
|
|
288838
|
-
...cmd.bodyLimit ?? payload.bodyLimit ? { bodyLimit: String(cmd.bodyLimit ?? payload.bodyLimit) } : {},
|
|
288839
|
-
clusterId,
|
|
288840
|
-
network: cmd.network || payload.network || ["public", "private"],
|
|
288841
|
-
federation: cmd.federation ?? !!payload.federation,
|
|
288842
|
-
subgraphs: cmd.subgraphs || payload.subgraphs || [],
|
|
288843
|
-
/* MCP server — operations/headers come from the spec (yaml/json); mcp/mcpGraph also accept flags */
|
|
288844
|
-
mcp: cmd.mcp ?? !!payload.mcp,
|
|
288845
|
-
mcpGraph: cmd.mcpGraph || payload.mcpGraph || "",
|
|
288846
|
-
mcpOperations: payload.mcpOperations || [],
|
|
288847
|
-
mcpHeaders: payload.mcpHeaders || [],
|
|
288848
|
-
mcpForwardHeaders: payload.mcpForwardHeaders || [],
|
|
288849
|
-
cache: cmd.cache || payload.cache || false,
|
|
288850
|
-
customUploadFileId: cmd.customUploadFileId || payload.customUploadFileId || "",
|
|
288851
|
-
scaleOptions: {
|
|
288852
|
-
executorType: cmd.executorType || payload.scaleOptions?.executorType || "poolmgr",
|
|
288853
|
-
maxCpu: cmd.maxCpu || payload.scaleOptions?.maxCpu || 0,
|
|
288854
|
-
maxMemory: cmd.maxMemory || payload.scaleOptions?.maxMemory || 0,
|
|
288855
|
-
maxScale: cmd.maxScale || payload.scaleOptions?.maxScale || 0,
|
|
288856
|
-
minCpu: cmd.minCpu || payload.scaleOptions?.minCpu || 0,
|
|
288857
|
-
minMemory: cmd.minMemory || payload.scaleOptions?.minMemory || 0,
|
|
288858
|
-
minScale: cmd.minScale || payload.scaleOptions?.minScale || 0,
|
|
288859
|
-
targetCpu: cmd.targetCpu || payload.scaleOptions?.targetCpu || 0,
|
|
288860
|
-
idleTimeout: cmd.idleTimeout || payload.scaleOptions?.idleTimeout || 120,
|
|
288861
|
-
// 0 = not set: the server fills these in within the project's
|
|
288862
|
-
// plan (concurrency <= 3, timeouts 60/120 s capped). A fixed
|
|
288863
|
-
// 500 / 60 / 120 here was refused on plans with lower maxima.
|
|
288864
|
-
concurrency: cmd.concurrency || payload.scaleOptions?.concurrency || 0,
|
|
288865
|
-
functionTimeout: cmd.functionTimeout || payload.scaleOptions?.functionTimeout || 0,
|
|
288866
|
-
specializationTimeout: cmd.specializationTimeout || payload.scaleOptions?.specializationTimeout || 0,
|
|
288867
|
-
...spreadScaleOptions(cmd, payload.scaleOptions)
|
|
288868
|
-
}
|
|
288869
|
-
})
|
|
288870
|
-
);
|
|
288871
|
-
}),
|
|
288872
|
-
(0, import_operators18.tap)((data) => {
|
|
288873
|
-
Logger.info(JSON.stringify(data, null, 2));
|
|
288874
|
-
}),
|
|
288875
|
-
(0, import_operators18.switchMap)((data) => printAddresses(data))
|
|
288876
|
-
)
|
|
288877
|
-
);
|
|
288940
|
+
);
|
|
288941
|
+
}),
|
|
288942
|
+
(0, import_operators19.tap)((data) => {
|
|
288943
|
+
Logger.info(JSON.stringify(data, null, 2));
|
|
288944
|
+
}),
|
|
288945
|
+
(0, import_operators19.switchMap)((data) => printAddresses(data)),
|
|
288946
|
+
// apply `triggers.time` of lambforge.yaml (it used to be ignored)
|
|
288947
|
+
(0, import_operators19.switchMap)(
|
|
288948
|
+
(data) => syncTimeTrigger(
|
|
288949
|
+
projectIdUsed,
|
|
288950
|
+
data,
|
|
288951
|
+
timeTrigger
|
|
288952
|
+
).pipe((0, import_operators19.map)(() => data))
|
|
288953
|
+
)
|
|
288954
|
+
)
|
|
288955
|
+
);
|
|
288956
|
+
};
|
|
288878
288957
|
printAddresses = (data) => (data?.id ? GraphqlClienAPI.getLambda(data.id, ["siteUrl"]).pipe(
|
|
288879
|
-
(0,
|
|
288880
|
-
(0,
|
|
288881
|
-
) : (0,
|
|
288882
|
-
(0,
|
|
288958
|
+
(0, import_operators19.map)((l) => l.siteUrl ?? null),
|
|
288959
|
+
(0, import_operators19.catchError)(() => (0, import_rxjs36.of)(null))
|
|
288960
|
+
) : (0, import_rxjs36.of)(null)).pipe(
|
|
288961
|
+
(0, import_operators19.tap)((siteUrl) => {
|
|
288883
288962
|
if (data?.url) Logger.info(`URL: ${data.url}`);
|
|
288884
288963
|
if (siteUrl) Logger.info(`Site: ${siteUrl}`);
|
|
288885
288964
|
}),
|
|
288886
|
-
(0,
|
|
288965
|
+
(0, import_operators19.map)(() => data)
|
|
288887
288966
|
);
|
|
288888
288967
|
createCommand = (command) => (options) => (program2) => {
|
|
288889
288968
|
const cmd = program2.command(command);
|
|
@@ -288900,27 +288979,27 @@ var list_exports2 = {};
|
|
|
288900
288979
|
__export(list_exports2, {
|
|
288901
288980
|
default: () => list_default2
|
|
288902
288981
|
});
|
|
288903
|
-
var
|
|
288982
|
+
var import_rxjs37, import_operators20, list_default2;
|
|
288904
288983
|
var init_list2 = __esm({
|
|
288905
288984
|
"src/commands/lambda/list.ts"() {
|
|
288906
|
-
|
|
288907
|
-
|
|
288985
|
+
import_rxjs37 = __toESM(require_cjs());
|
|
288986
|
+
import_operators20 = __toESM(require_operators());
|
|
288908
288987
|
init_helpers();
|
|
288909
288988
|
init_gql_client();
|
|
288910
288989
|
init_log();
|
|
288911
|
-
list_default2 = (cmd) => (0,
|
|
288990
|
+
list_default2 = (cmd) => (0, import_rxjs37.lastValueFrom)(
|
|
288912
288991
|
parseProjectId(cmd.project).pipe(
|
|
288913
|
-
(0,
|
|
288992
|
+
(0, import_operators20.switchMap)(
|
|
288914
288993
|
(projectId) => resolveClusterId(projectId, {
|
|
288915
288994
|
clusterId: cmd.clusterId,
|
|
288916
288995
|
clusterName: cmd.clusterName
|
|
288917
288996
|
}).pipe(
|
|
288918
|
-
(0,
|
|
288997
|
+
(0, import_operators20.switchMap)(
|
|
288919
288998
|
(clusterId) => GraphqlClienAPI.listLambdas(projectId, clusterId)
|
|
288920
288999
|
)
|
|
288921
289000
|
)
|
|
288922
289001
|
),
|
|
288923
|
-
(0,
|
|
289002
|
+
(0, import_operators20.tap)((data) => {
|
|
288924
289003
|
const columns = [
|
|
288925
289004
|
"id",
|
|
288926
289005
|
"name",
|
|
@@ -288943,17 +289022,17 @@ var get_exports = {};
|
|
|
288943
289022
|
__export(get_exports, {
|
|
288944
289023
|
default: () => get_default
|
|
288945
289024
|
});
|
|
288946
|
-
var
|
|
289025
|
+
var import_rxjs38, import_operators21, get_default;
|
|
288947
289026
|
var init_get = __esm({
|
|
288948
289027
|
"src/commands/lambda/get.ts"() {
|
|
288949
|
-
|
|
288950
|
-
|
|
289028
|
+
import_rxjs38 = __toESM(require_cjs());
|
|
289029
|
+
import_operators21 = __toESM(require_operators());
|
|
288951
289030
|
init_helpers();
|
|
288952
289031
|
init_gql_client();
|
|
288953
289032
|
init_log();
|
|
288954
289033
|
init_load_spec();
|
|
288955
289034
|
get_default = async (cmd) => {
|
|
288956
|
-
const table = (0,
|
|
289035
|
+
const table = (0, import_operators21.tap)((data) => {
|
|
288957
289036
|
const columns = [
|
|
288958
289037
|
"name",
|
|
288959
289038
|
"projectId",
|
|
@@ -288968,33 +289047,33 @@ var init_get = __esm({
|
|
|
288968
289047
|
Logger.log("-------------------");
|
|
288969
289048
|
});
|
|
288970
289049
|
if (cmd.lambda) {
|
|
288971
|
-
return (0,
|
|
289050
|
+
return (0, import_rxjs38.lastValueFrom)(
|
|
288972
289051
|
isMongoId(cmd.lambda).pipe(
|
|
288973
|
-
(0,
|
|
289052
|
+
(0, import_operators21.switchMap)((id) => GraphqlClienAPI.getLambda(id)),
|
|
288974
289053
|
table
|
|
288975
289054
|
)
|
|
288976
289055
|
);
|
|
288977
289056
|
}
|
|
288978
|
-
const spec = await (0,
|
|
289057
|
+
const spec = await (0, import_rxjs38.lastValueFrom)(loadSpec(cmd.spec));
|
|
288979
289058
|
const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
|
|
288980
289059
|
if (name2) {
|
|
288981
|
-
return (0,
|
|
289060
|
+
return (0, import_rxjs38.lastValueFrom)(
|
|
288982
289061
|
parseProjectId(cmd.project).pipe(
|
|
288983
|
-
(0,
|
|
289062
|
+
(0, import_operators21.catchError)((error48) => {
|
|
288984
289063
|
if (!cmd.project) {
|
|
288985
|
-
return (0,
|
|
289064
|
+
return (0, import_rxjs38.throwError)(
|
|
288986
289065
|
() => `No project id try with "gcli use --project your-project-id" to specify one
|
|
288987
289066
|
Hint: "gcli lambda:get --name ${name2} --project your-project-id"`
|
|
288988
289067
|
);
|
|
288989
289068
|
}
|
|
288990
|
-
return (0,
|
|
289069
|
+
return (0, import_rxjs38.throwError)(() => error48);
|
|
288991
289070
|
}),
|
|
288992
|
-
(0,
|
|
289071
|
+
(0, import_operators21.switchMap)(
|
|
288993
289072
|
(projectId) => resolveClusterId(projectId, {
|
|
288994
289073
|
clusterId: cmd.clusterId,
|
|
288995
289074
|
clusterName: cmd.clusterName
|
|
288996
289075
|
}).pipe(
|
|
288997
|
-
(0,
|
|
289076
|
+
(0, import_operators21.switchMap)(
|
|
288998
289077
|
(clusterId) => GraphqlClienAPI.getLambdaByName(
|
|
288999
289078
|
name2,
|
|
289000
289079
|
projectId,
|
|
@@ -289044,34 +289123,34 @@ var delete_exports = {};
|
|
|
289044
289123
|
__export(delete_exports, {
|
|
289045
289124
|
default: () => delete_default
|
|
289046
289125
|
});
|
|
289047
|
-
var
|
|
289126
|
+
var import_rxjs39, import_operators22, delete_default;
|
|
289048
289127
|
var init_delete = __esm({
|
|
289049
289128
|
"src/commands/lambda/delete.ts"() {
|
|
289050
|
-
|
|
289051
|
-
|
|
289129
|
+
import_rxjs39 = __toESM(require_cjs());
|
|
289130
|
+
import_operators22 = __toESM(require_operators());
|
|
289052
289131
|
init_helpers();
|
|
289053
289132
|
init_gql_client();
|
|
289054
289133
|
init_log();
|
|
289055
289134
|
init_load_spec();
|
|
289056
289135
|
delete_default = async (cmd) => {
|
|
289057
|
-
const spec = await (0,
|
|
289136
|
+
const spec = await (0, import_rxjs39.lastValueFrom)(loadSpec(cmd.spec));
|
|
289058
289137
|
const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
|
|
289059
289138
|
const env = cmd.env ?? spec.function?.env ?? spec.env;
|
|
289060
289139
|
const clusterIdHint = cmd.clusterId ?? spec.function?.clusterId ?? spec.clusterId;
|
|
289061
289140
|
const clusterNameHint = cmd.clusterName ?? spec.function?.clusterName ?? spec.clusterName;
|
|
289062
|
-
return (0,
|
|
289141
|
+
return (0, import_rxjs39.lastValueFrom)(
|
|
289063
289142
|
parseProjectId(cmd.project).pipe(
|
|
289064
|
-
(0,
|
|
289143
|
+
(0, import_operators22.switchMap)(
|
|
289065
289144
|
(projectId) => resolveClusterId(projectId, {
|
|
289066
289145
|
clusterId: clusterIdHint,
|
|
289067
289146
|
clusterName: clusterNameHint
|
|
289068
289147
|
}).pipe(
|
|
289069
|
-
(0,
|
|
289148
|
+
(0, import_operators22.switchMap)(
|
|
289070
289149
|
(clusterId) => GraphqlClienAPI.deleteLambda({ name: name2, projectId, env, clusterId })
|
|
289071
289150
|
)
|
|
289072
289151
|
)
|
|
289073
289152
|
),
|
|
289074
|
-
(0,
|
|
289153
|
+
(0, import_operators22.tap)((data) => {
|
|
289075
289154
|
const columns = [
|
|
289076
289155
|
"name",
|
|
289077
289156
|
"projectId",
|
|
@@ -289094,45 +289173,45 @@ var logs_exports = {};
|
|
|
289094
289173
|
__export(logs_exports, {
|
|
289095
289174
|
default: () => logs_default
|
|
289096
289175
|
});
|
|
289097
|
-
var
|
|
289176
|
+
var import_rxjs40, import_operators23, logs_default;
|
|
289098
289177
|
var init_logs = __esm({
|
|
289099
289178
|
"src/commands/lambda/logs.ts"() {
|
|
289100
|
-
|
|
289101
|
-
|
|
289179
|
+
import_rxjs40 = __toESM(require_cjs());
|
|
289180
|
+
import_operators23 = __toESM(require_operators());
|
|
289102
289181
|
init_helpers();
|
|
289103
289182
|
init_gql_client();
|
|
289104
289183
|
init_log();
|
|
289105
289184
|
init_load_spec();
|
|
289106
289185
|
logs_default = async (cmd) => {
|
|
289107
|
-
const result = (0,
|
|
289186
|
+
const result = (0, import_operators23.tap)(({ data }) => Logger.log(data));
|
|
289108
289187
|
if (cmd.lambda) {
|
|
289109
|
-
return (0,
|
|
289188
|
+
return (0, import_rxjs40.lastValueFrom)(
|
|
289110
289189
|
isMongoId(cmd.lambda).pipe(
|
|
289111
|
-
(0,
|
|
289190
|
+
(0, import_operators23.switchMap)((id) => GraphqlClienAPI.getLambdaLogs(id)),
|
|
289112
289191
|
result
|
|
289113
289192
|
)
|
|
289114
289193
|
);
|
|
289115
289194
|
}
|
|
289116
|
-
const spec = await (0,
|
|
289195
|
+
const spec = await (0, import_rxjs40.lastValueFrom)(loadSpec(cmd.spec));
|
|
289117
289196
|
const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
|
|
289118
289197
|
if (name2) {
|
|
289119
|
-
return (0,
|
|
289198
|
+
return (0, import_rxjs40.lastValueFrom)(
|
|
289120
289199
|
parseProjectId(cmd.project).pipe(
|
|
289121
|
-
(0,
|
|
289200
|
+
(0, import_operators23.catchError)((error48) => {
|
|
289122
289201
|
if (!cmd.project) {
|
|
289123
|
-
return (0,
|
|
289202
|
+
return (0, import_rxjs40.throwError)(
|
|
289124
289203
|
() => `No project id try with "gcli use --project your-project-id" to specify one
|
|
289125
289204
|
Hint: "gcli lambda:logs --name ${name2} --project your-project-id"`
|
|
289126
289205
|
);
|
|
289127
289206
|
}
|
|
289128
|
-
return (0,
|
|
289207
|
+
return (0, import_rxjs40.throwError)(() => error48);
|
|
289129
289208
|
}),
|
|
289130
|
-
(0,
|
|
289209
|
+
(0, import_operators23.switchMap)(
|
|
289131
289210
|
(projectId) => resolveClusterId(projectId, {
|
|
289132
289211
|
clusterId: cmd.clusterId,
|
|
289133
289212
|
clusterName: cmd.clusterName
|
|
289134
289213
|
}).pipe(
|
|
289135
|
-
(0,
|
|
289214
|
+
(0, import_operators23.switchMap)(
|
|
289136
289215
|
(clusterId) => GraphqlClienAPI.getLambdaLogsByName(name2, projectId, clusterId)
|
|
289137
289216
|
)
|
|
289138
289217
|
)
|
|
@@ -289151,45 +289230,45 @@ var logs_builder_exports = {};
|
|
|
289151
289230
|
__export(logs_builder_exports, {
|
|
289152
289231
|
default: () => logs_builder_default
|
|
289153
289232
|
});
|
|
289154
|
-
var
|
|
289233
|
+
var import_rxjs41, import_operators24, logs_builder_default;
|
|
289155
289234
|
var init_logs_builder = __esm({
|
|
289156
289235
|
"src/commands/lambda/logs-builder.ts"() {
|
|
289157
|
-
|
|
289158
|
-
|
|
289236
|
+
import_rxjs41 = __toESM(require_cjs());
|
|
289237
|
+
import_operators24 = __toESM(require_operators());
|
|
289159
289238
|
init_helpers();
|
|
289160
289239
|
init_gql_client();
|
|
289161
289240
|
init_log();
|
|
289162
289241
|
init_load_spec();
|
|
289163
289242
|
logs_builder_default = async (cmd) => {
|
|
289164
|
-
const result = (0,
|
|
289243
|
+
const result = (0, import_operators24.tap)(({ data }) => Logger.log(data));
|
|
289165
289244
|
if (cmd.lambda) {
|
|
289166
|
-
return (0,
|
|
289245
|
+
return (0, import_rxjs41.lastValueFrom)(
|
|
289167
289246
|
isMongoId(cmd.lambda).pipe(
|
|
289168
|
-
(0,
|
|
289247
|
+
(0, import_operators24.switchMap)((id) => GraphqlClienAPI.getLambdaBuilderLogs(id)),
|
|
289169
289248
|
result
|
|
289170
289249
|
)
|
|
289171
289250
|
);
|
|
289172
289251
|
}
|
|
289173
|
-
const spec = await (0,
|
|
289252
|
+
const spec = await (0, import_rxjs41.lastValueFrom)(loadSpec(cmd.spec));
|
|
289174
289253
|
const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
|
|
289175
289254
|
if (name2) {
|
|
289176
|
-
return (0,
|
|
289255
|
+
return (0, import_rxjs41.lastValueFrom)(
|
|
289177
289256
|
parseProjectId(cmd.project).pipe(
|
|
289178
|
-
(0,
|
|
289257
|
+
(0, import_operators24.catchError)((error48) => {
|
|
289179
289258
|
if (!cmd.project) {
|
|
289180
|
-
return (0,
|
|
289259
|
+
return (0, import_rxjs41.throwError)(
|
|
289181
289260
|
() => `No project id try with "gcli use --project your-project-id" to specify one
|
|
289182
289261
|
Hint: "gcli lambda:logs --name ${name2} --project your-project-id"`
|
|
289183
289262
|
);
|
|
289184
289263
|
}
|
|
289185
|
-
return (0,
|
|
289264
|
+
return (0, import_rxjs41.throwError)(() => error48);
|
|
289186
289265
|
}),
|
|
289187
|
-
(0,
|
|
289266
|
+
(0, import_operators24.switchMap)(
|
|
289188
289267
|
(projectId) => resolveClusterId(projectId, {
|
|
289189
289268
|
clusterId: cmd.clusterId,
|
|
289190
289269
|
clusterName: cmd.clusterName
|
|
289191
289270
|
}).pipe(
|
|
289192
|
-
(0,
|
|
289271
|
+
(0, import_operators24.switchMap)(
|
|
289193
289272
|
(clusterId) => GraphqlClienAPI.getLambdaBuilderLogsByName(
|
|
289194
289273
|
name2,
|
|
289195
289274
|
projectId,
|
|
@@ -289212,39 +289291,39 @@ var test_exports = {};
|
|
|
289212
289291
|
__export(test_exports, {
|
|
289213
289292
|
default: () => test_default
|
|
289214
289293
|
});
|
|
289215
|
-
var
|
|
289294
|
+
var import_rxjs42, import_operators25, test_default;
|
|
289216
289295
|
var init_test = __esm({
|
|
289217
289296
|
"src/commands/lambda/test.ts"() {
|
|
289218
|
-
|
|
289219
|
-
|
|
289297
|
+
import_rxjs42 = __toESM(require_cjs());
|
|
289298
|
+
import_operators25 = __toESM(require_operators());
|
|
289220
289299
|
init_helpers();
|
|
289221
289300
|
init_gql_client();
|
|
289222
289301
|
init_log();
|
|
289223
289302
|
init_load_spec();
|
|
289224
289303
|
test_default = async (cmd) => {
|
|
289225
|
-
const spec = await (0,
|
|
289226
|
-
const processParameters = (lambda) => (0,
|
|
289227
|
-
(0,
|
|
289304
|
+
const spec = await (0, import_rxjs42.lastValueFrom)(loadSpec(cmd.spec));
|
|
289305
|
+
const processParameters = (lambda) => (0, import_rxjs42.of)(lambda).pipe(
|
|
289306
|
+
(0, import_operators25.map)((lambda2) => ({
|
|
289228
289307
|
...lambda2,
|
|
289229
289308
|
url: cmd.pathParams ? cmd.pathParams.split(";").map((param) => param.split("=")).reduce(
|
|
289230
289309
|
(prev, [key, value]) => prev.replace(key, value),
|
|
289231
289310
|
lambda2.url
|
|
289232
289311
|
) : lambda2.url
|
|
289233
289312
|
})),
|
|
289234
|
-
(0,
|
|
289313
|
+
(0, import_operators25.tap)(() => {
|
|
289235
289314
|
Logger.info(
|
|
289236
289315
|
`About to hit URL: ${[lambda.url, cmd.queryParams].join("")}`
|
|
289237
289316
|
);
|
|
289238
289317
|
}),
|
|
289239
|
-
(0,
|
|
289240
|
-
(lambda2) => (0,
|
|
289318
|
+
(0, import_operators25.switchMap)(
|
|
289319
|
+
(lambda2) => (0, import_rxjs42.from)(
|
|
289241
289320
|
fetch([lambda2.url, cmd.queryParams].filter((i2) => !!i2).join(""), {
|
|
289242
289321
|
method: cmd?.method ?? "GET",
|
|
289243
289322
|
body: cmd.body
|
|
289244
289323
|
})
|
|
289245
|
-
).pipe((0,
|
|
289324
|
+
).pipe((0, import_operators25.switchMap)((res) => res.json()))
|
|
289246
289325
|
),
|
|
289247
|
-
(0,
|
|
289326
|
+
(0, import_operators25.tap)((data) => {
|
|
289248
289327
|
if (data.error) {
|
|
289249
289328
|
Logger.error(data);
|
|
289250
289329
|
} else {
|
|
@@ -289253,29 +289332,29 @@ var init_test = __esm({
|
|
|
289253
289332
|
})
|
|
289254
289333
|
);
|
|
289255
289334
|
if (cmd.lambda) {
|
|
289256
|
-
return (0,
|
|
289335
|
+
return (0, import_rxjs42.lastValueFrom)(
|
|
289257
289336
|
isMongoId(cmd.lambda).pipe(
|
|
289258
|
-
(0,
|
|
289337
|
+
(0, import_operators25.switchMap)(
|
|
289259
289338
|
(id) => GraphqlClienAPI.getLambda(id, ["id", "url", "method", "params"])
|
|
289260
289339
|
),
|
|
289261
|
-
(0,
|
|
289340
|
+
(0, import_operators25.switchMap)(processParameters)
|
|
289262
289341
|
)
|
|
289263
289342
|
);
|
|
289264
289343
|
}
|
|
289265
289344
|
const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
|
|
289266
289345
|
if (name2) {
|
|
289267
|
-
return (0,
|
|
289346
|
+
return (0, import_rxjs42.lastValueFrom)(
|
|
289268
289347
|
parseProjectId(cmd.project).pipe(
|
|
289269
|
-
(0,
|
|
289348
|
+
(0, import_operators25.catchError)((error48) => {
|
|
289270
289349
|
if (!cmd.project) {
|
|
289271
|
-
return (0,
|
|
289350
|
+
return (0, import_rxjs42.throwError)(
|
|
289272
289351
|
() => `No project id try with "gcli use --project your-project-id" to specify one
|
|
289273
289352
|
Hint: "gcli lambda:get --name ${name2} --project your-project-id"`
|
|
289274
289353
|
);
|
|
289275
289354
|
}
|
|
289276
|
-
return (0,
|
|
289355
|
+
return (0, import_rxjs42.throwError)(() => error48);
|
|
289277
289356
|
}),
|
|
289278
|
-
(0,
|
|
289357
|
+
(0, import_operators25.switchMap)(
|
|
289279
289358
|
(projectId) => GraphqlClienAPI.getLambdaByName(name2, projectId, [
|
|
289280
289359
|
"id",
|
|
289281
289360
|
"url",
|
|
@@ -289283,7 +289362,7 @@ var init_test = __esm({
|
|
|
289283
289362
|
"params"
|
|
289284
289363
|
])
|
|
289285
289364
|
),
|
|
289286
|
-
(0,
|
|
289365
|
+
(0, import_operators25.switchMap)(processParameters)
|
|
289287
289366
|
)
|
|
289288
289367
|
);
|
|
289289
289368
|
}
|
|
@@ -289297,16 +289376,16 @@ var list_exports3 = {};
|
|
|
289297
289376
|
__export(list_exports3, {
|
|
289298
289377
|
default: () => list_default3
|
|
289299
289378
|
});
|
|
289300
|
-
var
|
|
289379
|
+
var import_rxjs43, import_operators26, list_default3;
|
|
289301
289380
|
var init_list3 = __esm({
|
|
289302
289381
|
"src/commands/plugin/list.ts"() {
|
|
289303
|
-
|
|
289304
|
-
|
|
289382
|
+
import_rxjs43 = __toESM(require_cjs());
|
|
289383
|
+
import_operators26 = __toESM(require_operators());
|
|
289305
289384
|
init_gql_client();
|
|
289306
289385
|
init_log();
|
|
289307
|
-
list_default3 = () => (0,
|
|
289386
|
+
list_default3 = () => (0, import_rxjs43.lastValueFrom)(
|
|
289308
289387
|
GraphqlClienAPI.listAvailablePlugins().pipe(
|
|
289309
|
-
(0,
|
|
289388
|
+
(0, import_operators26.tap)((plugins) => {
|
|
289310
289389
|
Logger.log("-------------------");
|
|
289311
289390
|
Logger.log("[Action][listAvailablePlugins]");
|
|
289312
289391
|
Logger.table(
|
|
@@ -289329,18 +289408,18 @@ var installed_exports = {};
|
|
|
289329
289408
|
__export(installed_exports, {
|
|
289330
289409
|
default: () => installed_default
|
|
289331
289410
|
});
|
|
289332
|
-
var
|
|
289411
|
+
var import_rxjs44, import_operators27, installed_default;
|
|
289333
289412
|
var init_installed = __esm({
|
|
289334
289413
|
"src/commands/plugin/installed.ts"() {
|
|
289335
|
-
|
|
289336
|
-
|
|
289414
|
+
import_rxjs44 = __toESM(require_cjs());
|
|
289415
|
+
import_operators27 = __toESM(require_operators());
|
|
289337
289416
|
init_helpers();
|
|
289338
289417
|
init_gql_client();
|
|
289339
289418
|
init_log();
|
|
289340
|
-
installed_default = (cmd) => (0,
|
|
289419
|
+
installed_default = (cmd) => (0, import_rxjs44.lastValueFrom)(
|
|
289341
289420
|
parseProjectId(cmd.project).pipe(
|
|
289342
|
-
(0,
|
|
289343
|
-
(0,
|
|
289421
|
+
(0, import_operators27.switchMap)((projectId) => GraphqlClienAPI.listInstalledPlugins(projectId)),
|
|
289422
|
+
(0, import_operators27.tap)((installed) => {
|
|
289344
289423
|
Logger.log("-------------------");
|
|
289345
289424
|
Logger.log("[Action][listInstalledPlugins]");
|
|
289346
289425
|
if (!installed?.length) {
|
|
@@ -289368,32 +289447,32 @@ var install_exports = {};
|
|
|
289368
289447
|
__export(install_exports, {
|
|
289369
289448
|
default: () => install_default
|
|
289370
289449
|
});
|
|
289371
|
-
var
|
|
289450
|
+
var import_rxjs45, import_operators28, install_default;
|
|
289372
289451
|
var init_install = __esm({
|
|
289373
289452
|
"src/commands/plugin/install.ts"() {
|
|
289374
|
-
|
|
289375
|
-
|
|
289453
|
+
import_rxjs45 = __toESM(require_cjs());
|
|
289454
|
+
import_operators28 = __toESM(require_operators());
|
|
289376
289455
|
init_helpers();
|
|
289377
289456
|
init_gql_client();
|
|
289378
289457
|
init_log();
|
|
289379
289458
|
init_load_spec();
|
|
289380
|
-
install_default = (cmd) => (0,
|
|
289459
|
+
install_default = (cmd) => (0, import_rxjs45.lastValueFrom)(
|
|
289381
289460
|
parseProjectId(cmd.project).pipe(
|
|
289382
|
-
(0,
|
|
289461
|
+
(0, import_operators28.switchMap)(
|
|
289383
289462
|
(projectId) => loadSpec(
|
|
289384
289463
|
cmd.spec ?? "plugin.yaml"
|
|
289385
289464
|
).pipe(
|
|
289386
289465
|
// No spec file is required at all if --name/--cluster fully
|
|
289387
289466
|
// cover it (unlike every other resource here, a plugin install
|
|
289388
289467
|
// is often just "install this by name", no YAML needed).
|
|
289389
|
-
(0,
|
|
289390
|
-
(0,
|
|
289468
|
+
(0, import_operators28.catchError)(() => (0, import_rxjs45.of)(void 0)),
|
|
289469
|
+
(0, import_operators28.map)((data) => ({
|
|
289391
289470
|
projectId,
|
|
289392
289471
|
...data ? data.plugin ?? data : {}
|
|
289393
289472
|
}))
|
|
289394
289473
|
)
|
|
289395
289474
|
),
|
|
289396
|
-
(0,
|
|
289475
|
+
(0, import_operators28.switchMap)(
|
|
289397
289476
|
({ projectId, ...data }) => GraphqlClienAPI.installPlugin(
|
|
289398
289477
|
projectId,
|
|
289399
289478
|
cmd.name || data.name,
|
|
@@ -289401,7 +289480,7 @@ var init_install = __esm({
|
|
|
289401
289480
|
cmd.cluster || data.clusterId
|
|
289402
289481
|
)
|
|
289403
289482
|
),
|
|
289404
|
-
(0,
|
|
289483
|
+
(0, import_operators28.tap)((installed) => {
|
|
289405
289484
|
Logger.log("-------------------");
|
|
289406
289485
|
Logger.log("[Action][installPlugin]");
|
|
289407
289486
|
Logger.table([installed]);
|
|
@@ -289417,20 +289496,20 @@ var uninstall_exports = {};
|
|
|
289417
289496
|
__export(uninstall_exports, {
|
|
289418
289497
|
default: () => uninstall_default
|
|
289419
289498
|
});
|
|
289420
|
-
var
|
|
289499
|
+
var import_rxjs46, import_operators29, uninstall_default;
|
|
289421
289500
|
var init_uninstall = __esm({
|
|
289422
289501
|
"src/commands/plugin/uninstall.ts"() {
|
|
289423
|
-
|
|
289424
|
-
|
|
289502
|
+
import_rxjs46 = __toESM(require_cjs());
|
|
289503
|
+
import_operators29 = __toESM(require_operators());
|
|
289425
289504
|
init_helpers();
|
|
289426
289505
|
init_gql_client();
|
|
289427
289506
|
init_log();
|
|
289428
|
-
uninstall_default = (cmd) => (0,
|
|
289507
|
+
uninstall_default = (cmd) => (0, import_rxjs46.lastValueFrom)(
|
|
289429
289508
|
parseProjectId(cmd.project).pipe(
|
|
289430
|
-
(0,
|
|
289509
|
+
(0, import_operators29.switchMap)(
|
|
289431
289510
|
(projectId) => GraphqlClienAPI.uninstallPlugin(projectId, cmd.name, cmd.cluster)
|
|
289432
289511
|
),
|
|
289433
|
-
(0,
|
|
289512
|
+
(0, import_operators29.tap)((pluginName) => {
|
|
289434
289513
|
Logger.log("-------------------");
|
|
289435
289514
|
Logger.log(`[Action][uninstallPlugin] removed ${pluginName}`);
|
|
289436
289515
|
Logger.log("-------------------");
|
|
@@ -289445,16 +289524,16 @@ var list_exports4 = {};
|
|
|
289445
289524
|
__export(list_exports4, {
|
|
289446
289525
|
default: () => list_default4
|
|
289447
289526
|
});
|
|
289448
|
-
var
|
|
289527
|
+
var import_rxjs47, import_operators30, list_default4;
|
|
289449
289528
|
var init_list4 = __esm({
|
|
289450
289529
|
"src/commands/project/list.ts"() {
|
|
289451
|
-
|
|
289452
|
-
|
|
289530
|
+
import_rxjs47 = __toESM(require_cjs());
|
|
289531
|
+
import_operators30 = __toESM(require_operators());
|
|
289453
289532
|
init_gql_client();
|
|
289454
289533
|
init_log();
|
|
289455
|
-
list_default4 = async () => (0,
|
|
289534
|
+
list_default4 = async () => (0, import_rxjs47.lastValueFrom)(
|
|
289456
289535
|
GraphqlClienAPI.listProjects().pipe(
|
|
289457
|
-
(0,
|
|
289536
|
+
(0, import_operators30.tap)((project) => {
|
|
289458
289537
|
const columns = ["id", "name"];
|
|
289459
289538
|
Logger.log("-------------------");
|
|
289460
289539
|
Logger.log("[Action][listProjects]");
|
|
@@ -289471,24 +289550,24 @@ var use_exports = {};
|
|
|
289471
289550
|
__export(use_exports, {
|
|
289472
289551
|
default: () => use_default
|
|
289473
289552
|
});
|
|
289474
|
-
var import_fs7,
|
|
289553
|
+
var import_fs7, import_rxjs48, import_operators31, import_util4, use_default;
|
|
289475
289554
|
var init_use = __esm({
|
|
289476
289555
|
"src/commands/project/use.ts"() {
|
|
289477
289556
|
import_fs7 = require("fs");
|
|
289478
|
-
|
|
289479
|
-
|
|
289557
|
+
import_rxjs48 = __toESM(require_cjs());
|
|
289558
|
+
import_operators31 = __toESM(require_operators());
|
|
289480
289559
|
import_util4 = require("util");
|
|
289481
289560
|
init_helpers();
|
|
289482
289561
|
init_gql_client();
|
|
289483
289562
|
init_types();
|
|
289484
289563
|
use_default = async (cmd) => {
|
|
289485
|
-
return (0,
|
|
289564
|
+
return (0, import_rxjs48.lastValueFrom)(
|
|
289486
289565
|
parseProjectId(cmd).pipe(
|
|
289487
|
-
(0,
|
|
289488
|
-
(projectId) => GraphqlClienAPI.getProject(projectId).pipe((0,
|
|
289566
|
+
(0, import_operators31.switchMap)(
|
|
289567
|
+
(projectId) => GraphqlClienAPI.getProject(projectId).pipe((0, import_operators31.map)(() => projectId))
|
|
289489
289568
|
),
|
|
289490
|
-
(0,
|
|
289491
|
-
(projectId) => (0,
|
|
289569
|
+
(0, import_operators31.switchMap)(
|
|
289570
|
+
(projectId) => (0, import_rxjs48.from)(
|
|
289492
289571
|
(0, import_util4.promisify)(import_fs7.writeFile)(projectDirectory, projectId, {
|
|
289493
289572
|
encoding: "utf-8"
|
|
289494
289573
|
})
|
|
@@ -289935,8 +290014,8 @@ var init_parseUtil = __esm({
|
|
|
289935
290014
|
}
|
|
289936
290015
|
let errorMessage = "";
|
|
289937
290016
|
const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
|
|
289938
|
-
for (const
|
|
289939
|
-
errorMessage =
|
|
290017
|
+
for (const map33 of maps) {
|
|
290018
|
+
errorMessage = map33(fullIssue, { data, defaultError: errorMessage }).message;
|
|
289940
290019
|
}
|
|
289941
290020
|
return {
|
|
289942
290021
|
...issueData,
|
|
@@ -296458,19 +296537,19 @@ var init_schemas = __esm({
|
|
|
296458
296537
|
});
|
|
296459
296538
|
const disc = cached(() => {
|
|
296460
296539
|
const opts = def.options;
|
|
296461
|
-
const
|
|
296540
|
+
const map33 = /* @__PURE__ */ new Map();
|
|
296462
296541
|
for (const o of opts) {
|
|
296463
296542
|
const values = o._zod.propValues?.[def.discriminator];
|
|
296464
296543
|
if (!values || values.size === 0)
|
|
296465
296544
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
296466
296545
|
for (const v of values) {
|
|
296467
|
-
if (
|
|
296546
|
+
if (map33.has(v)) {
|
|
296468
296547
|
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
296469
296548
|
}
|
|
296470
|
-
|
|
296549
|
+
map33.set(v, o);
|
|
296471
296550
|
}
|
|
296472
296551
|
}
|
|
296473
|
-
return
|
|
296552
|
+
return map33;
|
|
296474
296553
|
});
|
|
296475
296554
|
inst._zod.parse = (payload, ctx) => {
|
|
296476
296555
|
const input = payload.value;
|
|
@@ -305953,7 +306032,7 @@ __export(schemas_exports3, {
|
|
|
305953
306032
|
looseObject: () => looseObject,
|
|
305954
306033
|
looseRecord: () => looseRecord,
|
|
305955
306034
|
mac: () => mac2,
|
|
305956
|
-
map: () =>
|
|
306035
|
+
map: () => map19,
|
|
305957
306036
|
meta: () => meta2,
|
|
305958
306037
|
nan: () => nan,
|
|
305959
306038
|
nanoid: () => nanoid2,
|
|
@@ -306249,7 +306328,7 @@ function looseRecord(keyType, valueType, params) {
|
|
|
306249
306328
|
...util_exports.normalizeParams(params)
|
|
306250
306329
|
});
|
|
306251
306330
|
}
|
|
306252
|
-
function
|
|
306331
|
+
function map19(keyType, valueType, params) {
|
|
306253
306332
|
return new ZodMap2({
|
|
306254
306333
|
type: "map",
|
|
306255
306334
|
keyType,
|
|
@@ -307091,9 +307170,9 @@ var init_schemas3 = __esm({
|
|
|
307091
307170
|
});
|
|
307092
307171
|
|
|
307093
307172
|
// ../../node_modules/zod/v4/classic/compat.js
|
|
307094
|
-
function setErrorMap(
|
|
307173
|
+
function setErrorMap(map33) {
|
|
307095
307174
|
config({
|
|
307096
|
-
customError:
|
|
307175
|
+
customError: map33
|
|
307097
307176
|
});
|
|
307098
307177
|
}
|
|
307099
307178
|
function getErrorMap2() {
|
|
@@ -307793,7 +307872,7 @@ __export(external_exports3, {
|
|
|
307793
307872
|
lt: () => _lt,
|
|
307794
307873
|
lte: () => _lte,
|
|
307795
307874
|
mac: () => mac2,
|
|
307796
|
-
map: () =>
|
|
307875
|
+
map: () => map19,
|
|
307797
307876
|
maxLength: () => _maxLength,
|
|
307798
307877
|
maxSize: () => _maxSize,
|
|
307799
307878
|
meta: () => meta2,
|
|
@@ -320431,33 +320510,33 @@ async function startProxy(cmd) {
|
|
|
320431
320510
|
cmd.url ? cmd.url.replace(/\/mcp\/?$/, "") : "https://api.lambforge.com"
|
|
320432
320511
|
);
|
|
320433
320512
|
}
|
|
320434
|
-
return (0,
|
|
320513
|
+
return (0, import_rxjs49.lastValueFrom)(
|
|
320435
320514
|
GraphqlClienAPI.getConfig().pipe(
|
|
320436
|
-
(0,
|
|
320437
|
-
(0,
|
|
320515
|
+
(0, import_operators32.take)(1),
|
|
320516
|
+
(0, import_operators32.map)((config2) => ({
|
|
320438
320517
|
...config2,
|
|
320439
320518
|
mcpUrl: new URL(
|
|
320440
320519
|
cmd.url || [config2.url.replace(/\/graphql$/, ""), "/mcp"].join("") || "http://127.0.0.1:8000/mcp"
|
|
320441
320520
|
)
|
|
320442
320521
|
})),
|
|
320443
|
-
(0,
|
|
320522
|
+
(0, import_operators32.tap)((config2) => {
|
|
320444
320523
|
config2.mcpUrl.searchParams.set("transportType", "streamable-http");
|
|
320445
320524
|
process.stderr.write(`Starting MCP proxy \u2192 ${config2.mcpUrl}
|
|
320446
320525
|
`);
|
|
320447
320526
|
process.stderr.write("Retrieving config for auth...\n");
|
|
320448
320527
|
}),
|
|
320449
|
-
(0,
|
|
320450
|
-
(config2) => config2?.token ? (0,
|
|
320528
|
+
(0, import_operators32.switchMap)(
|
|
320529
|
+
(config2) => config2?.token ? (0, import_rxjs49.of)(config2) : (0, import_rxjs49.throwError)(
|
|
320451
320530
|
() => new Error("User is not authenticated (no token in config)")
|
|
320452
320531
|
)
|
|
320453
320532
|
),
|
|
320454
|
-
(0,
|
|
320533
|
+
(0, import_operators32.tap)((config2) => {
|
|
320455
320534
|
process.stderr.write(
|
|
320456
320535
|
`Config retrieved. Token start: ${config2.token.substring(0, 5)}
|
|
320457
320536
|
`
|
|
320458
320537
|
);
|
|
320459
320538
|
}),
|
|
320460
|
-
(0,
|
|
320539
|
+
(0, import_operators32.map)((config2) => ({
|
|
320461
320540
|
...config2,
|
|
320462
320541
|
transport: new StreamableHTTPClientTransport(config2.mcpUrl, {
|
|
320463
320542
|
requestInit: {
|
|
@@ -320465,34 +320544,34 @@ async function startProxy(cmd) {
|
|
|
320465
320544
|
Authorization: config2.token
|
|
320466
320545
|
}
|
|
320467
320546
|
},
|
|
320468
|
-
fetch: (input, init) => (0,
|
|
320547
|
+
fetch: (input, init) => (0, import_rxjs49.lastValueFrom)(performFetch(input, init))
|
|
320469
320548
|
}),
|
|
320470
320549
|
client: new Client({
|
|
320471
320550
|
name: "gapi-proxy-client",
|
|
320472
320551
|
version: "1.0.0"
|
|
320473
320552
|
})
|
|
320474
320553
|
})),
|
|
320475
|
-
(0,
|
|
320554
|
+
(0, import_operators32.tap)(() => {
|
|
320476
320555
|
process.stderr.write("Connecting to upstream...\n");
|
|
320477
320556
|
}),
|
|
320478
|
-
(0,
|
|
320479
|
-
(config2) => (0,
|
|
320557
|
+
(0, import_operators32.switchMap)(
|
|
320558
|
+
(config2) => (0, import_rxjs49.from)(config2.client.connect(config2.transport)).pipe((0, import_operators32.map)(() => config2))
|
|
320480
320559
|
),
|
|
320481
|
-
(0,
|
|
320560
|
+
(0, import_operators32.tap)(() => {
|
|
320482
320561
|
process.stderr.write("Connected to upstream MCP server\n");
|
|
320483
320562
|
}),
|
|
320484
320563
|
// Get capabilities AFTER connection is established
|
|
320485
|
-
(0,
|
|
320564
|
+
(0, import_operators32.map)((config2) => ({
|
|
320486
320565
|
...config2,
|
|
320487
320566
|
capabilities: config2.client.getServerCapabilities()
|
|
320488
320567
|
})),
|
|
320489
|
-
(0,
|
|
320568
|
+
(0, import_operators32.tap)((config2) => {
|
|
320490
320569
|
process.stderr.write(
|
|
320491
320570
|
`Upstream capabilities: ${JSON.stringify(config2.capabilities)}
|
|
320492
320571
|
`
|
|
320493
320572
|
);
|
|
320494
320573
|
}),
|
|
320495
|
-
(0,
|
|
320574
|
+
(0, import_operators32.map)((config2) => {
|
|
320496
320575
|
const server2 = new Server(
|
|
320497
320576
|
{
|
|
320498
320577
|
name: "gapi-proxy",
|
|
@@ -320502,45 +320581,45 @@ async function startProxy(cmd) {
|
|
|
320502
320581
|
capabilities: config2.capabilities || {}
|
|
320503
320582
|
}
|
|
320504
320583
|
);
|
|
320505
|
-
server2.fallbackRequestHandler = async (request) => (0,
|
|
320506
|
-
(0,
|
|
320507
|
-
(0,
|
|
320584
|
+
server2.fallbackRequestHandler = async (request) => (0, import_rxjs49.lastValueFrom)(
|
|
320585
|
+
(0, import_rxjs49.defer)(() => config2.client.request(request, external_exports3.any())).pipe(
|
|
320586
|
+
(0, import_operators32.catchError)((e2) => {
|
|
320508
320587
|
process.stderr.write(`Upstream error: ${e2.message}
|
|
320509
320588
|
`);
|
|
320510
|
-
return (0,
|
|
320589
|
+
return (0, import_rxjs49.throwError)(() => e2);
|
|
320511
320590
|
})
|
|
320512
320591
|
)
|
|
320513
320592
|
);
|
|
320514
320593
|
server2.fallbackNotificationHandler = async (notification) => {
|
|
320515
|
-
await (0,
|
|
320516
|
-
(0,
|
|
320517
|
-
(0,
|
|
320518
|
-
(0,
|
|
320519
|
-
(n) => (0,
|
|
320520
|
-
(0,
|
|
320594
|
+
await (0, import_rxjs49.lastValueFrom)(
|
|
320595
|
+
(0, import_rxjs49.of)(notification).pipe(
|
|
320596
|
+
(0, import_operators32.filter)((n) => n.method !== "notifications/initialized"),
|
|
320597
|
+
(0, import_operators32.switchMap)(
|
|
320598
|
+
(n) => (0, import_rxjs49.defer)(() => config2.client.notification(n)).pipe(
|
|
320599
|
+
(0, import_operators32.catchError)((e2) => {
|
|
320521
320600
|
process.stderr.write(`Notification error: ${e2}
|
|
320522
320601
|
`);
|
|
320523
|
-
return
|
|
320602
|
+
return import_rxjs49.EMPTY;
|
|
320524
320603
|
})
|
|
320525
320604
|
)
|
|
320526
320605
|
),
|
|
320527
|
-
(0,
|
|
320606
|
+
(0, import_operators32.defaultIfEmpty)(null)
|
|
320528
320607
|
)
|
|
320529
320608
|
);
|
|
320530
320609
|
};
|
|
320531
320610
|
return server2;
|
|
320532
320611
|
}),
|
|
320533
|
-
(0,
|
|
320534
|
-
(0,
|
|
320612
|
+
(0, import_operators32.switchMap)((server2) => (0, import_rxjs49.from)(server2.connect(new StdioServerTransport()))),
|
|
320613
|
+
(0, import_operators32.tap)(() => {
|
|
320535
320614
|
process.stderr.write("MCP stdio server ready\n");
|
|
320536
320615
|
}),
|
|
320537
320616
|
// Keep the process running indefinitely to handle stdio communication
|
|
320538
|
-
(0,
|
|
320617
|
+
(0, import_operators32.switchMap)(() => new Promise(() => {
|
|
320539
320618
|
}))
|
|
320540
320619
|
)
|
|
320541
320620
|
);
|
|
320542
320621
|
}
|
|
320543
|
-
var import_fs9,
|
|
320622
|
+
var import_fs9, import_rxjs49, import_operators32, import_stream2, pendingToken, currentToken, withToken, performFetch;
|
|
320544
320623
|
var init_start = __esm({
|
|
320545
320624
|
"src/commands/proxy/start.ts"() {
|
|
320546
320625
|
init_client2();
|
|
@@ -320548,8 +320627,8 @@ var init_start = __esm({
|
|
|
320548
320627
|
init_server2();
|
|
320549
320628
|
init_stdio2();
|
|
320550
320629
|
import_fs9 = require("fs");
|
|
320551
|
-
|
|
320552
|
-
|
|
320630
|
+
import_rxjs49 = __toESM(require_cjs());
|
|
320631
|
+
import_operators32 = __toESM(require_operators());
|
|
320553
320632
|
import_stream2 = require("stream");
|
|
320554
320633
|
init_zod();
|
|
320555
320634
|
init_gql_client();
|
|
@@ -320558,10 +320637,10 @@ var init_start = __esm({
|
|
|
320558
320637
|
pendingToken = null;
|
|
320559
320638
|
currentToken = (force = false) => {
|
|
320560
320639
|
if (!pendingToken || force) {
|
|
320561
|
-
pendingToken = (0,
|
|
320640
|
+
pendingToken = (0, import_rxjs49.lastValueFrom)(
|
|
320562
320641
|
GraphqlClienAPI.getConfig(force).pipe(
|
|
320563
|
-
(0,
|
|
320564
|
-
(0,
|
|
320642
|
+
(0, import_operators32.take)(1),
|
|
320643
|
+
(0, import_operators32.map)((config2) => config2.token)
|
|
320565
320644
|
)
|
|
320566
320645
|
).finally(() => {
|
|
320567
320646
|
pendingToken = null;
|
|
@@ -320575,16 +320654,16 @@ var init_start = __esm({
|
|
|
320575
320654
|
return { ...init, headers };
|
|
320576
320655
|
};
|
|
320577
320656
|
performFetch = (input, init) => {
|
|
320578
|
-
return (0,
|
|
320579
|
-
(0,
|
|
320580
|
-
(0,
|
|
320657
|
+
return (0, import_rxjs49.from)(currentToken()).pipe(
|
|
320658
|
+
(0, import_operators32.switchMap)((token) => fetch(input, withToken(init, token))),
|
|
320659
|
+
(0, import_operators32.switchMap)((res) => {
|
|
320581
320660
|
if (res.status === 401 || res.status === 403) {
|
|
320582
320661
|
process.stderr.write(
|
|
320583
320662
|
`[DEBUG] Request failed with ${res.status}. Refreshing token...
|
|
320584
320663
|
`
|
|
320585
320664
|
);
|
|
320586
|
-
return (0,
|
|
320587
|
-
(0,
|
|
320665
|
+
return (0, import_rxjs49.from)(currentToken(true)).pipe(
|
|
320666
|
+
(0, import_operators32.switchMap)((token) => {
|
|
320588
320667
|
process.stderr.write(
|
|
320589
320668
|
"[DEBUG] Token refreshed. Retrying request...\n"
|
|
320590
320669
|
);
|
|
@@ -320592,9 +320671,9 @@ var init_start = __esm({
|
|
|
320592
320671
|
})
|
|
320593
320672
|
);
|
|
320594
320673
|
}
|
|
320595
|
-
return (0,
|
|
320674
|
+
return (0, import_rxjs49.of)(res);
|
|
320596
320675
|
}),
|
|
320597
|
-
(0,
|
|
320676
|
+
(0, import_operators32.map)((res) => {
|
|
320598
320677
|
if (typeof res?.body?.pipeThrough !== "function") {
|
|
320599
320678
|
try {
|
|
320600
320679
|
const webStream = import_stream2.Readable.toWeb(res.body);
|
|
@@ -320608,10 +320687,10 @@ var init_start = __esm({
|
|
|
320608
320687
|
}
|
|
320609
320688
|
return res;
|
|
320610
320689
|
}),
|
|
320611
|
-
(0,
|
|
320690
|
+
(0, import_operators32.catchError)((e2) => {
|
|
320612
320691
|
process.stderr.write(`[ERROR] Fetch error: ${e2.message}
|
|
320613
320692
|
`);
|
|
320614
|
-
return (0,
|
|
320693
|
+
return (0, import_rxjs49.throwError)(() => e2);
|
|
320615
320694
|
})
|
|
320616
320695
|
);
|
|
320617
320696
|
};
|
|
@@ -320623,28 +320702,28 @@ var create_exports3 = {};
|
|
|
320623
320702
|
__export(create_exports3, {
|
|
320624
320703
|
default: () => create_default3
|
|
320625
320704
|
});
|
|
320626
|
-
var
|
|
320705
|
+
var import_rxjs50, import_operators33, create_default3;
|
|
320627
320706
|
var init_create3 = __esm({
|
|
320628
320707
|
"src/commands/rabbitmq/create.ts"() {
|
|
320629
|
-
|
|
320630
|
-
|
|
320708
|
+
import_rxjs50 = __toESM(require_cjs());
|
|
320709
|
+
import_operators33 = __toESM(require_operators());
|
|
320631
320710
|
init_helpers();
|
|
320632
320711
|
init_gql_client();
|
|
320633
320712
|
init_log();
|
|
320634
320713
|
init_load_spec();
|
|
320635
|
-
create_default3 = (cmd) => (0,
|
|
320714
|
+
create_default3 = (cmd) => (0, import_rxjs50.lastValueFrom)(
|
|
320636
320715
|
parseProjectId(cmd.project).pipe(
|
|
320637
|
-
(0,
|
|
320716
|
+
(0, import_operators33.switchMap)(
|
|
320638
320717
|
(projectId) => loadSpec(
|
|
320639
320718
|
cmd.spec ?? "rabbitmq.yaml"
|
|
320640
320719
|
).pipe(
|
|
320641
|
-
(0,
|
|
320720
|
+
(0, import_operators33.map)((data) => ({
|
|
320642
320721
|
projectId,
|
|
320643
320722
|
...data ? data.rabbitmq ?? data : {}
|
|
320644
320723
|
}))
|
|
320645
320724
|
)
|
|
320646
320725
|
),
|
|
320647
|
-
(0,
|
|
320726
|
+
(0, import_operators33.switchMap)(
|
|
320648
320727
|
({ projectId, ...data }) => GraphqlClienAPI.installRabbitMq(projectId, {
|
|
320649
320728
|
name: cmd.name || data.name,
|
|
320650
320729
|
description: cmd.description || data.description,
|
|
@@ -320655,7 +320734,7 @@ var init_create3 = __esm({
|
|
|
320655
320734
|
clusterId: cmd.cluster || data.clusterId
|
|
320656
320735
|
})
|
|
320657
320736
|
),
|
|
320658
|
-
(0,
|
|
320737
|
+
(0, import_operators33.tap)((broker) => {
|
|
320659
320738
|
Logger.log("-------------------");
|
|
320660
320739
|
Logger.log("[Action][installRabbitMq]");
|
|
320661
320740
|
Logger.table([broker]);
|
|
@@ -320671,20 +320750,20 @@ var list_exports5 = {};
|
|
|
320671
320750
|
__export(list_exports5, {
|
|
320672
320751
|
default: () => list_default5
|
|
320673
320752
|
});
|
|
320674
|
-
var
|
|
320753
|
+
var import_rxjs51, import_operators34, list_default5;
|
|
320675
320754
|
var init_list5 = __esm({
|
|
320676
320755
|
"src/commands/rabbitmq/list.ts"() {
|
|
320677
|
-
|
|
320678
|
-
|
|
320756
|
+
import_rxjs51 = __toESM(require_cjs());
|
|
320757
|
+
import_operators34 = __toESM(require_operators());
|
|
320679
320758
|
init_helpers();
|
|
320680
320759
|
init_gql_client();
|
|
320681
320760
|
init_log();
|
|
320682
|
-
list_default5 = (cmd) => (0,
|
|
320761
|
+
list_default5 = (cmd) => (0, import_rxjs51.lastValueFrom)(
|
|
320683
320762
|
parseProjectId(cmd.project).pipe(
|
|
320684
|
-
(0,
|
|
320763
|
+
(0, import_operators34.switchMap)(
|
|
320685
320764
|
(projectId) => GraphqlClienAPI.listRabbitMqInstances(projectId)
|
|
320686
320765
|
),
|
|
320687
|
-
(0,
|
|
320766
|
+
(0, import_operators34.tap)((brokers) => {
|
|
320688
320767
|
Logger.log("-------------------");
|
|
320689
320768
|
Logger.log("[Action][listRabbitMqInstances]");
|
|
320690
320769
|
if (!brokers?.length) {
|
|
@@ -320755,40 +320834,40 @@ var declare_queue_exports = {};
|
|
|
320755
320834
|
__export(declare_queue_exports, {
|
|
320756
320835
|
default: () => declare_queue_default
|
|
320757
320836
|
});
|
|
320758
|
-
var
|
|
320837
|
+
var import_rxjs52, import_operators35, declare_queue_default;
|
|
320759
320838
|
var init_declare_queue = __esm({
|
|
320760
320839
|
"src/commands/rabbitmq/declare-queue.ts"() {
|
|
320761
|
-
|
|
320762
|
-
|
|
320840
|
+
import_rxjs52 = __toESM(require_cjs());
|
|
320841
|
+
import_operators35 = __toESM(require_operators());
|
|
320763
320842
|
init_load_spec();
|
|
320764
320843
|
init_helpers();
|
|
320765
320844
|
init_gql_client();
|
|
320766
320845
|
init_log();
|
|
320767
320846
|
init_resolve_broker();
|
|
320768
|
-
declare_queue_default = (cmd) => (0,
|
|
320847
|
+
declare_queue_default = (cmd) => (0, import_rxjs52.lastValueFrom)(
|
|
320769
320848
|
parseProjectId(cmd.project).pipe(
|
|
320770
|
-
(0,
|
|
320771
|
-
(projectId) => (cmd.name?.length ? (0,
|
|
320772
|
-
(0,
|
|
320849
|
+
(0, import_operators35.switchMap)(
|
|
320850
|
+
(projectId) => (cmd.name?.length ? (0, import_rxjs52.of)({ names: cmd.name, broker: cmd.broker }) : loadSpec(cmd.spec).pipe(
|
|
320851
|
+
(0, import_operators35.map)((data) => ({
|
|
320773
320852
|
names: data?.queues?.declare ?? [],
|
|
320774
320853
|
broker: cmd.broker ?? data?.queues?.broker
|
|
320775
320854
|
})),
|
|
320776
|
-
(0,
|
|
320777
|
-
() => (0,
|
|
320855
|
+
(0, import_operators35.catchError)(
|
|
320856
|
+
() => (0, import_rxjs52.of)({ names: [], broker: cmd.broker })
|
|
320778
320857
|
)
|
|
320779
320858
|
)).pipe(
|
|
320780
|
-
(0,
|
|
320859
|
+
(0, import_operators35.switchMap)(({ names, broker }) => {
|
|
320781
320860
|
if (!names.length) {
|
|
320782
320861
|
throw new Error(
|
|
320783
320862
|
"queue:declare needs --name (repeatable) or queues.declare in lambforge.yaml"
|
|
320784
320863
|
);
|
|
320785
320864
|
}
|
|
320786
320865
|
return GraphqlClienAPI.listRabbitMqInstances(projectId).pipe(
|
|
320787
|
-
(0,
|
|
320788
|
-
(0,
|
|
320866
|
+
(0, import_operators35.map)((brokers) => resolveBroker(brokers, broker)),
|
|
320867
|
+
(0, import_operators35.switchMap)((target) => {
|
|
320789
320868
|
const missing = queuesToDeclare(target, names);
|
|
320790
320869
|
const skipped = names.filter((n) => !missing.includes(n));
|
|
320791
|
-
return (0,
|
|
320870
|
+
return (0, import_rxjs52.concat)(
|
|
320792
320871
|
...missing.map(
|
|
320793
320872
|
(name2) => GraphqlClienAPI.declareQueue(target.id, projectId, {
|
|
320794
320873
|
name: name2,
|
|
@@ -320797,15 +320876,15 @@ var init_declare_queue = __esm({
|
|
|
320797
320876
|
})
|
|
320798
320877
|
)
|
|
320799
320878
|
).pipe(
|
|
320800
|
-
(0,
|
|
320801
|
-
(0,
|
|
320879
|
+
(0, import_operators35.toArray)(),
|
|
320880
|
+
(0, import_operators35.map)(() => ({ broker: target.name, missing, skipped }))
|
|
320802
320881
|
);
|
|
320803
320882
|
})
|
|
320804
320883
|
);
|
|
320805
320884
|
})
|
|
320806
320885
|
)
|
|
320807
320886
|
),
|
|
320808
|
-
(0,
|
|
320887
|
+
(0, import_operators35.tap)(({ broker, missing, skipped }) => {
|
|
320809
320888
|
Logger.log("-------------------");
|
|
320810
320889
|
Logger.log("[Action][declareQueue]");
|
|
320811
320890
|
Logger.table([
|
|
@@ -320832,20 +320911,20 @@ var delete_exports2 = {};
|
|
|
320832
320911
|
__export(delete_exports2, {
|
|
320833
320912
|
default: () => delete_default2
|
|
320834
320913
|
});
|
|
320835
|
-
var
|
|
320914
|
+
var import_rxjs53, import_operators36, delete_default2;
|
|
320836
320915
|
var init_delete2 = __esm({
|
|
320837
320916
|
"src/commands/rabbitmq/delete.ts"() {
|
|
320838
|
-
|
|
320839
|
-
|
|
320917
|
+
import_rxjs53 = __toESM(require_cjs());
|
|
320918
|
+
import_operators36 = __toESM(require_operators());
|
|
320840
320919
|
init_helpers();
|
|
320841
320920
|
init_gql_client();
|
|
320842
320921
|
init_log();
|
|
320843
|
-
delete_default2 = (cmd) => (0,
|
|
320922
|
+
delete_default2 = (cmd) => (0, import_rxjs53.lastValueFrom)(
|
|
320844
320923
|
parseProjectId(cmd.project).pipe(
|
|
320845
|
-
(0,
|
|
320924
|
+
(0, import_operators36.switchMap)(
|
|
320846
320925
|
(projectId) => GraphqlClienAPI.uninstallRabbitMq(cmd.id, projectId)
|
|
320847
320926
|
),
|
|
320848
|
-
(0,
|
|
320927
|
+
(0, import_operators36.tap)((broker) => {
|
|
320849
320928
|
Logger.log("-------------------");
|
|
320850
320929
|
Logger.log("[Action][uninstallRabbitMq]");
|
|
320851
320930
|
Logger.table([broker]);
|
|
@@ -321905,11 +321984,11 @@ __export(start_exports2, {
|
|
|
321905
321984
|
default: () => start_default,
|
|
321906
321985
|
resolveRunner: () => resolveRunner
|
|
321907
321986
|
});
|
|
321908
|
-
var import_os6,
|
|
321987
|
+
var import_os6, import_rxjs54, RUNNER_VERSION, resolveRunner, start_default;
|
|
321909
321988
|
var init_start2 = __esm({
|
|
321910
321989
|
"src/commands/runner/start.ts"() {
|
|
321911
321990
|
import_os6 = require("os");
|
|
321912
|
-
|
|
321991
|
+
import_rxjs54 = __toESM(require_cjs());
|
|
321913
321992
|
init_gql_client();
|
|
321914
321993
|
init_log();
|
|
321915
321994
|
init_spec();
|
|
@@ -321930,7 +322009,7 @@ var init_start2 = __esm({
|
|
|
321930
322009
|
}
|
|
321931
322010
|
const name2 = cmd.name || (0, import_os6.hostname)();
|
|
321932
322011
|
Logger.info(`Registering this machine as local runner "${name2}"...`);
|
|
321933
|
-
const { runner, token } = await (0,
|
|
322012
|
+
const { runner, token } = await (0, import_rxjs54.lastValueFrom)(
|
|
321934
322013
|
GraphqlClienAPI.createLocalRunner(name2)
|
|
321935
322014
|
).catch((e2) => {
|
|
321936
322015
|
throw new Error(
|
|
@@ -322134,16 +322213,16 @@ var list_exports6 = {};
|
|
|
322134
322213
|
__export(list_exports6, {
|
|
322135
322214
|
default: () => list_default6
|
|
322136
322215
|
});
|
|
322137
|
-
var
|
|
322216
|
+
var import_rxjs55, import_operators37, list_default6;
|
|
322138
322217
|
var init_list6 = __esm({
|
|
322139
322218
|
"src/commands/runner/list.ts"() {
|
|
322140
|
-
|
|
322141
|
-
|
|
322219
|
+
import_rxjs55 = __toESM(require_cjs());
|
|
322220
|
+
import_operators37 = __toESM(require_operators());
|
|
322142
322221
|
init_gql_client();
|
|
322143
322222
|
init_log();
|
|
322144
|
-
list_default6 = () => (0,
|
|
322223
|
+
list_default6 = () => (0, import_rxjs55.lastValueFrom)(
|
|
322145
322224
|
GraphqlClienAPI.listLocalRunners().pipe(
|
|
322146
|
-
(0,
|
|
322225
|
+
(0, import_operators37.tap)((runners) => {
|
|
322147
322226
|
Logger.log("-------------------");
|
|
322148
322227
|
Logger.log("[Action][listLocalRunners]");
|
|
322149
322228
|
if (!runners?.length) {
|
|
@@ -322174,10 +322253,10 @@ __export(models_exports, {
|
|
|
322174
322253
|
default: () => models_default,
|
|
322175
322254
|
parseSelection: () => parseSelection
|
|
322176
322255
|
});
|
|
322177
|
-
var
|
|
322256
|
+
var import_rxjs56, isShown, parseSelection, models_default;
|
|
322178
322257
|
var init_models = __esm({
|
|
322179
322258
|
"src/commands/runner/models.ts"() {
|
|
322180
|
-
|
|
322259
|
+
import_rxjs56 = __toESM(require_cjs());
|
|
322181
322260
|
init_gql_client();
|
|
322182
322261
|
init_log();
|
|
322183
322262
|
init_config();
|
|
@@ -322207,11 +322286,11 @@ var init_models = __esm({
|
|
|
322207
322286
|
}
|
|
322208
322287
|
let runner;
|
|
322209
322288
|
if (selection) {
|
|
322210
|
-
runner = await (0,
|
|
322289
|
+
runner = await (0, import_rxjs56.lastValueFrom)(
|
|
322211
322290
|
GraphqlClienAPI.setLocalRunnerModels(runnerId, selection.models)
|
|
322212
322291
|
);
|
|
322213
322292
|
} else {
|
|
322214
|
-
const runners = await (0,
|
|
322293
|
+
const runners = await (0, import_rxjs56.lastValueFrom)(GraphqlClienAPI.listLocalRunners());
|
|
322215
322294
|
runner = runners.find((r2) => r2.id === runnerId);
|
|
322216
322295
|
}
|
|
322217
322296
|
if (!runner) {
|
|
@@ -322246,10 +322325,10 @@ var delete_exports3 = {};
|
|
|
322246
322325
|
__export(delete_exports3, {
|
|
322247
322326
|
default: () => delete_default3
|
|
322248
322327
|
});
|
|
322249
|
-
var
|
|
322328
|
+
var import_rxjs57, delete_default3;
|
|
322250
322329
|
var init_delete3 = __esm({
|
|
322251
322330
|
"src/commands/runner/delete.ts"() {
|
|
322252
|
-
|
|
322331
|
+
import_rxjs57 = __toESM(require_cjs());
|
|
322253
322332
|
init_gql_client();
|
|
322254
322333
|
init_log();
|
|
322255
322334
|
init_config();
|
|
@@ -322259,7 +322338,7 @@ var init_delete3 = __esm({
|
|
|
322259
322338
|
if (!runnerId) {
|
|
322260
322339
|
throw new Error("Specify the runner with --id (see `gcli runner:list`).");
|
|
322261
322340
|
}
|
|
322262
|
-
await (0,
|
|
322341
|
+
await (0, import_rxjs57.lastValueFrom)(GraphqlClienAPI.deleteLocalRunner(runnerId));
|
|
322263
322342
|
if (saved?.id === runnerId) {
|
|
322264
322343
|
await forgetRunner();
|
|
322265
322344
|
}
|
|
@@ -322275,10 +322354,10 @@ __export(start_exports3, {
|
|
|
322275
322354
|
});
|
|
322276
322355
|
async function start2(args) {
|
|
322277
322356
|
Logger.log("---------------------------------");
|
|
322278
|
-
return (0,
|
|
322357
|
+
return (0, import_rxjs58.lastValueFrom)(
|
|
322279
322358
|
loadSpec().pipe(
|
|
322280
|
-
(0,
|
|
322281
|
-
(config2) => (0,
|
|
322359
|
+
(0, import_operators38.switchMap)(
|
|
322360
|
+
(config2) => (0, import_rxjs58.of)({
|
|
322282
322361
|
watcher: (0, import_node_fs2.watch)(process.cwd(), {
|
|
322283
322362
|
recursive: true
|
|
322284
322363
|
}),
|
|
@@ -322299,7 +322378,7 @@ async function start2(args) {
|
|
|
322299
322378
|
outfile: args.outfile ?? config2?.options?.bundler?.outfile ?? "index.js",
|
|
322300
322379
|
startCommand: "node"
|
|
322301
322380
|
}).pipe(
|
|
322302
|
-
(0,
|
|
322381
|
+
(0, import_operators38.switchMap)(
|
|
322303
322382
|
({
|
|
322304
322383
|
child,
|
|
322305
322384
|
watcher,
|
|
@@ -322307,14 +322386,14 @@ async function start2(args) {
|
|
|
322307
322386
|
outfile,
|
|
322308
322387
|
startCommand,
|
|
322309
322388
|
ignorelist
|
|
322310
|
-
}) => (0,
|
|
322311
|
-
(0,
|
|
322389
|
+
}) => (0, import_rxjs58.from)(build_default(args)).pipe(
|
|
322390
|
+
(0, import_operators38.tap)(() => {
|
|
322312
322391
|
Logger.warn(
|
|
322313
322392
|
`\u{1F4E2} Starting script "${startCommand} ${outfile}"`
|
|
322314
322393
|
);
|
|
322315
322394
|
Logger.log("---------------------------------\n");
|
|
322316
322395
|
}),
|
|
322317
|
-
(0,
|
|
322396
|
+
(0, import_operators38.tap)(() => {
|
|
322318
322397
|
child = (0, import_node_child_process.spawn)(
|
|
322319
322398
|
startCommand,
|
|
322320
322399
|
["--disable-warning=DEP0040", outfile],
|
|
@@ -322324,14 +322403,14 @@ async function start2(args) {
|
|
|
322324
322403
|
}
|
|
322325
322404
|
);
|
|
322326
322405
|
}),
|
|
322327
|
-
(0,
|
|
322328
|
-
() => (0,
|
|
322329
|
-
(0,
|
|
322330
|
-
(0,
|
|
322331
|
-
(0,
|
|
322406
|
+
(0, import_operators38.tap)(
|
|
322407
|
+
() => (0, import_rxjs58.merge)(
|
|
322408
|
+
(0, import_rxjs58.fromEvent)(process, "SIGINT"),
|
|
322409
|
+
(0, import_rxjs58.fromEvent)(process, "SIGTERM"),
|
|
322410
|
+
(0, import_rxjs58.fromEvent)(process, "exit")
|
|
322332
322411
|
).pipe(
|
|
322333
|
-
(0,
|
|
322334
|
-
(0,
|
|
322412
|
+
(0, import_operators38.debounceTime)(100),
|
|
322413
|
+
(0, import_operators38.tap)(() => {
|
|
322335
322414
|
Logger.warn("\u26A0\uFE0F Main process shutting down");
|
|
322336
322415
|
watcher.close();
|
|
322337
322416
|
child.kill("SIGTERM");
|
|
@@ -322339,13 +322418,13 @@ async function start2(args) {
|
|
|
322339
322418
|
})
|
|
322340
322419
|
).subscribe()
|
|
322341
322420
|
),
|
|
322342
|
-
(0,
|
|
322343
|
-
() => (0,
|
|
322344
|
-
(0,
|
|
322421
|
+
(0, import_operators38.switchMap)(
|
|
322422
|
+
() => (0, import_rxjs58.fromEvent)(watcher, "change").pipe(
|
|
322423
|
+
(0, import_operators38.map)(([event, filename]) => ({
|
|
322345
322424
|
event,
|
|
322346
322425
|
filename
|
|
322347
322426
|
})),
|
|
322348
|
-
(0,
|
|
322427
|
+
(0, import_operators38.filter)(({ filename }) => {
|
|
322349
322428
|
if (!filename) {
|
|
322350
322429
|
return false;
|
|
322351
322430
|
}
|
|
@@ -322357,18 +322436,18 @@ async function start2(args) {
|
|
|
322357
322436
|
const rootDir = filename.split(/[/\\]/)[0];
|
|
322358
322437
|
return whitelist.has(rootDir);
|
|
322359
322438
|
}),
|
|
322360
|
-
(0,
|
|
322439
|
+
(0, import_operators38.debounceTime)(100)
|
|
322361
322440
|
)
|
|
322362
322441
|
),
|
|
322363
|
-
(0,
|
|
322442
|
+
(0, import_operators38.tap)((data) => {
|
|
322364
322443
|
Logger.log("\n---------------------------------");
|
|
322365
322444
|
Logger.log(
|
|
322366
322445
|
`\u27F3 Restarting due to change in: ${data.filename}`
|
|
322367
322446
|
);
|
|
322368
322447
|
child?.kill("SIGTERM");
|
|
322369
322448
|
}),
|
|
322370
|
-
(0,
|
|
322371
|
-
(0,
|
|
322449
|
+
(0, import_operators38.switchMap)(() => build_default(args)),
|
|
322450
|
+
(0, import_operators38.tap)(() => {
|
|
322372
322451
|
Logger.warn(
|
|
322373
322452
|
`\u{1F4E2} Starting script "${startCommand} ${outfile}"`
|
|
322374
322453
|
);
|
|
@@ -322389,13 +322468,13 @@ async function start2(args) {
|
|
|
322389
322468
|
)
|
|
322390
322469
|
);
|
|
322391
322470
|
}
|
|
322392
|
-
var import_node_child_process, import_node_fs2,
|
|
322471
|
+
var import_node_child_process, import_node_fs2, import_rxjs58, import_operators38;
|
|
322393
322472
|
var init_start3 = __esm({
|
|
322394
322473
|
"src/commands/start/start.ts"() {
|
|
322395
322474
|
import_node_child_process = require("node:child_process");
|
|
322396
322475
|
import_node_fs2 = require("node:fs");
|
|
322397
|
-
|
|
322398
|
-
|
|
322476
|
+
import_rxjs58 = __toESM(require_cjs());
|
|
322477
|
+
import_operators38 = __toESM(require_operators());
|
|
322399
322478
|
init_log();
|
|
322400
322479
|
init_build();
|
|
322401
322480
|
init_load_spec();
|
|
@@ -322407,25 +322486,25 @@ var create_cron_exports = {};
|
|
|
322407
322486
|
__export(create_cron_exports, {
|
|
322408
322487
|
default: () => create_cron_default
|
|
322409
322488
|
});
|
|
322410
|
-
var
|
|
322489
|
+
var import_rxjs59, import_operators39, create_cron_default;
|
|
322411
322490
|
var init_create_cron = __esm({
|
|
322412
322491
|
"src/commands/triggers/cron/create-cron.ts"() {
|
|
322413
|
-
|
|
322414
|
-
|
|
322492
|
+
import_rxjs59 = __toESM(require_cjs());
|
|
322493
|
+
import_operators39 = __toESM(require_operators());
|
|
322415
322494
|
init_helpers();
|
|
322416
322495
|
init_gql_client();
|
|
322417
322496
|
init_log();
|
|
322418
322497
|
init_load_spec();
|
|
322419
|
-
create_cron_default = (cmd) => (0,
|
|
322498
|
+
create_cron_default = (cmd) => (0, import_rxjs59.lastValueFrom)(
|
|
322420
322499
|
parseProjectId(cmd.project).pipe(
|
|
322421
|
-
(0,
|
|
322500
|
+
(0, import_operators39.switchMap)(
|
|
322422
322501
|
(projectId) => loadSpec(cmd.spec ?? "cron.yaml").pipe(
|
|
322423
|
-
(0,
|
|
322502
|
+
(0, import_operators39.switchMap)(
|
|
322424
322503
|
(data) => GraphqlClienAPI.getLambdaByName(
|
|
322425
322504
|
cmd?.lambdaName ?? data?.function?.name ?? data?.name,
|
|
322426
322505
|
projectId
|
|
322427
322506
|
).pipe(
|
|
322428
|
-
(0,
|
|
322507
|
+
(0, import_operators39.map)((lambda) => {
|
|
322429
322508
|
const fromSpec = data?.triggers?.time ?? data;
|
|
322430
322509
|
return {
|
|
322431
322510
|
lambdaName: lambda.name,
|
|
@@ -322438,8 +322517,8 @@ var init_create_cron = __esm({
|
|
|
322438
322517
|
)
|
|
322439
322518
|
)
|
|
322440
322519
|
),
|
|
322441
|
-
(0,
|
|
322442
|
-
({ lambdaId, cron, triggerName, lambdaName }) => !cron || !triggerName ? (0,
|
|
322520
|
+
(0, import_operators39.switchMap)(
|
|
322521
|
+
({ lambdaId, cron, triggerName, lambdaName }) => !cron || !triggerName ? (0, import_rxjs59.throwError)(
|
|
322443
322522
|
() => new Error(
|
|
322444
322523
|
"cron:create needs --cron and --triggerName (or triggers.time.cron / triggerName in lambforge.yaml)"
|
|
322445
322524
|
)
|
|
@@ -322447,9 +322526,9 @@ var init_create_cron = __esm({
|
|
|
322447
322526
|
lambdaId,
|
|
322448
322527
|
cron,
|
|
322449
322528
|
triggerName
|
|
322450
|
-
}).pipe((0,
|
|
322529
|
+
}).pipe((0, import_operators39.map)((data) => ({ ...data, lambdaName })))
|
|
322451
322530
|
),
|
|
322452
|
-
(0,
|
|
322531
|
+
(0, import_operators39.tap)((data) => {
|
|
322453
322532
|
const columns = [
|
|
322454
322533
|
"id",
|
|
322455
322534
|
"lambdaName",
|
|
@@ -322472,25 +322551,25 @@ var delete_cron_exports = {};
|
|
|
322472
322551
|
__export(delete_cron_exports, {
|
|
322473
322552
|
default: () => delete_cron_default
|
|
322474
322553
|
});
|
|
322475
|
-
var
|
|
322554
|
+
var import_rxjs60, import_operators40, delete_cron_default;
|
|
322476
322555
|
var init_delete_cron = __esm({
|
|
322477
322556
|
"src/commands/triggers/cron/delete-cron.ts"() {
|
|
322478
|
-
|
|
322479
|
-
|
|
322557
|
+
import_rxjs60 = __toESM(require_cjs());
|
|
322558
|
+
import_operators40 = __toESM(require_operators());
|
|
322480
322559
|
init_helpers();
|
|
322481
322560
|
init_gql_client();
|
|
322482
322561
|
init_log();
|
|
322483
322562
|
init_load_spec();
|
|
322484
|
-
delete_cron_default = (cmd) => (0,
|
|
322563
|
+
delete_cron_default = (cmd) => (0, import_rxjs60.lastValueFrom)(
|
|
322485
322564
|
parseProjectId(cmd.project).pipe(
|
|
322486
|
-
(0,
|
|
322565
|
+
(0, import_operators40.switchMap)(
|
|
322487
322566
|
(projectId) => loadSpec(cmd.spec ?? "cron.yaml").pipe(
|
|
322488
|
-
(0,
|
|
322567
|
+
(0, import_operators40.switchMap)(
|
|
322489
322568
|
(data) => GraphqlClienAPI.getLambdaByName(
|
|
322490
322569
|
cmd?.lambdaName ?? data?.function?.name ?? data?.name,
|
|
322491
322570
|
projectId
|
|
322492
322571
|
).pipe(
|
|
322493
|
-
(0,
|
|
322572
|
+
(0, import_operators40.map)((lambda) => ({
|
|
322494
322573
|
lambdaName: lambda.name,
|
|
322495
322574
|
lambdaId: lambda.id
|
|
322496
322575
|
}))
|
|
@@ -322498,12 +322577,12 @@ var init_delete_cron = __esm({
|
|
|
322498
322577
|
)
|
|
322499
322578
|
)
|
|
322500
322579
|
),
|
|
322501
|
-
(0,
|
|
322580
|
+
(0, import_operators40.switchMap)(
|
|
322502
322581
|
({ lambdaId, lambdaName }) => GraphqlClienAPI.deleteLambdaTimeTrigger(lambdaId).pipe(
|
|
322503
|
-
(0,
|
|
322582
|
+
(0, import_operators40.map)((data) => ({ ...data, lambdaName }))
|
|
322504
322583
|
)
|
|
322505
322584
|
),
|
|
322506
|
-
(0,
|
|
322585
|
+
(0, import_operators40.tap)((data) => {
|
|
322507
322586
|
const columns = [
|
|
322508
322587
|
"id",
|
|
322509
322588
|
"lambdaName",
|
|
@@ -322525,29 +322604,29 @@ var list_crons_exports = {};
|
|
|
322525
322604
|
__export(list_crons_exports, {
|
|
322526
322605
|
default: () => list_crons_default
|
|
322527
322606
|
});
|
|
322528
|
-
var
|
|
322607
|
+
var import_rxjs61, import_operators41, list_crons_default;
|
|
322529
322608
|
var init_list_crons = __esm({
|
|
322530
322609
|
"src/commands/triggers/cron/list-crons.ts"() {
|
|
322531
|
-
|
|
322532
|
-
|
|
322610
|
+
import_rxjs61 = __toESM(require_cjs());
|
|
322611
|
+
import_operators41 = __toESM(require_operators());
|
|
322533
322612
|
init_helpers();
|
|
322534
322613
|
init_gql_client();
|
|
322535
322614
|
init_log();
|
|
322536
|
-
list_crons_default = (cmd) => (0,
|
|
322615
|
+
list_crons_default = (cmd) => (0, import_rxjs61.lastValueFrom)(
|
|
322537
322616
|
parseProjectId(cmd.project).pipe(
|
|
322538
|
-
(0,
|
|
322539
|
-
(projectId) => (0,
|
|
322617
|
+
(0, import_operators41.switchMap)(
|
|
322618
|
+
(projectId) => (0, import_rxjs61.combineLatest)([
|
|
322540
322619
|
GraphqlClienAPI.listProjectTimeTriggers(projectId),
|
|
322541
322620
|
GraphqlClienAPI.listLambdas(projectId)
|
|
322542
322621
|
])
|
|
322543
322622
|
),
|
|
322544
|
-
(0,
|
|
322623
|
+
(0, import_operators41.map)(
|
|
322545
322624
|
([triggers, lambdas]) => triggers.map((v) => ({
|
|
322546
322625
|
lambdaName: lambdas.find((l) => l.id === v.lambdaId)?.name,
|
|
322547
322626
|
...v
|
|
322548
322627
|
}))
|
|
322549
322628
|
),
|
|
322550
|
-
(0,
|
|
322629
|
+
(0, import_operators41.tap)((data) => {
|
|
322551
322630
|
const columns = [
|
|
322552
322631
|
"id",
|
|
322553
322632
|
"triggerName",
|
|
@@ -322569,20 +322648,20 @@ var list_exports7 = {};
|
|
|
322569
322648
|
__export(list_exports7, {
|
|
322570
322649
|
default: () => list_default7
|
|
322571
322650
|
});
|
|
322572
|
-
var
|
|
322651
|
+
var import_rxjs62, import_operators42, list_default7;
|
|
322573
322652
|
var init_list7 = __esm({
|
|
322574
322653
|
"src/commands/triggers/message-queue/list.ts"() {
|
|
322575
|
-
|
|
322576
|
-
|
|
322654
|
+
import_rxjs62 = __toESM(require_cjs());
|
|
322655
|
+
import_operators42 = __toESM(require_operators());
|
|
322577
322656
|
init_helpers();
|
|
322578
322657
|
init_gql_client();
|
|
322579
322658
|
init_log();
|
|
322580
|
-
list_default7 = (cmd) => (0,
|
|
322659
|
+
list_default7 = (cmd) => (0, import_rxjs62.lastValueFrom)(
|
|
322581
322660
|
parseProjectId(cmd.project).pipe(
|
|
322582
|
-
(0,
|
|
322661
|
+
(0, import_operators42.switchMap)(
|
|
322583
322662
|
(projectId) => GraphqlClienAPI.listMessageQueueTriggers(projectId)
|
|
322584
322663
|
),
|
|
322585
|
-
(0,
|
|
322664
|
+
(0, import_operators42.tap)((triggers) => {
|
|
322586
322665
|
Logger.log("-------------------");
|
|
322587
322666
|
Logger.log("[Action][listMessageQueueTriggers]");
|
|
322588
322667
|
if (!triggers?.length) {
|
|
@@ -322613,11 +322692,11 @@ __export(save_exports, {
|
|
|
322613
322692
|
mergeOverExisting: () => mergeOverExisting,
|
|
322614
322693
|
toTriggerInput: () => toTriggerInput
|
|
322615
322694
|
});
|
|
322616
|
-
var
|
|
322695
|
+
var import_rxjs63, import_operators43, int2, toTriggerInput, mergeOverExisting, save_default;
|
|
322617
322696
|
var init_save = __esm({
|
|
322618
322697
|
"src/commands/triggers/message-queue/save.ts"() {
|
|
322619
|
-
|
|
322620
|
-
|
|
322698
|
+
import_rxjs63 = __toESM(require_cjs());
|
|
322699
|
+
import_operators43 = __toESM(require_operators());
|
|
322621
322700
|
init_helpers();
|
|
322622
322701
|
init_gql_client();
|
|
322623
322702
|
init_log();
|
|
@@ -322679,12 +322758,12 @@ var init_save = __esm({
|
|
|
322679
322758
|
)
|
|
322680
322759
|
);
|
|
322681
322760
|
};
|
|
322682
|
-
save_default = (mode, cmd) => (0,
|
|
322761
|
+
save_default = (mode, cmd) => (0, import_rxjs63.lastValueFrom)(
|
|
322683
322762
|
parseProjectId(cmd.project).pipe(
|
|
322684
|
-
(0,
|
|
322763
|
+
(0, import_operators43.switchMap)((projectId) => {
|
|
322685
322764
|
const changes = toTriggerInput(mode, cmd);
|
|
322686
|
-
const payload$ = mode === "create" ? (0,
|
|
322687
|
-
(0,
|
|
322765
|
+
const payload$ = mode === "create" ? (0, import_rxjs63.of)(changes) : GraphqlClienAPI.listMessageQueueTriggers(projectId).pipe(
|
|
322766
|
+
(0, import_operators43.map)(
|
|
322688
322767
|
(triggers) => mergeOverExisting(
|
|
322689
322768
|
triggers.find((t2) => t2.name === cmd.name),
|
|
322690
322769
|
changes
|
|
@@ -322692,12 +322771,12 @@ var init_save = __esm({
|
|
|
322692
322771
|
)
|
|
322693
322772
|
);
|
|
322694
322773
|
return payload$.pipe(
|
|
322695
|
-
(0,
|
|
322774
|
+
(0, import_operators43.switchMap)(
|
|
322696
322775
|
(payload) => GraphqlClienAPI.saveMessageQueueTrigger(mode, projectId, payload)
|
|
322697
322776
|
)
|
|
322698
322777
|
);
|
|
322699
322778
|
}),
|
|
322700
|
-
(0,
|
|
322779
|
+
(0, import_operators43.tap)((trigger) => {
|
|
322701
322780
|
Logger.log("-------------------");
|
|
322702
322781
|
Logger.log(`[Action][${mode}MessageQueueTrigger]`);
|
|
322703
322782
|
Logger.table([
|
|
@@ -322723,11 +322802,11 @@ __export(apply_exports2, {
|
|
|
322723
322802
|
default: () => apply_default2,
|
|
322724
322803
|
yamlTriggerInput: () => yamlTriggerInput
|
|
322725
322804
|
});
|
|
322726
|
-
var
|
|
322805
|
+
var import_rxjs64, import_operators44, yamlTriggerInput, applyMode, apply_default2;
|
|
322727
322806
|
var init_apply2 = __esm({
|
|
322728
322807
|
"src/commands/triggers/message-queue/apply.ts"() {
|
|
322729
|
-
|
|
322730
|
-
|
|
322808
|
+
import_rxjs64 = __toESM(require_cjs());
|
|
322809
|
+
import_operators44 = __toESM(require_operators());
|
|
322731
322810
|
init_load_spec();
|
|
322732
322811
|
init_resolve_broker();
|
|
322733
322812
|
init_helpers();
|
|
@@ -322763,11 +322842,11 @@ var init_apply2 = __esm({
|
|
|
322763
322842
|
);
|
|
322764
322843
|
};
|
|
322765
322844
|
applyMode = (existing, name2) => existing.some((t2) => t2.name === name2) ? "update" : "create";
|
|
322766
|
-
apply_default2 = (cmd) => (0,
|
|
322845
|
+
apply_default2 = (cmd) => (0, import_rxjs64.lastValueFrom)(
|
|
322767
322846
|
parseProjectId(cmd.project).pipe(
|
|
322768
|
-
(0,
|
|
322847
|
+
(0, import_operators44.switchMap)(
|
|
322769
322848
|
(projectId) => loadSpec(cmd.spec).pipe(
|
|
322770
|
-
(0,
|
|
322849
|
+
(0, import_operators44.switchMap)((data) => {
|
|
322771
322850
|
const triggers = data?.triggers?.mq ?? [];
|
|
322772
322851
|
if (!triggers.length) {
|
|
322773
322852
|
throw new Error(
|
|
@@ -322775,10 +322854,10 @@ var init_apply2 = __esm({
|
|
|
322775
322854
|
);
|
|
322776
322855
|
}
|
|
322777
322856
|
return GraphqlClienAPI.listRabbitMqInstances(projectId).pipe(
|
|
322778
|
-
(0,
|
|
322857
|
+
(0, import_operators44.switchMap)(
|
|
322779
322858
|
(brokers) => GraphqlClienAPI.listMessageQueueTriggers(projectId).pipe(
|
|
322780
|
-
(0,
|
|
322781
|
-
(existing) => (0,
|
|
322859
|
+
(0, import_operators44.switchMap)(
|
|
322860
|
+
(existing) => (0, import_rxjs64.concat)(
|
|
322782
322861
|
...triggers.map((trigger) => {
|
|
322783
322862
|
const input = yamlTriggerInput(trigger, {
|
|
322784
322863
|
lambda: data?.function?.name ?? data?.name,
|
|
@@ -322795,9 +322874,9 @@ var init_apply2 = __esm({
|
|
|
322795
322874
|
existing.find((t2) => t2.name === input.name),
|
|
322796
322875
|
input
|
|
322797
322876
|
)
|
|
322798
|
-
).pipe((0,
|
|
322877
|
+
).pipe((0, import_operators44.map)((saved) => ({ mode, saved })));
|
|
322799
322878
|
})
|
|
322800
|
-
).pipe((0,
|
|
322879
|
+
).pipe((0, import_operators44.toArray)())
|
|
322801
322880
|
)
|
|
322802
322881
|
)
|
|
322803
322882
|
)
|
|
@@ -322805,7 +322884,7 @@ var init_apply2 = __esm({
|
|
|
322805
322884
|
})
|
|
322806
322885
|
)
|
|
322807
322886
|
),
|
|
322808
|
-
(0,
|
|
322887
|
+
(0, import_operators44.tap)((results) => {
|
|
322809
322888
|
Logger.log("-------------------");
|
|
322810
322889
|
Logger.log("[Action][applyMessageQueueTriggers]");
|
|
322811
322890
|
Logger.table(
|
|
@@ -322830,20 +322909,20 @@ var delete_exports4 = {};
|
|
|
322830
322909
|
__export(delete_exports4, {
|
|
322831
322910
|
default: () => delete_default4
|
|
322832
322911
|
});
|
|
322833
|
-
var
|
|
322912
|
+
var import_rxjs65, import_operators45, delete_default4;
|
|
322834
322913
|
var init_delete4 = __esm({
|
|
322835
322914
|
"src/commands/triggers/message-queue/delete.ts"() {
|
|
322836
|
-
|
|
322837
|
-
|
|
322915
|
+
import_rxjs65 = __toESM(require_cjs());
|
|
322916
|
+
import_operators45 = __toESM(require_operators());
|
|
322838
322917
|
init_helpers();
|
|
322839
322918
|
init_gql_client();
|
|
322840
322919
|
init_log();
|
|
322841
|
-
delete_default4 = (cmd) => (0,
|
|
322920
|
+
delete_default4 = (cmd) => (0, import_rxjs65.lastValueFrom)(
|
|
322842
322921
|
parseProjectId(cmd.project).pipe(
|
|
322843
|
-
(0,
|
|
322922
|
+
(0, import_operators45.switchMap)(
|
|
322844
322923
|
(projectId) => GraphqlClienAPI.deleteMessageQueueTrigger(projectId, cmd.name)
|
|
322845
322924
|
),
|
|
322846
|
-
(0,
|
|
322925
|
+
(0, import_operators45.tap)((trigger) => {
|
|
322847
322926
|
Logger.log("-------------------");
|
|
322848
322927
|
Logger.log("[Action][deleteMessageQueueTrigger]");
|
|
322849
322928
|
Logger.info(
|
|
@@ -322948,12 +323027,12 @@ var init_definition = __esm({
|
|
|
322948
323027
|
});
|
|
322949
323028
|
|
|
322950
323029
|
// src/commands/workflow/helpers.ts
|
|
322951
|
-
var import_promises7,
|
|
323030
|
+
var import_promises7, import_rxjs66, import_operators46, resolveWorkflow, withProject, readWorkflowFile, writeTextFile, POLL_MS, followRun, printRunResult;
|
|
322952
323031
|
var init_helpers4 = __esm({
|
|
322953
323032
|
"src/commands/workflow/helpers.ts"() {
|
|
322954
323033
|
import_promises7 = require("fs/promises");
|
|
322955
|
-
|
|
322956
|
-
|
|
323034
|
+
import_rxjs66 = __toESM(require_cjs());
|
|
323035
|
+
import_operators46 = __toESM(require_operators());
|
|
322957
323036
|
init_helpers();
|
|
322958
323037
|
init_gql_client();
|
|
322959
323038
|
init_log();
|
|
@@ -322963,7 +323042,7 @@ var init_helpers4 = __esm({
|
|
|
322963
323042
|
throw new Error("--name is required (see workflow:list)");
|
|
322964
323043
|
}
|
|
322965
323044
|
return GraphqlClienAPI.listWorkflows(projectId).pipe(
|
|
322966
|
-
(0,
|
|
323045
|
+
(0, import_operators46.map)((workflows) => {
|
|
322967
323046
|
const workflow = workflows.find((w) => w.name === name2 || w.id === name2);
|
|
322968
323047
|
if (!workflow) {
|
|
322969
323048
|
throw new Error(
|
|
@@ -322974,30 +323053,30 @@ var init_helpers4 = __esm({
|
|
|
322974
323053
|
})
|
|
322975
323054
|
);
|
|
322976
323055
|
};
|
|
322977
|
-
withProject = (project, fn) => (0,
|
|
323056
|
+
withProject = (project, fn) => (0, import_rxjs66.lastValueFrom)(parseProjectId(project).pipe((0, import_operators46.switchMap)(fn)));
|
|
322978
323057
|
readWorkflowFile = (path2) => {
|
|
322979
323058
|
if (!path2) {
|
|
322980
323059
|
throw new Error("--file is required (a workflow YAML or JSON file)");
|
|
322981
323060
|
}
|
|
322982
|
-
return (0,
|
|
323061
|
+
return (0, import_rxjs66.from)((0, import_promises7.readFile)(path2, "utf8")).pipe((0, import_operators46.map)(parseWorkflowFile));
|
|
322983
323062
|
};
|
|
322984
|
-
writeTextFile = (path2, text) => (0,
|
|
323063
|
+
writeTextFile = (path2, text) => (0, import_rxjs66.from)((0, import_promises7.writeFile)(path2, text, "utf8"));
|
|
322985
323064
|
POLL_MS = 2e3;
|
|
322986
323065
|
followRun = (projectId, workflowId, runName) => {
|
|
322987
323066
|
let printed = 0;
|
|
322988
|
-
return (0,
|
|
322989
|
-
(0,
|
|
323067
|
+
return (0, import_rxjs66.timer)(0, POLL_MS).pipe(
|
|
323068
|
+
(0, import_operators46.switchMap)(
|
|
322990
323069
|
() => GraphqlClienAPI.getWorkflowRun(projectId, workflowId, runName)
|
|
322991
323070
|
),
|
|
322992
|
-
(0,
|
|
323071
|
+
(0, import_operators46.tap)((run2) => {
|
|
322993
323072
|
for (const e2 of newEvents(run2, printed)) {
|
|
322994
323073
|
Logger.log(formatEvent(e2));
|
|
322995
323074
|
printed = Math.max(printed, e2.seq);
|
|
322996
323075
|
}
|
|
322997
323076
|
}),
|
|
322998
|
-
(0,
|
|
322999
|
-
(0,
|
|
323000
|
-
(0,
|
|
323077
|
+
(0, import_operators46.filter)((run2) => isTerminal2(run2.phase)),
|
|
323078
|
+
(0, import_operators46.take)(1),
|
|
323079
|
+
(0, import_operators46.tap)(printRunResult)
|
|
323001
323080
|
);
|
|
323002
323081
|
};
|
|
323003
323082
|
printRunResult = (run2) => {
|
|
@@ -323020,10 +323099,10 @@ var list_exports8 = {};
|
|
|
323020
323099
|
__export(list_exports8, {
|
|
323021
323100
|
default: () => list_default8
|
|
323022
323101
|
});
|
|
323023
|
-
var
|
|
323102
|
+
var import_operators47, list_default8;
|
|
323024
323103
|
var init_list8 = __esm({
|
|
323025
323104
|
"src/commands/workflow/list.ts"() {
|
|
323026
|
-
|
|
323105
|
+
import_operators47 = __toESM(require_operators());
|
|
323027
323106
|
init_gql_client();
|
|
323028
323107
|
init_log();
|
|
323029
323108
|
init_definition();
|
|
@@ -323031,7 +323110,7 @@ var init_list8 = __esm({
|
|
|
323031
323110
|
list_default8 = (cmd) => withProject(
|
|
323032
323111
|
cmd.project,
|
|
323033
323112
|
(projectId) => GraphqlClienAPI.listWorkflows(projectId).pipe(
|
|
323034
|
-
(0,
|
|
323113
|
+
(0, import_operators47.tap)((workflows) => {
|
|
323035
323114
|
if (!workflows.length) {
|
|
323036
323115
|
Logger.info(
|
|
323037
323116
|
"No workflows yet. Draft one with workflow:generate, or write a file and workflow:apply it."
|
|
@@ -323058,18 +323137,18 @@ var get_exports2 = {};
|
|
|
323058
323137
|
__export(get_exports2, {
|
|
323059
323138
|
default: () => get_default2
|
|
323060
323139
|
});
|
|
323061
|
-
var
|
|
323140
|
+
var import_rxjs67, import_operators48, get_default2;
|
|
323062
323141
|
var init_get2 = __esm({
|
|
323063
323142
|
"src/commands/workflow/get.ts"() {
|
|
323064
|
-
|
|
323065
|
-
|
|
323143
|
+
import_rxjs67 = __toESM(require_cjs());
|
|
323144
|
+
import_operators48 = __toESM(require_operators());
|
|
323066
323145
|
init_log();
|
|
323067
323146
|
init_definition();
|
|
323068
323147
|
init_helpers4();
|
|
323069
323148
|
get_default2 = (cmd) => withProject(
|
|
323070
323149
|
cmd.project,
|
|
323071
323150
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323072
|
-
(0,
|
|
323151
|
+
(0, import_operators48.switchMap)((w) => {
|
|
323073
323152
|
const text = toWorkflowYaml({
|
|
323074
323153
|
name: w.name,
|
|
323075
323154
|
description: w.description ?? void 0,
|
|
@@ -323077,10 +323156,10 @@ var init_get2 = __esm({
|
|
|
323077
323156
|
});
|
|
323078
323157
|
if (!cmd.out) {
|
|
323079
323158
|
Logger.log(text);
|
|
323080
|
-
return (0,
|
|
323159
|
+
return (0, import_rxjs67.of)(null);
|
|
323081
323160
|
}
|
|
323082
323161
|
return writeTextFile(cmd.out, text).pipe(
|
|
323083
|
-
(0,
|
|
323162
|
+
(0, import_operators48.tap)(() => Logger.info(`Wrote ${cmd.out}`))
|
|
323084
323163
|
);
|
|
323085
323164
|
})
|
|
323086
323165
|
)
|
|
@@ -323094,10 +323173,10 @@ __export(apply_exports3, {
|
|
|
323094
323173
|
applyWorkflow: () => applyWorkflow,
|
|
323095
323174
|
default: () => apply_default3
|
|
323096
323175
|
});
|
|
323097
|
-
var
|
|
323176
|
+
var import_operators49, applyWorkflow, apply_default3;
|
|
323098
323177
|
var init_apply3 = __esm({
|
|
323099
323178
|
"src/commands/workflow/apply.ts"() {
|
|
323100
|
-
|
|
323179
|
+
import_operators49 = __toESM(require_operators());
|
|
323101
323180
|
init_gql_client();
|
|
323102
323181
|
init_log();
|
|
323103
323182
|
init_helpers4();
|
|
@@ -323108,7 +323187,7 @@ var init_apply3 = __esm({
|
|
|
323108
323187
|
);
|
|
323109
323188
|
}
|
|
323110
323189
|
return GraphqlClienAPI.listWorkflows(projectId).pipe(
|
|
323111
|
-
(0,
|
|
323190
|
+
(0, import_operators49.switchMap)((workflows) => {
|
|
323112
323191
|
const existing = workflows.find((w) => w.name === file2.name);
|
|
323113
323192
|
return existing ? GraphqlClienAPI.updateWorkflow(projectId, existing.id, {
|
|
323114
323193
|
description: file2.description,
|
|
@@ -323120,7 +323199,7 @@ var init_apply3 = __esm({
|
|
|
323120
323199
|
clusterId: file2.clusterId
|
|
323121
323200
|
});
|
|
323122
323201
|
}),
|
|
323123
|
-
(0,
|
|
323202
|
+
(0, import_operators49.tap)(
|
|
323124
323203
|
(w) => Logger.info(
|
|
323125
323204
|
`Workflow ${w.name} saved (${Object.keys(w.definition?.states ?? {}).length} steps). Run it: gcli workflow:run --name ${w.name} --wait`
|
|
323126
323205
|
)
|
|
@@ -323130,7 +323209,7 @@ var init_apply3 = __esm({
|
|
|
323130
323209
|
apply_default3 = (cmd) => withProject(
|
|
323131
323210
|
cmd.project,
|
|
323132
323211
|
(projectId) => readWorkflowFile(cmd.file).pipe(
|
|
323133
|
-
(0,
|
|
323212
|
+
(0, import_operators49.switchMap)(
|
|
323134
323213
|
(file2) => applyWorkflow(projectId, {
|
|
323135
323214
|
...file2,
|
|
323136
323215
|
name: cmd.name ?? file2.name,
|
|
@@ -323147,12 +323226,12 @@ var generate_exports = {};
|
|
|
323147
323226
|
__export(generate_exports, {
|
|
323148
323227
|
default: () => generate_default
|
|
323149
323228
|
});
|
|
323150
|
-
var import_promises8,
|
|
323229
|
+
var import_promises8, import_rxjs68, import_operators50, generate_default;
|
|
323151
323230
|
var init_generate = __esm({
|
|
323152
323231
|
"src/commands/workflow/generate.ts"() {
|
|
323153
323232
|
import_promises8 = require("fs/promises");
|
|
323154
|
-
|
|
323155
|
-
|
|
323233
|
+
import_rxjs68 = __toESM(require_cjs());
|
|
323234
|
+
import_operators50 = __toESM(require_operators());
|
|
323156
323235
|
init_gql_client();
|
|
323157
323236
|
init_log();
|
|
323158
323237
|
init_apply3();
|
|
@@ -323164,26 +323243,26 @@ var init_generate = __esm({
|
|
|
323164
323243
|
'Describe the workflow: --description "charge the card with retries, then email the receipt"'
|
|
323165
323244
|
);
|
|
323166
323245
|
}
|
|
323167
|
-
const base$ = cmd.from ? (0,
|
|
323168
|
-
(0,
|
|
323246
|
+
const base$ = cmd.from ? (0, import_rxjs68.from)((0, import_promises8.readFile)(cmd.from, "utf8")).pipe((0, import_operators50.map)(parseWorkflowFile)) : cmd.name ? GraphqlClienAPI.listWorkflows(projectId).pipe(
|
|
323247
|
+
(0, import_operators50.switchMap)(
|
|
323169
323248
|
(workflows) => workflows.some((w) => w.name === cmd.name) ? resolveWorkflow(projectId, cmd.name).pipe(
|
|
323170
|
-
(0,
|
|
323249
|
+
(0, import_operators50.map)((w) => ({
|
|
323171
323250
|
name: w.name,
|
|
323172
323251
|
description: w.description ?? void 0,
|
|
323173
323252
|
definition: w.definition
|
|
323174
323253
|
}))
|
|
323175
|
-
) : (0,
|
|
323254
|
+
) : (0, import_rxjs68.of)(null)
|
|
323176
323255
|
)
|
|
323177
|
-
) : (0,
|
|
323256
|
+
) : (0, import_rxjs68.of)(null);
|
|
323178
323257
|
return base$.pipe(
|
|
323179
|
-
(0,
|
|
323180
|
-
(0,
|
|
323258
|
+
(0, import_operators50.tap)(() => Logger.info("Asking the AI for a draft...")),
|
|
323259
|
+
(0, import_operators50.switchMap)(
|
|
323181
323260
|
(base) => GraphqlClienAPI.generateWorkflowDraft(
|
|
323182
323261
|
projectId,
|
|
323183
323262
|
cmd.description,
|
|
323184
323263
|
base?.definition
|
|
323185
323264
|
).pipe(
|
|
323186
|
-
(0,
|
|
323265
|
+
(0, import_operators50.map)((draft) => ({
|
|
323187
323266
|
draft,
|
|
323188
323267
|
file: {
|
|
323189
323268
|
name: cmd.name ?? base?.name,
|
|
@@ -323193,19 +323272,19 @@ var init_generate = __esm({
|
|
|
323193
323272
|
}))
|
|
323194
323273
|
)
|
|
323195
323274
|
),
|
|
323196
|
-
(0,
|
|
323275
|
+
(0, import_operators50.tap)(({ draft }) => {
|
|
323197
323276
|
if (draft.explanation) Logger.log(draft.explanation);
|
|
323198
323277
|
(draft.warnings ?? []).filter(Boolean).forEach((w) => Logger.warn(`- ${w}`));
|
|
323199
323278
|
}),
|
|
323200
|
-
(0,
|
|
323279
|
+
(0, import_operators50.switchMap)(({ file: file2 }) => {
|
|
323201
323280
|
const text = toWorkflowYaml(file2);
|
|
323202
323281
|
const written$ = cmd.out ? writeTextFile(cmd.out, text).pipe(
|
|
323203
|
-
(0,
|
|
323204
|
-
) : (0,
|
|
323282
|
+
(0, import_operators50.tap)(() => Logger.info(`Wrote ${cmd.out}`))
|
|
323283
|
+
) : (0, import_rxjs68.of)(null).pipe((0, import_operators50.tap)(() => !cmd.apply && Logger.log(text)));
|
|
323205
323284
|
return written$.pipe(
|
|
323206
|
-
(0,
|
|
323207
|
-
() => cmd.apply ? applyWorkflow(projectId, file2) : (0,
|
|
323208
|
-
(0,
|
|
323285
|
+
(0, import_operators50.switchMap)(
|
|
323286
|
+
() => cmd.apply ? applyWorkflow(projectId, file2) : (0, import_rxjs68.of)(null).pipe(
|
|
323287
|
+
(0, import_operators50.tap)(
|
|
323209
323288
|
() => Logger.info(
|
|
323210
323289
|
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>"
|
|
323211
323290
|
)
|
|
@@ -323224,24 +323303,24 @@ var validate_exports = {};
|
|
|
323224
323303
|
__export(validate_exports, {
|
|
323225
323304
|
default: () => validate_default
|
|
323226
323305
|
});
|
|
323227
|
-
var
|
|
323306
|
+
var import_operators51, validate_default;
|
|
323228
323307
|
var init_validate = __esm({
|
|
323229
323308
|
"src/commands/workflow/validate.ts"() {
|
|
323230
|
-
|
|
323309
|
+
import_operators51 = __toESM(require_operators());
|
|
323231
323310
|
init_gql_client();
|
|
323232
323311
|
init_log();
|
|
323233
323312
|
init_helpers4();
|
|
323234
323313
|
validate_default = (cmd) => withProject(
|
|
323235
323314
|
cmd.project,
|
|
323236
323315
|
(projectId) => readWorkflowFile(cmd.file).pipe(
|
|
323237
|
-
(0,
|
|
323316
|
+
(0, import_operators51.switchMap)(
|
|
323238
323317
|
(file2) => GraphqlClienAPI.validateWorkflow(
|
|
323239
323318
|
projectId,
|
|
323240
323319
|
file2.definition,
|
|
323241
323320
|
file2.clusterId
|
|
323242
323321
|
)
|
|
323243
323322
|
),
|
|
323244
|
-
(0,
|
|
323323
|
+
(0, import_operators51.tap)(
|
|
323245
323324
|
(v) => Logger.info(
|
|
323246
323325
|
`Valid. Calls: ${(v.functions ?? []).join(", ") || "no lambdas"}`
|
|
323247
323326
|
)
|
|
@@ -323256,18 +323335,18 @@ var delete_exports5 = {};
|
|
|
323256
323335
|
__export(delete_exports5, {
|
|
323257
323336
|
default: () => delete_default5
|
|
323258
323337
|
});
|
|
323259
|
-
var
|
|
323338
|
+
var import_operators52, delete_default5;
|
|
323260
323339
|
var init_delete5 = __esm({
|
|
323261
323340
|
"src/commands/workflow/delete.ts"() {
|
|
323262
|
-
|
|
323341
|
+
import_operators52 = __toESM(require_operators());
|
|
323263
323342
|
init_gql_client();
|
|
323264
323343
|
init_log();
|
|
323265
323344
|
init_helpers4();
|
|
323266
323345
|
delete_default5 = (cmd) => withProject(
|
|
323267
323346
|
cmd.project,
|
|
323268
323347
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323269
|
-
(0,
|
|
323270
|
-
(0,
|
|
323348
|
+
(0, import_operators52.switchMap)((w) => GraphqlClienAPI.deleteWorkflow(projectId, w.id)),
|
|
323349
|
+
(0, import_operators52.tap)((w) => Logger.info(`Deleted workflow ${w.name} and its runs`))
|
|
323271
323350
|
)
|
|
323272
323351
|
);
|
|
323273
323352
|
}
|
|
@@ -323278,28 +323357,28 @@ var run_exports = {};
|
|
|
323278
323357
|
__export(run_exports, {
|
|
323279
323358
|
default: () => run_default
|
|
323280
323359
|
});
|
|
323281
|
-
var import_promises9,
|
|
323360
|
+
var import_promises9, import_rxjs69, import_operators53, run_default;
|
|
323282
323361
|
var init_run = __esm({
|
|
323283
323362
|
"src/commands/workflow/run.ts"() {
|
|
323284
323363
|
import_promises9 = require("fs/promises");
|
|
323285
|
-
|
|
323286
|
-
|
|
323364
|
+
import_rxjs69 = __toESM(require_cjs());
|
|
323365
|
+
import_operators53 = __toESM(require_operators());
|
|
323287
323366
|
init_gql_client();
|
|
323288
323367
|
init_log();
|
|
323289
323368
|
init_definition();
|
|
323290
323369
|
init_helpers4();
|
|
323291
323370
|
run_default = (cmd) => withProject(
|
|
323292
323371
|
cmd.project,
|
|
323293
|
-
(projectId) => (cmd.inputFile ? (0,
|
|
323294
|
-
(0,
|
|
323295
|
-
(0,
|
|
323372
|
+
(projectId) => (cmd.inputFile ? (0, import_rxjs69.from)((0, import_promises9.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs69.of)(cmd.input)).pipe(
|
|
323373
|
+
(0, import_operators53.map)(parseRunInput),
|
|
323374
|
+
(0, import_operators53.switchMap)(
|
|
323296
323375
|
(input) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323297
|
-
(0,
|
|
323376
|
+
(0, import_operators53.switchMap)(
|
|
323298
323377
|
(w) => GraphqlClienAPI.startWorkflowRun(projectId, w.id, input).pipe(
|
|
323299
|
-
(0,
|
|
323300
|
-
(0,
|
|
323301
|
-
(run2) => cmd.wait ? followRun(projectId, w.id, run2.name) : (0,
|
|
323302
|
-
(0,
|
|
323378
|
+
(0, import_operators53.tap)((run2) => Logger.info(`Started run ${run2.name}`)),
|
|
323379
|
+
(0, import_operators53.switchMap)(
|
|
323380
|
+
(run2) => cmd.wait ? followRun(projectId, w.id, run2.name) : (0, import_rxjs69.of)(run2).pipe(
|
|
323381
|
+
(0, import_operators53.tap)(
|
|
323303
323382
|
() => Logger.info(
|
|
323304
323383
|
`Follow it: gcli workflow:status --name ${w.name} --run ${run2.name} --follow`
|
|
323305
323384
|
)
|
|
@@ -323375,10 +323454,10 @@ var runs_exports = {};
|
|
|
323375
323454
|
__export(runs_exports, {
|
|
323376
323455
|
default: () => runs_default
|
|
323377
323456
|
});
|
|
323378
|
-
var
|
|
323457
|
+
var import_operators54, runs_default;
|
|
323379
323458
|
var init_runs = __esm({
|
|
323380
323459
|
"src/commands/workflow/runs.ts"() {
|
|
323381
|
-
|
|
323460
|
+
import_operators54 = __toESM(require_operators());
|
|
323382
323461
|
init_gql_client();
|
|
323383
323462
|
init_log();
|
|
323384
323463
|
init_helpers4();
|
|
@@ -323386,14 +323465,14 @@ var init_runs = __esm({
|
|
|
323386
323465
|
runs_default = (cmd) => withProject(
|
|
323387
323466
|
cmd.project,
|
|
323388
323467
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323389
|
-
(0,
|
|
323468
|
+
(0, import_operators54.switchMap)(
|
|
323390
323469
|
(w) => GraphqlClienAPI.listWorkflowRuns(
|
|
323391
323470
|
projectId,
|
|
323392
323471
|
w.id,
|
|
323393
323472
|
cmd.limit ? Number(cmd.limit) : void 0
|
|
323394
323473
|
)
|
|
323395
323474
|
),
|
|
323396
|
-
(0,
|
|
323475
|
+
(0, import_operators54.tap)(
|
|
323397
323476
|
(runs) => runs.length ? Logger.table(
|
|
323398
323477
|
runs.map((r2) => ({
|
|
323399
323478
|
run: r2.name,
|
|
@@ -323415,10 +323494,10 @@ var status_exports2 = {};
|
|
|
323415
323494
|
__export(status_exports2, {
|
|
323416
323495
|
default: () => status_default2
|
|
323417
323496
|
});
|
|
323418
|
-
var
|
|
323497
|
+
var import_operators55, status_default2;
|
|
323419
323498
|
var init_status2 = __esm({
|
|
323420
323499
|
"src/commands/workflow/status.ts"() {
|
|
323421
|
-
|
|
323500
|
+
import_operators55 = __toESM(require_operators());
|
|
323422
323501
|
init_gql_client();
|
|
323423
323502
|
init_log();
|
|
323424
323503
|
init_definition();
|
|
@@ -323428,9 +323507,9 @@ var init_status2 = __esm({
|
|
|
323428
323507
|
throw new Error("--run is required (see workflow:runs)");
|
|
323429
323508
|
}
|
|
323430
323509
|
return resolveWorkflow(projectId, cmd.name).pipe(
|
|
323431
|
-
(0,
|
|
323510
|
+
(0, import_operators55.switchMap)(
|
|
323432
323511
|
(w) => cmd.follow ? followRun(projectId, w.id, cmd.run) : GraphqlClienAPI.getWorkflowRun(projectId, w.id, cmd.run).pipe(
|
|
323433
|
-
(0,
|
|
323512
|
+
(0, import_operators55.tap)((run2) => {
|
|
323434
323513
|
(run2.events ?? []).forEach((e2) => Logger.log(formatEvent(e2)));
|
|
323435
323514
|
printRunResult(run2);
|
|
323436
323515
|
})
|
|
@@ -323446,10 +323525,10 @@ var cancel_exports = {};
|
|
|
323446
323525
|
__export(cancel_exports, {
|
|
323447
323526
|
default: () => cancel_default
|
|
323448
323527
|
});
|
|
323449
|
-
var
|
|
323528
|
+
var import_operators56, cancel_default;
|
|
323450
323529
|
var init_cancel = __esm({
|
|
323451
323530
|
"src/commands/workflow/cancel.ts"() {
|
|
323452
|
-
|
|
323531
|
+
import_operators56 = __toESM(require_operators());
|
|
323453
323532
|
init_gql_client();
|
|
323454
323533
|
init_log();
|
|
323455
323534
|
init_helpers4();
|
|
@@ -323458,10 +323537,10 @@ var init_cancel = __esm({
|
|
|
323458
323537
|
throw new Error("--run is required (see workflow:runs)");
|
|
323459
323538
|
}
|
|
323460
323539
|
return resolveWorkflow(projectId, cmd.name).pipe(
|
|
323461
|
-
(0,
|
|
323540
|
+
(0, import_operators56.switchMap)(
|
|
323462
323541
|
(w) => GraphqlClienAPI.cancelWorkflowRun(projectId, w.id, cmd.run)
|
|
323463
323542
|
),
|
|
323464
|
-
(0,
|
|
323543
|
+
(0, import_operators56.tap)((run2) => Logger.info(`Run ${run2.name}: ${run2.phase}`))
|
|
323465
323544
|
);
|
|
323466
323545
|
});
|
|
323467
323546
|
}
|
|
@@ -323472,30 +323551,30 @@ var trigger_add_exports = {};
|
|
|
323472
323551
|
__export(trigger_add_exports, {
|
|
323473
323552
|
default: () => trigger_add_default
|
|
323474
323553
|
});
|
|
323475
|
-
var import_promises10,
|
|
323554
|
+
var import_promises10, import_rxjs70, import_operators57, trigger_add_default;
|
|
323476
323555
|
var init_trigger_add = __esm({
|
|
323477
323556
|
"src/commands/workflow/trigger-add.ts"() {
|
|
323478
323557
|
import_promises10 = require("fs/promises");
|
|
323479
|
-
|
|
323480
|
-
|
|
323558
|
+
import_rxjs70 = __toESM(require_cjs());
|
|
323559
|
+
import_operators57 = __toESM(require_operators());
|
|
323481
323560
|
init_gql_client();
|
|
323482
323561
|
init_log();
|
|
323483
323562
|
init_helpers4();
|
|
323484
323563
|
init_triggers();
|
|
323485
323564
|
trigger_add_default = (cmd) => withProject(
|
|
323486
323565
|
cmd.project,
|
|
323487
|
-
(projectId) => (cmd.inputFile ? (0,
|
|
323488
|
-
(0,
|
|
323489
|
-
(0,
|
|
323566
|
+
(projectId) => (cmd.inputFile ? (0, import_rxjs70.from)((0, import_promises10.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs70.of)(void 0)).pipe(
|
|
323567
|
+
(0, import_operators57.map)((inputText) => buildTriggerInput({ ...cmd, inputText })),
|
|
323568
|
+
(0, import_operators57.switchMap)(
|
|
323490
323569
|
(trigger) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323491
|
-
(0,
|
|
323570
|
+
(0, import_operators57.switchMap)(
|
|
323492
323571
|
(w) => GraphqlClienAPI.addWorkflowTrigger(projectId, w.id, trigger).pipe(
|
|
323493
|
-
(0,
|
|
323572
|
+
(0, import_operators57.map)((updated) => ({ before: w.triggers ?? [], updated }))
|
|
323494
323573
|
)
|
|
323495
323574
|
)
|
|
323496
323575
|
)
|
|
323497
323576
|
),
|
|
323498
|
-
(0,
|
|
323577
|
+
(0, import_operators57.tap)(({ before, updated }) => {
|
|
323499
323578
|
const added = (updated.triggers ?? []).find(
|
|
323500
323579
|
(t2) => !before.some((b) => b.id === t2.id)
|
|
323501
323580
|
);
|
|
@@ -323519,17 +323598,17 @@ var trigger_list_exports = {};
|
|
|
323519
323598
|
__export(trigger_list_exports, {
|
|
323520
323599
|
default: () => trigger_list_default
|
|
323521
323600
|
});
|
|
323522
|
-
var
|
|
323601
|
+
var import_operators58, trigger_list_default;
|
|
323523
323602
|
var init_trigger_list = __esm({
|
|
323524
323603
|
"src/commands/workflow/trigger-list.ts"() {
|
|
323525
|
-
|
|
323604
|
+
import_operators58 = __toESM(require_operators());
|
|
323526
323605
|
init_log();
|
|
323527
323606
|
init_helpers4();
|
|
323528
323607
|
init_triggers();
|
|
323529
323608
|
trigger_list_default = (cmd) => withProject(
|
|
323530
323609
|
cmd.project,
|
|
323531
323610
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323532
|
-
(0,
|
|
323611
|
+
(0, import_operators58.tap)(
|
|
323533
323612
|
(w) => w.triggers?.length ? Logger.table(w.triggers.map(triggerRow)) : Logger.info(
|
|
323534
323613
|
'No triggers. Add one with workflow:trigger:add --http or --cron "@daily".'
|
|
323535
323614
|
)
|
|
@@ -323544,10 +323623,10 @@ var trigger_remove_exports = {};
|
|
|
323544
323623
|
__export(trigger_remove_exports, {
|
|
323545
323624
|
default: () => trigger_remove_default
|
|
323546
323625
|
});
|
|
323547
|
-
var
|
|
323626
|
+
var import_operators59, trigger_remove_default;
|
|
323548
323627
|
var init_trigger_remove = __esm({
|
|
323549
323628
|
"src/commands/workflow/trigger-remove.ts"() {
|
|
323550
|
-
|
|
323629
|
+
import_operators59 = __toESM(require_operators());
|
|
323551
323630
|
init_gql_client();
|
|
323552
323631
|
init_log();
|
|
323553
323632
|
init_helpers4();
|
|
@@ -323555,14 +323634,14 @@ var init_trigger_remove = __esm({
|
|
|
323555
323634
|
trigger_remove_default = (cmd) => withProject(
|
|
323556
323635
|
cmd.project,
|
|
323557
323636
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323558
|
-
(0,
|
|
323637
|
+
(0, import_operators59.switchMap)(
|
|
323559
323638
|
(w) => GraphqlClienAPI.removeWorkflowTrigger(
|
|
323560
323639
|
projectId,
|
|
323561
323640
|
w.id,
|
|
323562
323641
|
findTrigger(w.triggers, cmd.trigger).id
|
|
323563
323642
|
)
|
|
323564
323643
|
),
|
|
323565
|
-
(0,
|
|
323644
|
+
(0, import_operators59.tap)(
|
|
323566
323645
|
(w) => Logger.info(
|
|
323567
323646
|
`Trigger removed from ${w.name} (${w.triggers?.length ?? 0} left)`
|
|
323568
323647
|
)
|
|
@@ -324659,15 +324738,15 @@ function kill(child) {
|
|
|
324659
324738
|
} catch {
|
|
324660
324739
|
}
|
|
324661
324740
|
}
|
|
324662
|
-
var import_child_process8, import_crypto3, import_fs13, import_path8,
|
|
324741
|
+
var import_child_process8, import_crypto3, import_fs13, import_path8, import_rxjs71, import_operators60, MAX_SESSIONS, WATCH_BATCH_MS, TerminalManager;
|
|
324663
324742
|
var init_terminals = __esm({
|
|
324664
324743
|
"src/commands/workspace/terminals.ts"() {
|
|
324665
324744
|
import_child_process8 = require("child_process");
|
|
324666
324745
|
import_crypto3 = require("crypto");
|
|
324667
324746
|
import_fs13 = require("fs");
|
|
324668
324747
|
import_path8 = require("path");
|
|
324669
|
-
|
|
324670
|
-
|
|
324748
|
+
import_rxjs71 = __toESM(require_cjs());
|
|
324749
|
+
import_operators60 = __toESM(require_operators());
|
|
324671
324750
|
init_files();
|
|
324672
324751
|
MAX_SESSIONS = 4;
|
|
324673
324752
|
WATCH_BATCH_MS = 150;
|
|
@@ -324681,7 +324760,7 @@ var init_terminals = __esm({
|
|
|
324681
324760
|
this.root = root;
|
|
324682
324761
|
this.env = env;
|
|
324683
324762
|
this.notIgnored = notIgnored;
|
|
324684
|
-
this.events$ = new
|
|
324763
|
+
this.events$ = new import_rxjs71.Subject();
|
|
324685
324764
|
/** shells (`terminal/*`) */
|
|
324686
324765
|
this.sessions = /* @__PURE__ */ new Map();
|
|
324687
324766
|
/** file watches (`watch/*`) - the open editor, terminal or not */
|
|
@@ -324781,12 +324860,12 @@ ${e2.message}\r
|
|
|
324781
324860
|
this.unwatch(oldest);
|
|
324782
324861
|
}
|
|
324783
324862
|
const sessionId = (0, import_crypto3.randomUUID)();
|
|
324784
|
-
const changed$ = new
|
|
324863
|
+
const changed$ = new import_rxjs71.Subject();
|
|
324785
324864
|
const changes = changed$.pipe(
|
|
324786
|
-
(0,
|
|
324787
|
-
(0,
|
|
324788
|
-
(0,
|
|
324789
|
-
(0,
|
|
324865
|
+
(0, import_operators60.bufferTime)(WATCH_BATCH_MS),
|
|
324866
|
+
(0, import_operators60.filter)((paths) => paths.length > 0),
|
|
324867
|
+
(0, import_operators60.concatMap)((paths) => (0, import_rxjs71.from)(this.notIgnored([...new Set(paths)]))),
|
|
324868
|
+
(0, import_operators60.mergeMap)((paths) => (0, import_rxjs71.from)(paths))
|
|
324790
324869
|
).subscribe(
|
|
324791
324870
|
(path2) => this.events$.next({ sessionId, kind: "changed", data: path2 })
|
|
324792
324871
|
);
|
|
@@ -324828,12 +324907,12 @@ ${e2.message}\r
|
|
|
324828
324907
|
});
|
|
324829
324908
|
|
|
324830
324909
|
// src/commands/workspace/connection.ts
|
|
324831
|
-
var import_os7,
|
|
324910
|
+
var import_os7, import_rxjs72, import_operators61, WORKSPACE_PATH_PREFIX, WORKSPACE_OPS, HEARTBEAT_MUTATION2, REQUEST_APPROVAL_MUTATION, PUSH_TERMINAL_MUTATION, SETTLE_APPROVAL_MUTATION, str, num2, short, WorkspaceConnection;
|
|
324832
324911
|
var init_connection2 = __esm({
|
|
324833
324912
|
"src/commands/workspace/connection.ts"() {
|
|
324834
324913
|
import_os7 = require("os");
|
|
324835
|
-
|
|
324836
|
-
|
|
324914
|
+
import_rxjs72 = __toESM(require_cjs());
|
|
324915
|
+
import_operators61 = __toESM(require_operators());
|
|
324837
324916
|
init_tunnel();
|
|
324838
324917
|
init_approvals();
|
|
324839
324918
|
init_files();
|
|
@@ -324887,11 +324966,11 @@ var init_connection2 = __esm({
|
|
|
324887
324966
|
(paths) => this.files.notIgnored(paths)
|
|
324888
324967
|
);
|
|
324889
324968
|
this.terminals.events$.pipe(
|
|
324890
|
-
(0,
|
|
324891
|
-
(0,
|
|
324892
|
-
(0,
|
|
324893
|
-
(events) => (0,
|
|
324894
|
-
(0,
|
|
324969
|
+
(0, import_operators61.bufferTime)(40),
|
|
324970
|
+
(0, import_operators61.filter)((events) => events.length > 0),
|
|
324971
|
+
(0, import_operators61.concatMap)(
|
|
324972
|
+
(events) => (0, import_rxjs72.from)(this.operation(PUSH_TERMINAL_MUTATION, { events })).pipe(
|
|
324973
|
+
(0, import_operators61.catchError)(() => import_rxjs72.EMPTY)
|
|
324895
324974
|
)
|
|
324896
324975
|
)
|
|
324897
324976
|
).subscribe();
|
|
@@ -325303,12 +325382,12 @@ __export(start_exports4, {
|
|
|
325303
325382
|
WORKSPACE_VERSION: () => WORKSPACE_VERSION,
|
|
325304
325383
|
default: () => start_default2
|
|
325305
325384
|
});
|
|
325306
|
-
var import_promises12, import_path9,
|
|
325385
|
+
var import_promises12, import_path9, import_rxjs73, WORKSPACE_VERSION, csv, resolveWorkspace, start_default2;
|
|
325307
325386
|
var init_start4 = __esm({
|
|
325308
325387
|
"src/commands/workspace/start.ts"() {
|
|
325309
325388
|
import_promises12 = require("fs/promises");
|
|
325310
325389
|
import_path9 = require("path");
|
|
325311
|
-
|
|
325390
|
+
import_rxjs73 = __toESM(require_cjs());
|
|
325312
325391
|
init_helpers();
|
|
325313
325392
|
init_gql_client();
|
|
325314
325393
|
init_log();
|
|
@@ -325338,7 +325417,7 @@ var init_start4 = __esm({
|
|
|
325338
325417
|
if (saved && (!cmd.project || cmd.project === saved.projectId)) {
|
|
325339
325418
|
return saved;
|
|
325340
325419
|
}
|
|
325341
|
-
const projectId = await (0,
|
|
325420
|
+
const projectId = await (0, import_rxjs73.lastValueFrom)(parseProjectId(cmd.project)).catch(
|
|
325342
325421
|
() => {
|
|
325343
325422
|
throw new Error(
|
|
325344
325423
|
"No project selected. Pass --project <projectId> or run `gcli project:use <projectId>` first."
|
|
@@ -325347,7 +325426,7 @@ var init_start4 = __esm({
|
|
|
325347
325426
|
);
|
|
325348
325427
|
const name2 = cmd.name || (0, import_path9.basename)(root);
|
|
325349
325428
|
Logger.info(`Registering ${root} as local workspace "${name2}"...`);
|
|
325350
|
-
const { workspace, token } = await (0,
|
|
325429
|
+
const { workspace, token } = await (0, import_rxjs73.lastValueFrom)(
|
|
325351
325430
|
GraphqlClienAPI.createLocalWorkspace(projectId, name2)
|
|
325352
325431
|
).catch((e2) => {
|
|
325353
325432
|
throw new Error(
|
|
@@ -325447,16 +325526,16 @@ var list_exports9 = {};
|
|
|
325447
325526
|
__export(list_exports9, {
|
|
325448
325527
|
default: () => list_default9
|
|
325449
325528
|
});
|
|
325450
|
-
var
|
|
325529
|
+
var import_rxjs74, list_default9;
|
|
325451
325530
|
var init_list9 = __esm({
|
|
325452
325531
|
"src/commands/workspace/list.ts"() {
|
|
325453
|
-
|
|
325532
|
+
import_rxjs74 = __toESM(require_cjs());
|
|
325454
325533
|
init_gql_client();
|
|
325455
325534
|
init_log();
|
|
325456
325535
|
init_config2();
|
|
325457
325536
|
list_default9 = async (cmd) => {
|
|
325458
325537
|
const [workspaces, saved] = await Promise.all([
|
|
325459
|
-
(0,
|
|
325538
|
+
(0, import_rxjs74.lastValueFrom)(GraphqlClienAPI.listLocalWorkspaces(cmd.project)),
|
|
325460
325539
|
readSavedWorkspaces()
|
|
325461
325540
|
]);
|
|
325462
325541
|
const onThisMachine = new Set(Object.values(saved).map((w) => w.id));
|
|
@@ -325490,11 +325569,11 @@ var delete_exports6 = {};
|
|
|
325490
325569
|
__export(delete_exports6, {
|
|
325491
325570
|
default: () => delete_default6
|
|
325492
325571
|
});
|
|
325493
|
-
var import_promises13,
|
|
325572
|
+
var import_promises13, import_rxjs75, delete_default6;
|
|
325494
325573
|
var init_delete6 = __esm({
|
|
325495
325574
|
"src/commands/workspace/delete.ts"() {
|
|
325496
325575
|
import_promises13 = require("fs/promises");
|
|
325497
|
-
|
|
325576
|
+
import_rxjs75 = __toESM(require_cjs());
|
|
325498
325577
|
init_gql_client();
|
|
325499
325578
|
init_log();
|
|
325500
325579
|
init_config2();
|
|
@@ -325506,7 +325585,7 @@ var init_delete6 = __esm({
|
|
|
325506
325585
|
"No workspace registered for this directory - pass --id (see `gcli workspace:list`)."
|
|
325507
325586
|
);
|
|
325508
325587
|
}
|
|
325509
|
-
await (0,
|
|
325588
|
+
await (0, import_rxjs75.lastValueFrom)(GraphqlClienAPI.deleteLocalWorkspace(workspaceId));
|
|
325510
325589
|
await forgetWorkspace({ id: workspaceId });
|
|
325511
325590
|
Logger.log(
|
|
325512
325591
|
`Local workspace ${workspaceId} deleted; its token no longer works.`
|
|
@@ -326257,7 +326336,7 @@ if (!isWebContainer) {
|
|
|
326257
326336
|
} else {
|
|
326258
326337
|
}
|
|
326259
326338
|
}
|
|
326260
|
-
var version2 = true ? "1.8.
|
|
326339
|
+
var version2 = true ? "1.8.277" : "development";
|
|
326261
326340
|
var main = (argv) => {
|
|
326262
326341
|
import_commander.program.name("gcli").version(version2);
|
|
326263
326342
|
commands.map((command) => command(import_commander.program));
|