@alipay/faas-server-sdk
Advanced tools
Comparing version 0.0.27 to 0.0.28
import { CallFunctionResponse } from '../../types'; | ||
import type { Next } from 'koa'; | ||
import { HttpRequestContext } from './HttpRequestContext'; | ||
export declare function callFunctionMiddleware<T>(ctx: HttpRequestContext<CallFunctionResponse<T>, T>, next: Next): Promise<void>; | ||
export declare function callFunctionMiddleware<T>(ctx: HttpRequestContext<CallFunctionResponse | T, T>, next: Next): Promise<void>; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.callFunctionMiddleware=void 0;async function callFunctionMiddleware(e,r){await r();const s=e.requestId;e.res.status!==200?e.result={succeed:!1,status:e.res.status,requestId:s,errCode:-1,errMsg:`code = ${e.res.data.errCode}, msg = ${e.res.data.errMsg}`}:e.result={succeed:!0,status:e.res.status,requestId:s,data:e.res.data.result}}exports.callFunctionMiddleware=callFunctionMiddleware; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.callFunctionMiddleware=void 0;async function callFunctionMiddleware(e,t){await t();const s=e.requestId;if(e.res.status!==200){const r=e.res.data;e.result={succeed:!1,status:e.res.status,requestId:s,errCode:-1,errMsg:`code = ${r.errCode}, msg = ${r.errMsg}`}}else e.result={succeed:!0,status:e.res.status,requestId:s,data:e.res.data}}exports.callFunctionMiddleware=callFunctionMiddleware; |
@@ -34,5 +34,4 @@ import { RequestOptions } from 'urllib'; | ||
} | ||
export interface CallFunctionResponse<T = object> { | ||
export interface CallFunctionResponse { | ||
errCode: string; | ||
result: T; | ||
errMsg: string; | ||
@@ -39,0 +38,0 @@ } |
{ | ||
"name": "@alipay/faas-server-sdk", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"description": "云函数服务 SDK", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54805
515