@botmock/client
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -8,3 +8,3 @@ /// <reference types="node" /> | ||
agent?: Agent; | ||
subdomain?: string; | ||
url?: string; | ||
} | ||
@@ -11,0 +11,0 @@ export default class ClientImpl<T = any> implements Client<T> { |
@@ -30,6 +30,5 @@ "use strict"; | ||
constructor(config) { | ||
var _a; | ||
this.debug = {}; | ||
_token.set(this, void 0); | ||
_url.set(this, void 0); | ||
_url.set(this, "https://app.botmock.com/api/v2"); | ||
_agent.set(this, void 0); | ||
@@ -63,3 +62,5 @@ _resourceMethodMap.set(this, new Map([ | ||
__classPrivateFieldSet(this, _token, config.token); | ||
__classPrivateFieldSet(this, _url, `http://${(_a = config.subdomain) !== null && _a !== void 0 ? _a : "local"}.botmock.com/api/v2`); | ||
if (config.url) { | ||
__classPrivateFieldSet(this, _url, config.url); | ||
} | ||
if (typeof config.agent !== "undefined") { | ||
@@ -66,0 +67,0 @@ __classPrivateFieldSet(this, _agent, config.agent); |
{ | ||
"name": "@botmock/client", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "Kevin Donahue <nonnontrivial@gmail.com>", |
@@ -16,3 +16,3 @@ import { Agent } from "https"; | ||
agent?: Agent; | ||
subdomain?: string; | ||
url?: string; | ||
} | ||
@@ -23,3 +23,3 @@ | ||
#token: string; | ||
#url: string; | ||
#url: string = "https://app.botmock.com/api/v2"; | ||
#agent!: Agent; | ||
@@ -36,3 +36,5 @@ #resourceMethodMap = new Map<Resource, string>([ | ||
this.#token = config.token; | ||
this.#url = `http://${config.subdomain ?? "local"}.botmock.com/api/v2`; | ||
if (config.url) { | ||
this.#url = config.url; | ||
} | ||
if (typeof config.agent !== "undefined") { | ||
@@ -39,0 +41,0 @@ this.#agent = config.agent; |
Sorry, the diff of this file is not supported yet
335
23394