lemon-engine
Version:
Lemon Engine Module to Synchronize Node over DynamoDB + ElastiCache + Elasticsearch by [lemoncloud](https://lemoncloud.io)
45 lines (44 loc) • 1.27 kB
TypeScript
/**
* Http Proxy Service Exports
* - proxy call to http based service.
*
*
*
* @author steve@lemoncloud.io
* @date 2019-05-23
* @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
*/
import { EnginePluggable, EnginePluginBuilder } from '../common/types';
/**
* Define Interface
*
* @see http://www.albertgao.xyz/2016/08/11/how-to-declare-a-function-type-variable-in-typescript/
*/
export interface HttpProxy extends EnginePluggable {
/**
* get the current endpoint address.
*/
endpoint: () => string;
/**
* GET
*/
do_get: (type: string, id?: string, cmd?: string, $param?: any, $body?: any, $ctx?: any) => any;
/**
* PUT
*/
do_put: (type: string, id?: string, cmd?: string, $param?: any, $body?: any, $ctx?: any) => any;
/**
* POST
*/
do_post: (type: string, id?: string, cmd?: string, $param?: any, $body?: any, $ctx?: any) => any;
/**
* PATCH
*/
do_patch: (type: string, id?: string, cmd?: string, $param?: any, $body?: any, $ctx?: any) => any;
/**
* DELETE
*/
do_delete: (type: string, id?: string, cmd?: string, $param?: any, $body?: any, $ctx?: any) => any;
}
declare const maker: EnginePluginBuilder<HttpProxy>;
export default maker;