@colearn/microservices-kit
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -1,6 +0,6 @@ | ||
import { RequestInfo, RequestInit } from 'node-fetch'; | ||
import * as fetch from 'node-fetch'; | ||
export default class MicroserviceHttpClient { | ||
private baseURL; | ||
constructor(baseURL: string); | ||
protected fetch(url: RequestInfo, init?: RequestInit, token?: any): Promise<import("node-fetch").Response>; | ||
protected fetch(url: fetch.RequestInfo, init?: fetch.RequestInit, token?: any): Promise<fetch.Response>; | ||
} |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const node_fetch_1 = __importDefault(require("node-fetch")); | ||
const fetch = __importStar(require("node-fetch")); | ||
class MicroserviceHttpClient { | ||
@@ -19,3 +35,3 @@ constructor(baseURL) { | ||
} | ||
const response = await (0, node_fetch_1.default)(`${this.baseURL}/${url}`, { | ||
const response = await fetch.default(`${this.baseURL}/${url}`, { | ||
...(init !== null && init !== void 0 ? init : {}), | ||
@@ -22,0 +38,0 @@ method: (_a = init === null || init === void 0 ? void 0 : init.method) !== null && _a !== void 0 ? _a : 'GET', |
{ | ||
"name": "@colearn/microservices-kit", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "colearn microservice kit", | ||
@@ -5,0 +5,0 @@ "author": "Colearn", |
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
Network access
Supply chain riskThis module accesses the network.
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
34538
551
1