UNPKG

@breautek/storm

Version:

Object-Oriented REST API framework

25 lines (24 loc) 1.41 kB
import { Application } from './Application'; import { HTTPMethod } from './HTTPMethod'; import { ServiceResponse } from './ServiceResponse'; import { OutgoingHttpHeaders } from 'http2'; export declare abstract class ServiceProvider { private $app; constructor(app: Application); protected abstract _getBase(): string; protected abstract _getPort(): number; protected _getApp(): Application; getApp(): Application; protected _getDomain(): string; private $getSecret; urlSuffix(): string; protected _getProtocol(): string; getVersion(): string; protected _createURL(url: string, queryParams?: Record<any, any>): string; request(method: HTTPMethod, url: string, accessToken: string, data: any, headers?: OutgoingHttpHeaders, additionalOptions?: any): Promise<ServiceResponse>; private $sendRequest; get(url: string, accessToken: string, data?: any, headers?: OutgoingHttpHeaders, additionalOptions?: any): Promise<ServiceResponse>; post(url: string, accessToken: string, data?: any, headers?: OutgoingHttpHeaders, additionalOptions?: any): Promise<ServiceResponse>; put(url: string, accessToken: string, data?: any, headers?: OutgoingHttpHeaders, additionalOptions?: any): Promise<ServiceResponse>; delete(url: string, accessToken: string, data?: any, headers?: OutgoingHttpHeaders, additionalOptions?: any): Promise<ServiceResponse>; }