Skip to content

Commit b816404

Browse files
authored
Merge branch 'main' into feat-web-fixbugs
2 parents 8fe5e77 + c3dd637 commit b816404

File tree

34 files changed

+700
-436
lines changed

34 files changed

+700
-436
lines changed

CHANGELOG.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
# [](https://github.com/maslow/laf/compare/v1.0.0-alpha.2...v) (2022-12-24)
1+
# [](https://github.com/maslow/laf/compare/v1.0.0-alpha.4...v) (2023-01-01)
2+
3+
4+
5+
# [1.0.0-alpha.4](https://github.com/maslow/laf/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2023-01-01)
6+
7+
8+
### Bug Fixes
9+
10+
* **runtime:** add func data header for debug api, support multiple-method for debug request ([#594](https://github.com/maslow/laf/issues/594)) ([db9eacd](https://github.com/maslow/laf/commit/db9eacd8015a2a4b428230456588e11f51fdcf09))
11+
12+
13+
### Features
14+
15+
* **cli:** init cli project ([#488](https://github.com/maslow/laf/issues/488)) ([90b177f](https://github.com/maslow/laf/commit/90b177ff63697bc76591ebfbd40577adf0959acb))
16+
* **cli:** login and logout & update work dir ([#587](https://github.com/maslow/laf/issues/587)) ([792a0f3](https://github.com/maslow/laf/commit/792a0f31794cb44d5d3489456237080571edc50e))
17+
* **server:** implement pat schema & apis ([#597](https://github.com/maslow/laf/issues/597)) ([d4da55a](https://github.com/maslow/laf/commit/d4da55a9305547496a64c64e1c7c9ddbff68a36d))
18+
* **web:** add custom url for page ([#592](https://github.com/maslow/laf/issues/592)) ([41916f9](https://github.com/maslow/laf/commit/41916f973078926ee1556c839a8cdf9707b9cc76))
19+
* **web:** add function ide console panel ([#593](https://github.com/maslow/laf/issues/593)) ([03846e7](https://github.com/maslow/laf/commit/03846e759430192f86174cec6a78a29705717043))
20+
* **web:** adjust dependence add、remove、get interface ([#582](https://github.com/maslow/laf/issues/582)) ([7795fb1](https://github.com/maslow/laf/commit/7795fb1a739b027c53161b86612d37944b9406e0))
21+
* **web:** disabled upload button when fileList is empty ([#589](https://github.com/maslow/laf/issues/589)) ([5de333c](https://github.com/maslow/laf/commit/5de333c76513783b911a0094bc52a652a586a40b))
22+
* **web:** fix functionPannel & dataPannel ([#586](https://github.com/maslow/laf/issues/586)) ([7dcc72a](https://github.com/maslow/laf/commit/7dcc72a31745ddf47e5c47c30d59a92c243a4365))
23+
* **web:** impl storage page ([5c42bc6](https://github.com/maslow/laf/commit/5c42bc6e4c967a526547ac6bfb0284c658768209))
24+
25+
26+
27+
# [1.0.0-alpha.3](https://github.com/maslow/laf/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2022-12-24)
228

329

430
### Bug Fixes

runtimes/nodejs/package-lock.json

+35-95
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtimes/nodejs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"express": "^4.18.2",
3636
"express-xml-bodyparser": "^0.3.0",
3737
"fs-extra": "^9.1.0",
38-
"jsonwebtoken": "^8.5.1",
38+
"jsonwebtoken": "^9.0.0",
3939
"lodash": "^4.17.21",
4040
"log4js": "^6.7.1",
4141
"minio": "^7.0.32",

runtimes/nodejs/src/handler/debug-func.ts

+17-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { logger } from '../support/logger'
1111
import { CloudFunction } from '../support/function-engine'
1212
import { IRequest } from '../support/types'
1313
import { parseToken } from '../support/token'
14+
import { ICloudFunctionData } from '@lafjs/cloud'
1415

1516
/**
1617
* Handler of debugging cloud function
@@ -26,10 +27,22 @@ export async function handleDebugFunction(req: IRequest, res: Response) {
2627
return res.status(403).send('permission denied: invalid debug token')
2728
}
2829

30+
// get func_data from header
31+
const func_str = req.get('x-laf-func-data')
32+
if (!func_str) {
33+
return res.status(400).send('x-laf-func-data is required')
34+
}
35+
36+
// parse func_data
37+
let func_data: ICloudFunctionData
38+
try {
39+
func_data = JSON.parse(func_str)
40+
} catch (error) {
41+
return res.status(400).send('x-laf-func-data is invalid')
42+
}
43+
2944
const requestId = req['requestId']
3045
const func_name = req.params?.name
31-
const func_data = req.body?.func
32-
const param = req.body?.param
3346

3447
if (!func_data) {
3548
return res.send({ code: 1, error: 'function data not found', requestId })
@@ -42,12 +55,13 @@ export async function handleDebugFunction(req: IRequest, res: Response) {
4255
const ctx: FunctionContext = {
4356
query: req.query,
4457
files: req.files as any,
45-
body: param,
58+
body: req.body,
4659
headers: req.headers,
4760
method: req.method,
4861
auth: req.user,
4962
user: req.user,
5063
requestId,
64+
request: req,
5165
response: res,
5266
__function_name: func.name,
5367
}

0 commit comments

Comments
 (0)