@timetac/js-client-library
Advanced tools
Comparing version 0.4.1 to 0.5.1
@@ -68,3 +68,3 @@ "use strict"; | ||
refresh_token: refreshToken, | ||
}); | ||
}, 'Missing data for:'); | ||
}); | ||
@@ -71,0 +71,0 @@ } |
@@ -43,3 +43,3 @@ "use strict"; | ||
if (!this.config.account) { | ||
throw 'Account is not set'; | ||
throw new Error('Account is not set'); | ||
} | ||
@@ -46,0 +46,0 @@ return `${(_a = axios_1.default.defaults.baseURL) !== null && _a !== void 0 ? _a : DEFAULT_HOST}/${this.config.account}/`; |
@@ -76,5 +76,5 @@ import { AbsenceDaysEndpoint } from './absenceDays'; | ||
constructor(config: ApiConfig); | ||
setConfig(config: any): void; | ||
setAccount(account: string): void; | ||
setConfig(config: any): void; | ||
getConfig(): ApiConfig; | ||
} |
@@ -49,2 +49,3 @@ "use strict"; | ||
var _a, _b; | ||
this.config = {}; | ||
this.setConfig(Object.assign(Object.assign({}, config), { autoRefreshToken: (_a = config.autoRefreshToken) !== null && _a !== void 0 ? _a : true, https: (_b = config.https) !== null && _b !== void 0 ? _b : true })); | ||
@@ -77,10 +78,10 @@ this.config = this.getConfig(); | ||
} | ||
setAccount(account) { | ||
this.config.account = account; | ||
} | ||
setConfig(config) { | ||
var _a; | ||
this.config = Object.assign(Object.assign({}, this.config), config); | ||
Object.assign(this.config, config); | ||
axiosSetup_1.setAxiosDefaults({ baseURL: `${this.config.https ? 'https' : 'http'}://${(_a = this.config.host) !== null && _a !== void 0 ? _a : DEFAULT_HOST}` }); | ||
} | ||
setAccount(account) { | ||
this.config.account = account; | ||
} | ||
getConfig() { | ||
@@ -87,0 +88,0 @@ return this.config; |
declare type Data = { | ||
[index: string]: any; | ||
[index: string]: unknown; | ||
}; | ||
export declare const objectCheck: (data: Data, prefix?: string | undefined, postfix?: string | undefined) => string; | ||
export {}; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const objectCheck = (data, prefix, postfix) => { | ||
let message = `${prefix || ''} `; | ||
let message = ''; | ||
for (const key in data) { | ||
@@ -14,2 +14,5 @@ if (data[key] == undefined) { | ||
message += `${postfix || '.'}`; | ||
if (prefix) { | ||
message = `${prefix} ${message}`; | ||
} | ||
} | ||
@@ -16,0 +19,0 @@ return message; |
{ | ||
"name": "@timetac/js-client-library", | ||
"version": "0.4.1", | ||
"version": "0.5.1", | ||
"description": "TimeTac API JS client library", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/TimeTac/js-client-library#readme", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
166948
2456