@squiz/render-runtime-lib 1.2.1-alpha.82 → 1.2.1-alpha.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -20118,7 +20118,11 @@ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.ht
|
|
|
20118
20118
|
setTimeout(resolve, timeMs);
|
|
20119
20119
|
});
|
|
20120
20120
|
}
|
|
20121
|
-
var migration_list_default = [
|
|
20121
|
+
var migration_list_default = [
|
|
20122
|
+
"20220704054051_initial.sql",
|
|
20123
|
+
"20220718172237_adding_component_sets.sql",
|
|
20124
|
+
"20220728113941_add_env_vars_field.sql"
|
|
20125
|
+
];
|
|
20122
20126
|
var ComponentSet = class {
|
|
20123
20127
|
constructor() {
|
|
20124
20128
|
this.webPath = "";
|
|
@@ -20151,6 +20155,7 @@ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.ht
|
|
|
20151
20155
|
this.componentSetWebPath = "";
|
|
20152
20156
|
this.componentName = "";
|
|
20153
20157
|
this.componentVersion = "";
|
|
20158
|
+
this.envVars = {};
|
|
20154
20159
|
}
|
|
20155
20160
|
};
|
|
20156
20161
|
var ComponentSetComponentVersionRepository = class extends AbstractRepository {
|
|
@@ -20158,7 +20163,8 @@ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.ht
|
|
|
20158
20163
|
super(options.repositories, options.pool, "component_set_component_version", {
|
|
20159
20164
|
componentSetWebPath: "component_set_web_path",
|
|
20160
20165
|
componentName: "component_name",
|
|
20161
|
-
componentVersion: "component_version"
|
|
20166
|
+
componentVersion: "component_version",
|
|
20167
|
+
envVars: "env_vars"
|
|
20162
20168
|
}, ComponentSetComponentVersion);
|
|
20163
20169
|
}
|
|
20164
20170
|
async componentSetComponentVersionExists(componentSetWebPath, componentName, componentVersion) {
|
|
@@ -26743,11 +26749,11 @@ var require_codegen = __commonJS({
|
|
|
26743
26749
|
const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
26744
26750
|
return `${varKind} ${this.name}${rhs};` + _n;
|
|
26745
26751
|
}
|
|
26746
|
-
optimizeNames(names,
|
|
26752
|
+
optimizeNames(names, constants2) {
|
|
26747
26753
|
if (!names[this.name.str])
|
|
26748
26754
|
return;
|
|
26749
26755
|
if (this.rhs)
|
|
26750
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
26756
|
+
this.rhs = optimizeExpr(this.rhs, names, constants2);
|
|
26751
26757
|
return this;
|
|
26752
26758
|
}
|
|
26753
26759
|
get names() {
|
|
@@ -26764,10 +26770,10 @@ var require_codegen = __commonJS({
|
|
|
26764
26770
|
render({ _n }) {
|
|
26765
26771
|
return `${this.lhs} = ${this.rhs};` + _n;
|
|
26766
26772
|
}
|
|
26767
|
-
optimizeNames(names,
|
|
26773
|
+
optimizeNames(names, constants2) {
|
|
26768
26774
|
if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
|
|
26769
26775
|
return;
|
|
26770
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
26776
|
+
this.rhs = optimizeExpr(this.rhs, names, constants2);
|
|
26771
26777
|
return this;
|
|
26772
26778
|
}
|
|
26773
26779
|
get names() {
|
|
@@ -26828,8 +26834,8 @@ var require_codegen = __commonJS({
|
|
|
26828
26834
|
optimizeNodes() {
|
|
26829
26835
|
return `${this.code}` ? this : void 0;
|
|
26830
26836
|
}
|
|
26831
|
-
optimizeNames(names,
|
|
26832
|
-
this.code = optimizeExpr(this.code, names,
|
|
26837
|
+
optimizeNames(names, constants2) {
|
|
26838
|
+
this.code = optimizeExpr(this.code, names, constants2);
|
|
26833
26839
|
return this;
|
|
26834
26840
|
}
|
|
26835
26841
|
get names() {
|
|
@@ -26858,12 +26864,12 @@ var require_codegen = __commonJS({
|
|
|
26858
26864
|
}
|
|
26859
26865
|
return nodes.length > 0 ? this : void 0;
|
|
26860
26866
|
}
|
|
26861
|
-
optimizeNames(names,
|
|
26867
|
+
optimizeNames(names, constants2) {
|
|
26862
26868
|
const { nodes } = this;
|
|
26863
26869
|
let i = nodes.length;
|
|
26864
26870
|
while (i--) {
|
|
26865
26871
|
const n = nodes[i];
|
|
26866
|
-
if (n.optimizeNames(names,
|
|
26872
|
+
if (n.optimizeNames(names, constants2))
|
|
26867
26873
|
continue;
|
|
26868
26874
|
subtractNames(names, n.names);
|
|
26869
26875
|
nodes.splice(i, 1);
|
|
@@ -26916,12 +26922,12 @@ var require_codegen = __commonJS({
|
|
|
26916
26922
|
return void 0;
|
|
26917
26923
|
return this;
|
|
26918
26924
|
}
|
|
26919
|
-
optimizeNames(names,
|
|
26925
|
+
optimizeNames(names, constants2) {
|
|
26920
26926
|
var _a;
|
|
26921
|
-
this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names,
|
|
26922
|
-
if (!(super.optimizeNames(names,
|
|
26927
|
+
this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants2);
|
|
26928
|
+
if (!(super.optimizeNames(names, constants2) || this.else))
|
|
26923
26929
|
return;
|
|
26924
|
-
this.condition = optimizeExpr(this.condition, names,
|
|
26930
|
+
this.condition = optimizeExpr(this.condition, names, constants2);
|
|
26925
26931
|
return this;
|
|
26926
26932
|
}
|
|
26927
26933
|
get names() {
|
|
@@ -26944,10 +26950,10 @@ var require_codegen = __commonJS({
|
|
|
26944
26950
|
render(opts) {
|
|
26945
26951
|
return `for(${this.iteration})` + super.render(opts);
|
|
26946
26952
|
}
|
|
26947
|
-
optimizeNames(names,
|
|
26948
|
-
if (!super.optimizeNames(names,
|
|
26953
|
+
optimizeNames(names, constants2) {
|
|
26954
|
+
if (!super.optimizeNames(names, constants2))
|
|
26949
26955
|
return;
|
|
26950
|
-
this.iteration = optimizeExpr(this.iteration, names,
|
|
26956
|
+
this.iteration = optimizeExpr(this.iteration, names, constants2);
|
|
26951
26957
|
return this;
|
|
26952
26958
|
}
|
|
26953
26959
|
get names() {
|
|
@@ -26983,10 +26989,10 @@ var require_codegen = __commonJS({
|
|
|
26983
26989
|
render(opts) {
|
|
26984
26990
|
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
|
|
26985
26991
|
}
|
|
26986
|
-
optimizeNames(names,
|
|
26987
|
-
if (!super.optimizeNames(names,
|
|
26992
|
+
optimizeNames(names, constants2) {
|
|
26993
|
+
if (!super.optimizeNames(names, constants2))
|
|
26988
26994
|
return;
|
|
26989
|
-
this.iterable = optimizeExpr(this.iterable, names,
|
|
26995
|
+
this.iterable = optimizeExpr(this.iterable, names, constants2);
|
|
26990
26996
|
return this;
|
|
26991
26997
|
}
|
|
26992
26998
|
get names() {
|
|
@@ -27028,11 +27034,11 @@ var require_codegen = __commonJS({
|
|
|
27028
27034
|
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
|
|
27029
27035
|
return this;
|
|
27030
27036
|
}
|
|
27031
|
-
optimizeNames(names,
|
|
27037
|
+
optimizeNames(names, constants2) {
|
|
27032
27038
|
var _a, _b;
|
|
27033
|
-
super.optimizeNames(names,
|
|
27034
|
-
(_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names,
|
|
27035
|
-
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names,
|
|
27039
|
+
super.optimizeNames(names, constants2);
|
|
27040
|
+
(_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants2);
|
|
27041
|
+
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants2);
|
|
27036
27042
|
return this;
|
|
27037
27043
|
}
|
|
27038
27044
|
get names() {
|
|
@@ -27302,7 +27308,7 @@ var require_codegen = __commonJS({
|
|
|
27302
27308
|
function addExprNames(names, from) {
|
|
27303
27309
|
return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
|
|
27304
27310
|
}
|
|
27305
|
-
function optimizeExpr(expr, names,
|
|
27311
|
+
function optimizeExpr(expr, names, constants2) {
|
|
27306
27312
|
if (expr instanceof code_1.Name)
|
|
27307
27313
|
return replaceName(expr);
|
|
27308
27314
|
if (!canOptimize(expr))
|
|
@@ -27317,14 +27323,14 @@ var require_codegen = __commonJS({
|
|
|
27317
27323
|
return items;
|
|
27318
27324
|
}, []));
|
|
27319
27325
|
function replaceName(n) {
|
|
27320
|
-
const c =
|
|
27326
|
+
const c = constants2[n.str];
|
|
27321
27327
|
if (c === void 0 || names[n.str] !== 1)
|
|
27322
27328
|
return n;
|
|
27323
27329
|
delete names[n.str];
|
|
27324
27330
|
return c;
|
|
27325
27331
|
}
|
|
27326
27332
|
function canOptimize(e) {
|
|
27327
|
-
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 &&
|
|
27333
|
+
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants2[c.str] !== void 0);
|
|
27328
27334
|
}
|
|
27329
27335
|
}
|
|
27330
27336
|
function subtractNames(names, from) {
|
|
@@ -38441,7 +38447,7 @@ var require_universalify = __commonJS({
|
|
|
38441
38447
|
// ../component-lib/node_modules/graceful-fs/polyfills.js
|
|
38442
38448
|
var require_polyfills = __commonJS({
|
|
38443
38449
|
"../component-lib/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
|
38444
|
-
var
|
|
38450
|
+
var constants2 = require("constants");
|
|
38445
38451
|
var origCwd = process.cwd;
|
|
38446
38452
|
var cwd = null;
|
|
38447
38453
|
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
@@ -38466,7 +38472,7 @@ var require_polyfills = __commonJS({
|
|
|
38466
38472
|
var chdir;
|
|
38467
38473
|
module2.exports = patch;
|
|
38468
38474
|
function patch(fs) {
|
|
38469
|
-
if (
|
|
38475
|
+
if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
38470
38476
|
patchLchmod(fs);
|
|
38471
38477
|
}
|
|
38472
38478
|
if (!fs.lutimes) {
|
|
@@ -38571,7 +38577,7 @@ var require_polyfills = __commonJS({
|
|
|
38571
38577
|
}(fs.readSync);
|
|
38572
38578
|
function patchLchmod(fs2) {
|
|
38573
38579
|
fs2.lchmod = function(path7, mode, callback) {
|
|
38574
|
-
fs2.open(path7,
|
|
38580
|
+
fs2.open(path7, constants2.O_WRONLY | constants2.O_SYMLINK, mode, function(err, fd) {
|
|
38575
38581
|
if (err) {
|
|
38576
38582
|
if (callback)
|
|
38577
38583
|
callback(err);
|
|
@@ -38586,7 +38592,7 @@ var require_polyfills = __commonJS({
|
|
|
38586
38592
|
});
|
|
38587
38593
|
};
|
|
38588
38594
|
fs2.lchmodSync = function(path7, mode) {
|
|
38589
|
-
var fd = fs2.openSync(path7,
|
|
38595
|
+
var fd = fs2.openSync(path7, constants2.O_WRONLY | constants2.O_SYMLINK, mode);
|
|
38590
38596
|
var threw = true;
|
|
38591
38597
|
var ret;
|
|
38592
38598
|
try {
|
|
@@ -38606,9 +38612,9 @@ var require_polyfills = __commonJS({
|
|
|
38606
38612
|
};
|
|
38607
38613
|
}
|
|
38608
38614
|
function patchLutimes(fs2) {
|
|
38609
|
-
if (
|
|
38615
|
+
if (constants2.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
|
|
38610
38616
|
fs2.lutimes = function(path7, at, mt, cb) {
|
|
38611
|
-
fs2.open(path7,
|
|
38617
|
+
fs2.open(path7, constants2.O_SYMLINK, function(er, fd) {
|
|
38612
38618
|
if (er) {
|
|
38613
38619
|
if (cb)
|
|
38614
38620
|
cb(er);
|
|
@@ -38623,7 +38629,7 @@ var require_polyfills = __commonJS({
|
|
|
38623
38629
|
});
|
|
38624
38630
|
};
|
|
38625
38631
|
fs2.lutimesSync = function(path7, at, mt) {
|
|
38626
|
-
var fd = fs2.openSync(path7,
|
|
38632
|
+
var fd = fs2.openSync(path7, constants2.O_SYMLINK);
|
|
38627
38633
|
var ret;
|
|
38628
38634
|
var threw = true;
|
|
38629
38635
|
try {
|
|
@@ -55654,14 +55660,14 @@ var require_zip_archive_entry = __commonJS({
|
|
|
55654
55660
|
var ArchiveEntry = require_archive_entry();
|
|
55655
55661
|
var GeneralPurposeBit = require_general_purpose_bit();
|
|
55656
55662
|
var UnixStat = require_unix_stat();
|
|
55657
|
-
var
|
|
55663
|
+
var constants2 = require_constants();
|
|
55658
55664
|
var zipUtil = require_util5();
|
|
55659
55665
|
var ZipArchiveEntry = module2.exports = function(name) {
|
|
55660
55666
|
if (!(this instanceof ZipArchiveEntry)) {
|
|
55661
55667
|
return new ZipArchiveEntry(name);
|
|
55662
55668
|
}
|
|
55663
55669
|
ArchiveEntry.call(this);
|
|
55664
|
-
this.platform =
|
|
55670
|
+
this.platform = constants2.PLATFORM_FAT;
|
|
55665
55671
|
this.method = -1;
|
|
55666
55672
|
this.name = null;
|
|
55667
55673
|
this.size = 0;
|
|
@@ -55669,7 +55675,7 @@ var require_zip_archive_entry = __commonJS({
|
|
|
55669
55675
|
this.gpb = new GeneralPurposeBit();
|
|
55670
55676
|
this.crc = 0;
|
|
55671
55677
|
this.time = -1;
|
|
55672
|
-
this.minver =
|
|
55678
|
+
this.minver = constants2.MIN_VERSION_INITIAL;
|
|
55673
55679
|
this.mode = -1;
|
|
55674
55680
|
this.extra = null;
|
|
55675
55681
|
this.exattr = 0;
|
|
@@ -55696,7 +55702,7 @@ var require_zip_archive_entry = __commonJS({
|
|
|
55696
55702
|
return this.exattr;
|
|
55697
55703
|
};
|
|
55698
55704
|
ZipArchiveEntry.prototype.getExtra = function() {
|
|
55699
|
-
return this.extra !== null ? this.extra :
|
|
55705
|
+
return this.extra !== null ? this.extra : constants2.EMPTY;
|
|
55700
55706
|
};
|
|
55701
55707
|
ZipArchiveEntry.prototype.getGeneralPurposeBit = function() {
|
|
55702
55708
|
return this.gpb;
|
|
@@ -55729,7 +55735,7 @@ var require_zip_archive_entry = __commonJS({
|
|
|
55729
55735
|
return this.time !== -1 ? this.time : 0;
|
|
55730
55736
|
};
|
|
55731
55737
|
ZipArchiveEntry.prototype.getUnixMode = function() {
|
|
55732
|
-
return this.platform !==
|
|
55738
|
+
return this.platform !== constants2.PLATFORM_UNIX ? 0 : this.getExternalAttributes() >> constants2.SHORT_SHIFT & constants2.SHORT_MASK;
|
|
55733
55739
|
};
|
|
55734
55740
|
ZipArchiveEntry.prototype.getVersionNeededToExtract = function() {
|
|
55735
55741
|
return this.minver;
|
|
@@ -55799,12 +55805,12 @@ var require_zip_archive_entry = __commonJS({
|
|
|
55799
55805
|
this.time = zipUtil.dateToDos(time, forceLocalTime);
|
|
55800
55806
|
};
|
|
55801
55807
|
ZipArchiveEntry.prototype.setUnixMode = function(mode) {
|
|
55802
|
-
mode |= this.isDirectory() ?
|
|
55808
|
+
mode |= this.isDirectory() ? constants2.S_IFDIR : constants2.S_IFREG;
|
|
55803
55809
|
var extattr = 0;
|
|
55804
|
-
extattr |= mode <<
|
|
55810
|
+
extattr |= mode << constants2.SHORT_SHIFT | (this.isDirectory() ? constants2.S_DOS_D : constants2.S_DOS_A);
|
|
55805
55811
|
this.setExternalAttributes(extattr);
|
|
55806
|
-
this.mode = mode &
|
|
55807
|
-
this.platform =
|
|
55812
|
+
this.mode = mode & constants2.MODE_MASK;
|
|
55813
|
+
this.platform = constants2.PLATFORM_UNIX;
|
|
55808
55814
|
};
|
|
55809
55815
|
ZipArchiveEntry.prototype.setVersionNeededToExtract = function(minver) {
|
|
55810
55816
|
this.minver = minver;
|
|
@@ -55816,7 +55822,7 @@ var require_zip_archive_entry = __commonJS({
|
|
|
55816
55822
|
return (this.getUnixMode() & UnixStat.FILE_TYPE_FLAG) === UnixStat.LINK_FLAG;
|
|
55817
55823
|
};
|
|
55818
55824
|
ZipArchiveEntry.prototype.isZip64 = function() {
|
|
55819
|
-
return this.csize >
|
|
55825
|
+
return this.csize > constants2.ZIP64_MAGIC || this.size > constants2.ZIP64_MAGIC;
|
|
55820
55826
|
};
|
|
55821
55827
|
}
|
|
55822
55828
|
});
|
|
@@ -56447,7 +56453,7 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56447
56453
|
var ArchiveOutputStream = require_archive_output_stream();
|
|
56448
56454
|
var ZipArchiveEntry = require_zip_archive_entry();
|
|
56449
56455
|
var GeneralPurposeBit = require_general_purpose_bit();
|
|
56450
|
-
var
|
|
56456
|
+
var constants2 = require_constants();
|
|
56451
56457
|
var util = require_util6();
|
|
56452
56458
|
var zipUtil = require_util5();
|
|
56453
56459
|
var ZipArchiveOutputStream = module2.exports = function(options) {
|
|
@@ -56483,21 +56489,21 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56483
56489
|
};
|
|
56484
56490
|
ZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback) {
|
|
56485
56491
|
if (source.length === 0) {
|
|
56486
|
-
ae.setMethod(
|
|
56492
|
+
ae.setMethod(constants2.METHOD_STORED);
|
|
56487
56493
|
}
|
|
56488
56494
|
var method = ae.getMethod();
|
|
56489
|
-
if (method ===
|
|
56495
|
+
if (method === constants2.METHOD_STORED) {
|
|
56490
56496
|
ae.setSize(source.length);
|
|
56491
56497
|
ae.setCompressedSize(source.length);
|
|
56492
56498
|
ae.setCrc(crc32.unsigned(source));
|
|
56493
56499
|
}
|
|
56494
56500
|
this._writeLocalFileHeader(ae);
|
|
56495
|
-
if (method ===
|
|
56501
|
+
if (method === constants2.METHOD_STORED) {
|
|
56496
56502
|
this.write(source);
|
|
56497
56503
|
this._afterAppend(ae);
|
|
56498
56504
|
callback(null, ae);
|
|
56499
56505
|
return;
|
|
56500
|
-
} else if (method ===
|
|
56506
|
+
} else if (method === constants2.METHOD_DEFLATED) {
|
|
56501
56507
|
this._smartStream(ae, callback).end(source);
|
|
56502
56508
|
return;
|
|
56503
56509
|
} else {
|
|
@@ -56507,7 +56513,7 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56507
56513
|
};
|
|
56508
56514
|
ZipArchiveOutputStream.prototype._appendStream = function(ae, source, callback) {
|
|
56509
56515
|
ae.getGeneralPurposeBit().useDataDescriptor(true);
|
|
56510
|
-
ae.setVersionNeededToExtract(
|
|
56516
|
+
ae.setVersionNeededToExtract(constants2.MIN_VERSION_DATA_DESCRIPTOR);
|
|
56511
56517
|
this._writeLocalFileHeader(ae);
|
|
56512
56518
|
var smart = this._smartStream(ae, callback);
|
|
56513
56519
|
source.once("error", function(err) {
|
|
@@ -56524,7 +56530,7 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56524
56530
|
o.zlib = {};
|
|
56525
56531
|
}
|
|
56526
56532
|
if (typeof o.zlib.level !== "number") {
|
|
56527
|
-
o.zlib.level =
|
|
56533
|
+
o.zlib.level = constants2.ZLIB_BEST_SPEED;
|
|
56528
56534
|
}
|
|
56529
56535
|
o.forceZip64 = !!o.forceZip64;
|
|
56530
56536
|
o.forceLocalTime = !!o.forceLocalTime;
|
|
@@ -56547,11 +56553,11 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56547
56553
|
};
|
|
56548
56554
|
ZipArchiveOutputStream.prototype._normalizeEntry = function(ae) {
|
|
56549
56555
|
if (ae.getMethod() === -1) {
|
|
56550
|
-
ae.setMethod(
|
|
56556
|
+
ae.setMethod(constants2.METHOD_DEFLATED);
|
|
56551
56557
|
}
|
|
56552
|
-
if (ae.getMethod() ===
|
|
56558
|
+
if (ae.getMethod() === constants2.METHOD_DEFLATED) {
|
|
56553
56559
|
ae.getGeneralPurposeBit().useDataDescriptor(true);
|
|
56554
|
-
ae.setVersionNeededToExtract(
|
|
56560
|
+
ae.setVersionNeededToExtract(constants2.MIN_VERSION_DATA_DESCRIPTOR);
|
|
56555
56561
|
}
|
|
56556
56562
|
if (ae.getTime() === -1) {
|
|
56557
56563
|
ae.setTime(new Date(), this._archive.forceLocalTime);
|
|
@@ -56563,7 +56569,7 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56563
56569
|
};
|
|
56564
56570
|
};
|
|
56565
56571
|
ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) {
|
|
56566
|
-
var deflate = ae.getMethod() ===
|
|
56572
|
+
var deflate = ae.getMethod() === constants2.METHOD_DEFLATED;
|
|
56567
56573
|
var process2 = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream();
|
|
56568
56574
|
var error = null;
|
|
56569
56575
|
function handleStuff() {
|
|
@@ -56586,13 +56592,13 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56586
56592
|
var size = this._archive.centralLength;
|
|
56587
56593
|
var offset = this._archive.centralOffset;
|
|
56588
56594
|
if (this.isZip64()) {
|
|
56589
|
-
records =
|
|
56590
|
-
size =
|
|
56591
|
-
offset =
|
|
56595
|
+
records = constants2.ZIP64_MAGIC_SHORT;
|
|
56596
|
+
size = constants2.ZIP64_MAGIC;
|
|
56597
|
+
offset = constants2.ZIP64_MAGIC;
|
|
56592
56598
|
}
|
|
56593
|
-
this.write(zipUtil.getLongBytes(
|
|
56594
|
-
this.write(
|
|
56595
|
-
this.write(
|
|
56599
|
+
this.write(zipUtil.getLongBytes(constants2.SIG_EOCD));
|
|
56600
|
+
this.write(constants2.SHORT_ZERO);
|
|
56601
|
+
this.write(constants2.SHORT_ZERO);
|
|
56596
56602
|
this.write(zipUtil.getShortBytes(records));
|
|
56597
56603
|
this.write(zipUtil.getShortBytes(records));
|
|
56598
56604
|
this.write(zipUtil.getLongBytes(size));
|
|
@@ -56603,18 +56609,18 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56603
56609
|
this.write(comment);
|
|
56604
56610
|
};
|
|
56605
56611
|
ZipArchiveOutputStream.prototype._writeCentralDirectoryZip64 = function() {
|
|
56606
|
-
this.write(zipUtil.getLongBytes(
|
|
56612
|
+
this.write(zipUtil.getLongBytes(constants2.SIG_ZIP64_EOCD));
|
|
56607
56613
|
this.write(zipUtil.getEightBytes(44));
|
|
56608
|
-
this.write(zipUtil.getShortBytes(
|
|
56609
|
-
this.write(zipUtil.getShortBytes(
|
|
56610
|
-
this.write(
|
|
56611
|
-
this.write(
|
|
56614
|
+
this.write(zipUtil.getShortBytes(constants2.MIN_VERSION_ZIP64));
|
|
56615
|
+
this.write(zipUtil.getShortBytes(constants2.MIN_VERSION_ZIP64));
|
|
56616
|
+
this.write(constants2.LONG_ZERO);
|
|
56617
|
+
this.write(constants2.LONG_ZERO);
|
|
56612
56618
|
this.write(zipUtil.getEightBytes(this._entries.length));
|
|
56613
56619
|
this.write(zipUtil.getEightBytes(this._entries.length));
|
|
56614
56620
|
this.write(zipUtil.getEightBytes(this._archive.centralLength));
|
|
56615
56621
|
this.write(zipUtil.getEightBytes(this._archive.centralOffset));
|
|
56616
|
-
this.write(zipUtil.getLongBytes(
|
|
56617
|
-
this.write(
|
|
56622
|
+
this.write(zipUtil.getLongBytes(constants2.SIG_ZIP64_EOCD_LOC));
|
|
56623
|
+
this.write(constants2.LONG_ZERO);
|
|
56618
56624
|
this.write(zipUtil.getEightBytes(this._archive.centralOffset + this._archive.centralLength));
|
|
56619
56625
|
this.write(zipUtil.getLongBytes(1));
|
|
56620
56626
|
};
|
|
@@ -56624,12 +56630,12 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56624
56630
|
var offsets = ae._offsets;
|
|
56625
56631
|
var size = ae.getSize();
|
|
56626
56632
|
var compressedSize = ae.getCompressedSize();
|
|
56627
|
-
if (ae.isZip64() || offsets.file >
|
|
56628
|
-
size =
|
|
56629
|
-
compressedSize =
|
|
56630
|
-
ae.setVersionNeededToExtract(
|
|
56633
|
+
if (ae.isZip64() || offsets.file > constants2.ZIP64_MAGIC) {
|
|
56634
|
+
size = constants2.ZIP64_MAGIC;
|
|
56635
|
+
compressedSize = constants2.ZIP64_MAGIC;
|
|
56636
|
+
ae.setVersionNeededToExtract(constants2.MIN_VERSION_ZIP64);
|
|
56631
56637
|
var extraBuf = Buffer.concat([
|
|
56632
|
-
zipUtil.getShortBytes(
|
|
56638
|
+
zipUtil.getShortBytes(constants2.ZIP64_EXTRA_ID),
|
|
56633
56639
|
zipUtil.getShortBytes(24),
|
|
56634
56640
|
zipUtil.getEightBytes(ae.getSize()),
|
|
56635
56641
|
zipUtil.getEightBytes(ae.getCompressedSize()),
|
|
@@ -56637,8 +56643,8 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56637
56643
|
], 28);
|
|
56638
56644
|
ae.setExtra(extraBuf);
|
|
56639
56645
|
}
|
|
56640
|
-
this.write(zipUtil.getLongBytes(
|
|
56641
|
-
this.write(zipUtil.getShortBytes(ae.getPlatform() << 8 |
|
|
56646
|
+
this.write(zipUtil.getLongBytes(constants2.SIG_CFH));
|
|
56647
|
+
this.write(zipUtil.getShortBytes(ae.getPlatform() << 8 | constants2.VERSION_MADEBY));
|
|
56642
56648
|
this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract()));
|
|
56643
56649
|
this.write(gpb.encode());
|
|
56644
56650
|
this.write(zipUtil.getShortBytes(method));
|
|
@@ -56656,11 +56662,11 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56656
56662
|
this.write(zipUtil.getShortBytes(name.length));
|
|
56657
56663
|
this.write(zipUtil.getShortBytes(extra.length));
|
|
56658
56664
|
this.write(zipUtil.getShortBytes(comment.length));
|
|
56659
|
-
this.write(
|
|
56665
|
+
this.write(constants2.SHORT_ZERO);
|
|
56660
56666
|
this.write(zipUtil.getShortBytes(ae.getInternalAttributes()));
|
|
56661
56667
|
this.write(zipUtil.getLongBytes(ae.getExternalAttributes()));
|
|
56662
|
-
if (offsets.file >
|
|
56663
|
-
this.write(zipUtil.getLongBytes(
|
|
56668
|
+
if (offsets.file > constants2.ZIP64_MAGIC) {
|
|
56669
|
+
this.write(zipUtil.getLongBytes(constants2.ZIP64_MAGIC));
|
|
56664
56670
|
} else {
|
|
56665
56671
|
this.write(zipUtil.getLongBytes(offsets.file));
|
|
56666
56672
|
}
|
|
@@ -56669,7 +56675,7 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56669
56675
|
this.write(comment);
|
|
56670
56676
|
};
|
|
56671
56677
|
ZipArchiveOutputStream.prototype._writeDataDescriptor = function(ae) {
|
|
56672
|
-
this.write(zipUtil.getLongBytes(
|
|
56678
|
+
this.write(zipUtil.getLongBytes(constants2.SIG_DD));
|
|
56673
56679
|
this.write(zipUtil.getLongBytes(ae.getCrc()));
|
|
56674
56680
|
if (ae.isZip64()) {
|
|
56675
56681
|
this.write(zipUtil.getEightBytes(ae.getCompressedSize()));
|
|
@@ -56686,22 +56692,22 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56686
56692
|
var extra = ae.getLocalFileDataExtra();
|
|
56687
56693
|
if (ae.isZip64()) {
|
|
56688
56694
|
gpb.useDataDescriptor(true);
|
|
56689
|
-
ae.setVersionNeededToExtract(
|
|
56695
|
+
ae.setVersionNeededToExtract(constants2.MIN_VERSION_ZIP64);
|
|
56690
56696
|
}
|
|
56691
56697
|
if (gpb.usesUTF8ForNames()) {
|
|
56692
56698
|
name = Buffer.from(name);
|
|
56693
56699
|
}
|
|
56694
56700
|
ae._offsets.file = this.offset;
|
|
56695
|
-
this.write(zipUtil.getLongBytes(
|
|
56701
|
+
this.write(zipUtil.getLongBytes(constants2.SIG_LFH));
|
|
56696
56702
|
this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract()));
|
|
56697
56703
|
this.write(gpb.encode());
|
|
56698
56704
|
this.write(zipUtil.getShortBytes(method));
|
|
56699
56705
|
this.write(zipUtil.getLongBytes(ae.getTimeDos()));
|
|
56700
56706
|
ae._offsets.data = this.offset;
|
|
56701
56707
|
if (gpb.usesDataDescriptor()) {
|
|
56702
|
-
this.write(
|
|
56703
|
-
this.write(
|
|
56704
|
-
this.write(
|
|
56708
|
+
this.write(constants2.LONG_ZERO);
|
|
56709
|
+
this.write(constants2.LONG_ZERO);
|
|
56710
|
+
this.write(constants2.LONG_ZERO);
|
|
56705
56711
|
} else {
|
|
56706
56712
|
this.write(zipUtil.getLongBytes(ae.getCrc()));
|
|
56707
56713
|
this.write(zipUtil.getLongBytes(ae.getCompressedSize()));
|
|
@@ -56717,7 +56723,7 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
56717
56723
|
return this._archive.comment !== null ? this._archive.comment : "";
|
|
56718
56724
|
};
|
|
56719
56725
|
ZipArchiveOutputStream.prototype.isZip64 = function() {
|
|
56720
|
-
return this._archive.forceZip64 || this._entries.length >
|
|
56726
|
+
return this._archive.forceZip64 || this._entries.length > constants2.ZIP64_MAGIC_SHORT || this._archive.centralLength > constants2.ZIP64_MAGIC || this._archive.centralOffset > constants2.ZIP64_MAGIC;
|
|
56721
56727
|
};
|
|
56722
56728
|
ZipArchiveOutputStream.prototype.setComment = function(comment) {
|
|
56723
56729
|
this._archive.comment = comment;
|
|
@@ -57875,7 +57881,7 @@ var require_end_of_stream2 = __commonJS({
|
|
|
57875
57881
|
// ../component-lib/node_modules/tar-stream/pack.js
|
|
57876
57882
|
var require_pack = __commonJS({
|
|
57877
57883
|
"../component-lib/node_modules/tar-stream/pack.js"(exports2, module2) {
|
|
57878
|
-
var
|
|
57884
|
+
var constants2 = require_fs_constants();
|
|
57879
57885
|
var eos = require_end_of_stream2();
|
|
57880
57886
|
var inherits = require_inherits2();
|
|
57881
57887
|
var alloc = Buffer.alloc;
|
|
@@ -57894,16 +57900,16 @@ var require_pack = __commonJS({
|
|
|
57894
57900
|
self2.push(END_OF_TAR.slice(0, 512 - size));
|
|
57895
57901
|
};
|
|
57896
57902
|
function modeToType(mode) {
|
|
57897
|
-
switch (mode &
|
|
57898
|
-
case
|
|
57903
|
+
switch (mode & constants2.S_IFMT) {
|
|
57904
|
+
case constants2.S_IFBLK:
|
|
57899
57905
|
return "block-device";
|
|
57900
|
-
case
|
|
57906
|
+
case constants2.S_IFCHR:
|
|
57901
57907
|
return "character-device";
|
|
57902
|
-
case
|
|
57908
|
+
case constants2.S_IFDIR:
|
|
57903
57909
|
return "directory";
|
|
57904
|
-
case
|
|
57910
|
+
case constants2.S_IFIFO:
|
|
57905
57911
|
return "fifo";
|
|
57906
|
-
case
|
|
57912
|
+
case constants2.S_IFLNK:
|
|
57907
57913
|
return "symlink";
|
|
57908
57914
|
}
|
|
57909
57915
|
return "file";
|
|
@@ -81007,7 +81013,7 @@ var require_universalify2 = __commonJS({
|
|
|
81007
81013
|
// node_modules/graceful-fs/polyfills.js
|
|
81008
81014
|
var require_polyfills2 = __commonJS({
|
|
81009
81015
|
"node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
|
81010
|
-
var
|
|
81016
|
+
var constants2 = require("constants");
|
|
81011
81017
|
var origCwd = process.cwd;
|
|
81012
81018
|
var cwd = null;
|
|
81013
81019
|
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
@@ -81032,7 +81038,7 @@ var require_polyfills2 = __commonJS({
|
|
|
81032
81038
|
var chdir;
|
|
81033
81039
|
module2.exports = patch;
|
|
81034
81040
|
function patch(fs) {
|
|
81035
|
-
if (
|
|
81041
|
+
if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
81036
81042
|
patchLchmod(fs);
|
|
81037
81043
|
}
|
|
81038
81044
|
if (!fs.lutimes) {
|
|
@@ -81137,7 +81143,7 @@ var require_polyfills2 = __commonJS({
|
|
|
81137
81143
|
}(fs.readSync);
|
|
81138
81144
|
function patchLchmod(fs2) {
|
|
81139
81145
|
fs2.lchmod = function(path7, mode, callback) {
|
|
81140
|
-
fs2.open(path7,
|
|
81146
|
+
fs2.open(path7, constants2.O_WRONLY | constants2.O_SYMLINK, mode, function(err, fd) {
|
|
81141
81147
|
if (err) {
|
|
81142
81148
|
if (callback)
|
|
81143
81149
|
callback(err);
|
|
@@ -81152,7 +81158,7 @@ var require_polyfills2 = __commonJS({
|
|
|
81152
81158
|
});
|
|
81153
81159
|
};
|
|
81154
81160
|
fs2.lchmodSync = function(path7, mode) {
|
|
81155
|
-
var fd = fs2.openSync(path7,
|
|
81161
|
+
var fd = fs2.openSync(path7, constants2.O_WRONLY | constants2.O_SYMLINK, mode);
|
|
81156
81162
|
var threw = true;
|
|
81157
81163
|
var ret;
|
|
81158
81164
|
try {
|
|
@@ -81172,9 +81178,9 @@ var require_polyfills2 = __commonJS({
|
|
|
81172
81178
|
};
|
|
81173
81179
|
}
|
|
81174
81180
|
function patchLutimes(fs2) {
|
|
81175
|
-
if (
|
|
81181
|
+
if (constants2.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
|
|
81176
81182
|
fs2.lutimes = function(path7, at, mt, cb) {
|
|
81177
|
-
fs2.open(path7,
|
|
81183
|
+
fs2.open(path7, constants2.O_SYMLINK, function(er, fd) {
|
|
81178
81184
|
if (er) {
|
|
81179
81185
|
if (cb)
|
|
81180
81186
|
cb(er);
|
|
@@ -81189,7 +81195,7 @@ var require_polyfills2 = __commonJS({
|
|
|
81189
81195
|
});
|
|
81190
81196
|
};
|
|
81191
81197
|
fs2.lutimesSync = function(path7, at, mt) {
|
|
81192
|
-
var fd = fs2.openSync(path7,
|
|
81198
|
+
var fd = fs2.openSync(path7, constants2.O_SYMLINK);
|
|
81193
81199
|
var ret;
|
|
81194
81200
|
var threw = true;
|
|
81195
81201
|
try {
|
|
@@ -94873,10 +94879,11 @@ var static_default = router3;
|
|
|
94873
94879
|
// src/webserver/controllers/core.ts
|
|
94874
94880
|
var import_component_lib8 = __toESM(require_lib7());
|
|
94875
94881
|
var import_express4 = __toESM(require_express2());
|
|
94876
|
-
var
|
|
94882
|
+
var import_fs = require("fs");
|
|
94877
94883
|
var import_fs_extra = __toESM(require_lib10());
|
|
94878
94884
|
var import_promises = __toESM(require("fs/promises"));
|
|
94879
94885
|
var import_os2 = __toESM(require("os"));
|
|
94886
|
+
var import_path4 = __toESM(require("path"));
|
|
94880
94887
|
var router4 = import_express4.default.Router();
|
|
94881
94888
|
router4.get("/schemas/:version.json", async (req, res, _next) => {
|
|
94882
94889
|
const schema = import_component_lib8.schemaVersions[req.params.version];
|
|
@@ -94886,22 +94893,32 @@ router4.get("/schemas/:version.json", async (req, res, _next) => {
|
|
|
94886
94893
|
res.status(200).json(schema);
|
|
94887
94894
|
});
|
|
94888
94895
|
router4.get("/health", async (req, res, _next) => {
|
|
94896
|
+
var _a, _b, _c, _d, _e;
|
|
94889
94897
|
try {
|
|
94890
94898
|
const packagePath = import_path4.default.resolve("package.json");
|
|
94891
94899
|
const pkg = JSON.parse(await import_promises.default.readFile(packagePath, { encoding: "utf-8" }));
|
|
94892
94900
|
if (!pkg.version) {
|
|
94893
94901
|
throw new import_component_lib8.BadRequestError(`package could not be loaded from ../package.json`);
|
|
94894
94902
|
}
|
|
94895
|
-
const
|
|
94896
|
-
|
|
94897
|
-
|
|
94903
|
+
const crConfig = ComponentRunner.getConfig();
|
|
94904
|
+
const webConfig = Webserver.getConfig();
|
|
94905
|
+
if (!await import_fs_extra.default.pathExists(crConfig.dataMountPoint)) {
|
|
94906
|
+
throw new import_component_lib8.BadRequestError(`${crConfig.dataMountPoint} does not exist`);
|
|
94907
|
+
}
|
|
94908
|
+
const dbHealth = { idle: (_a = req.db) == null ? void 0 : _a.pool.idleCount, max: (_b = req.db) == null ? void 0 : _b.pool.totalCount, waiting: (_c = req.db) == null ? void 0 : _c.pool.waitingCount };
|
|
94909
|
+
if (req.db && req.db.pool.totalCount === 0) {
|
|
94910
|
+
throw new Error("Database has no listeners");
|
|
94898
94911
|
}
|
|
94912
|
+
await import_promises.default.access(crConfig.dataMountPoint, import_fs.constants.R_OK);
|
|
94899
94913
|
res.status(200).send({
|
|
94900
94914
|
status: "healthy",
|
|
94901
94915
|
version: pkg.version,
|
|
94916
|
+
buildVersion: (_d = webConfig.compiledConfig) == null ? void 0 : _d.buildVersion,
|
|
94917
|
+
buildBranch: (_e = webConfig.compiledConfig) == null ? void 0 : _e.buildBranch,
|
|
94902
94918
|
name: pkg.name,
|
|
94903
94919
|
"number-of-cpus": import_os2.default.cpus().length,
|
|
94904
|
-
"number-of-workers": ComponentRunner.get().healthCheck()
|
|
94920
|
+
"number-of-workers": ComponentRunner.get().healthCheck(),
|
|
94921
|
+
db: dbHealth
|
|
94905
94922
|
});
|
|
94906
94923
|
} catch (error) {
|
|
94907
94924
|
req.log.error(error);
|
|
@@ -94994,7 +95011,7 @@ var Webserver = class {
|
|
|
94994
95011
|
(0, import_strict2.default)(Webserver.config);
|
|
94995
95012
|
return Webserver.config;
|
|
94996
95013
|
}
|
|
94997
|
-
static async start(config, db) {
|
|
95014
|
+
static async start(config, db, compiledConfig) {
|
|
94998
95015
|
(0, import_strict2.default)(!Webserver.singleton);
|
|
94999
95016
|
(0, import_strict2.default)(ComponentRunner.get());
|
|
95000
95017
|
if (config.shouldRunMigrations === true) {
|
|
@@ -95007,7 +95024,7 @@ var Webserver = class {
|
|
|
95007
95024
|
throw e;
|
|
95008
95025
|
}
|
|
95009
95026
|
}
|
|
95010
|
-
config = Webserver.mergeConfig(config);
|
|
95027
|
+
config = Webserver.mergeConfig(config, compiledConfig);
|
|
95011
95028
|
const app = setupApp(db);
|
|
95012
95029
|
const server = await new Promise((resolve) => {
|
|
95013
95030
|
const server2 = app.listen(config.port);
|
|
@@ -95026,10 +95043,11 @@ var Webserver = class {
|
|
|
95026
95043
|
this.singleton.close();
|
|
95027
95044
|
this.singleton = void 0;
|
|
95028
95045
|
}
|
|
95029
|
-
static mergeConfig(config) {
|
|
95046
|
+
static mergeConfig(config, compiledConfig = {}) {
|
|
95030
95047
|
return {
|
|
95031
95048
|
port: 3e3,
|
|
95032
|
-
...config
|
|
95049
|
+
...config,
|
|
95050
|
+
compiledConfig
|
|
95033
95051
|
};
|
|
95034
95052
|
}
|
|
95035
95053
|
};
|
|
@@ -95054,6 +95072,10 @@ var import_path5 = __toESM(require("path"));
|
|
|
95054
95072
|
function getTestConfig(port) {
|
|
95055
95073
|
const rootDir = (0, import_child_process.execSync)("git rev-parse --show-toplevel", { encoding: "utf-8" }).replace(/\n$/, "");
|
|
95056
95074
|
return {
|
|
95075
|
+
compiledConfig: {
|
|
95076
|
+
buildVersion: "v1.0.0",
|
|
95077
|
+
buildBranch: "develop"
|
|
95078
|
+
},
|
|
95057
95079
|
dbConnection: {
|
|
95058
95080
|
databaseConnectionString: "postgresql://root:root@localhost:5432/cmp_db?schema=public",
|
|
95059
95081
|
databaseConnectionSecret: false
|
|
@@ -95869,7 +95891,7 @@ async function startRenderStack(config) {
|
|
|
95869
95891
|
db = new import_component_db_lib.ConnectionManager("render-runtime", connection, "../lib/migrations");
|
|
95870
95892
|
}
|
|
95871
95893
|
ComponentRunner.start(config.componentRunner);
|
|
95872
|
-
await Webserver.start(config.webserver, db);
|
|
95894
|
+
await Webserver.start(config.webserver, db, config.compiledConfig);
|
|
95873
95895
|
}
|
|
95874
95896
|
async function stopRenderStack() {
|
|
95875
95897
|
Webserver.stop();
|