@orbis-systems/orbis-api-clients 0.5.1 → 0.5.3

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.
@@ -234,8 +234,8 @@ class $538ed1203bac2e79$export$f280b732bbc5934b extends (0, $3621850f1f570615$ex
234
234
  }
235
235
  if (this.config.autoRenewToken !== false && this.isTokenExpired(accessToken)) try {
236
236
  await this.lock.runExclusive(async ()=>{
237
- (0, $5Loj3$consola.consola).info("Token expired. Renewing\u2026");
238
- await this.renewToken();
237
+ if (this.config.debug) (0, $5Loj3$consola.consola).debug("Token expired. Renewing\u2026");
238
+ accessToken = (await this.renewToken()).accessToken;
239
239
  this.lock.cancel();
240
240
  });
241
241
  } catch (error) {
@@ -251,12 +251,14 @@ class $538ed1203bac2e79$export$f280b732bbc5934b extends (0, $3621850f1f570615$ex
251
251
  isTokenExpired(token) {
252
252
  const payload = (0, $5Loj3$jwtdecode.jwtDecode)(token);
253
253
  if (!payload.exp) return true;
254
- return (0, $5Loj3$datefns.isBefore)((0, $5Loj3$datefns.subMinutes)(payload.exp * 1000, 5), Date.now());
254
+ return (0, $5Loj3$datefns.isBefore)((0, $5Loj3$datefns.subMinutes)(payload.exp * 1000, 1), Date.now());
255
255
  }
256
256
  async renewToken() {
257
- if (!this.renewTokenCallback) throw new Error('No renew token callback provided');
258
- const authData = await this.renewTokenCallback();
257
+ const callback = this.config.onRenewToken ?? this.renewTokenCallback;
258
+ if (!callback) throw new Error('No renew token callback provided');
259
+ const authData = await callback();
259
260
  this.setAuthData(authData);
261
+ return authData;
260
262
  }
261
263
  }
262
264
 
@@ -1523,6 +1525,22 @@ class $da89e2663382a79a$export$82b8d343c504672 {
1523
1525
  responseType: 'json'
1524
1526
  });
1525
1527
  }
1528
+ /**
1529
+ * @tags Quote
1530
+ * @name GetOptionDayChart
1531
+ * @summary Query Option Day Chart - All users - available in Microservice
1532
+ * @request GET:/api/quote/option-day-chart
1533
+ * @secure
1534
+ */ getOptionDayChart(query, config) {
1535
+ return this.apiClient.request({
1536
+ ...config,
1537
+ url: `/quote/option-day-chart`,
1538
+ method: 'GET',
1539
+ params: query,
1540
+ secure: true,
1541
+ responseType: 'json'
1542
+ });
1543
+ }
1526
1544
  /**
1527
1545
  * @tags Quote
1528
1546
  * @name GetEquiductLevel1
@@ -1735,14 +1753,14 @@ class $cbc117ce07829f62$export$304305f55794ea0e {
1735
1753
  }
1736
1754
  /**
1737
1755
  * @tags QuotesReformat
1738
- * @name GetEquityHistorical
1739
- * @summary Query Historical Day Chart. No weekly data point support yet. No rsiSpan support. - All users - available in Microservice
1740
- * @request GET:/api/quotes/equity/historical
1756
+ * @name GetOptionHistorical
1757
+ * @summary Query option Day Chart. No weekly data point support yet. No rsiSpan support. - All users - available in Microservice
1758
+ * @request GET:/api/quotes/option/historical
1741
1759
  * @secure
1742
- */ getEquityHistorical(query, config) {
1760
+ */ getOptionHistorical(query, config) {
1743
1761
  return this.apiClient.request({
1744
1762
  ...config,
1745
- url: `/quotes/equity/historical`,
1763
+ url: `/quotes/option/historical`,
1746
1764
  method: 'GET',
1747
1765
  params: query,
1748
1766
  secure: true,
@@ -1812,6 +1830,22 @@ class $cbc117ce07829f62$export$304305f55794ea0e {
1812
1830
  responseType: 'json'
1813
1831
  });
1814
1832
  }
1833
+ /**
1834
+ * @tags QuotesReformat
1835
+ * @name GetEquityHistorical
1836
+ * @summary Query Historical Day Chart. No weekly data point support yet. No rsiSpan support. - All users - available in Microservice
1837
+ * @request GET:/api/quotes/equity/historical
1838
+ * @secure
1839
+ */ getEquityHistorical(query, config) {
1840
+ return this.apiClient.request({
1841
+ ...config,
1842
+ url: `/quotes/equity/historical`,
1843
+ method: 'GET',
1844
+ params: query,
1845
+ secure: true,
1846
+ responseType: 'json'
1847
+ });
1848
+ }
1815
1849
  /**
1816
1850
  * @tags QuotesReformat
1817
1851
  * @name GetBonds