celitech-sdk 1.3.47 → 1.3.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Celitech TypeScript SDK 1.3.47
1
+ # Celitech TypeScript SDK 1.3.49
2
2
 
3
3
  Welcome to the Celitech SDK documentation. This guide will help you get started with integrating and using the Celitech SDK in your project.
4
4
 
@@ -6,8 +6,8 @@ Welcome to the Celitech SDK documentation. This guide will help you get started
6
6
 
7
7
  ## Versions
8
8
 
9
- - API version: `1.3.47`
10
- - SDK version: `1.3.47`
9
+ - API version: `1.3.49`
10
+ - SDK version: `1.3.49`
11
11
 
12
12
  ## About the API
13
13
 
package/dist/index.js CHANGED
@@ -1447,7 +1447,7 @@ var OAuthToken = class {
1447
1447
  var OAuthTokenManager = class {
1448
1448
  async getToken(scopes, config) {
1449
1449
  var _a, _b, _c, _d, _e, _f;
1450
- if (((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) && ((_b = this.token) == null ? void 0 : _b.expiresAt) && this.token.expiresAt >= Math.floor(Date.now() / 1e3)) {
1450
+ if (((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) && ((_b = this.token) == null ? void 0 : _b.expiresAt) && this.token.expiresAt - Date.now() > 1e3) {
1451
1451
  return this.token;
1452
1452
  }
1453
1453
  if (!config.clientId || !config.clientSecret) {
@@ -1477,7 +1477,7 @@ var OAuthTokenManager = class {
1477
1477
  this.token = new OAuthToken(
1478
1478
  response.data.accessToken,
1479
1479
  updatedScopes,
1480
- ((_e = response.data) == null ? void 0 : _e.expiresIn) ? ((_f = response.data) == null ? void 0 : _f.expiresIn) + Math.floor(Date.now() / 1e3) : null
1480
+ ((_e = response.data) == null ? void 0 : _e.expiresIn) ? ((_f = response.data) == null ? void 0 : _f.expiresIn) * 1e3 + Date.now() : null
1481
1481
  );
1482
1482
  return this.token;
1483
1483
  }
package/dist/index.mjs CHANGED
@@ -1403,7 +1403,7 @@ var OAuthToken = class {
1403
1403
  var OAuthTokenManager = class {
1404
1404
  async getToken(scopes, config) {
1405
1405
  var _a, _b, _c, _d, _e, _f;
1406
- if (((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) && ((_b = this.token) == null ? void 0 : _b.expiresAt) && this.token.expiresAt >= Math.floor(Date.now() / 1e3)) {
1406
+ if (((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) && ((_b = this.token) == null ? void 0 : _b.expiresAt) && this.token.expiresAt - Date.now() > 1e3) {
1407
1407
  return this.token;
1408
1408
  }
1409
1409
  if (!config.clientId || !config.clientSecret) {
@@ -1433,7 +1433,7 @@ var OAuthTokenManager = class {
1433
1433
  this.token = new OAuthToken(
1434
1434
  response.data.accessToken,
1435
1435
  updatedScopes,
1436
- ((_e = response.data) == null ? void 0 : _e.expiresIn) ? ((_f = response.data) == null ? void 0 : _f.expiresIn) + Math.floor(Date.now() / 1e3) : null
1436
+ ((_e = response.data) == null ? void 0 : _e.expiresIn) ? ((_f = response.data) == null ? void 0 : _f.expiresIn) * 1e3 + Date.now() : null
1437
1437
  );
1438
1438
  return this.token;
1439
1439
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "celitech-sdk",
3
- "version": "1.3.47",
3
+ "version": "1.3.49",
4
4
  "description": "Welcome to the CELITECH API documentation! Useful links: [Homepage](https://www.celitech.com) | [Support email](mailto:support@celitech.com) | [Blog](https://www.celitech.com/blog/)",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",