@colearn/microservices-kit
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -1,6 +0,6 @@ | ||
import * as fetch from 'node-fetch'; | ||
import fetch from 'isomorphic-unfetch'; | ||
export default class MicroserviceHttpClient { | ||
private baseURL; | ||
constructor(baseURL: string); | ||
protected fetch(url: fetch.RequestInfo, init?: fetch.RequestInit, token?: any): Promise<fetch.Response>; | ||
protected fetchJson(url: string, init?: fetch.IsomorphicRequestInit, token?: any): Promise<any>; | ||
} |
"use strict"; | ||
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; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fetch = __importStar(require("node-fetch")); | ||
const isomorphic_unfetch_1 = __importDefault(require("isomorphic-unfetch")); | ||
class MicroserviceHttpClient { | ||
@@ -27,3 +11,3 @@ constructor(baseURL) { | ||
} | ||
async fetch(url, init, token) { | ||
async fetchJson(url, init, token) { | ||
var _a; | ||
@@ -36,3 +20,3 @@ const headers = { | ||
} | ||
const response = await fetch.default(`${this.baseURL}/${url}`, { | ||
const response = await (0, isomorphic_unfetch_1.default)(`${this.baseURL}/${url}`, { | ||
...(init !== null && init !== void 0 ? init : {}), | ||
@@ -39,0 +23,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.5", | ||
"version": "0.0.6", | ||
"description": "colearn microservice kit", | ||
@@ -39,3 +39,3 @@ "author": "Colearn", | ||
"express-jwt": "^6.1.0", | ||
"node-fetch": "^3.1.0" | ||
"isomorphic-unfetch": "^3.1.0" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
0
33849
535
+ Addedisomorphic-unfetch@^3.1.0
+ Addedisomorphic-unfetch@3.1.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedunfetch@4.2.0(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removednode-fetch@^3.1.0
- Removeddata-uri-to-buffer@4.0.1(transitive)
- Removedfetch-blob@3.2.0(transitive)
- Removedformdata-polyfill@4.0.10(transitive)
- Removednode-domexception@1.0.0(transitive)
- Removednode-fetch@3.3.2(transitive)
- Removedweb-streams-polyfill@3.3.3(transitive)