UNPKG

coa-wx-isv

Version:

一个轻量的微信SDK服务商版 for Node.js

34 lines (33 loc) 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WxIsvServiceBase = void 0; class WxIsvServiceBase { constructor(bin) { this.customErrorMessage = {}; this.bin = bin; this.config = bin.config; } async request(method, url, data, params, ignoreError = []) { return await this.bin.request({ method, url, params, data }, this.customErrorMessage, this.customErrorHandler, ignoreError); } async requestStream(method, url, data, params, ignoreError = []) { return await this.bin.request({ method, url, params, data, responseType: 'stream' }, this.customErrorMessage, this.customErrorHandler, ignoreError); } async requestTransformResponse(method, url, data, params, transformResponseFunction, ignoreError = []) { return await this.bin.requestTransformResponse({ method, url, params, data }, this.customErrorMessage, this.customErrorHandler, ignoreError, transformResponseFunction); } async requestBuffer(method, url, buffer, headers = {}, params = {}, ignoreError = []) { return await this.bin.request({ method, url, params, data: buffer, headers, }, this.customErrorMessage, this.customErrorHandler, ignoreError); } // eslint-disable-next-line @typescript-eslint/no-unused-vars customErrorHandler(res) { // handle custom error } } exports.WxIsvServiceBase = WxIsvServiceBase;