@colearn/microservices-kit
Advanced tools
Comparing version 0.0.48 to 0.0.49
@@ -11,1 +11,7 @@ /// <reference types="node" /> | ||
} | ||
export declare class ClientFactory<T> { | ||
private Constructor; | ||
private baseURL; | ||
constructor(Constructor: new (baseURL: string, token?: string) => T, baseURL: string); | ||
createClient(token: string): T; | ||
} |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MicroserviceHttpClient = void 0; | ||
exports.ClientFactory = exports.MicroserviceHttpClient = void 0; | ||
const isomorphic_fetch_1 = __importDefault(require("isomorphic-fetch")); | ||
@@ -33,2 +33,12 @@ class MicroserviceHttpClient { | ||
exports.MicroserviceHttpClient = MicroserviceHttpClient; | ||
class ClientFactory { | ||
constructor(Constructor, baseURL) { | ||
this.Constructor = Constructor; | ||
this.baseURL = baseURL; | ||
} | ||
createClient(token) { | ||
return new this.Constructor(this.baseURL, token); | ||
} | ||
} | ||
exports.ClientFactory = ClientFactory; | ||
//# sourceMappingURL=client.js.map |
{ | ||
"name": "@colearn/microservices-kit", | ||
"version": "0.0.48", | ||
"version": "0.0.49", | ||
"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
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
70898
1129