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/README.md +12 -5
- package/dist/cli.cjs +564 -124
- package/dist/index.cjs +109 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +413 -26
- package/dist/index.d.ts +413 -26
- package/dist/index.mjs +109 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -253,6 +253,16 @@ var Calendar = class {
|
|
|
253
253
|
constructor(client) {
|
|
254
254
|
this.client = client;
|
|
255
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* List the calendars the API serves, with the path of each, so a client can find them
|
|
258
|
+
* without hardcoding paths.
|
|
259
|
+
*
|
|
260
|
+
* Every tier receives the same list, and the call does not count against the monthly quota;
|
|
261
|
+
* the per-minute rate limit still applies.
|
|
262
|
+
*/
|
|
263
|
+
async list() {
|
|
264
|
+
return this.client.get("/api/v1/calendar");
|
|
265
|
+
}
|
|
256
266
|
/**
|
|
257
267
|
* Upcoming company earnings, sorted by date.
|
|
258
268
|
*
|
|
@@ -434,6 +444,14 @@ var Earnings = class {
|
|
|
434
444
|
};
|
|
435
445
|
|
|
436
446
|
// src/resources/entityMetrics.ts
|
|
447
|
+
function requirePathSegment(method, name, value) {
|
|
448
|
+
if (typeof value !== "string" || value.trim() === "" || value === "." || value === "..") {
|
|
449
|
+
throw new SentiSenseError(
|
|
450
|
+
`${method}: ${name} must not be empty, "." or ".." (got ${JSON.stringify(value)})`
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
return value;
|
|
454
|
+
}
|
|
437
455
|
var EntityMetrics = class {
|
|
438
456
|
constructor(client) {
|
|
439
457
|
this.client = client;
|
|
@@ -484,6 +502,25 @@ var EntityMetrics = class {
|
|
|
484
502
|
}
|
|
485
503
|
);
|
|
486
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* List the dimensions a metric can be broken down by for one entity, with the values present
|
|
507
|
+
* in the data, so you can see what exists before calling `getDistribution()`.
|
|
508
|
+
*
|
|
509
|
+
* Returns a plain array, empty when the metric has no slices for this entity. Available on
|
|
510
|
+
* every tier; each call counts against the monthly quota.
|
|
511
|
+
*
|
|
512
|
+
* @param symbol Ticker symbol (e.g. "AAPL") or entity urlSlug (e.g. "Nancy-Pelosi").
|
|
513
|
+
* @param metricType The metric to look up (e.g. "mentions").
|
|
514
|
+
* @throws {SentiSenseError} Before any request, when `symbol` or `metricType` is empty,
|
|
515
|
+
* whitespace only, `"."` or `".."`.
|
|
516
|
+
*/
|
|
517
|
+
async getSlices(symbol, metricType) {
|
|
518
|
+
const entity = requirePathSegment("entityMetrics.getSlices", "symbol", symbol);
|
|
519
|
+
const metric = requirePathSegment("entityMetrics.getSlices", "metricType", metricType);
|
|
520
|
+
return this.client.get(
|
|
521
|
+
`/api/v2/metrics/entity/${encodeURIComponent(entity)}/metric/${encodeURIComponent(metric)}/slices`
|
|
522
|
+
);
|
|
523
|
+
}
|
|
487
524
|
};
|
|
488
525
|
|
|
489
526
|
// src/resources/etfs.ts
|
|
@@ -859,6 +896,35 @@ var Institutional = class {
|
|
|
859
896
|
async getActivists(reportDate) {
|
|
860
897
|
return this.client.get("/api/v1/institutional/activist", { reportDate });
|
|
861
898
|
}
|
|
899
|
+
/**
|
|
900
|
+
* Get convertible bond positions from 13F filings for one quarter, one row per issuer,
|
|
901
|
+
* grouped by the issuer's equity ticker.
|
|
902
|
+
*
|
|
903
|
+
* `reportDate` is the quarter end as an ISO date (e.g. `"2026-06-30"`); the API requires it,
|
|
904
|
+
* so take one from `getQuarters()`. Returns the preview envelope, so the rows are `.data`. A
|
|
905
|
+
* FREE key receives the top three rows with `isPreview: true` and `totalCount` holding the full
|
|
906
|
+
* row count; a PRO key receives the full list.
|
|
907
|
+
*
|
|
908
|
+
* Each row's `bondTickers` is one comma-separated string, not an array.
|
|
909
|
+
*/
|
|
910
|
+
async getBondFlows(reportDate) {
|
|
911
|
+
return this.client.get("/api/v1/institutional/bonds", { reportDate });
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Get the call and put positions institutions reported on Form 13F for one quarter, one row
|
|
915
|
+
* per stock.
|
|
916
|
+
*
|
|
917
|
+
* These are quarter-end 13F holdings, not options market activity: for options volume, open
|
|
918
|
+
* interest and implied volatility, use `client.options` and `stocks.getOptionsSummary()`.
|
|
919
|
+
*
|
|
920
|
+
* `reportDate` is the quarter end as an ISO date (e.g. `"2026-06-30"`); the API requires it,
|
|
921
|
+
* so take one from `getQuarters()`. Returns the preview envelope, so the rows are `.data`. A
|
|
922
|
+
* FREE key receives the top three rows with `isPreview: true` and `totalCount` holding the full
|
|
923
|
+
* row count; a PRO key receives the full list.
|
|
924
|
+
*/
|
|
925
|
+
async getOptionFlows(reportDate) {
|
|
926
|
+
return this.client.get("/api/v1/institutional/options", { reportDate });
|
|
927
|
+
}
|
|
862
928
|
/**
|
|
863
929
|
* Discover institutions: a paginated, AUM-ranked list of filers (slug + metadata)
|
|
864
930
|
* so you can find what to query without knowing slugs upfront.
|
|
@@ -1000,6 +1066,37 @@ var MarketMoodResource = class {
|
|
|
1000
1066
|
// index envelope alongside fed-sentiment and ai-sentiment. Use this resource when you want
|
|
1001
1067
|
// the phase band, weekly change, per-signal breakdown and per-sector map; use `indexes`
|
|
1002
1068
|
// when you want every index to answer the same shape. Both report the same headline number.
|
|
1069
|
+
/**
|
|
1070
|
+
* Get the per-sector sentiment rollup: the 11 GICS sectors, each measured against the
|
|
1071
|
+
* market's own news-and-social tone.
|
|
1072
|
+
*
|
|
1073
|
+
* Compare sectors on `consensusVsMarket`, the gap between a sector's bullish-versus-bearish
|
|
1074
|
+
* mention balance and the market's. Available on every tier with the same response; each
|
|
1075
|
+
* call counts against the monthly quota. It is a daily precomputed snapshot, so `generatedAt`
|
|
1076
|
+
* (epoch seconds) is its freshness.
|
|
1077
|
+
*
|
|
1078
|
+
* @example
|
|
1079
|
+
* const { sectors } = await client.marketMood.getSentimentSectors();
|
|
1080
|
+
* for (const s of sectors) console.log(s.sector, s.consensusVsMarket, s.consensusLabel);
|
|
1081
|
+
*/
|
|
1082
|
+
async getSentimentSectors() {
|
|
1083
|
+
return this.client.get("/api/v1/sentiment/sectors");
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Get market-wide sentiment breadth: each day's share of the covered US stocks leaning
|
|
1087
|
+
* bullish, neutral or bearish, the tone analogue of an advance/decline line.
|
|
1088
|
+
*
|
|
1089
|
+
* `series` runs oldest to newest, and `latest` is the newest entry of `series`. Available on
|
|
1090
|
+
* every tier with the same response; each call counts against the monthly quota. It is a daily
|
|
1091
|
+
* precomputed snapshot, so `generatedAt` (epoch seconds) is its freshness.
|
|
1092
|
+
*
|
|
1093
|
+
* @example
|
|
1094
|
+
* const breadth = await client.marketMood.getSentimentBreadth();
|
|
1095
|
+
* console.log(breadth.latest?.date, breadth.latest?.netBreadth);
|
|
1096
|
+
*/
|
|
1097
|
+
async getSentimentBreadth() {
|
|
1098
|
+
return this.client.get("/api/v1/sentiment/breadth");
|
|
1099
|
+
}
|
|
1003
1100
|
};
|
|
1004
1101
|
|
|
1005
1102
|
// src/resources/marketSummary.ts
|
|
@@ -1034,9 +1131,10 @@ var Options = class {
|
|
|
1034
1131
|
* `data` is `null` before the first nightly build populates it, which is a cold-start
|
|
1035
1132
|
* state rather than an error.
|
|
1036
1133
|
*
|
|
1037
|
-
* Tiering: a PRO key receives every row. A FREE key receives the top 25
|
|
1038
|
-
*
|
|
1039
|
-
*
|
|
1134
|
+
* Tiering: a PRO key receives every row. A FREE key receives the top 25 rows of each board
|
|
1135
|
+
* and the top 3 session highlights of each board, plus every aggregate for both boards, with
|
|
1136
|
+
* `isPreview` true and the envelope's `totalCount` reporting the full stock board;
|
|
1137
|
+
* `data.etfTotalCount` does the same for the ETF board.
|
|
1040
1138
|
*
|
|
1041
1139
|
* Drill into any row with `client.stocks.getOptionsSummary(ticker)` for its full dossier,
|
|
1042
1140
|
* or `client.stocks.getOptionsHistory(ticker)` to chart how a reading has trended.
|
|
@@ -1399,7 +1497,9 @@ var Stocks = class {
|
|
|
1399
1497
|
* ten calls each calendar month and a headline-only preview after that, with `isPreview`
|
|
1400
1498
|
* true; calls that return a null `data` never spend that allowance. The headline preview has
|
|
1401
1499
|
* no nested objects: its readings arrive flat as `data.ivRank1y`, `data.atmIv`,
|
|
1402
|
-
* `data.expectedMove1d`, `data.pcVol`, `data.pcVolPctl1y` and `data.maxPain`.
|
|
1500
|
+
* `data.expectedMove1d`, `data.pcVol`, `data.pcVolPctl1y` and `data.maxPain`. On a FREE key
|
|
1501
|
+
* the envelope's `dossierAllowance`, when available, says how many full dossiers are left
|
|
1502
|
+
* this calendar month and when the count resets.
|
|
1403
1503
|
*/
|
|
1404
1504
|
async getOptionsSummary(ticker) {
|
|
1405
1505
|
return this.client.get(
|
|
@@ -1445,8 +1545,10 @@ var Stocks = class {
|
|
|
1445
1545
|
*
|
|
1446
1546
|
* **No data is an empty `series`, not a null payload.** A weekend, a holiday, a session from
|
|
1447
1547
|
* before the history was kept, a ticker outside the board and an unknown symbol all answer
|
|
1448
|
-
* with `data.series` empty. `data.missingCycles` lists cycles
|
|
1449
|
-
*
|
|
1548
|
+
* with `data.series` empty. `data.missingCycles` lists cycles with no stored history (a cycle
|
|
1549
|
+
* that published no board, or one whose history was lost), where the ticker's numbers are
|
|
1550
|
+
* unknown rather than zero. `data.cycles` counts the session's stored cycles, so `series` can
|
|
1551
|
+
* be shorter. A malformed or future `session` rejects with
|
|
1450
1552
|
* an `APIError` (status 400, code `invalid_session`). A 503 means the stored series could
|
|
1451
1553
|
* not be read; it is retried like any other 503 and never answered with a partial series.
|
|
1452
1554
|
*/
|
|
@@ -1592,7 +1694,7 @@ function serializeTrackerParams(params) {
|
|
|
1592
1694
|
}
|
|
1593
1695
|
|
|
1594
1696
|
// src/version.ts
|
|
1595
|
-
var VERSION = "0.
|
|
1697
|
+
var VERSION = "0.82.0";
|
|
1596
1698
|
|
|
1597
1699
|
// src/client.ts
|
|
1598
1700
|
var DEFAULT_BASE_URL = "https://app.sentisense.ai";
|