@koibanx/http
Advanced tools
Comparing version 0.0.2 to 0.0.3
import { AxiosInstance } from 'axios'; | ||
import { StatusCode } from './utils/statusCode'; | ||
export declare type Input<B> = { | ||
@@ -6,13 +7,14 @@ url: string; | ||
headers?: Record<string, string>; | ||
params?: any; | ||
}; | ||
export declare type Output<O> = { | ||
status: number; | ||
status: StatusCode; | ||
body: O; | ||
}; | ||
export interface IClient { | ||
get<O>({ url, headers }: Input<undefined>): Promise<Output<O>>; | ||
get<O>({ url, headers, params }: Input<undefined>): Promise<Output<O>>; | ||
post<B, O>({ url, headers, body }: Input<B>): Promise<Output<O>>; | ||
put<B, O>({ url, headers }: Input<B>): Promise<Output<O>>; | ||
put<B, O>({ url, headers, body }: Input<B>): Promise<Output<O>>; | ||
delete<O>({ url, headers }: Input<undefined>): Promise<Output<O>>; | ||
} | ||
export declare const client: (instance: AxiosInstance) => IClient; |
@@ -13,3 +13,3 @@ "use strict"; | ||
}); | ||
const httpGet = (client) => ({ url, headers, }) => client.get(url, { headers }) | ||
const httpGet = (client) => ({ url, headers, params, }) => client.get(url, { headers, params }) | ||
.then((res) => handleResponse(res)) | ||
@@ -16,0 +16,0 @@ .catch((err) => handleError(err)); |
@@ -5,2 +5,3 @@ import { Interceptor } from './Interceptor'; | ||
export { Interceptor } from './Interceptor'; | ||
export { StatusCode } from './utils/statusCode'; | ||
/** | ||
@@ -7,0 +8,0 @@ * |
@@ -6,5 +6,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StatusCode = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
const Interceptor_1 = require("./Interceptor"); | ||
const Client_1 = require("./Client"); | ||
var statusCode_1 = require("./utils/statusCode"); | ||
Object.defineProperty(exports, "StatusCode", { enumerable: true, get: function () { return statusCode_1.StatusCode; } }); | ||
/** | ||
@@ -11,0 +14,0 @@ * Module Http for Default |
{ | ||
"name": "@koibanx/http", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51342
14
961
1