sentisense 0.50.0 → 0.52.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 +36 -7
- package/dist/cli.cjs +461 -59
- package/dist/index.cjs +37 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +126 -19
- package/dist/index.d.ts +126 -19
- package/dist/index.mjs +37 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -710,6 +710,22 @@ var KB = class {
|
|
|
710
710
|
async getPopularEntities() {
|
|
711
711
|
return this.client.get("/api/v1/kb/entities/popular");
|
|
712
712
|
}
|
|
713
|
+
/**
|
|
714
|
+
* Resolve a name, alias, ticker or slug to the entities we track, best match first.
|
|
715
|
+
*
|
|
716
|
+
* This is resolution, not enumeration: the query must be at least 2 characters and the
|
|
717
|
+
* result count is capped, so it answers "which handle did the user mean" rather than
|
|
718
|
+
* dumping the graph. Use it when someone typed "Tesla" and the rest of your code needs
|
|
719
|
+
* `TSLA`, or when you need the `urlSlug` an entity's metric series is addressed by.
|
|
720
|
+
*
|
|
721
|
+
* Returns a bare array, not a `PreviewResponse` envelope, and an empty array is the
|
|
722
|
+
* normal answer for a query that matches nothing.
|
|
723
|
+
*
|
|
724
|
+
* @param q What the user typed. At least 2 characters, or the API answers 400.
|
|
725
|
+
*/
|
|
726
|
+
async searchEntities(q, options) {
|
|
727
|
+
return this.client.get("/api/v1/kb/entities/search", { q, ...options });
|
|
728
|
+
}
|
|
713
729
|
};
|
|
714
730
|
|
|
715
731
|
// src/resources/marketMood.ts
|
|
@@ -1114,10 +1130,10 @@ var Stocks = class {
|
|
|
1114
1130
|
* security. `disclaimer` carries the wording to display alongside a grade. Methodology:
|
|
1115
1131
|
* https://sentisense.ai/methodology/#sentisense-rating
|
|
1116
1132
|
*
|
|
1117
|
-
* **A discriminated union on `rated`.** `if (rating.rated)` narrows to `
|
|
1118
|
-
* `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the
|
|
1119
|
-
* narrows to `reason`, `dimensionsPresent` and `presentDimensions`.
|
|
1120
|
-
* rather than testing a field for `undefined`.
|
|
1133
|
+
* **A discriminated union on `rated`.** `if (rating.rated)` narrows to `score`,
|
|
1134
|
+
* `letter`, `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the
|
|
1135
|
+
* `else` branch narrows to `reason`, `dimensionsPresent` and `presentDimensions`.
|
|
1136
|
+
* Branch on the flag rather than testing a field for `undefined`.
|
|
1121
1137
|
*
|
|
1122
1138
|
* **Having no grade is a normal 200, not a 404.** ETFs and tickers outside the swept
|
|
1123
1139
|
* universe answer with `rated` false, and the composition still arrives so a card can
|
|
@@ -1127,11 +1143,22 @@ var Stocks = class {
|
|
|
1127
1143
|
*
|
|
1128
1144
|
* `dimensions` always holds all six rows in a fixed order, including the ones with no
|
|
1129
1145
|
* data, which arrive with `present` false and a `null` percentile. Read `present` first
|
|
1130
|
-
* and never read a missing percentile as zero.
|
|
1131
|
-
*
|
|
1132
|
-
*
|
|
1133
|
-
*
|
|
1134
|
-
*
|
|
1146
|
+
* and never read a missing percentile as zero.
|
|
1147
|
+
*
|
|
1148
|
+
* **`score` and `percentile` are different numbers.** `percentile` is the rank of the
|
|
1149
|
+
* blended signals against the day's rated set, and
|
|
1150
|
+
* `score = percentile - sum(riskAdjustments.map((a) => a.points))`, floored at 10 when
|
|
1151
|
+
* fewer than five dimensions are available and at 0 otherwise. `letter` is the band
|
|
1152
|
+
* `score` falls in, at edges 90, 70, 30 and 10, while `bucketLetter` is the band the
|
|
1153
|
+
* percentile alone would fall in, so a difference between the two letters is exactly
|
|
1154
|
+
* what the conditions cost. `riskConditions` names the active ones, `riskAdjustments`
|
|
1155
|
+
* gives the points each cost (graded, up to 12 apiece), and `penaltyPoints` is their
|
|
1156
|
+
* sum. `letter` is served as stored, so read it instead of computing your own bucket
|
|
1157
|
+
* edges. The five fields arrive from the next API deploy onward and are optional, so a
|
|
1158
|
+
* response served before then still parses.
|
|
1159
|
+
*
|
|
1160
|
+
* For the daily history of a stock's score, ask `client.entityMetrics.getMetrics` for
|
|
1161
|
+
* the `sentisense_rating` metric.
|
|
1135
1162
|
*/
|
|
1136
1163
|
async getRating(ticker) {
|
|
1137
1164
|
return this.client.get(`/api/v1/rating/${encodeURIComponent(ticker.toUpperCase())}`);
|
|
@@ -1215,7 +1242,7 @@ var Trackers = class {
|
|
|
1215
1242
|
};
|
|
1216
1243
|
|
|
1217
1244
|
// src/version.ts
|
|
1218
|
-
var VERSION = "0.
|
|
1245
|
+
var VERSION = "0.52.0";
|
|
1219
1246
|
|
|
1220
1247
|
// src/client.ts
|
|
1221
1248
|
var DEFAULT_BASE_URL = "https://app.sentisense.ai";
|