@como/como-client
Advanced tools
Comparing version 0.7.53 to 0.7.54
@@ -19,9 +19,12 @@ 'use strict'; | ||
var _require = require('../interceptors/refresh'), | ||
tokenInterceptor = _require.tokenInterceptor, | ||
refreshInterceptor = _require.refreshInterceptor; | ||
var _require = require('../../package.json'), | ||
version = _require.version; | ||
var _require2 = require('../interceptors/response'), | ||
responseInterceptor = _require2.responseInterceptor; | ||
var _require2 = require('../interceptors/refresh'), | ||
tokenInterceptor = _require2.tokenInterceptor, | ||
refreshInterceptor = _require2.refreshInterceptor; | ||
var _require3 = require('../interceptors/response'), | ||
responseInterceptor = _require3.responseInterceptor; | ||
var auth = require('./auth.service'); | ||
@@ -34,3 +37,3 @@ var loyalty = require('./loyalty.service'); | ||
exports.getService = function (baseURL, uid, getCredentials, credentialsRefresh, source) { | ||
var httpClient = axios.create({ baseURL: baseURL }); | ||
var httpClient = axios.create({ baseURL: baseURL, headers: { 'x-phoenix-version': version } }); | ||
@@ -37,0 +40,0 @@ /** |
{ | ||
"name": "@como/como-client", | ||
"version": "0.7.53", | ||
"version": "0.7.54", | ||
"description": "Client module for Como's loaylty API", | ||
@@ -5,0 +5,0 @@ "main": "src/como.js", |
@@ -30,3 +30,3 @@ const moment = require('moment-timezone'); | ||
} | ||
else if (expiresIn && moment(expiresIn).subtract(10, 'seconds').isBefore(moment())) { | ||
else if (expiresIn && moment(expiresIn).subtract(60, 'seconds').isBefore(moment())) { | ||
await refresher(); | ||
@@ -448,2 +448,3 @@ } | ||
} = this.comoData; | ||
await this.refreshTokenIfNeeded(); | ||
const responseJson = await api.getShortUserId(env.zapp_root, locationId); | ||
@@ -489,2 +490,3 @@ return responseJson.ID; | ||
} = this.comoData; | ||
await this.refreshTokenIfNeeded(); | ||
const responseJson = await api.redeemAsset(env.zapp_root, locationId, assetKey); | ||
@@ -491,0 +493,0 @@ return responseJson; |
Sorry, the diff of this file is too big to display
221029
4735