@vitrical/utils
Advanced tools
Comparing version 1.1.7 to 1.1.8
11
api.d.ts
@@ -30,1 +30,12 @@ import { Response } from './superagent'; | ||
export declare const request: ({ method, url, body, query, headers, }: CustomRequestOptions) => Promise<CustomRequestResponse>; | ||
export declare const makeMicroserviceRequest: (baseURL: string, key: string) => (method: 'get' | 'post' | 'put' | 'delete', url: string, options?: { | ||
body?: string | { | ||
[key: string]: any; | ||
} | undefined; | ||
query?: string | { | ||
[key: string]: any; | ||
} | undefined; | ||
headers?: { | ||
[key: string]: any; | ||
} | undefined; | ||
} | undefined) => Promise<CustomRequestResponse>; |
13
api.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.request = exports.handleSuperagentError = exports.ApiError = void 0; | ||
exports.makeMicroserviceRequest = exports.request = exports.handleSuperagentError = exports.ApiError = void 0; | ||
const superagent_1 = require("./superagent"); | ||
@@ -89,2 +89,13 @@ class ApiError extends Error { | ||
exports.request = request; | ||
const makeMicroserviceRequest = (baseURL, key) => (method, url, options) => (0, exports.request)({ | ||
method, | ||
url: `${baseURL}${url}`, | ||
body: options?.body, | ||
query: options?.query, | ||
headers: { | ||
key, | ||
...options?.headers, | ||
}, | ||
}); | ||
exports.makeMicroserviceRequest = makeMicroserviceRequest; | ||
//# sourceMappingURL=api.js.map |
{ | ||
"name": "@vitrical/utils", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Collection of useful functions and typings", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
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
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
44993
763