Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@colearn/microservices-kit

Package Overview
Dependencies
Maintainers
3
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@colearn/microservices-kit - npm Package Compare versions

Comparing version 0.0.46 to 0.0.47

5

lib/client.d.ts

@@ -0,1 +1,2 @@

/// <reference types="node" />
import { RequestInit, Response } from 'node-fetch';

@@ -6,3 +7,5 @@ export declare class MicroserviceHttpClient {

constructor(baseURL: string, token?: string | undefined);
protected fetch(url: string, init?: RequestInit, token?: any): Promise<Response>;
protected fetch(url: string, init?: RequestInit & {
params?: URLSearchParams | string;
}, token?: string): Promise<Response>;
}

12

lib/client.js

@@ -13,12 +13,14 @@ "use strict";

}
async fetch(url, init, token) {
async fetch(url, init = {}, token) {
var _a;
const { params, ...rest } = init || {};
const headers = {
'Content-Type': 'application/json',
};
if (token) {
headers['Authorization'] = `Bearer ${token}`;
const t = token || this.token;
if (t) {
headers['Authorization'] = `Bearer ${t}`;
}
const response = await (0, isomorphic_fetch_1.default)(`${this.baseURL}/${url}`, {
...(init !== null && init !== void 0 ? init : {}),
const response = await (0, isomorphic_fetch_1.default)(`${this.baseURL}/${url}${params ? `?${params.toString()}` : ''}`, {
...(rest !== null && rest !== void 0 ? rest : {}),
method: (_a = init === null || init === void 0 ? void 0 : init.method) !== null && _a !== void 0 ? _a : 'GET',

@@ -25,0 +27,0 @@ headers,

{
"name": "@colearn/microservices-kit",
"version": "0.0.46",
"version": "0.0.47",
"description": "colearn microservice kit",

@@ -5,0 +5,0 @@ "author": "Colearn",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc