@finatic/client 0.0.135 → 0.0.136

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/dist/index.mjs CHANGED
@@ -196,6 +196,12 @@ class OrderValidationError extends ApiError {
196
196
  this.name = 'OrderValidationError';
197
197
  }
198
198
  }
199
+ class TradingNotEnabledError extends ApiError {
200
+ constructor(message, details) {
201
+ super(403, message, details);
202
+ this.name = 'TradingNotEnabledError';
203
+ }
204
+ }
199
205
 
200
206
  class ApiClient {
201
207
  constructor(baseUrl, deviceInfo) {
@@ -511,6 +517,9 @@ class ApiClient {
511
517
  if (error.detail?.code === 'NO_COMPANY_ACCESS') {
512
518
  return new CompanyAccessError(error.detail.message || 'No broker connections found for this company', error.detail);
513
519
  }
520
+ if (error.detail?.code === 'TRADING_NOT_ENABLED') {
521
+ return new TradingNotEnabledError(error.detail.message || 'Trading is not enabled for your company', error.detail);
522
+ }
514
523
  return new AuthorizationError(message || 'Forbidden: No access to the requested data', error);
515
524
  case 404:
516
525
  return new ApiError(status, message || 'Not found: The requested data does not exist', error);
@@ -4892,5 +4901,5 @@ class FinaticConnect extends EventEmitter {
4892
4901
  }
4893
4902
  FinaticConnect.instance = null;
4894
4903
 
4895
- export { ApiClient, ApiError, AuthenticationError, AuthorizationError, BaseError, CompanyAccessError, EventEmitter, FinaticConnect, MockFactory, NetworkError, OrderError, OrderValidationError, PaginatedResult, RateLimitError, SecurityError, SessionError, TokenError, ValidationError, appendThemeToURL, createCustomThemeFromPreset, generatePortalThemeURL, getThemePreset, portalThemePresets, validateCustomTheme };
4904
+ export { ApiClient, ApiError, AuthenticationError, AuthorizationError, BaseError, CompanyAccessError, EventEmitter, FinaticConnect, MockFactory, NetworkError, OrderError, OrderValidationError, PaginatedResult, RateLimitError, SecurityError, SessionError, TokenError, TradingNotEnabledError, ValidationError, appendThemeToURL, createCustomThemeFromPreset, generatePortalThemeURL, getThemePreset, portalThemePresets, validateCustomTheme };
4896
4905
  //# sourceMappingURL=index.mjs.map