gloomberb 0.19.6 → 0.20.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.
Files changed (137) hide show
  1. package/LICENSE +0 -4
  2. package/package.json +6 -5
  3. package/patches/electrobun-devkit@2.0.5.patch +148 -0
  4. package/src/api-client/bond-trades.ts +59 -0
  5. package/src/api-client/data.ts +21 -0
  6. package/src/api-client/index.ts +2 -0
  7. package/src/api-client/types/account.ts +86 -0
  8. package/src/api-client/types/assist.ts +32 -0
  9. package/src/api-client/types/auth.ts +63 -0
  10. package/src/api-client/types/billing.ts +54 -0
  11. package/src/api-client/types/chat.ts +180 -0
  12. package/src/api-client/types/congress.ts +107 -0
  13. package/src/api-client/types/credit.ts +110 -0
  14. package/src/api-client/types/econ.ts +158 -0
  15. package/src/api-client/types/equity-diagnostic.ts +73 -0
  16. package/src/api-client/types/filings-and-calls.ts +350 -0
  17. package/src/api-client/types/index.ts +25 -0
  18. package/src/api-client/types/jobs.ts +147 -0
  19. package/src/api-client/types/market.ts +122 -0
  20. package/src/api-client/types/news.ts +91 -0
  21. package/src/api-client/types/notes-and-theses.ts +172 -0
  22. package/src/api-client/types/quotes.ts +28 -0
  23. package/src/api-client/types/scanners.ts +125 -0
  24. package/src/api-client/types/screener.ts +65 -0
  25. package/src/api-client/types/search.ts +107 -0
  26. package/src/api-client/types/sync.ts +14 -0
  27. package/src/api-client/types/team-collections.ts +43 -0
  28. package/src/api-client/types/team-views.ts +32 -0
  29. package/src/api-client/types/teams.ts +135 -0
  30. package/src/api-client/types/ticker-data.ts +57 -0
  31. package/src/api-client/types/tweets.ts +59 -0
  32. package/src/api-client/types/world-venues.ts +23 -0
  33. package/src/app/runtime/desktop-deeplink.ts +41 -6
  34. package/src/app/star-prompt/status-line.tsx +1 -1
  35. package/src/app.tsx +1 -7
  36. package/src/architecture/ui-tokens-allowlist.json +0 -8
  37. package/src/cli/commands/ticker.ts +17 -4
  38. package/src/cli/desktop-pane-shot-browser.ts +69 -3
  39. package/src/cli/pane-functions/catalog.ts +3 -1
  40. package/src/components/chart/composite/use-composite-chart-keyboard.ts +11 -2
  41. package/src/components/data-table/export.ts +4 -1
  42. package/src/components/layout/detached-pane-shell.tsx +10 -37
  43. package/src/components/layout/double-escape-close.ts +90 -0
  44. package/src/components/layout/header.tsx +3 -2
  45. package/src/components/layout/market-summary.ts +6 -3
  46. package/src/components/layout/pane/footer/index.tsx +2 -6
  47. package/src/components/layout/pane/footer/model.ts +6 -12
  48. package/src/components/layout/shell/active-drag.ts +53 -11
  49. package/src/components/layout/shell/drag/magnets.ts +128 -19
  50. package/src/components/layout/shell/pane/actions.ts +6 -2
  51. package/src/components/layout/shell/pane/management-shortcuts.ts +13 -51
  52. package/src/components/layout/status-bar.tsx +4 -78
  53. package/src/components/layout/status-widget-space.ts +5 -5
  54. package/src/components/onboarding/portfolio-step/positions-panel.tsx +1 -1
  55. package/src/components/ui/data-table/index.tsx +5 -1
  56. package/src/components/ui/data-table/render-cell.ts +19 -0
  57. package/src/components/ui/delayed-mark.tsx +59 -7
  58. package/src/components/ui/icon.tsx +1 -8
  59. package/src/components/ui/menu.tsx +6 -1
  60. package/src/i18n/es.ts +3 -3
  61. package/src/i18n/ja.ts +3 -3
  62. package/src/i18n/ko.ts +3 -3
  63. package/src/i18n/zh-cn.ts +3 -3
  64. package/src/i18n/zh-tw.ts +3 -3
  65. package/src/plugins/builtin/chat/content/composer.tsx +21 -27
  66. package/src/plugins/builtin/chat/content/index.tsx +31 -3
  67. package/src/plugins/builtin/chat/content/shortcuts.ts +4 -2
  68. package/src/plugins/builtin/chat/content/snapshot.ts +0 -3
  69. package/src/plugins/builtin/cloud/auth-actions.tsx +51 -23
  70. package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +3 -3
  71. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +32 -25
  72. package/src/plugins/builtin/congress-trades/model.ts +2 -1
  73. package/src/plugins/builtin/congress-trades/pane.tsx +3 -0
  74. package/src/plugins/builtin/custom-view/index.tsx +1 -1
  75. package/src/plugins/builtin/custom-view/loader.ts +85 -8
  76. package/src/plugins/builtin/custom-view/view-spec.ts +28 -0
  77. package/src/plugins/builtin/equity-screener/criterion-editor.tsx +13 -4
  78. package/src/plugins/builtin/equity-screener/headless.ts +33 -1
  79. package/src/plugins/builtin/equity-screener/model.ts +58 -15
  80. package/src/plugins/builtin/equity-screener/pane.tsx +36 -6
  81. package/src/plugins/builtin/executives/format.ts +5 -4
  82. package/src/plugins/builtin/executives/pane.tsx +1 -1
  83. package/src/plugins/builtin/help/index.tsx +55 -1
  84. package/src/plugins/builtin/insider/model.ts +30 -2
  85. package/src/plugins/builtin/jobs/model.ts +2 -2
  86. package/src/plugins/builtin/mna/model.ts +2 -2
  87. package/src/plugins/builtin/notes/files.ts +2 -0
  88. package/src/plugins/builtin/notes/owner.tsx +20 -1
  89. package/src/plugins/builtin/notes/quick-notes-pane.tsx +22 -4
  90. package/src/plugins/builtin/notes/store.ts +6 -1
  91. package/src/plugins/builtin/portfolio-list/header.tsx +1 -1
  92. package/src/plugins/builtin/research/corporate-actions-pane.tsx +29 -25
  93. package/src/plugins/builtin/series-inventory.ts +1 -0
  94. package/src/plugins/builtin/shared/earnings-report.ts +7 -2
  95. package/src/plugins/builtin/shared/use-quote-board.ts +85 -46
  96. package/src/plugins/builtin/short-interest/headless.ts +1 -1
  97. package/src/plugins/builtin/short-interest/model.ts +15 -6
  98. package/src/plugins/builtin/short-interest/types.ts +2 -0
  99. package/src/plugins/builtin/thirteenf/overlap-pane.tsx +3 -0
  100. package/src/plugins/builtin/thirteenf/pane.tsx +3 -0
  101. package/src/plugins/builtin/ticker-detail/overview/model.ts +5 -3
  102. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +4 -4
  103. package/src/plugins/builtin/trace-bonds/detail.tsx +198 -0
  104. package/src/plugins/builtin/trace-bonds/headless.ts +62 -4
  105. package/src/plugins/builtin/trace-bonds/history.ts +155 -0
  106. package/src/plugins/builtin/trace-bonds/pane.tsx +64 -5
  107. package/src/plugins/installer.ts +16 -3
  108. package/src/plugins/plugin-names.ts +11 -2
  109. package/src/remote/controller.ts +9 -2
  110. package/src/remote/schema.ts +2 -1
  111. package/src/renderers/cloudflare/http-proxy.ts +67 -8
  112. package/src/renderers/cloudflare/proxy-session.ts +1 -1
  113. package/src/renderers/cloudflare/worker.ts +29 -2
  114. package/src/renderers/dom/desktop/icons.tsx +0 -2
  115. package/src/renderers/dom/styles.css +0 -3
  116. package/src/renderers/electrobun/bun/desktop/install-records.ts +59 -0
  117. package/src/renderers/electrobun/bun/desktop/installer-folder.ts +208 -592
  118. package/src/renderers/electrobun/bun/desktop/macos-objc.ts +14 -0
  119. package/src/renderers/electrobun/bun/desktop/update.ts +1 -1
  120. package/src/renderers/electrobun/bun/index.ts +19 -13
  121. package/src/renderers/electrobun/bun/window/create.ts +23 -3
  122. package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +4 -4
  123. package/src/renderers/electrobun/bun/window/events.ts +4 -4
  124. package/src/renderers/electrobun/bun/window/frame.ts +2 -1
  125. package/src/renderers/electrobun/bun/window/native-min-size.ts +322 -0
  126. package/src/renderers/electrobun/view/backend-rpc.ts +1 -1
  127. package/src/sources/gloomberb-cloud/index.ts +5 -7
  128. package/src/sources/provider-router/batches.ts +18 -3
  129. package/src/sources/provider-router/financials.ts +18 -4
  130. package/src/types/data-provider.ts +14 -0
  131. package/src/types/financials.ts +15 -3
  132. package/src/types/headless.ts +2 -0
  133. package/src/utils/double-escape-close.ts +38 -16
  134. package/src/utils/format.ts +23 -3
  135. package/src/utils/price-earnings.ts +18 -0
  136. package/patches/electrobun@1.18.1.patch +0 -633
  137. package/src/api-client/types.ts +0 -2441
@@ -0,0 +1,91 @@
1
+ import type { CompanyFrom } from "../../types/company-from";
2
+
3
+ interface CloudNewsEntityPayload {
4
+ id: string;
5
+ entityType: string;
6
+ name: string;
7
+ symbol: string | null;
8
+ exchange: string | null;
9
+ canonicalTicker: string | null;
10
+ role: string | null;
11
+ confidence: number | null;
12
+ }
13
+
14
+ interface CloudNewsTickerLinkPayload {
15
+ symbol: string;
16
+ exchange: string;
17
+ canonicalTicker: string;
18
+ relationType: string;
19
+ displayTier: "primary" | "related";
20
+ confidence: number;
21
+ relevanceScore: number;
22
+ impactScore?: number;
23
+ /** The company's market cap, stated on its home listing and not on a cross-listing. */
24
+ marketCap?: number | null;
25
+ sentiment?: "positive" | "neutral" | "negative" | null;
26
+ }
27
+
28
+ export interface CloudNewsStoryItemPayload {
29
+ id: string;
30
+ sourceKey: string;
31
+ sourceName: string;
32
+ title: string;
33
+ summary?: string;
34
+ url: string;
35
+ publishedAt: string;
36
+ hasArticleText?: boolean;
37
+ }
38
+
39
+ export interface CloudNewsPayload {
40
+ id: string;
41
+ headline: string;
42
+ summary: string;
43
+ topic?: string;
44
+ topics?: string[];
45
+ category: string;
46
+ sentiment: "positive" | "neutral" | "negative";
47
+ sectors: string[];
48
+ scope?: string;
49
+ firstPublishedAt: string;
50
+ lastPublishedAt: string;
51
+ firstSeenAt: string;
52
+ lastSeenAt: string;
53
+ primaryUrl: string;
54
+ /** Routing key of the representative item, for source filters. */
55
+ primarySource: string;
56
+ /** Who published the representative item (FT, SEC, @unusual_whales). */
57
+ primaryPublisher?: string;
58
+ publishers?: string[];
59
+ scores?: {
60
+ importance?: number;
61
+ urgency?: number;
62
+ marketImpact?: number;
63
+ novelty?: number;
64
+ confidence?: number;
65
+ };
66
+ flags?: {
67
+ breaking?: boolean;
68
+ developing?: boolean;
69
+ stale?: boolean;
70
+ };
71
+ variantCount: number;
72
+ sourceCount: number;
73
+ sources: string[];
74
+ entities: CloudNewsEntityPayload[];
75
+ tickerLinks: CloudNewsTickerLinkPayload[];
76
+ items?: CloudNewsStoryItemPayload[];
77
+ }
78
+
79
+ export interface CloudNewsListResponse {
80
+ items: CloudNewsPayload[];
81
+ nextCursor: string | null;
82
+ /** Which news the service answered with, when it says: the live wire, or the one held back for a free account. */
83
+ access?: "realtime" | "delayed";
84
+ /**
85
+ * A search asked for its closest stories: `all` when stories have every
86
+ * word, `closest` when none does and these have the most of them.
87
+ */
88
+ match?: "all" | "closest";
89
+ /** A receipt's or foreign line's feed is its company's: the home line it reads, when not the listing asked. */
90
+ companyFrom?: CompanyFrom;
91
+ }
@@ -0,0 +1,172 @@
1
+ // Cloud notes
2
+
3
+ type NoteOwnerKind = "user" | "team";
4
+ export type NoteKind = "ticker" | "quick";
5
+
6
+ interface CloudNoteOwner {
7
+ kind: NoteOwnerKind;
8
+ id: string;
9
+ }
10
+
11
+ export interface CloudNoteSummary {
12
+ id: string;
13
+ owner: CloudNoteOwner;
14
+ kind: NoteKind;
15
+ key: string;
16
+ title: string | null;
17
+ revision: number;
18
+ /** Who wrote the note; null when unknown. Older servers leave it out. */
19
+ createdBy?: string | null;
20
+ updatedBy: { id: string; username: string | null; displayName: string };
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ size: number;
24
+ }
25
+
26
+ export interface CloudNote extends Omit<CloudNoteSummary, "size"> {
27
+ content: string;
28
+ }
29
+
30
+ export interface CloudNoteScope {
31
+ scope: NoteOwnerKind;
32
+ teamId?: string;
33
+ }
34
+
35
+ // Theses
36
+
37
+ export type ThesisStatus = "watching" | "active" | "closed";
38
+ export type ThesisHealth = "unverified" | "intact" | "weakening" | "broken";
39
+ export type ThesisPillarStatus = ThesisHealth;
40
+
41
+ interface ThesisInstrument {
42
+ symbol: string;
43
+ exchange?: string;
44
+ side: "long" | "short";
45
+ role: "core" | "hedge";
46
+ }
47
+
48
+ interface ThesisMetricBound {
49
+ key: string;
50
+ op: ">=" | "<=";
51
+ value: number;
52
+ unit?: string;
53
+ }
54
+
55
+ export interface ThesisPillar {
56
+ id: string;
57
+ text: string;
58
+ kind: "qualitative" | "metric";
59
+ metric?: ThesisMetricBound;
60
+ /** Symbol the claim is about; absent means the thesis as a whole. */
61
+ scope?: string;
62
+ status: ThesisPillarStatus;
63
+ note?: string;
64
+ }
65
+
66
+ export interface ThesisKillCondition {
67
+ id: string;
68
+ text: string;
69
+ triggered: boolean;
70
+ note?: string;
71
+ }
72
+
73
+ export interface ThesisCatalyst {
74
+ id: string;
75
+ text: string;
76
+ date?: string;
77
+ status: "pending" | "hit" | "missed";
78
+ }
79
+
80
+ export interface ThesisDocument {
81
+ summary: string;
82
+ instruments: ThesisInstrument[];
83
+ evidence: { symbols: string[]; keywords: string[] };
84
+ pillars: ThesisPillar[];
85
+ killConditions: ThesisKillCondition[];
86
+ catalysts: ThesisCatalyst[];
87
+ target?: { price?: number; note?: string };
88
+ entry?: { date?: string; price?: number };
89
+ }
90
+
91
+ interface ThesisOutcome {
92
+ verdict: "right" | "wrong" | "lucky" | "unlucky";
93
+ returnPct?: number;
94
+ lesson?: string;
95
+ }
96
+
97
+ interface ThesisEditor {
98
+ id: string;
99
+ username: string | null;
100
+ displayName: string;
101
+ }
102
+
103
+ export interface CloudThesis {
104
+ id: string;
105
+ owner: CloudNoteOwner;
106
+ title: string;
107
+ status: ThesisStatus;
108
+ conviction: number;
109
+ horizon: string | null;
110
+ reviewEveryDays: number;
111
+ document: ThesisDocument;
112
+ outcome: ThesisOutcome | null;
113
+ health: ThesisHealth;
114
+ revision: number;
115
+ /** Signals waiting for a verdict. */
116
+ openSignals: number;
117
+ createdBy: string;
118
+ updatedBy: ThesisEditor;
119
+ createdAt: string;
120
+ updatedAt: string;
121
+ reviewedAt: string | null;
122
+ closedAt: string | null;
123
+ }
124
+
125
+ type ThesisSignalTargetKind = "pillar" | "kill" | "catalyst" | "thesis";
126
+ type ThesisSignalVerdict = "supports" | "challenges" | "breaks" | "neutral";
127
+ type ThesisSignalStatus = "open" | "accepted" | "dismissed" | "snoozed" | "noted";
128
+
129
+ interface ThesisSignalSource {
130
+ kind: "news" | "filing" | "transcript" | "metric" | "review" | "user";
131
+ id?: string;
132
+ title?: string;
133
+ url?: string;
134
+ at?: string;
135
+ symbol?: string;
136
+ }
137
+
138
+ export interface ThesisSignal {
139
+ id: string;
140
+ thesisId: string;
141
+ targetKind: ThesisSignalTargetKind;
142
+ targetId: string | null;
143
+ verdict: ThesisSignalVerdict;
144
+ confidence: number | null;
145
+ reason: string;
146
+ source: ThesisSignalSource | null;
147
+ origin: "ai" | "rule" | "user";
148
+ status: ThesisSignalStatus;
149
+ resolutionNote: string | null;
150
+ createdBy: ThesisEditor | null;
151
+ resolvedBy: ThesisEditor | null;
152
+ createdAt: string;
153
+ resolvedAt: string | null;
154
+ snoozedUntil: string | null;
155
+ }
156
+
157
+ export interface ThesisDraft extends ThesisDocument {
158
+ title: string;
159
+ horizon: string | null;
160
+ }
161
+
162
+ export interface ThesisPatch {
163
+ title?: string;
164
+ status?: ThesisStatus;
165
+ conviction?: number;
166
+ horizon?: string | null;
167
+ reviewEveryDays?: number;
168
+ document?: ThesisDocument;
169
+ outcome?: ThesisOutcome | null;
170
+ note?: string | null;
171
+ reviewed?: boolean;
172
+ }
@@ -0,0 +1,28 @@
1
+ import type { Quote } from "../../types/financials";
2
+
3
+ export interface CloudQuotePayload extends Omit<Quote, "change" | "changePercent" | "priceBasis" | "priceObservation"> {
4
+ /** The service labels daily NAV here; the app separates observation kind from price units. */
5
+ priceBasis?: Quote["priceBasis"] | "nav";
6
+ // JSON encodes the provider's unavailable numeric values as null.
7
+ change?: number | null;
8
+ changePercent?: number | null;
9
+ providerId: "gloomberb-cloud";
10
+ dataSource: "live" | "delayed";
11
+ }
12
+
13
+ export interface QuoteStreamTarget {
14
+ symbol: string;
15
+ exchange?: string;
16
+ surface?:
17
+ | "portfolio"
18
+ | "watchlist"
19
+ | "detail"
20
+ | "monitor"
21
+ | "inline"
22
+ | "options"
23
+ | "screener"
24
+ | "unknown";
25
+ visible?: boolean;
26
+ selected?: boolean;
27
+ weight?: number;
28
+ }
@@ -0,0 +1,125 @@
1
+ /** Shared server-computed scanners fanned out to every subscriber. */
2
+ export type ScannerKind = "hilo" | "flow";
3
+
4
+ export type ScannerStatus = "live" | "starting" | "closed" | "degraded";
5
+
6
+ interface ScannerWindowCounts {
7
+ highs: number;
8
+ lows: number;
9
+ }
10
+
11
+ export interface ScannerHiloExtreme {
12
+ symbol: string;
13
+ price: number;
14
+ volume?: number | null;
15
+ /** Times this symbol printed a new session extreme today. */
16
+ count: number;
17
+ at: number;
18
+ }
19
+
20
+ /** Which entitlement tier produced the payload: free accounts get a delayed instance. */
21
+ interface ScannerAccessInfo {
22
+ access: "realtime" | "delayed";
23
+ /** 0 on the realtime instance, 15 on the delayed one. */
24
+ delayMinutes: number;
25
+ }
26
+
27
+ export interface ScannerHiloPayload extends ScannerAccessInfo {
28
+ status: ScannerStatus;
29
+ asOf: number;
30
+ windows: {
31
+ s30: ScannerWindowCounts;
32
+ m1: ScannerWindowCounts;
33
+ m5: ScannerWindowCounts;
34
+ };
35
+ highs: ScannerHiloExtreme[];
36
+ lows: ScannerHiloExtreme[];
37
+ }
38
+
39
+ export interface ScannerFlowEvent {
40
+ id: string;
41
+ at: number;
42
+ underlying: string;
43
+ contract: string;
44
+ right: "C" | "P";
45
+ strike: number;
46
+ expiry: string;
47
+ side: "ask" | "bid" | "mid" | "unknown";
48
+ kind: "sweep" | "block" | "split" | "trade";
49
+ size: number;
50
+ price: number;
51
+ premium: number;
52
+ volume?: number | null;
53
+ openInterest?: number | null;
54
+ volOi?: number | null;
55
+ iv?: number | null;
56
+ }
57
+
58
+ export interface ScannerFlowPayload extends ScannerAccessInfo {
59
+ status: ScannerStatus;
60
+ asOf: number;
61
+ events: ScannerFlowEvent[];
62
+ }
63
+
64
+ /** Filters for recorded flow prints, matching the FLOW pane's own. */
65
+ export interface ScannerFlowHistoryQuery {
66
+ /** Page before this print (newest first); omit for the latest prints. */
67
+ before?: { at: number; id: string };
68
+ limit?: number;
69
+ minPremium?: number;
70
+ right?: "C" | "P";
71
+ kind?: "sweep" | "block";
72
+ minVolOi?: number;
73
+ maxExpiryDays?: number;
74
+ /** Only these listed symbols (the pane's "mine" universe). */
75
+ symbols?: string[];
76
+ }
77
+
78
+ export interface ScannerFlowHistoryPage {
79
+ events: ScannerFlowEvent[];
80
+ hasMore: boolean;
81
+ }
82
+
83
+ /**
84
+ * Premium of a slice of the session's recorded prints by where it traded: at
85
+ * or above the ask (bought) or at or below the bid (sold). Mid and unknown
86
+ * prints count as neither.
87
+ */
88
+ interface ScannerFlowSidePremium {
89
+ callAsk: number;
90
+ callBid: number;
91
+ putAsk: number;
92
+ putBid: number;
93
+ }
94
+
95
+ /** The session's prints in one time bucket, which starts at `at`. */
96
+ export interface ScannerFlowSessionBucket extends ScannerFlowSidePremium {
97
+ at: number;
98
+ }
99
+
100
+ /** What one name printed at one expiry and strike during the session. */
101
+ export interface ScannerFlowSessionStrike extends ScannerFlowSidePremium {
102
+ expiry: string;
103
+ strike: number;
104
+ /** Every call print's premium, mid and unknown included. */
105
+ callPremium: number;
106
+ putPremium: number;
107
+ prints: number;
108
+ }
109
+
110
+ /** The latest session's recorded prints under the FLOW pane's filters, summed. */
111
+ export interface ScannerFlowSession {
112
+ /** The New York date of the session; null before any print was recorded. */
113
+ session: string | null;
114
+ bucketMs: number;
115
+ /** Buckets with a matching print, oldest first. */
116
+ buckets: ScannerFlowSessionBucket[];
117
+ /** Only when one name was asked for: most premium first. */
118
+ strikes: ScannerFlowSessionStrike[] | null;
119
+ }
120
+
121
+ export type ScannerPayload = ScannerHiloPayload | ScannerFlowPayload;
122
+
123
+ /** What a scanner subscriber receives: data, or the entitlement refusal. */
124
+ export type ScannerFeedEvent<T extends ScannerPayload = ScannerPayload> =
125
+ { type: "data"; payload: T } | { type: "denied"; reason: string };
@@ -0,0 +1,65 @@
1
+ import type { Quote } from "../../types/financials";
2
+
3
+ export type CloudMarketScreenerCategory = "gainers" | "losers" | "most-active";
4
+
5
+ /**
6
+ * What Gloom Cloud selects and ranks Gainers and Losers by: `regular` the last
7
+ * completed regular session's move, the Chg% a row shows; `extended` the
8
+ * latest print, after-hours or pre-market included. While the regular session
9
+ * trades the two are one list. A server that predates the choice ignores it
10
+ * and ranks by the latest print.
11
+ */
12
+ export type CloudMoverSession = "regular" | "extended";
13
+
14
+ /**
15
+ * A movers row's quote sessions, under the quote's field names and meaning:
16
+ * the session it was read in, the day its change is dated to, the last
17
+ * completed regular session's close and move, and an open pre-market or
18
+ * after-hours print with its move from that close. Older servers send none.
19
+ */
20
+ export type CloudMoverSessionFields = Partial<Pick<Quote,
21
+ | "marketState" | "changeSessionDate"
22
+ | "regularClose" | "regularCloseSessionDate" | "regularChange" | "regularChangePercent"
23
+ | "preMarketPrice" | "preMarketChange" | "preMarketChangePercent"
24
+ | "postMarketPrice" | "postMarketChange" | "postMarketChangePercent">>;
25
+
26
+ /** price, change and changePercent are the live print the server ranks the list by; the session fields say how it reads. */
27
+ export interface CloudMarketScreenerItem extends CloudMoverSessionFields {
28
+ rank: number;
29
+ symbol: string;
30
+ name: string;
31
+ price: number;
32
+ change: number;
33
+ changePercent: number;
34
+ previousClose?: number;
35
+ volume: number;
36
+ /** Available average volume for this listing, independent of public ranking membership. */
37
+ avgVolume?: number;
38
+ /** Observation time of the optional retained metadata. */
39
+ metadataAsOf?: string;
40
+ tradeCount?: number;
41
+ currency: string;
42
+ high52w?: number;
43
+ low52w?: number;
44
+ dayHigh?: number;
45
+ dayLow?: number;
46
+ exchange: string;
47
+ lastUpdated: number;
48
+ dataSource: "live";
49
+ /** The listing's float as the equity screener serves it; absent where it serves none. */
50
+ floatShares?: number;
51
+ /** Set with a float the source states no measurement date for: `partial`. */
52
+ floatSharesState?: "partial";
53
+ /** Why the float is partial, as the server says it. */
54
+ floatSharesReason?: string;
55
+ /** When the statistics the float is read from were retrieved (ISO). */
56
+ floatSharesRetrievedAt?: string;
57
+ }
58
+
59
+ export interface CloudMarketScreenerPayload {
60
+ providerId: "gloomberb-cloud";
61
+ category: CloudMarketScreenerCategory;
62
+ asOf: string;
63
+ stale?: boolean;
64
+ items: CloudMarketScreenerItem[];
65
+ }
@@ -0,0 +1,107 @@
1
+ export type CloudSearchDocType = "transcript" | "news" | "filing";
2
+
3
+ export type CloudSearchSort = "relevance" | "newest" | "oldest";
4
+
5
+ /**
6
+ * Per-chunk provenance. Which keys are present depends on `docType`: transcripts
7
+ * carry speaker attribution, news carries the wire source, filings carry the
8
+ * form and section. Kept as one optional-key record so an unknown docType from a
9
+ * newer server still renders instead of failing to parse.
10
+ */
11
+ export interface CloudSearchChunkMetadata {
12
+ speaker?: string;
13
+ role?: string;
14
+ company?: string;
15
+ isQa?: boolean;
16
+ startSeconds?: number;
17
+ turnIndex?: number;
18
+ source?: string;
19
+ summary?: string;
20
+ form?: string;
21
+ accession?: string;
22
+ section?: string;
23
+ }
24
+
25
+ export interface CloudSearchHit {
26
+ id: string;
27
+ docType: CloudSearchDocType;
28
+ sourceId: string;
29
+ chunkIndex: number;
30
+ ticker: string;
31
+ publishedAt: string;
32
+ title: string;
33
+ url: string;
34
+ /** Matched terms wrapped in `<mark>`, fragments joined by an ellipsis. */
35
+ snippet: string;
36
+ score: number;
37
+ metadata: CloudSearchChunkMetadata;
38
+ /**
39
+ * Chunks of this document that matched. Only sent for a distinct search,
40
+ * where the row stands for the document rather than for one chunk.
41
+ */
42
+ matchCount?: number;
43
+ }
44
+
45
+ export interface CloudSearchResponse {
46
+ hits: CloudSearchHit[];
47
+ total: number;
48
+ /** The server stopped counting past its cap, so `total` is a lower bound. */
49
+ countCapped: boolean;
50
+ hasMore: boolean;
51
+ nextOffset: number;
52
+ tookMs: number;
53
+ }
54
+
55
+ interface CloudSearchDocumentChunk {
56
+ id: string;
57
+ chunkIndex: number;
58
+ body: string;
59
+ metadata: CloudSearchChunkMetadata;
60
+ }
61
+
62
+ export interface CloudSearchDocument {
63
+ docType: CloudSearchDocType;
64
+ sourceId: string;
65
+ ticker: string;
66
+ title: string;
67
+ url: string;
68
+ publishedAt: string;
69
+ chunks: CloudSearchDocumentChunk[];
70
+ }
71
+
72
+ export interface CloudSearchDocumentResponse {
73
+ document: CloudSearchDocument;
74
+ }
75
+
76
+ export interface CloudSavedSearchFilters {
77
+ tickers?: string[];
78
+ docTypes?: CloudSearchDocType[];
79
+ sources?: string[];
80
+ from?: string;
81
+ to?: string;
82
+ }
83
+
84
+ export interface CloudSavedSearch {
85
+ id: string;
86
+ name: string;
87
+ query: string;
88
+ filters: CloudSavedSearchFilters;
89
+ alertEnabled: boolean;
90
+ alertChannels: string[];
91
+ lastRunAt: string | null;
92
+ lastMatchAt: string | null;
93
+ matchCount: number;
94
+ createdAt: string;
95
+ }
96
+
97
+ export interface CloudSavedSearchListResponse {
98
+ searches: CloudSavedSearch[];
99
+ }
100
+
101
+ export interface CloudSavedSearchInput {
102
+ name: string;
103
+ query: string;
104
+ filters?: CloudSavedSearchFilters;
105
+ alertEnabled?: boolean;
106
+ alertChannels?: string[];
107
+ }
@@ -0,0 +1,14 @@
1
+ import type { SyncSettings, SyncSnapshot } from "../../sync/types";
2
+
3
+ export interface CloudSyncSnapshotResponse {
4
+ snapshot: SyncSnapshot | null;
5
+ revision: number | null;
6
+ updatedAt: string | null;
7
+ settings: SyncSettings;
8
+ }
9
+
10
+ export interface CloudSyncPushResponse {
11
+ revision: number;
12
+ updatedAt: string;
13
+ settings: SyncSettings;
14
+ }
@@ -0,0 +1,43 @@
1
+ // Team collections
2
+
3
+ export type TeamCollectionKind = "watchlist" | "portfolio";
4
+
5
+ export interface TeamCollection {
6
+ id: string;
7
+ teamId: string;
8
+ kind: TeamCollectionKind;
9
+ name: string;
10
+ currency: string | null;
11
+ createdBy: string;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ itemCount: number;
15
+ }
16
+
17
+ export interface TeamCollectionItem {
18
+ collectionId: string;
19
+ symbol: string;
20
+ exchange: string;
21
+ quantity: number | null;
22
+ note: string | null;
23
+ /**
24
+ * A portfolio holding's purchase date (YYYY-MM-DD), its currency, and the
25
+ * rate its cost was bought at (one unit of `currency` in `costFxCurrency`).
26
+ * Null when no one has sent one; missing from a server that keeps none.
27
+ */
28
+ dateAcquired?: string | null;
29
+ currency?: string | null;
30
+ costFxRate?: number | null;
31
+ costFxCurrency?: string | null;
32
+ addedBy: string;
33
+ addedAt: string;
34
+ updatedAt: string;
35
+ }
36
+
37
+ type TeamCollectionChange =
38
+ | { change: "created"; collection: TeamCollection }
39
+ | { change: "updated"; collection: TeamCollection }
40
+ | { change: "deleted"; collectionId: string }
41
+ | { change: "item-added" | "item-updated" | "item-removed"; collectionId: string; item: TeamCollectionItem };
42
+
43
+ export type TeamCollectionEvent = TeamCollectionChange & { teamId: string; actorId: string };
@@ -0,0 +1,32 @@
1
+ // Team views and plugin state
2
+
3
+ export interface TeamView {
4
+ id: string;
5
+ teamId: string;
6
+ name: string;
7
+ revision: number;
8
+ spec: Record<string, unknown>;
9
+ createdBy: string;
10
+ author: { username: string | null; displayName: string };
11
+ createdAt: string;
12
+ updatedAt: string;
13
+ publishedAt: string;
14
+ }
15
+
16
+ export type TeamViewEvent =
17
+ | { teamId: string; actorId: string; view: TeamView }
18
+ | { teamId: string; actorId: string; viewId: string };
19
+
20
+ export interface TeamPluginStateEntry {
21
+ teamId: string;
22
+ pluginId: string;
23
+ key: string;
24
+ value: unknown;
25
+ revision: number;
26
+ updatedBy: string;
27
+ updatedAt: string;
28
+ }
29
+
30
+ export type TeamPluginStateEvent =
31
+ | { teamId: string; actorId: string; state: TeamPluginStateEntry }
32
+ | { teamId: string; actorId: string; pluginId: string; key: string; deleted: true };