|
17 | 17 |
|
18 | 18 | /** |
19 | 19 | * @module purecloud-platform-client-v2/ApiClient |
20 | | - * @version 6.1.0 |
| 20 | + * @version 6.1.1 |
21 | 21 | */ |
22 | 22 |
|
23 | 23 | /** |
|
251 | 251 | resolve(); |
252 | 252 | }) |
253 | 253 | .catch(function(error) { |
254 | | - self.setAccessToken(undefined); |
| 254 | + self.setAccessToken(); |
255 | 255 | reject(error); |
256 | 256 | }); |
257 | 257 | }); |
|
339 | 339 | */ |
340 | 340 | exports.prototype.logout = function() { |
341 | 341 | if(exports.hasLocalStorage) { |
342 | | - this.setAccessToken(null); |
| 342 | + this.setAccessToken(); |
343 | 343 | } |
344 | 344 |
|
345 | 345 | var query = { |
|
377 | 377 | * @returns {String} The string representation of <code>param</code>. |
378 | 378 | */ |
379 | 379 | exports.prototype.paramToString = function(param) { |
380 | | - if (param === undefined || param === null) { |
| 380 | + if (!param) { |
381 | 381 | return ''; |
382 | 382 | } |
383 | 383 | if (param instanceof Date) { |
|
423 | 423 | * @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>. |
424 | 424 | */ |
425 | 425 | exports.prototype.isJsonMime = function(contentType) { |
426 | | - return Boolean(contentType !== null && contentType.match(/^application\/json(;.*)?$/i)); |
| 426 | + return Boolean(contentType && contentType.match(/^application\/json(;.*)?$/i)); |
427 | 427 | }; |
428 | 428 |
|
429 | 429 | /** |
|
481 | 481 | exports.prototype.normalizeParams = function(params) { |
482 | 482 | var newParams = {}; |
483 | 483 | for (var key in params) { |
484 | | - if (params.hasOwnProperty(key) && params[key] !== undefined && params[key] !== null) { |
| 484 | + if (params.hasOwnProperty(key) && params[key]) { |
485 | 485 | var value = params[key]; |
486 | 486 | if (this.isFileParam(value) || Array.isArray(value)) { |
487 | 487 | newParams[key] = value; |
|
534 | 534 | * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>. |
535 | 535 | */ |
536 | 536 | exports.prototype.buildCollectionParam = function buildCollectionParam(param, collectionFormat) { |
537 | | - if (param === null) { |
538 | | - return null; |
539 | | - } |
| 537 | + if (!param) return; |
| 538 | + |
540 | 539 | switch (collectionFormat) { |
541 | 540 | case 'csv': |
542 | 541 | return param.map(this.paramToString).join(','); |
|
641 | 640 |
|
642 | 641 | // set header parameters |
643 | 642 | request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); |
644 | | - request.set({ 'purecloud-sdk': '6.1.0' }); |
| 643 | + request.set({ 'purecloud-sdk': '6.1.1' }); |
645 | 644 |
|
646 | 645 | // set request timeout |
647 | 646 | request.timeout(this.timeout); |
|
0 commit comments