sentisense 0.65.0 → 0.66.0

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.d.mts CHANGED
@@ -4874,7 +4874,7 @@ declare class Trackers {
4874
4874
  /** @internal HTTP interface exposed to resource classes. */
4875
4875
  interface APIClient {
4876
4876
  get<T = unknown>(path: string, params?: object): Promise<T>;
4877
- post<T = unknown>(path: string, body: unknown): Promise<T>;
4877
+ post<T = unknown>(path: string, body: unknown, extraHeaders?: Record<string, string>): Promise<T>;
4878
4878
  }
4879
4879
  declare class SentiSense implements APIClient {
4880
4880
  private baseUrl;
@@ -4904,7 +4904,7 @@ declare class SentiSense implements APIClient {
4904
4904
  /** @internal */
4905
4905
  get<T = unknown>(path: string, params?: object): Promise<T>;
4906
4906
  /** @internal */
4907
- post<T = unknown>(path: string, body: unknown): Promise<T>;
4907
+ post<T = unknown>(path: string, body: unknown, extraHeaders?: Record<string, string>): Promise<T>;
4908
4908
  private buildUrl;
4909
4909
  private handleErrorResponse;
4910
4910
  }
@@ -4938,6 +4938,8 @@ declare class DeepHistoryUnavailableError extends SentiSenseError {
4938
4938
  * before throwing, so you see this only once retries are used up.
4939
4939
  * - `"quota_exceeded"`: the monthly request allowance is used up. It is thrown on the first
4940
4940
  * response without retrying, and `message` says when the allowance resets.
4941
+ * - `"key_limit_reached"`: a temporary key from `sentisense init` used its daily or total
4942
+ * allowance. Thrown on the first response without retrying; keeping the key lifts it.
4941
4943
  */
4942
4944
  declare class RateLimitError extends SentiSenseError {
4943
4945
  /**
@@ -4966,6 +4968,6 @@ declare class APIError extends SentiSenseError {
4966
4968
  constructor(message: string, status: number, code?: string);
4967
4969
  }
4968
4970
 
4969
- declare const VERSION = "0.65.0";
4971
+ declare const VERSION = "0.66.0";
4970
4972
 
4971
4973
  export { type AISummary, APIError, type AnalystAction, type AnalystCall, type AnalystCalledItCall, type AnalystCalledItMove, type AnalystConsensus, type AnalystConsensusHistory, type AnalystConsensusHistoryPoint, type AnalystCoverage, type AnalystCoverageAnalyst, type AnalystCoverageBookEntry, type AnalystCoverageFirm, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatePeriodType, type AnalystEstimatesResponse, type AnalystFirmRating, type AnalystFirmTenure, type AnalystNote, type AnalystProfile, type AnalystRatingBuckets, type AnalystRef, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsOutcomeStatistics, type EarningsQuarter, type EarningsReaction, type EarningsReactionsResponse, type EarningsSource, type EarningsStatistics, type EarningsStatisticsBaseline, type EarningsStatisticsDeviation, type EarningsStatisticsThresholds, type EarningsStatisticsWindow, type EntitySearchResult, type EntitySearchType, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfQuote, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type ExtendedHoursInfo, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystCalledItOptions, type GetAnalystCallsOptions, type GetAnalystConsensusHistoryOptions, type GetAnalystCoverageOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsStatisticsOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetOptionsHistoryOptions, type GetOptionsIntradayHistoryOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticianMemberOptions, type GetPoliticiansOptions, type GetRankedEarningsOptions, type GetRecentEarningsOptions, type GetShortInterestOptions, type GetShortVolumeOptions, type GetStockGraphOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type GraphCounts, type GraphEdge, type GraphGroups, type GraphNode, type GraphProductFamily, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionDetail, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketMoodOptions, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type OptionsAggregate, type OptionsCapabilities, type OptionsContext, type OptionsHighlight, type OptionsHistory, type OptionsHistoryWindow, type OptionsIntradayBoardCapability, type OptionsIntradayFlow, type OptionsIntradayHistory, type OptionsIntradayPoint, type OptionsOiFollowUp, type OptionsOiWalls, type OptionsOverview, type OptionsOverviewRow, type OptionsSummary, type OptionsUnusualContract, type OptionsWall, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, type RankedEarnings, type RankedEarningsSection, type RankedReportedEarnings, type RankedUpcomingEarnings, RateLimitError, type RatingBase, type RatingDimension, type RatingDimensionKey, type RatingFlag, type RatingNotRatedReason, type RatingSubLeg, type RecentEarningsEntry, type RiskAdjustment, type RiskCondition, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, type SearchEntitiesOptions, type SearchStoriesOptions, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortInterestDataPoint, type ShortVolume, type ShortVolumeDataPoint, type SimilarStock, type StockDetail, type StockEntity, type StockGraph, type StockImage, type StockNotRated, type StockPrice, type StockProfile, type StockQuote, type StockRating, type StockRatingResponse, type StockSocialDominance, type Story, type StoryCluster, type StoryTimelineEntry, TemporarilyUnavailableError, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
package/dist/index.d.ts CHANGED
@@ -4874,7 +4874,7 @@ declare class Trackers {
4874
4874
  /** @internal HTTP interface exposed to resource classes. */
4875
4875
  interface APIClient {
4876
4876
  get<T = unknown>(path: string, params?: object): Promise<T>;
4877
- post<T = unknown>(path: string, body: unknown): Promise<T>;
4877
+ post<T = unknown>(path: string, body: unknown, extraHeaders?: Record<string, string>): Promise<T>;
4878
4878
  }
4879
4879
  declare class SentiSense implements APIClient {
4880
4880
  private baseUrl;
@@ -4904,7 +4904,7 @@ declare class SentiSense implements APIClient {
4904
4904
  /** @internal */
4905
4905
  get<T = unknown>(path: string, params?: object): Promise<T>;
4906
4906
  /** @internal */
4907
- post<T = unknown>(path: string, body: unknown): Promise<T>;
4907
+ post<T = unknown>(path: string, body: unknown, extraHeaders?: Record<string, string>): Promise<T>;
4908
4908
  private buildUrl;
4909
4909
  private handleErrorResponse;
4910
4910
  }
@@ -4938,6 +4938,8 @@ declare class DeepHistoryUnavailableError extends SentiSenseError {
4938
4938
  * before throwing, so you see this only once retries are used up.
4939
4939
  * - `"quota_exceeded"`: the monthly request allowance is used up. It is thrown on the first
4940
4940
  * response without retrying, and `message` says when the allowance resets.
4941
+ * - `"key_limit_reached"`: a temporary key from `sentisense init` used its daily or total
4942
+ * allowance. Thrown on the first response without retrying; keeping the key lifts it.
4941
4943
  */
4942
4944
  declare class RateLimitError extends SentiSenseError {
4943
4945
  /**
@@ -4966,6 +4968,6 @@ declare class APIError extends SentiSenseError {
4966
4968
  constructor(message: string, status: number, code?: string);
4967
4969
  }
4968
4970
 
4969
- declare const VERSION = "0.65.0";
4971
+ declare const VERSION = "0.66.0";
4970
4972
 
4971
4973
  export { type AISummary, APIError, type AnalystAction, type AnalystCall, type AnalystCalledItCall, type AnalystCalledItMove, type AnalystConsensus, type AnalystConsensusHistory, type AnalystConsensusHistoryPoint, type AnalystCoverage, type AnalystCoverageAnalyst, type AnalystCoverageBookEntry, type AnalystCoverageFirm, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatePeriodType, type AnalystEstimatesResponse, type AnalystFirmRating, type AnalystFirmTenure, type AnalystNote, type AnalystProfile, type AnalystRatingBuckets, type AnalystRef, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsOutcomeStatistics, type EarningsQuarter, type EarningsReaction, type EarningsReactionsResponse, type EarningsSource, type EarningsStatistics, type EarningsStatisticsBaseline, type EarningsStatisticsDeviation, type EarningsStatisticsThresholds, type EarningsStatisticsWindow, type EntitySearchResult, type EntitySearchType, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfQuote, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type ExtendedHoursInfo, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystCalledItOptions, type GetAnalystCallsOptions, type GetAnalystConsensusHistoryOptions, type GetAnalystCoverageOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsStatisticsOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetOptionsHistoryOptions, type GetOptionsIntradayHistoryOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticianMemberOptions, type GetPoliticiansOptions, type GetRankedEarningsOptions, type GetRecentEarningsOptions, type GetShortInterestOptions, type GetShortVolumeOptions, type GetStockGraphOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type GraphCounts, type GraphEdge, type GraphGroups, type GraphNode, type GraphProductFamily, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionDetail, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketMoodOptions, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type OptionsAggregate, type OptionsCapabilities, type OptionsContext, type OptionsHighlight, type OptionsHistory, type OptionsHistoryWindow, type OptionsIntradayBoardCapability, type OptionsIntradayFlow, type OptionsIntradayHistory, type OptionsIntradayPoint, type OptionsOiFollowUp, type OptionsOiWalls, type OptionsOverview, type OptionsOverviewRow, type OptionsSummary, type OptionsUnusualContract, type OptionsWall, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, type RankedEarnings, type RankedEarningsSection, type RankedReportedEarnings, type RankedUpcomingEarnings, RateLimitError, type RatingBase, type RatingDimension, type RatingDimensionKey, type RatingFlag, type RatingNotRatedReason, type RatingSubLeg, type RecentEarningsEntry, type RiskAdjustment, type RiskCondition, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, type SearchEntitiesOptions, type SearchStoriesOptions, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortInterestDataPoint, type ShortVolume, type ShortVolumeDataPoint, type SimilarStock, type StockDetail, type StockEntity, type StockGraph, type StockImage, type StockNotRated, type StockPrice, type StockProfile, type StockQuote, type StockRating, type StockRatingResponse, type StockSocialDominance, type Story, type StoryCluster, type StoryTimelineEntry, TemporarilyUnavailableError, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
package/dist/index.mjs CHANGED
@@ -1388,7 +1388,7 @@ var Trackers = class {
1388
1388
  };
1389
1389
 
1390
1390
  // src/version.ts
1391
- var VERSION = "0.65.0";
1391
+ var VERSION = "0.66.0";
1392
1392
 
1393
1393
  // src/client.ts
1394
1394
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";
@@ -1400,11 +1400,11 @@ var DEEP_HISTORY_FALLBACK_WAIT_S = 3;
1400
1400
  var MAX_DEEP_HISTORY_WAIT_S = 30;
1401
1401
  var MAX_RATE_LIMIT_WAIT_S = 120;
1402
1402
  var RATE_LIMIT_FALLBACK_WAIT_S = 60;
1403
- var QUOTA_EXCEEDED_CODE = "quota_exceeded";
1404
- async function isQuotaExceeded(response) {
1403
+ var NON_RETRYABLE_429_CODES = /* @__PURE__ */ new Set(["quota_exceeded", "key_limit_reached"]);
1404
+ async function isAllowanceExhausted(response) {
1405
1405
  try {
1406
1406
  const body = await response.clone().json();
1407
- return body?.error === QUOTA_EXCEEDED_CODE;
1407
+ return typeof body?.error === "string" && NON_RETRYABLE_429_CODES.has(body.error);
1408
1408
  } catch {
1409
1409
  return false;
1410
1410
  }
@@ -1494,7 +1494,7 @@ var SentiSense = class {
1494
1494
  );
1495
1495
  }
1496
1496
  if (!response.ok) {
1497
- if (response.status === 429 && await isQuotaExceeded(response)) {
1497
+ if (response.status === 429 && await isAllowanceExhausted(response)) {
1498
1498
  await this.handleErrorResponse(response);
1499
1499
  }
1500
1500
  const isRetryable = response.status === 429 || response.status >= 500;
@@ -1543,9 +1543,10 @@ var SentiSense = class {
1543
1543
  throw new SentiSenseError("All retries exhausted");
1544
1544
  }
1545
1545
  /** @internal */
1546
- async post(path, body) {
1546
+ async post(path, body, extraHeaders) {
1547
1547
  const url = this.buildUrl(path);
1548
1548
  const headers = {
1549
+ ...extraHeaders,
1549
1550
  "Accept": "application/json",
1550
1551
  "Content-Type": "application/json"
1551
1552
  };