edgeone 1.0.5 → 1.0.7
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/edgeone-dist/cli.js +27 -2
- package/package.json +4 -2
package/edgeone-dist/cli.js
CHANGED
|
@@ -103299,7 +103299,7 @@ var yargs_default = Yargs;
|
|
|
103299
103299
|
// package.json
|
|
103300
103300
|
var package_default = {
|
|
103301
103301
|
name: "edgeone",
|
|
103302
|
-
version: "1.0.
|
|
103302
|
+
version: "1.0.7",
|
|
103303
103303
|
description: "Command-line interface for TencentCloud Pages Functions",
|
|
103304
103304
|
bin: {
|
|
103305
103305
|
edgeone: "./edgeone-bin/edgeone.js"
|
|
@@ -103363,6 +103363,7 @@ var package_default = {
|
|
|
103363
103363
|
"node-fetch": "^3.3.2",
|
|
103364
103364
|
prompts: "^2.4.2",
|
|
103365
103365
|
react: "^17.0.2",
|
|
103366
|
+
rimraf: "^6.0.1",
|
|
103366
103367
|
semiver: "^1.1.0",
|
|
103367
103368
|
sirv: "^2.0.3",
|
|
103368
103369
|
"tencentcloud-cls-sdk-js-web": "^1.0.13",
|
|
@@ -103371,7 +103372,8 @@ var package_default = {
|
|
|
103371
103372
|
ws: "^8.14.2",
|
|
103372
103373
|
yargs: "^17.6.2",
|
|
103373
103374
|
zod: "^3.23.8",
|
|
103374
|
-
"zod-to-json-schema": "^3.23.5"
|
|
103375
|
+
"zod-to-json-schema": "^3.23.5",
|
|
103376
|
+
"esbuild-register": "^3.6.0"
|
|
103375
103377
|
},
|
|
103376
103378
|
engines: {
|
|
103377
103379
|
node: ">=12"
|
|
@@ -113049,6 +113051,13 @@ function isSource(v) {
|
|
|
113049
113051
|
if (/(?<![a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]):/.test(v) || /:(?![a-zA-Z0-9]+)/.test(v)) {
|
|
113050
113052
|
return Error_Message.char_match;
|
|
113051
113053
|
}
|
|
113054
|
+
if (v.length) {
|
|
113055
|
+
const arr = v.split("/");
|
|
113056
|
+
const ret = arr.some((v2) => v2.includes(":") && (v2.includes("*") || v2.includes(".")));
|
|
113057
|
+
if (ret) {
|
|
113058
|
+
return Error_Message.char_match;
|
|
113059
|
+
}
|
|
113060
|
+
}
|
|
113052
113061
|
}
|
|
113053
113062
|
function isDestination(v) {
|
|
113054
113063
|
var _a6;
|
|
@@ -113069,6 +113078,13 @@ function isDestination(v) {
|
|
|
113069
113078
|
if (/(?<![a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]):/.test(v) || /:(?![a-zA-Z0-9]+)/.test(v)) {
|
|
113070
113079
|
return Error_Message.char_match;
|
|
113071
113080
|
}
|
|
113081
|
+
if (v.length) {
|
|
113082
|
+
const arr = v.split("/");
|
|
113083
|
+
const ret = arr.some((v2) => v2.includes(":") && (v2.includes("*") || v2.includes(".")));
|
|
113084
|
+
if (ret) {
|
|
113085
|
+
return Error_Message.char_match;
|
|
113086
|
+
}
|
|
113087
|
+
}
|
|
113072
113088
|
}
|
|
113073
113089
|
function isKey(v) {
|
|
113074
113090
|
if (v.length === 0) {
|
|
@@ -114658,6 +114674,10 @@ async function PagesDevServer(devConfig) {
|
|
|
114658
114674
|
res.writeHead(204, { "X-LEGO-PROXY": "blocked by edgeone" });
|
|
114659
114675
|
return res.end();
|
|
114660
114676
|
}
|
|
114677
|
+
if (req.method === "OPTIONS") {
|
|
114678
|
+
res.writeHead(200, { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "*", "Access-Control-Allow-Headers": "*" });
|
|
114679
|
+
return res.end();
|
|
114680
|
+
}
|
|
114661
114681
|
proxy.web(req, res, {
|
|
114662
114682
|
target: `${DebugUrl}`,
|
|
114663
114683
|
changeOrigin: true
|
|
@@ -114667,6 +114687,11 @@ async function PagesDevServer(devConfig) {
|
|
|
114667
114687
|
console.log("proxy error", _err);
|
|
114668
114688
|
reportError("Proxy server error", _err);
|
|
114669
114689
|
});
|
|
114690
|
+
proxy.on("proxyRes", function(proxyRes, req, res) {
|
|
114691
|
+
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
114692
|
+
res.setHeader("Access-Control-Allow-Methods", "*");
|
|
114693
|
+
res.setHeader("Access-Control-Allow-Headers", "*");
|
|
114694
|
+
});
|
|
114670
114695
|
proxy.on("close", async () => {
|
|
114671
114696
|
process.exit(1);
|
|
114672
114697
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edgeone",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Command-line interface for TencentCloud Pages Functions",
|
|
5
5
|
"bin": {
|
|
6
6
|
"edgeone": "./edgeone-bin/edgeone.js"
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"node-fetch": "^3.3.2",
|
|
65
65
|
"prompts": "^2.4.2",
|
|
66
66
|
"react": "^17.0.2",
|
|
67
|
+
"rimraf": "^6.0.1",
|
|
67
68
|
"semiver": "^1.1.0",
|
|
68
69
|
"sirv": "^2.0.3",
|
|
69
70
|
"tencentcloud-cls-sdk-js-web": "^1.0.13",
|
|
@@ -72,7 +73,8 @@
|
|
|
72
73
|
"ws": "^8.14.2",
|
|
73
74
|
"yargs": "^17.6.2",
|
|
74
75
|
"zod": "^3.23.8",
|
|
75
|
-
"zod-to-json-schema": "^3.23.5"
|
|
76
|
+
"zod-to-json-schema": "^3.23.5",
|
|
77
|
+
"esbuild-register": "^3.6.0"
|
|
76
78
|
},
|
|
77
79
|
"engines": {
|
|
78
80
|
"node": ">=12"
|