@squiz/render-runtime-lib 1.2.1-alpha.94 → 1.2.1-alpha.97
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/component-runner/index.d.ts +2 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +90759 -74953
- package/lib/index.js.map +4 -4
- package/lib/migrations/20220704054051_initial.sql +12 -10
- package/lib/migrations/20220817113300_removing_null_props_from_jsonb.sql +41 -0
- package/lib/test/helpers/stack.d.ts +2 -0
- package/lib/webserver/app.d.ts +2 -1
- package/lib/webserver/index.d.ts +2 -1
- package/lib/worker/worker-root.js +208 -86
- package/lib/worker/worker-root.js.map +2 -2
- package/package.json +15 -11
- package/lib/utils/log.d.ts +0 -3
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
-- CreateTable
|
|
2
|
-
CREATE TABLE "component" (
|
|
3
|
-
"name" VARCHAR(128) NOT NULL,
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
);
|
|
3
|
+
CREATE TABLE "component" ("name" VARCHAR(128) NOT NULL,
|
|
4
|
+
CONSTRAINT "component_pkey" PRIMARY KEY ("name"));
|
|
7
5
|
|
|
8
6
|
-- CreateTable
|
|
9
|
-
CREATE TABLE "component_version" (
|
|
10
|
-
"component_name" VARCHAR(128) NOT NULL,
|
|
11
|
-
"version" VARCHAR(128) NOT NULL,
|
|
12
7
|
|
|
13
|
-
|
|
14
|
-
)
|
|
8
|
+
CREATE TABLE "component_version" ("component_name" VARCHAR(128) NOT NULL,
|
|
9
|
+
"version" VARCHAR(128) NOT NULL,
|
|
10
|
+
CONSTRAINT "component_version_pkey" PRIMARY KEY ("component_name",
|
|
11
|
+
"version"));
|
|
15
12
|
|
|
16
13
|
-- AddForeignKey
|
|
17
|
-
|
|
14
|
+
|
|
15
|
+
ALTER TABLE "component_version" ADD CONSTRAINT "component_version_component_name_fkey"
|
|
16
|
+
FOREIGN KEY ("component_name") REFERENCES "component"("name") ON
|
|
17
|
+
DELETE CASCADE ON
|
|
18
|
+
UPDATE CASCADE;
|
|
19
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
UPDATE component_set as rc
|
|
2
|
+
set env_vars = (
|
|
3
|
+
|
|
4
|
+
-- subtract non string properties, resulting object is all keys have values
|
|
5
|
+
select COALESCE((o2.env_vars - od.nonStringProps), '{}'::jsonb) as stringProps
|
|
6
|
+
from component_set as o2 , (
|
|
7
|
+
|
|
8
|
+
-- select get an array of all properties whos value is not a string, as an array
|
|
9
|
+
select web_path, array(
|
|
10
|
+
select envK
|
|
11
|
+
from component_set, jsonb_object_keys(env_vars) as envK
|
|
12
|
+
where jsonb_typeof(component_set.env_vars->envk) <> 'string' and o.web_path = component_set.web_path
|
|
13
|
+
) as nonStringProps
|
|
14
|
+
from component_set as o
|
|
15
|
+
) as od
|
|
16
|
+
|
|
17
|
+
-- make sure all the web_paths are the same
|
|
18
|
+
where o2.web_path = od.web_path and rc.web_path = o2.web_path
|
|
19
|
+
),
|
|
20
|
+
headers = (
|
|
21
|
+
-- subtract non string properties resulting object is all keys have values
|
|
22
|
+
select COALESCE((o2.headers - od.nonStringProps), '{}'::jsonb) as stringProps
|
|
23
|
+
from component_set as o2 , (
|
|
24
|
+
|
|
25
|
+
-- select get an array of all properties whos value is not a string, as an array
|
|
26
|
+
select web_path, array(
|
|
27
|
+
select headerK
|
|
28
|
+
from component_set, jsonb_object_keys(headers) as headerK
|
|
29
|
+
where jsonb_typeof(component_set.headers->headerK) <> 'string' and o.web_path = component_set.web_path
|
|
30
|
+
) as nonStringProps
|
|
31
|
+
from component_set as o
|
|
32
|
+
) as od
|
|
33
|
+
|
|
34
|
+
-- make sure all the web_paths are the same
|
|
35
|
+
where o2.web_path = od.web_path and rc.web_path = o2.web_path
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
-- make columns not nullable
|
|
39
|
+
ALTER TABLE component_set ALTER COLUMN env_vars SET NOT NULL;
|
|
40
|
+
ALTER TABLE component_set ALTER COLUMN headers SET NOT NULL;
|
|
41
|
+
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import supertest from 'supertest';
|
|
2
2
|
import { type RenderRuntimeConfig } from '../../';
|
|
3
|
+
import { Logger } from '@squiz/dx-logger-lib';
|
|
4
|
+
export declare const testLogger: Logger;
|
|
3
5
|
export declare function getTestConfig(port: number): RenderRuntimeConfig;
|
|
4
6
|
export declare function getTestServer(): supertest.SuperTest<supertest.Test>;
|
package/lib/webserver/app.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { type Express } from 'express';
|
|
2
|
+
import { Logger } from '@squiz/dx-logger-lib';
|
|
2
3
|
import { ComponentConnectionManager } from '@squiz/component-db-lib';
|
|
3
|
-
export declare function setupApp(db?: ComponentConnectionManager): Express;
|
|
4
|
+
export declare function setupApp(logger: Logger, db?: ComponentConnectionManager): Express;
|
package/lib/webserver/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { type Server } from 'http';
|
|
3
|
+
import { Logger } from '@squiz/dx-logger-lib';
|
|
3
4
|
import { ComponentConnectionManager } from '@squiz/component-db-lib';
|
|
4
5
|
export interface WebserverConfig {
|
|
5
6
|
port?: number;
|
|
@@ -15,7 +16,7 @@ export declare class Webserver {
|
|
|
15
16
|
private static config;
|
|
16
17
|
static get(): Server;
|
|
17
18
|
static getConfig(): WebserverConfig;
|
|
18
|
-
static start(config: Omit<WebserverConfig, 'compiledConfig'>, db?: ComponentConnectionManager, compiledConfig?: Record<string, string>): Promise<Server>;
|
|
19
|
+
static start(config: Omit<WebserverConfig, 'compiledConfig'>, logger: Logger, db?: ComponentConnectionManager, compiledConfig?: Record<string, string>): Promise<Server>;
|
|
19
20
|
static stop(): void;
|
|
20
21
|
private static mergeConfig;
|
|
21
22
|
}
|
|
@@ -16,7 +16,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
}
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
20
23
|
|
|
21
24
|
// node_modules/vm2/lib/bridge.js
|
|
22
25
|
var require_bridge = __commonJS({
|
|
@@ -1973,7 +1976,10 @@ var require_acorn = __commonJS({
|
|
|
1973
1976
|
var isForIn = this.type === types$1._in;
|
|
1974
1977
|
this.next();
|
|
1975
1978
|
if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
|
|
1976
|
-
this.raise(
|
|
1979
|
+
this.raise(
|
|
1980
|
+
init.start,
|
|
1981
|
+
(isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
|
|
1982
|
+
);
|
|
1977
1983
|
}
|
|
1978
1984
|
node.left = init;
|
|
1979
1985
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
|
|
@@ -2407,7 +2413,11 @@ var require_acorn = __commonJS({
|
|
|
2407
2413
|
var node = this.startNode();
|
|
2408
2414
|
node.local = this.parseModuleExportName();
|
|
2409
2415
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
2410
|
-
this.checkExport(
|
|
2416
|
+
this.checkExport(
|
|
2417
|
+
exports3,
|
|
2418
|
+
node.exported,
|
|
2419
|
+
node.exported.start
|
|
2420
|
+
);
|
|
2411
2421
|
nodes.push(this.finishNode(node, "ExportSpecifier"));
|
|
2412
2422
|
}
|
|
2413
2423
|
return nodes;
|
|
@@ -4923,7 +4933,14 @@ var require_acorn = __commonJS({
|
|
|
4923
4933
|
}
|
|
4924
4934
|
}
|
|
4925
4935
|
if (this.options.onComment) {
|
|
4926
|
-
this.options.onComment(
|
|
4936
|
+
this.options.onComment(
|
|
4937
|
+
true,
|
|
4938
|
+
this.input.slice(start + 2, end),
|
|
4939
|
+
start,
|
|
4940
|
+
this.pos,
|
|
4941
|
+
startLoc,
|
|
4942
|
+
this.curPosition()
|
|
4943
|
+
);
|
|
4927
4944
|
}
|
|
4928
4945
|
};
|
|
4929
4946
|
pp.skipLineComment = function(startSkip) {
|
|
@@ -4934,7 +4951,14 @@ var require_acorn = __commonJS({
|
|
|
4934
4951
|
ch = this.input.charCodeAt(++this.pos);
|
|
4935
4952
|
}
|
|
4936
4953
|
if (this.options.onComment) {
|
|
4937
|
-
this.options.onComment(
|
|
4954
|
+
this.options.onComment(
|
|
4955
|
+
false,
|
|
4956
|
+
this.input.slice(start + startSkip, this.pos),
|
|
4957
|
+
start,
|
|
4958
|
+
this.pos,
|
|
4959
|
+
startLoc,
|
|
4960
|
+
this.curPosition()
|
|
4961
|
+
);
|
|
4938
4962
|
}
|
|
4939
4963
|
};
|
|
4940
4964
|
pp.skipSpace = function() {
|
|
@@ -5549,11 +5573,17 @@ var require_acorn = __commonJS({
|
|
|
5549
5573
|
case 56:
|
|
5550
5574
|
case 57:
|
|
5551
5575
|
if (this.strict) {
|
|
5552
|
-
this.invalidStringToken(
|
|
5576
|
+
this.invalidStringToken(
|
|
5577
|
+
this.pos - 1,
|
|
5578
|
+
"Invalid escape sequence"
|
|
5579
|
+
);
|
|
5553
5580
|
}
|
|
5554
5581
|
if (inTemplate) {
|
|
5555
5582
|
var codePos = this.pos - 1;
|
|
5556
|
-
this.invalidStringToken(
|
|
5583
|
+
this.invalidStringToken(
|
|
5584
|
+
codePos,
|
|
5585
|
+
"Invalid escape sequence in template string"
|
|
5586
|
+
);
|
|
5557
5587
|
return null;
|
|
5558
5588
|
}
|
|
5559
5589
|
default:
|
|
@@ -5567,7 +5597,10 @@ var require_acorn = __commonJS({
|
|
|
5567
5597
|
this.pos += octalStr.length - 1;
|
|
5568
5598
|
ch = this.input.charCodeAt(this.pos);
|
|
5569
5599
|
if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
|
|
5570
|
-
this.invalidStringToken(
|
|
5600
|
+
this.invalidStringToken(
|
|
5601
|
+
this.pos - 1 - octalStr.length,
|
|
5602
|
+
inTemplate ? "Octal literal in template string" : "Octal literal in strict mode"
|
|
5603
|
+
);
|
|
5571
5604
|
}
|
|
5572
5605
|
return String.fromCharCode(octal);
|
|
5573
5606
|
}
|
|
@@ -6621,10 +6654,16 @@ var require_vm = __commonJS({
|
|
|
6621
6654
|
cacheTimeoutContext.fn = null;
|
|
6622
6655
|
}
|
|
6623
6656
|
}
|
|
6624
|
-
var bridgeScript = compileScript(
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
})`
|
|
6657
|
+
var bridgeScript = compileScript(
|
|
6658
|
+
`${__dirname}/bridge.js`,
|
|
6659
|
+
`(function(global) {"use strict"; const exports = {};${fs.readFileSync(`${__dirname}/bridge.js`, "utf8")}
|
|
6660
|
+
return exports;})`
|
|
6661
|
+
);
|
|
6662
|
+
var setupSandboxScript = compileScript(
|
|
6663
|
+
`${__dirname}/setup-sandbox.js`,
|
|
6664
|
+
`(function(global, host, bridge, data, context) { ${fs.readFileSync(`${__dirname}/setup-sandbox.js`, "utf8")}
|
|
6665
|
+
})`
|
|
6666
|
+
);
|
|
6628
6667
|
var getGlobalScript = compileScript("get_global.js", "this");
|
|
6629
6668
|
var getGeneratorFunctionScript = null;
|
|
6630
6669
|
var getAsyncFunctionScript = null;
|
|
@@ -7859,8 +7898,11 @@ var require_nodevm = __commonJS({
|
|
|
7859
7898
|
const resolver = resolverFromOptions(this, requireOpts, nesting && NESTING_OVERRIDE, this._compiler);
|
|
7860
7899
|
objectDefineProperty(this, "_resolver", { __proto__: null, value: resolver });
|
|
7861
7900
|
if (!cacheSandboxScript) {
|
|
7862
|
-
cacheSandboxScript = compileScript(
|
|
7863
|
-
}
|
|
7901
|
+
cacheSandboxScript = compileScript(
|
|
7902
|
+
`${__dirname}/setup-node-sandbox.js`,
|
|
7903
|
+
`(function (host, data) { ${fs.readFileSync(`${__dirname}/setup-node-sandbox.js`, "utf8")}
|
|
7904
|
+
})`
|
|
7905
|
+
);
|
|
7864
7906
|
}
|
|
7865
7907
|
const closure = this._runScript(cacheSandboxScript);
|
|
7866
7908
|
const extensions = {
|
|
@@ -13822,10 +13864,14 @@ var require_dependencies = __commonJS({
|
|
|
13822
13864
|
for (const prop in schemaDeps) {
|
|
13823
13865
|
if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
|
|
13824
13866
|
continue;
|
|
13825
|
-
gen.if(
|
|
13826
|
-
|
|
13827
|
-
|
|
13828
|
-
|
|
13867
|
+
gen.if(
|
|
13868
|
+
(0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties),
|
|
13869
|
+
() => {
|
|
13870
|
+
const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
|
|
13871
|
+
cxt.mergeValidEvaluated(schCxt, valid);
|
|
13872
|
+
},
|
|
13873
|
+
() => gen.var(valid, true)
|
|
13874
|
+
);
|
|
13829
13875
|
cxt.ok(valid);
|
|
13830
13876
|
}
|
|
13831
13877
|
}
|
|
@@ -15356,20 +15402,26 @@ var require_api = __commonJS({
|
|
|
15356
15402
|
} else if (escapeChar === "u") {
|
|
15357
15403
|
const hexCode = value.slice(escapeIndex + 2, escapeIndex + 6);
|
|
15358
15404
|
if (hexCode.length < 4 || /[^0-9a-f]/i.test(hexCode)) {
|
|
15359
|
-
throw new ErrorWithLocation(
|
|
15360
|
-
|
|
15361
|
-
|
|
15362
|
-
|
|
15363
|
-
|
|
15405
|
+
throw new ErrorWithLocation(
|
|
15406
|
+
`Invalid unicode escape \\u${hexCode}.`,
|
|
15407
|
+
{
|
|
15408
|
+
line: token.loc.start.line,
|
|
15409
|
+
column: token.loc.start.column + escapeIndex,
|
|
15410
|
+
offset: token.loc.start.offset + escapeIndex
|
|
15411
|
+
}
|
|
15412
|
+
);
|
|
15364
15413
|
}
|
|
15365
15414
|
result += String.fromCharCode(parseInt(hexCode, 16));
|
|
15366
15415
|
lastIndex = escapeIndex + 6;
|
|
15367
15416
|
} else {
|
|
15368
|
-
throw new ErrorWithLocation(
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15372
|
-
|
|
15417
|
+
throw new ErrorWithLocation(
|
|
15418
|
+
`Invalid escape \\${escapeChar}.`,
|
|
15419
|
+
{
|
|
15420
|
+
line: token.loc.start.line,
|
|
15421
|
+
column: token.loc.start.column + escapeIndex,
|
|
15422
|
+
offset: token.loc.start.offset + escapeIndex
|
|
15423
|
+
}
|
|
15424
|
+
);
|
|
15373
15425
|
}
|
|
15374
15426
|
escapeIndex = value.indexOf("\\", lastIndex);
|
|
15375
15427
|
}
|
|
@@ -17237,7 +17289,10 @@ var require_source = __commonJS({
|
|
|
17237
17289
|
const arguments_ = strings.slice(1);
|
|
17238
17290
|
const parts = [firstString.raw[0]];
|
|
17239
17291
|
for (let i = 1; i < firstString.length; i++) {
|
|
17240
|
-
parts.push(
|
|
17292
|
+
parts.push(
|
|
17293
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
17294
|
+
String(firstString.raw[i])
|
|
17295
|
+
);
|
|
17241
17296
|
}
|
|
17242
17297
|
if (template === void 0) {
|
|
17243
17298
|
template = require_templates();
|
|
@@ -20270,7 +20325,11 @@ var require_universalify = __commonJS({
|
|
|
20270
20325
|
fn.apply(this, args);
|
|
20271
20326
|
else {
|
|
20272
20327
|
return new Promise((resolve, reject) => {
|
|
20273
|
-
fn.call(
|
|
20328
|
+
fn.call(
|
|
20329
|
+
this,
|
|
20330
|
+
...args,
|
|
20331
|
+
(err, res) => err != null ? reject(err) : resolve(res)
|
|
20332
|
+
);
|
|
20274
20333
|
});
|
|
20275
20334
|
}
|
|
20276
20335
|
}, "name", { value: fn.name });
|
|
@@ -20420,19 +20479,24 @@ var require_polyfills = __commonJS({
|
|
|
20420
20479
|
}(fs.readSync);
|
|
20421
20480
|
function patchLchmod(fs2) {
|
|
20422
20481
|
fs2.lchmod = function(path, mode, callback) {
|
|
20423
|
-
fs2.open(
|
|
20424
|
-
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20429
|
-
fs2.fchmod(fd, mode, function(err2) {
|
|
20430
|
-
fs2.close(fd, function(err22) {
|
|
20482
|
+
fs2.open(
|
|
20483
|
+
path,
|
|
20484
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
|
20485
|
+
mode,
|
|
20486
|
+
function(err, fd) {
|
|
20487
|
+
if (err) {
|
|
20431
20488
|
if (callback)
|
|
20432
|
-
callback(
|
|
20489
|
+
callback(err);
|
|
20490
|
+
return;
|
|
20491
|
+
}
|
|
20492
|
+
fs2.fchmod(fd, mode, function(err2) {
|
|
20493
|
+
fs2.close(fd, function(err22) {
|
|
20494
|
+
if (callback)
|
|
20495
|
+
callback(err2 || err22);
|
|
20496
|
+
});
|
|
20433
20497
|
});
|
|
20434
|
-
}
|
|
20435
|
-
|
|
20498
|
+
}
|
|
20499
|
+
);
|
|
20436
20500
|
};
|
|
20437
20501
|
fs2.lchmodSync = function(path, mode) {
|
|
20438
20502
|
var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
@@ -20883,9 +20947,19 @@ var require_graceful_fs = __commonJS({
|
|
|
20883
20947
|
if (typeof options === "function")
|
|
20884
20948
|
cb = options, options = null;
|
|
20885
20949
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) {
|
|
20886
|
-
return fs$readdir(path2, fs$readdirCallback(
|
|
20950
|
+
return fs$readdir(path2, fs$readdirCallback(
|
|
20951
|
+
path2,
|
|
20952
|
+
options2,
|
|
20953
|
+
cb2,
|
|
20954
|
+
startTime
|
|
20955
|
+
));
|
|
20887
20956
|
} : function go$readdir2(path2, options2, cb2, startTime) {
|
|
20888
|
-
return fs$readdir(path2, options2, fs$readdirCallback(
|
|
20957
|
+
return fs$readdir(path2, options2, fs$readdirCallback(
|
|
20958
|
+
path2,
|
|
20959
|
+
options2,
|
|
20960
|
+
cb2,
|
|
20961
|
+
startTime
|
|
20962
|
+
));
|
|
20889
20963
|
};
|
|
20890
20964
|
return go$readdir(path, options, cb);
|
|
20891
20965
|
function fs$readdirCallback(path2, options2, cb2, startTime) {
|
|
@@ -21177,7 +21251,11 @@ var require_fs = __commonJS({
|
|
|
21177
21251
|
if (typeof fs.realpath.native === "function") {
|
|
21178
21252
|
exports.realpath.native = u(fs.realpath.native);
|
|
21179
21253
|
} else {
|
|
21180
|
-
process.emitWarning(
|
|
21254
|
+
process.emitWarning(
|
|
21255
|
+
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
21256
|
+
"Warning",
|
|
21257
|
+
"fs-extra-WARN0003"
|
|
21258
|
+
);
|
|
21181
21259
|
}
|
|
21182
21260
|
}
|
|
21183
21261
|
});
|
|
@@ -21453,7 +21531,11 @@ var require_copy = __commonJS({
|
|
|
21453
21531
|
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
21454
21532
|
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
21455
21533
|
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
21456
|
-
process.emitWarning(
|
|
21534
|
+
process.emitWarning(
|
|
21535
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
21536
|
+
"Warning",
|
|
21537
|
+
"fs-extra-WARN0001"
|
|
21538
|
+
);
|
|
21457
21539
|
}
|
|
21458
21540
|
stat.checkPaths(src, dest, "copy", opts, (err, stats) => {
|
|
21459
21541
|
if (err)
|
|
@@ -21672,7 +21754,11 @@ var require_copy_sync = __commonJS({
|
|
|
21672
21754
|
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
21673
21755
|
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
21674
21756
|
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
21675
|
-
process.emitWarning(
|
|
21757
|
+
process.emitWarning(
|
|
21758
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
21759
|
+
"Warning",
|
|
21760
|
+
"fs-extra-WARN0002"
|
|
21761
|
+
);
|
|
21676
21762
|
}
|
|
21677
21763
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
21678
21764
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
@@ -23300,17 +23386,18 @@ var require_errorMiddleware = __commonJS({
|
|
|
23300
23386
|
const statusCode = error.statusCode || 500;
|
|
23301
23387
|
const message = (error === null || error === void 0 ? void 0 : error.message) || "An error occurred with no additional information available";
|
|
23302
23388
|
if (error instanceof error_1.ComponentError) {
|
|
23303
|
-
req.log.
|
|
23304
|
-
|
|
23305
|
-
|
|
23306
|
-
|
|
23307
|
-
|
|
23308
|
-
|
|
23309
|
-
|
|
23310
|
-
|
|
23311
|
-
|
|
23389
|
+
req.log.error({
|
|
23390
|
+
area: "component",
|
|
23391
|
+
"function-name": error.functionName,
|
|
23392
|
+
"component-name": error.componentName,
|
|
23393
|
+
"component-version": error.componentVersion,
|
|
23394
|
+
"set-name": error.setName,
|
|
23395
|
+
"log-command": "exception-handler",
|
|
23396
|
+
err: error.error,
|
|
23397
|
+
message
|
|
23398
|
+
});
|
|
23312
23399
|
} else if (error instanceof Error) {
|
|
23313
|
-
req.log.error(error, message);
|
|
23400
|
+
req.log.error({ error, message });
|
|
23314
23401
|
} else {
|
|
23315
23402
|
req.log.error(message);
|
|
23316
23403
|
}
|
|
@@ -23713,7 +23800,10 @@ var require_minimatch = __commonJS({
|
|
|
23713
23800
|
}
|
|
23714
23801
|
matchOne(file, pattern, partial) {
|
|
23715
23802
|
var options = this.options;
|
|
23716
|
-
this.debug(
|
|
23803
|
+
this.debug(
|
|
23804
|
+
"matchOne",
|
|
23805
|
+
{ "this": this, file, pattern }
|
|
23806
|
+
);
|
|
23717
23807
|
this.debug("matchOne", file.length, pattern.length);
|
|
23718
23808
|
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
23719
23809
|
this.debug("matchOne loop");
|
|
@@ -24018,7 +24108,9 @@ var require_minimatch = __commonJS({
|
|
|
24018
24108
|
const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
|
24019
24109
|
const flags = options.nocase ? "i" : "";
|
|
24020
24110
|
let re = set.map((pattern) => {
|
|
24021
|
-
pattern = pattern.map(
|
|
24111
|
+
pattern = pattern.map(
|
|
24112
|
+
(p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src
|
|
24113
|
+
).reduce((set2, p) => {
|
|
24022
24114
|
if (!(set2[set2.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
|
|
24023
24115
|
set2.push(p);
|
|
24024
24116
|
}
|
|
@@ -24222,22 +24314,28 @@ var require_readdir_glob = __commonJS({
|
|
|
24222
24314
|
this.matchers = [];
|
|
24223
24315
|
if (this.options.pattern) {
|
|
24224
24316
|
const matchers = Array.isArray(this.options.pattern) ? this.options.pattern : [this.options.pattern];
|
|
24225
|
-
this.matchers = matchers.map(
|
|
24226
|
-
|
|
24227
|
-
|
|
24228
|
-
|
|
24229
|
-
|
|
24230
|
-
|
|
24317
|
+
this.matchers = matchers.map(
|
|
24318
|
+
(m) => new Minimatch(m, {
|
|
24319
|
+
dot: this.options.dot,
|
|
24320
|
+
noglobstar: this.options.noglobstar,
|
|
24321
|
+
matchBase: this.options.matchBase,
|
|
24322
|
+
nocase: this.options.nocase
|
|
24323
|
+
})
|
|
24324
|
+
);
|
|
24231
24325
|
}
|
|
24232
24326
|
this.ignoreMatchers = [];
|
|
24233
24327
|
if (this.options.ignore) {
|
|
24234
24328
|
const ignorePatterns = Array.isArray(this.options.ignore) ? this.options.ignore : [this.options.ignore];
|
|
24235
|
-
this.ignoreMatchers = ignorePatterns.map(
|
|
24329
|
+
this.ignoreMatchers = ignorePatterns.map(
|
|
24330
|
+
(ignore) => new Minimatch(ignore, { dot: true })
|
|
24331
|
+
);
|
|
24236
24332
|
}
|
|
24237
24333
|
this.skipMatchers = [];
|
|
24238
24334
|
if (this.options.skip) {
|
|
24239
24335
|
const skipPatterns = Array.isArray(this.options.skip) ? this.options.skip : [this.options.skip];
|
|
24240
|
-
this.skipMatchers = skipPatterns.map(
|
|
24336
|
+
this.skipMatchers = skipPatterns.map(
|
|
24337
|
+
(skip) => new Minimatch(skip, { dot: true })
|
|
24338
|
+
);
|
|
24241
24339
|
}
|
|
24242
24340
|
this.iterator = explore(resolve(cwd || "."), this.options.follow, this.options.stat, this._shouldSkipDirectory.bind(this));
|
|
24243
24341
|
this.paused = false;
|
|
@@ -24802,7 +24900,9 @@ var require_async = __commonJS({
|
|
|
24802
24900
|
});
|
|
24803
24901
|
}
|
|
24804
24902
|
if (counter !== numTasks) {
|
|
24805
|
-
throw new Error(
|
|
24903
|
+
throw new Error(
|
|
24904
|
+
"async.auto cannot execute tasks due to a recursive dependency"
|
|
24905
|
+
);
|
|
24806
24906
|
}
|
|
24807
24907
|
}
|
|
24808
24908
|
function getDependents(taskName) {
|
|
@@ -25023,7 +25123,10 @@ var require_async = __commonJS({
|
|
|
25023
25123
|
return res(args[0]);
|
|
25024
25124
|
res(args);
|
|
25025
25125
|
}
|
|
25026
|
-
var item = q._createTaskItem(
|
|
25126
|
+
var item = q._createTaskItem(
|
|
25127
|
+
data,
|
|
25128
|
+
rejectOnError ? promiseCallback2 : callback || promiseCallback2
|
|
25129
|
+
);
|
|
25027
25130
|
if (insertAtFront) {
|
|
25028
25131
|
q._tasks.unshift(item);
|
|
25029
25132
|
} else {
|
|
@@ -25246,11 +25349,16 @@ var require_async = __commonJS({
|
|
|
25246
25349
|
} else {
|
|
25247
25350
|
cb = promiseCallback();
|
|
25248
25351
|
}
|
|
25249
|
-
reduce$1(
|
|
25250
|
-
|
|
25251
|
-
|
|
25252
|
-
|
|
25253
|
-
|
|
25352
|
+
reduce$1(
|
|
25353
|
+
_functions,
|
|
25354
|
+
args,
|
|
25355
|
+
(newargs, fn, iterCb) => {
|
|
25356
|
+
fn.apply(that, newargs.concat((err, ...nextargs) => {
|
|
25357
|
+
iterCb(err, nextargs);
|
|
25358
|
+
}));
|
|
25359
|
+
},
|
|
25360
|
+
(err, results) => cb(err, ...results)
|
|
25361
|
+
);
|
|
25254
25362
|
return cb[PROMISE_SYMBOL];
|
|
25255
25363
|
};
|
|
25256
25364
|
}
|
|
@@ -30657,7 +30765,9 @@ var require_lodash3 = __commonJS({
|
|
|
30657
30765
|
var funcToString = funcProto.toString;
|
|
30658
30766
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
30659
30767
|
var objectToString = objectProto.toString;
|
|
30660
|
-
var reIsNative = RegExp(
|
|
30768
|
+
var reIsNative = RegExp(
|
|
30769
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
30770
|
+
);
|
|
30661
30771
|
var Symbol2 = root.Symbol;
|
|
30662
30772
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
30663
30773
|
var splice = arrayProto.splice;
|
|
@@ -31050,7 +31160,9 @@ var require_lodash4 = __commonJS({
|
|
|
31050
31160
|
var funcToString = funcProto.toString;
|
|
31051
31161
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
31052
31162
|
var objectToString = objectProto.toString;
|
|
31053
|
-
var reIsNative = RegExp(
|
|
31163
|
+
var reIsNative = RegExp(
|
|
31164
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
31165
|
+
);
|
|
31054
31166
|
var Symbol2 = root.Symbol;
|
|
31055
31167
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
31056
31168
|
var splice = arrayProto.splice;
|
|
@@ -32344,7 +32456,10 @@ var require_minimatch2 = __commonJS({
|
|
|
32344
32456
|
};
|
|
32345
32457
|
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
|
32346
32458
|
var options = this.options;
|
|
32347
|
-
this.debug(
|
|
32459
|
+
this.debug(
|
|
32460
|
+
"matchOne",
|
|
32461
|
+
{ "this": this, file, pattern }
|
|
32462
|
+
);
|
|
32348
32463
|
this.debug("matchOne", file.length, pattern.length);
|
|
32349
32464
|
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
32350
32465
|
this.debug("matchOne loop");
|
|
@@ -37376,7 +37491,9 @@ var require_general_purpose_bit = __commonJS({
|
|
|
37376
37491
|
return this;
|
|
37377
37492
|
};
|
|
37378
37493
|
GeneralPurposeBit.prototype.encode = function() {
|
|
37379
|
-
return zipUtil.getShortBytes(
|
|
37494
|
+
return zipUtil.getShortBytes(
|
|
37495
|
+
(this.descriptor ? DATA_DESCRIPTOR_FLAG : 0) | (this.utf8 ? UFT8_NAMES_FLAG : 0) | (this.encryption ? ENCRYPTION_FLAG : 0) | (this.strongEncryption ? STRONG_ENCRYPTION_FLAG : 0)
|
|
37496
|
+
);
|
|
37380
37497
|
};
|
|
37381
37498
|
GeneralPurposeBit.prototype.parse = function(buf, offset) {
|
|
37382
37499
|
var flag = zipUtil.getShortBytesValue(buf, offset);
|
|
@@ -40612,10 +40729,13 @@ var require_query_string = __commonJS({
|
|
|
40612
40729
|
decode: true
|
|
40613
40730
|
}, options);
|
|
40614
40731
|
const [url_, hash] = splitOnFirst(url, "#");
|
|
40615
|
-
return Object.assign(
|
|
40616
|
-
|
|
40617
|
-
|
|
40618
|
-
|
|
40732
|
+
return Object.assign(
|
|
40733
|
+
{
|
|
40734
|
+
url: url_.split("?")[0] || "",
|
|
40735
|
+
query: parse(extract(url), options)
|
|
40736
|
+
},
|
|
40737
|
+
options && options.parseFragmentIdentifier && hash ? { fragmentIdentifier: decode(hash, options) } : {}
|
|
40738
|
+
);
|
|
40619
40739
|
};
|
|
40620
40740
|
exports.stringifyUrl = (object, options) => {
|
|
40621
40741
|
options = Object.assign({
|
|
@@ -40935,7 +41055,7 @@ var require_ComponentSetService = __commonJS({
|
|
|
40935
41055
|
envVars: componentSet.envVars,
|
|
40936
41056
|
headers: componentSet.headers
|
|
40937
41057
|
}, client);
|
|
40938
|
-
await this.
|
|
41058
|
+
await this.saveComponentSetComponents(componentSet.webPath, componentSet.components, client);
|
|
40939
41059
|
return set;
|
|
40940
41060
|
});
|
|
40941
41061
|
const savedSet = await this.getComponentSet(createdSet.webPath);
|
|
@@ -40970,7 +41090,7 @@ var require_ComponentSetService = __commonJS({
|
|
|
40970
41090
|
await this.db.repositories.componentSet.update({ webPath }, values, client);
|
|
40971
41091
|
}
|
|
40972
41092
|
if (data.components !== void 0) {
|
|
40973
|
-
await this.
|
|
41093
|
+
await this.saveComponentSetComponents(webPath, data.components, client);
|
|
40974
41094
|
}
|
|
40975
41095
|
});
|
|
40976
41096
|
return this.getComponentSet(webPath);
|
|
@@ -41003,7 +41123,7 @@ var require_ComponentSetService = __commonJS({
|
|
|
41003
41123
|
components: components !== null && components !== void 0 ? components : {}
|
|
41004
41124
|
};
|
|
41005
41125
|
}
|
|
41006
|
-
async
|
|
41126
|
+
async saveComponentSetComponents(webPath, components, client = null) {
|
|
41007
41127
|
const existingComponents = [];
|
|
41008
41128
|
Object.entries(await this.getExistingComponents(webPath)).forEach(([cn, cvs]) => {
|
|
41009
41129
|
cvs.forEach((cv) => {
|
|
@@ -41283,7 +41403,8 @@ var vm = new import_vm2.NodeVM({
|
|
|
41283
41403
|
builtin: getRuntimeModules()
|
|
41284
41404
|
}
|
|
41285
41405
|
});
|
|
41286
|
-
var script = new import_vm2.VMScript(
|
|
41406
|
+
var script = new import_vm2.VMScript(
|
|
41407
|
+
` const events = require('events');
|
|
41287
41408
|
const asyncHooks = require('async_hooks');
|
|
41288
41409
|
|
|
41289
41410
|
module.exports = function(id, entry, input, info, environment = {}){
|
|
@@ -41368,7 +41489,8 @@ var script = new import_vm2.VMScript(` const events = require('events');
|
|
|
41368
41489
|
})
|
|
41369
41490
|
|
|
41370
41491
|
return emitter;
|
|
41371
|
-
}`
|
|
41492
|
+
}`
|
|
41493
|
+
);
|
|
41372
41494
|
script.compile();
|
|
41373
41495
|
if (import_worker_threads.parentPort) {
|
|
41374
41496
|
vm.on("error", (...data) => {
|