mpserverless-sdk-core
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -1,25 +0,3 @@ | ||
import * as $tea from '@alicloud/tea-typescript'; | ||
export declare class Config extends $tea.Model { | ||
mpserverless: any; | ||
constructor(map?: { | ||
[key: string]: any; | ||
}); | ||
static names(): { | ||
[key: string]: string; | ||
}; | ||
static types(): { | ||
[key: string]: any; | ||
}; | ||
} | ||
export interface ServerlessFunction { | ||
invoke<T, R>(functionName: string, request: object): Promise<object>; | ||
} | ||
export interface Serverless { | ||
function: ServerlessFunction; | ||
} | ||
export default class Client { | ||
static invoker: any; | ||
constructor(); | ||
static setConfig(config: Config): void; | ||
static invokeFunction(openApiName: string, params: { | ||
static invoke(openApiName: string, params: { | ||
[key: string]: any; | ||
@@ -29,10 +7,2 @@ }): Promise<{ | ||
}>; | ||
static invokeFunctionWithPageExe(openApiName: string, params: { | ||
[key: string]: any; | ||
}): Promise<string>; | ||
static invokePreFunction(preFunctionName: string, openApiName: string, params: { | ||
[key: string]: any; | ||
}): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
} |
"use strict"; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// This file is auto-generated, don't edit it | ||
const $tea = __importStar(require("@alicloud/tea-typescript")); | ||
class Config extends $tea.Model { | ||
constructor(map) { | ||
super(map); | ||
} | ||
static names() { | ||
return { | ||
mpserverless: 'mpserverless', | ||
}; | ||
} | ||
static types() { | ||
return { | ||
mpserverless: 'any', | ||
}; | ||
} | ||
} | ||
exports.Config = Config; | ||
class Client { | ||
constructor() { | ||
static async invoke(openApiName, params) { | ||
throw new Error('Un-implemented!'); | ||
} | ||
static setConfig(config) { | ||
this.invoker = config.mpserverless; | ||
} | ||
static async invokeFunction(openApiName, params) { | ||
const args = { | ||
'method': openApiName, | ||
params | ||
}; | ||
let response = await this.invoker.function.invoke("alipay-openapi", args); | ||
return response.result; | ||
} | ||
static async invokeFunctionWithPageExe(openApiName, params) { | ||
const args = { | ||
'method': openApiName, | ||
params | ||
}; | ||
let response = await this.invoker.function.invoke("alipay-openapi", args); | ||
return response.result; | ||
} | ||
static async invokePreFunction(preFunctionName, openApiName, params) { | ||
const args = { | ||
'method': openApiName, | ||
params | ||
}; | ||
let response = await this.invoker.function.invoke(preFunctionName, args); | ||
return response.result; | ||
} | ||
} | ||
exports.default = Client; | ||
//# sourceMappingURL=client.js.map |
{ | ||
"name": "mpserverless-sdk-core", | ||
"version": "0.0.6", | ||
"description": "Alipay miniprogram Serverless SDK Core", | ||
"main": "dist/client.js", | ||
"version": "0.0.7", | ||
"description": "Alipay mini program Serverless SDK Core", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1", |
// This file is auto-generated, don't edit it | ||
import { Readable } from 'stream'; | ||
import * as $tea from '@alicloud/tea-typescript'; | ||
export class Config extends $tea.Model { | ||
mpserverless: any; | ||
constructor(map?: { [key: string]: any }) { | ||
super(map); | ||
} | ||
static names(): { [key: string]: string } { | ||
return { | ||
mpserverless: 'mpserverless', | ||
}; | ||
} | ||
static types(): { [key: string]: any } { | ||
return { | ||
mpserverless: 'any', | ||
}; | ||
} | ||
} | ||
export interface ServerlessFunction { | ||
invoke<T, R>(functionName: string, request: object): Promise<object>; | ||
} | ||
export interface Serverless { | ||
function: ServerlessFunction; | ||
} | ||
export default class Client { | ||
static invoker; | ||
constructor() { | ||
static async invoke(openApiName: string, params: {[key: string]: any}): Promise<{[key: string]: any}> { | ||
throw new Error('Un-implemented!'); | ||
} | ||
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 invokeFunctionWithPageExe(openApiName: string, params: { [key: string]: any }): Promise<string> { | ||
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; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9
164
6149
1