sentisense 0.72.1 → 0.74.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
@@ -839,10 +839,71 @@ var Institutional = class {
839
839
  * The signature remains unknown for compatibility. Opt in to the exported
840
840
  * PreviewResponse<InstitutionDetail> type to read data.positionsHeld, the full
841
841
  * portfolio count excluding SOLD_OUT rows, even on a truncated holdings list.
842
+ *
843
+ * When the filing compares with the preceding quarter (`comparisonStatus` is `AVAILABLE`),
844
+ * the payload also carries `priorTotalValueUsd` and `priorPositionsHeld`, and each holding
845
+ * carries `priorValueUsd`, `priorPortfolioWeight` and `estimatedFlowUsd` (an estimate from
846
+ * two quarter-end snapshots, not a reported trade). Each is absent when it does not apply.
847
+ *
848
+ * `options.limit` returns a sorted page of holdings and adds `returnedCount` and `offset` to
849
+ * `data` and `totalCount` to the envelope; `sortBy`, `sortDir`, `changeType`, `q` and
850
+ * `minWeight` only take effect together with it (PRO only). `changeType` also accepts `"HELD"`,
851
+ * every position still held whatever its change; values combine as a union. With a filter set, `data.matchTotals`
852
+ * sums every matching holding, not just the page. Calling without `options` is unchanged.
853
+ *
854
+ * @example
855
+ * const page = await client.institutional.getInstitutionDetail("Berkshire-Hathaway", {
856
+ * limit: 10,
857
+ * sortBy: "estimatedFlowUsd",
858
+ * changeType: ["NEW", "INCREASED"],
859
+ * }) as PreviewResponse<InstitutionDetail>;
860
+ */
861
+ async getInstitutionDetail(slugOrCik, options) {
862
+ const { changeType, ...rest } = options ?? {};
863
+ return this.client.get(
864
+ `/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}`,
865
+ {
866
+ ...rest,
867
+ changeType: typeof changeType === "string" ? changeType : changeType?.join(",") || void 0
868
+ }
869
+ );
870
+ }
871
+ /**
872
+ * Get an institution's 13F book filing by filing, newest first.
873
+ *
874
+ * Returns the preview envelope wrapping an {@link InstitutionHistory}, so the rows are two
875
+ * levels down: `(await getInstitutionHistory(s)).data.quarters`. Each row carries the
876
+ * filing's reported value, positions held and top-10 concentration, and, when it compares
877
+ * with the quarter before (`comparisonStatus: "AVAILABLE"`), the position counts and the
878
+ * estimated dollars bought, trimmed and exited. Those comparison fields are absent
879
+ * otherwise, never zero. The flows are estimates from two quarter-end snapshots, not
880
+ * reported cash flow. A 13F covers long US-listed equity only.
881
+ *
882
+ * Pass `tickers` to also get `data.positions`: each ticker maps to its shares and value per
883
+ * filing, newest first. A filing in which the institution did not hold the ticker is absent
884
+ * from its list. Free keys receive positions only for the institution's ten largest
885
+ * holdings; other tickers are left out.
886
+ *
887
+ * Free keys receive the newest four filings with `isPreview: true` and `totalCount` holding
888
+ * the number of filings in the requested window. The first request for a large multi-filer
889
+ * institution can take a few seconds; when too many such computations run at once the API
890
+ * answers 503 with a `Retry-After` header.
891
+ *
892
+ * @example
893
+ * const { data } = await client.institutional.getInstitutionHistory("Renaissance-Technologies", {
894
+ * quarters: 8,
895
+ * tickers: ["NVDA", "META"],
896
+ * });
897
+ * for (const q of data.quarters) console.log(q.label, q.totalValueUsd, q.netFlowUsd);
842
898
  */
843
- async getInstitutionDetail(slugOrCik) {
899
+ async getInstitutionHistory(slugOrCik, options) {
900
+ const { tickers, ...rest } = options ?? {};
844
901
  return this.client.get(
845
- `/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}`
902
+ `/api/v1/institutional/institution/${encodeURIComponent(slugOrCik)}/history`,
903
+ {
904
+ ...rest,
905
+ tickers: typeof tickers === "string" ? tickers : tickers?.join(",") || void 0
906
+ }
846
907
  );
847
908
  }
848
909
  };
@@ -1440,7 +1501,7 @@ var Trackers = class {
1440
1501
  };
1441
1502
 
1442
1503
  // src/version.ts
1443
- var VERSION = "0.72.1";
1504
+ var VERSION = "0.74.0";
1444
1505
 
1445
1506
  // src/client.ts
1446
1507
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";