sentisense 0.80.0 → 0.82.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.mjs CHANGED
@@ -218,6 +218,16 @@ var Calendar = class {
218
218
  constructor(client) {
219
219
  this.client = client;
220
220
  }
221
+ /**
222
+ * List the calendars the API serves, with the path of each, so a client can find them
223
+ * without hardcoding paths.
224
+ *
225
+ * Every tier receives the same list, and the call does not count against the monthly quota;
226
+ * the per-minute rate limit still applies.
227
+ */
228
+ async list() {
229
+ return this.client.get("/api/v1/calendar");
230
+ }
221
231
  /**
222
232
  * Upcoming company earnings, sorted by date.
223
233
  *
@@ -399,6 +409,14 @@ var Earnings = class {
399
409
  };
400
410
 
401
411
  // src/resources/entityMetrics.ts
412
+ function requirePathSegment(method, name, value) {
413
+ if (typeof value !== "string" || value.trim() === "" || value === "." || value === "..") {
414
+ throw new SentiSenseError(
415
+ `${method}: ${name} must not be empty, "." or ".." (got ${JSON.stringify(value)})`
416
+ );
417
+ }
418
+ return value;
419
+ }
402
420
  var EntityMetrics = class {
403
421
  constructor(client) {
404
422
  this.client = client;
@@ -449,6 +467,25 @@ var EntityMetrics = class {
449
467
  }
450
468
  );
451
469
  }
470
+ /**
471
+ * List the dimensions a metric can be broken down by for one entity, with the values present
472
+ * in the data, so you can see what exists before calling `getDistribution()`.
473
+ *
474
+ * Returns a plain array, empty when the metric has no slices for this entity. Available on
475
+ * every tier; each call counts against the monthly quota.
476
+ *
477
+ * @param symbol Ticker symbol (e.g. "AAPL") or entity urlSlug (e.g. "Nancy-Pelosi").
478
+ * @param metricType The metric to look up (e.g. "mentions").
479
+ * @throws {SentiSenseError} Before any request, when `symbol` or `metricType` is empty,
480
+ * whitespace only, `"."` or `".."`.
481
+ */
482
+ async getSlices(symbol, metricType) {
483
+ const entity = requirePathSegment("entityMetrics.getSlices", "symbol", symbol);
484
+ const metric = requirePathSegment("entityMetrics.getSlices", "metricType", metricType);
485
+ return this.client.get(
486
+ `/api/v2/metrics/entity/${encodeURIComponent(entity)}/metric/${encodeURIComponent(metric)}/slices`
487
+ );
488
+ }
452
489
  };
453
490
 
454
491
  // src/resources/etfs.ts
@@ -824,6 +861,35 @@ var Institutional = class {
824
861
  async getActivists(reportDate) {
825
862
  return this.client.get("/api/v1/institutional/activist", { reportDate });
826
863
  }
864
+ /**
865
+ * Get convertible bond positions from 13F filings for one quarter, one row per issuer,
866
+ * grouped by the issuer's equity ticker.
867
+ *
868
+ * `reportDate` is the quarter end as an ISO date (e.g. `"2026-06-30"`); the API requires it,
869
+ * so take one from `getQuarters()`. Returns the preview envelope, so the rows are `.data`. A
870
+ * FREE key receives the top three rows with `isPreview: true` and `totalCount` holding the full
871
+ * row count; a PRO key receives the full list.
872
+ *
873
+ * Each row's `bondTickers` is one comma-separated string, not an array.
874
+ */
875
+ async getBondFlows(reportDate) {
876
+ return this.client.get("/api/v1/institutional/bonds", { reportDate });
877
+ }
878
+ /**
879
+ * Get the call and put positions institutions reported on Form 13F for one quarter, one row
880
+ * per stock.
881
+ *
882
+ * These are quarter-end 13F holdings, not options market activity: for options volume, open
883
+ * interest and implied volatility, use `client.options` and `stocks.getOptionsSummary()`.
884
+ *
885
+ * `reportDate` is the quarter end as an ISO date (e.g. `"2026-06-30"`); the API requires it,
886
+ * so take one from `getQuarters()`. Returns the preview envelope, so the rows are `.data`. A
887
+ * FREE key receives the top three rows with `isPreview: true` and `totalCount` holding the full
888
+ * row count; a PRO key receives the full list.
889
+ */
890
+ async getOptionFlows(reportDate) {
891
+ return this.client.get("/api/v1/institutional/options", { reportDate });
892
+ }
827
893
  /**
828
894
  * Discover institutions: a paginated, AUM-ranked list of filers (slug + metadata)
829
895
  * so you can find what to query without knowing slugs upfront.
@@ -965,6 +1031,37 @@ var MarketMoodResource = class {
965
1031
  // index envelope alongside fed-sentiment and ai-sentiment. Use this resource when you want
966
1032
  // the phase band, weekly change, per-signal breakdown and per-sector map; use `indexes`
967
1033
  // when you want every index to answer the same shape. Both report the same headline number.
1034
+ /**
1035
+ * Get the per-sector sentiment rollup: the 11 GICS sectors, each measured against the
1036
+ * market's own news-and-social tone.
1037
+ *
1038
+ * Compare sectors on `consensusVsMarket`, the gap between a sector's bullish-versus-bearish
1039
+ * mention balance and the market's. Available on every tier with the same response; each
1040
+ * call counts against the monthly quota. It is a daily precomputed snapshot, so `generatedAt`
1041
+ * (epoch seconds) is its freshness.
1042
+ *
1043
+ * @example
1044
+ * const { sectors } = await client.marketMood.getSentimentSectors();
1045
+ * for (const s of sectors) console.log(s.sector, s.consensusVsMarket, s.consensusLabel);
1046
+ */
1047
+ async getSentimentSectors() {
1048
+ return this.client.get("/api/v1/sentiment/sectors");
1049
+ }
1050
+ /**
1051
+ * Get market-wide sentiment breadth: each day's share of the covered US stocks leaning
1052
+ * bullish, neutral or bearish, the tone analogue of an advance/decline line.
1053
+ *
1054
+ * `series` runs oldest to newest, and `latest` is the newest entry of `series`. Available on
1055
+ * every tier with the same response; each call counts against the monthly quota. It is a daily
1056
+ * precomputed snapshot, so `generatedAt` (epoch seconds) is its freshness.
1057
+ *
1058
+ * @example
1059
+ * const breadth = await client.marketMood.getSentimentBreadth();
1060
+ * console.log(breadth.latest?.date, breadth.latest?.netBreadth);
1061
+ */
1062
+ async getSentimentBreadth() {
1063
+ return this.client.get("/api/v1/sentiment/breadth");
1064
+ }
968
1065
  };
969
1066
 
970
1067
  // src/resources/marketSummary.ts
@@ -999,9 +1096,10 @@ var Options = class {
999
1096
  * `data` is `null` before the first nightly build populates it, which is a cold-start
1000
1097
  * state rather than an error.
1001
1098
  *
1002
- * Tiering: a PRO key receives every row. A FREE key receives the top 25 stock rows plus
1003
- * all the aggregates, with `isPreview` true and the envelope's `totalCount` reporting the
1004
- * full stock board; `data.etfTotalCount` does the same for the ETF board.
1099
+ * Tiering: a PRO key receives every row. A FREE key receives the top 25 rows of each board
1100
+ * and the top 3 session highlights of each board, plus every aggregate for both boards, with
1101
+ * `isPreview` true and the envelope's `totalCount` reporting the full stock board;
1102
+ * `data.etfTotalCount` does the same for the ETF board.
1005
1103
  *
1006
1104
  * Drill into any row with `client.stocks.getOptionsSummary(ticker)` for its full dossier,
1007
1105
  * or `client.stocks.getOptionsHistory(ticker)` to chart how a reading has trended.
@@ -1364,7 +1462,9 @@ var Stocks = class {
1364
1462
  * ten calls each calendar month and a headline-only preview after that, with `isPreview`
1365
1463
  * true; calls that return a null `data` never spend that allowance. The headline preview has
1366
1464
  * no nested objects: its readings arrive flat as `data.ivRank1y`, `data.atmIv`,
1367
- * `data.expectedMove1d`, `data.pcVol`, `data.pcVolPctl1y` and `data.maxPain`.
1465
+ * `data.expectedMove1d`, `data.pcVol`, `data.pcVolPctl1y` and `data.maxPain`. On a FREE key
1466
+ * the envelope's `dossierAllowance`, when available, says how many full dossiers are left
1467
+ * this calendar month and when the count resets.
1368
1468
  */
1369
1469
  async getOptionsSummary(ticker) {
1370
1470
  return this.client.get(
@@ -1410,8 +1510,10 @@ var Stocks = class {
1410
1510
  *
1411
1511
  * **No data is an empty `series`, not a null payload.** A weekend, a holiday, a session from
1412
1512
  * before the history was kept, a ticker outside the board and an unknown symbol all answer
1413
- * with `data.series` empty. `data.missingCycles` lists cycles whose stored point could not be
1414
- * read, which are unknown rather than absent. A malformed or future `session` rejects with
1513
+ * with `data.series` empty. `data.missingCycles` lists cycles with no stored history (a cycle
1514
+ * that published no board, or one whose history was lost), where the ticker's numbers are
1515
+ * unknown rather than zero. `data.cycles` counts the session's stored cycles, so `series` can
1516
+ * be shorter. A malformed or future `session` rejects with
1415
1517
  * an `APIError` (status 400, code `invalid_session`). A 503 means the stored series could
1416
1518
  * not be read; it is retried like any other 503 and never answered with a partial series.
1417
1519
  */
@@ -1557,7 +1659,7 @@ function serializeTrackerParams(params) {
1557
1659
  }
1558
1660
 
1559
1661
  // src/version.ts
1560
- var VERSION = "0.80.0";
1662
+ var VERSION = "0.82.0";
1561
1663
 
1562
1664
  // src/client.ts
1563
1665
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";