Skip to content

Commit 20ead08

Browse files
committed
💥 支持腾讯云函数执行
1 parent 7b81677 commit 20ead08

11 files changed

Lines changed: 407 additions & 125 deletions

File tree

package-lock.json

Lines changed: 208 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"dexie": "^3.2.0",
2626
"file-saver": "^2.0.5",
2727
"jszip": "^3.7.1",
28+
"log4js": "^6.4.1",
2829
"monaco-editor": "^0.31.1",
2930
"reflect-metadata": "^0.1.13",
3031
"sortablejs": "^1.14.0",

src/apps/grant/background.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,7 @@ export class BackgroundGrant {
670670
protected CAT_fetchBlob(grant: Grant): Promise<any> {
671671
return new Promise(resolve => {
672672
const handler = async () => {
673-
const resp=await (await fetch(<string>grant.params[0])).blob();
674-
console.log('fetch',resp);
673+
const resp = await (await fetch(<string>grant.params[0])).blob();
675674
resolve(resp);
676675
}
677676
void handler();

src/apps/grant/frontend.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,10 @@ export class FrontendGrant implements ScriptContext {
152152
let abort = () => { return };
153153
const handler = async () => {
154154
const u = new URL(details.url, window.location.href);
155-
if (details.headers) {
156-
for (const key in details.headers) {
157-
if (key.toLowerCase() == 'cookie') {
158-
details.cookie = details.cookie || details.headers[key];
159-
delete details.headers[key];
160-
}
155+
for (const key in details.headers) {
156+
if (key.toLowerCase() == 'cookie') {
157+
details.cookie = details.headers[key];
158+
delete details.headers[key];
161159
}
162160
}
163161
const param: GMSend.XHRDetails = {

src/apps/msg-center/msg-center.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { compileScript } from "@App/pkg/sandbox/compile";
21

32
export type ListenCallback = (msg: any, port: chrome.runtime.Port) => Promise<any> | any;
43

src/pkg/sdk/tencent_cloud/scf.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export interface CreateFunctionRequest {
1515

1616
export interface CreateTriggerRequest {
1717
FunctionName: string,
18-
TriggerName: string
19-
Type: 'timer'
18+
TriggerName?: string
19+
Type?: 'timer'
2020
TriggerDesc?: string
2121
}
2222

@@ -26,6 +26,7 @@ export interface GetFunctionRequest {
2626

2727
export interface GetFunctionResponse extends Response {
2828
FunctionName: string
29+
Status: 'Creating' | 'CreateFailed' | 'Active' | 'Updating' | 'UpdateFailed' | 'Publishing' | 'PublishFailed' | 'Deleting' | 'DeleteFailed'
2930
}
3031

3132
export class ScfClient extends Client {

src/template/cloudcat-package/package.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"test": "echo \"Error: no test specified\" && exit 1"
99
},
1010
"author": "CodFrm",
11-
"license": "ISC",
11+
"license": "MIT",
1212
"dependencies": {
13-
"scriptcat-nodejs": "^0.1.2"
13+
"scriptcat-nodejs": "^0.1.4"
1414
}
1515
}

0 commit comments

Comments
 (0)