mpserverless-sdk-core
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "mpserverless-sdk-core", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Alipay miniprogram Serverless SDK Core", | ||
@@ -5,0 +5,0 @@ "main": "dist/client.js", |
@@ -5,57 +5,57 @@ // This file is auto-generated, don't edit it | ||
export class Config extends $tea.Model { | ||
mpserverless: any; | ||
mpserverless: any; | ||
constructor(map?: { [key: string]: any }) { | ||
super(map); | ||
} | ||
constructor(map?: { [key: string]: any }) { | ||
super(map); | ||
} | ||
static names(): { [key: string]: string } { | ||
return { | ||
mpserverless: 'mpserverless', | ||
}; | ||
} | ||
static names(): { [key: string]: string } { | ||
return { | ||
mpserverless: 'mpserverless', | ||
}; | ||
} | ||
static types(): { [key: string]: any } { | ||
return { | ||
mpserverless: 'any', | ||
}; | ||
} | ||
static types(): { [key: string]: any } { | ||
return { | ||
mpserverless: 'any', | ||
}; | ||
} | ||
} | ||
export interface ServerlessFunction { | ||
invoke<T, R>(functionName: string, request: object): Promise<object>; | ||
invoke<T, R>(functionName: string, request: object): Promise<object>; | ||
} | ||
export interface Serverless { | ||
function: ServerlessFunction; | ||
function: ServerlessFunction; | ||
} | ||
export default class Client { | ||
static invoker; | ||
static invoker; | ||
constructor() { | ||
} | ||
constructor() { | ||
} | ||
static setConfig(config: Config): void { | ||
this.invoker = <Serverless>config.mpserverless | ||
} | ||
static setConfig(config: Config): void { | ||
this.invoker = <Serverless>config.mpserverless | ||
} | ||
static async invokeFunction(openApiName: string, params: { [key: string]: any }): Promise<{ [key: string]: any }> { | ||
const args = { | ||
'method': openApiName, | ||
params | ||
}; | ||
let response = await this.invoker.function.invoke("alipay-openapi", args); | ||
return response.result; | ||
} | ||
static async invokeFunction(openApiName: string, params: { [key: string]: any }): Promise<{ [key: string]: any }> { | ||
const args = { | ||
'method': openApiName, | ||
params | ||
}; | ||
let response = await this.invoker.function.invoke("alipay-openapi", args); | ||
return response.result; | ||
} | ||
static async invokePreFunction(preFunctionName: string, openApiName: string, params: { [key: string]: any }): Promise<{ [key: string]: any }> { | ||
const args = { | ||
'method': openApiName, | ||
params | ||
}; | ||
let response = await this.invoker.function.invoke(preFunctionName, args); | ||
return response.result; | ||
} | ||
static async invokePreFunction(preFunctionName: string, openApiName: string, params: { [key: string]: any }): Promise<{ [key: string]: any }> { | ||
const args = { | ||
'method': openApiName, | ||
params | ||
}; | ||
let response = await this.invoker.function.invoke(preFunctionName, args); | ||
return response.result; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
0
5265