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.
- package/LICENSE +0 -4
- package/package.json +6 -5
- package/patches/electrobun-devkit@2.0.5.patch +148 -0
- package/src/api-client/bond-trades.ts +59 -0
- package/src/api-client/data.ts +21 -0
- package/src/api-client/index.ts +2 -0
- package/src/api-client/types/account.ts +86 -0
- package/src/api-client/types/assist.ts +32 -0
- package/src/api-client/types/auth.ts +63 -0
- package/src/api-client/types/billing.ts +54 -0
- package/src/api-client/types/chat.ts +180 -0
- package/src/api-client/types/congress.ts +107 -0
- package/src/api-client/types/credit.ts +110 -0
- package/src/api-client/types/econ.ts +158 -0
- package/src/api-client/types/equity-diagnostic.ts +73 -0
- package/src/api-client/types/filings-and-calls.ts +350 -0
- package/src/api-client/types/index.ts +25 -0
- package/src/api-client/types/jobs.ts +147 -0
- package/src/api-client/types/market.ts +122 -0
- package/src/api-client/types/news.ts +91 -0
- package/src/api-client/types/notes-and-theses.ts +172 -0
- package/src/api-client/types/quotes.ts +28 -0
- package/src/api-client/types/scanners.ts +125 -0
- package/src/api-client/types/screener.ts +65 -0
- package/src/api-client/types/search.ts +107 -0
- package/src/api-client/types/sync.ts +14 -0
- package/src/api-client/types/team-collections.ts +43 -0
- package/src/api-client/types/team-views.ts +32 -0
- package/src/api-client/types/teams.ts +135 -0
- package/src/api-client/types/ticker-data.ts +57 -0
- package/src/api-client/types/tweets.ts +59 -0
- package/src/api-client/types/world-venues.ts +23 -0
- package/src/app/runtime/desktop-deeplink.ts +41 -6
- package/src/app/star-prompt/status-line.tsx +1 -1
- package/src/app.tsx +1 -7
- package/src/architecture/ui-tokens-allowlist.json +0 -8
- package/src/cli/commands/ticker.ts +17 -4
- package/src/cli/desktop-pane-shot-browser.ts +69 -3
- package/src/cli/pane-functions/catalog.ts +3 -1
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +11 -2
- package/src/components/data-table/export.ts +4 -1
- package/src/components/layout/detached-pane-shell.tsx +10 -37
- package/src/components/layout/double-escape-close.ts +90 -0
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +6 -3
- package/src/components/layout/pane/footer/index.tsx +2 -6
- package/src/components/layout/pane/footer/model.ts +6 -12
- package/src/components/layout/shell/active-drag.ts +53 -11
- package/src/components/layout/shell/drag/magnets.ts +128 -19
- package/src/components/layout/shell/pane/actions.ts +6 -2
- package/src/components/layout/shell/pane/management-shortcuts.ts +13 -51
- package/src/components/layout/status-bar.tsx +4 -78
- package/src/components/layout/status-widget-space.ts +5 -5
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +1 -1
- package/src/components/ui/data-table/index.tsx +5 -1
- package/src/components/ui/data-table/render-cell.ts +19 -0
- package/src/components/ui/delayed-mark.tsx +59 -7
- package/src/components/ui/icon.tsx +1 -8
- package/src/components/ui/menu.tsx +6 -1
- package/src/i18n/es.ts +3 -3
- package/src/i18n/ja.ts +3 -3
- package/src/i18n/ko.ts +3 -3
- package/src/i18n/zh-cn.ts +3 -3
- package/src/i18n/zh-tw.ts +3 -3
- package/src/plugins/builtin/chat/content/composer.tsx +21 -27
- package/src/plugins/builtin/chat/content/index.tsx +31 -3
- package/src/plugins/builtin/chat/content/shortcuts.ts +4 -2
- package/src/plugins/builtin/chat/content/snapshot.ts +0 -3
- package/src/plugins/builtin/cloud/auth-actions.tsx +51 -23
- package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +3 -3
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +32 -25
- package/src/plugins/builtin/congress-trades/model.ts +2 -1
- package/src/plugins/builtin/congress-trades/pane.tsx +3 -0
- package/src/plugins/builtin/custom-view/index.tsx +1 -1
- package/src/plugins/builtin/custom-view/loader.ts +85 -8
- package/src/plugins/builtin/custom-view/view-spec.ts +28 -0
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +13 -4
- package/src/plugins/builtin/equity-screener/headless.ts +33 -1
- package/src/plugins/builtin/equity-screener/model.ts +58 -15
- package/src/plugins/builtin/equity-screener/pane.tsx +36 -6
- package/src/plugins/builtin/executives/format.ts +5 -4
- package/src/plugins/builtin/executives/pane.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +55 -1
- package/src/plugins/builtin/insider/model.ts +30 -2
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/mna/model.ts +2 -2
- package/src/plugins/builtin/notes/files.ts +2 -0
- package/src/plugins/builtin/notes/owner.tsx +20 -1
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +22 -4
- package/src/plugins/builtin/notes/store.ts +6 -1
- package/src/plugins/builtin/portfolio-list/header.tsx +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +29 -25
- package/src/plugins/builtin/series-inventory.ts +1 -0
- package/src/plugins/builtin/shared/earnings-report.ts +7 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +85 -46
- package/src/plugins/builtin/short-interest/headless.ts +1 -1
- package/src/plugins/builtin/short-interest/model.ts +15 -6
- package/src/plugins/builtin/short-interest/types.ts +2 -0
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +3 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +3 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +5 -3
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +4 -4
- package/src/plugins/builtin/trace-bonds/detail.tsx +198 -0
- package/src/plugins/builtin/trace-bonds/headless.ts +62 -4
- package/src/plugins/builtin/trace-bonds/history.ts +155 -0
- package/src/plugins/builtin/trace-bonds/pane.tsx +64 -5
- package/src/plugins/installer.ts +16 -3
- package/src/plugins/plugin-names.ts +11 -2
- package/src/remote/controller.ts +9 -2
- package/src/remote/schema.ts +2 -1
- package/src/renderers/cloudflare/http-proxy.ts +67 -8
- package/src/renderers/cloudflare/proxy-session.ts +1 -1
- package/src/renderers/cloudflare/worker.ts +29 -2
- package/src/renderers/dom/desktop/icons.tsx +0 -2
- package/src/renderers/dom/styles.css +0 -3
- package/src/renderers/electrobun/bun/desktop/install-records.ts +59 -0
- package/src/renderers/electrobun/bun/desktop/installer-folder.ts +208 -592
- package/src/renderers/electrobun/bun/desktop/macos-objc.ts +14 -0
- package/src/renderers/electrobun/bun/desktop/update.ts +1 -1
- package/src/renderers/electrobun/bun/index.ts +19 -13
- package/src/renderers/electrobun/bun/window/create.ts +23 -3
- package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +4 -4
- package/src/renderers/electrobun/bun/window/events.ts +4 -4
- package/src/renderers/electrobun/bun/window/frame.ts +2 -1
- package/src/renderers/electrobun/bun/window/native-min-size.ts +322 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +1 -1
- package/src/sources/gloomberb-cloud/index.ts +5 -7
- package/src/sources/provider-router/batches.ts +18 -3
- package/src/sources/provider-router/financials.ts +18 -4
- package/src/types/data-provider.ts +14 -0
- package/src/types/financials.ts +15 -3
- package/src/types/headless.ts +2 -0
- package/src/utils/double-escape-close.ts +38 -16
- package/src/utils/format.ts +23 -3
- package/src/utils/price-earnings.ts +18 -0
- package/patches/electrobun@1.18.1.patch +0 -633
- package/src/api-client/types.ts +0 -2441
package/LICENSE
CHANGED
|
@@ -12,10 +12,6 @@ furnished to do so, subject to the following conditions:
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
|
-
When using this software in a product or service, attribution to the Gloomberb
|
|
16
|
-
project (https://github.com/gloom-sh/gloomberb) is appreciated and encouraged,
|
|
17
|
-
though not legally required beyond preserving the above copyright notice.
|
|
18
|
-
|
|
19
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gloomberb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "Market research and portfolio tracker for the terminal",
|
|
6
6
|
"module": "src/public/index.ts",
|
|
@@ -61,12 +61,14 @@
|
|
|
61
61
|
"cloudflare:dry-run": "bun run web:build && wrangler deploy --dry-run --env production",
|
|
62
62
|
"desktop:dev": "bun run scripts/electrobun-dev.ts",
|
|
63
63
|
"desktop:build": "electrobun build",
|
|
64
|
-
"desktop:release": "electrobun build --env=stable",
|
|
65
|
-
"desktop:release:windows": "electrobun build --env=stable
|
|
64
|
+
"desktop:release": "electrobun build --env=stable && bun scripts/name-desktop-artifacts.ts artifacts stable",
|
|
65
|
+
"desktop:release:windows": "electrobun build --env=stable && bun scripts/name-desktop-artifacts.ts artifacts stable",
|
|
66
|
+
"desktop:sync": "electrobun sync && bun run scripts/patch-electrobun-devkit.ts",
|
|
66
67
|
"docs:snapshot": "bun run scripts/update-docs-snapshot.ts",
|
|
67
68
|
"plugins:manifest": "bun run scripts/generate-plugin-manifest.ts",
|
|
68
69
|
"plugins:manifest:check": "bun run scripts/generate-plugin-manifest.ts --check",
|
|
69
70
|
"plugins:registry:check": "bun run scripts/check-registry-plugins.ts",
|
|
71
|
+
"plugins:registry:packaged": "bun run scripts/check-packaged-registry-plugins.ts",
|
|
70
72
|
"web:proxy-hosts": "bun run scripts/generate-web-proxy-hosts.ts",
|
|
71
73
|
"map:data": "bun run scripts/generate-world-map-data.ts",
|
|
72
74
|
"glyphs:terminal": "bun run scripts/generate-terminal-glyphs.ts",
|
|
@@ -119,7 +121,7 @@
|
|
|
119
121
|
"@types/bun": "^1.3.14",
|
|
120
122
|
"@types/react-dom": "^19.2.3",
|
|
121
123
|
"@types/three": "0.165.0",
|
|
122
|
-
"electrobun": "
|
|
124
|
+
"electrobun": "2.0.5",
|
|
123
125
|
"gloom-polls": "github:gloom-sh/gloom-polls",
|
|
124
126
|
"gloom-prediction-markets": "github:gloom-sh/gloom-prediction-markets",
|
|
125
127
|
"happy-dom": "^20.11.1",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
},
|
|
144
146
|
"patchedDependencies": {
|
|
145
147
|
"@opentui/core@0.3.2": "patches/@opentui%2Fcore@0.3.2.patch",
|
|
146
|
-
"electrobun@1.18.1": "patches/electrobun@1.18.1.patch",
|
|
147
148
|
"react-reconciler@0.33.0": "patches/react-reconciler@0.33.0.patch"
|
|
148
149
|
}
|
|
149
150
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
diff --git a/api/preload/encryption.ts b/api/preload/encryption.ts
|
|
2
|
+
index 8cf3ab6..0f70f21 100644
|
|
3
|
+
--- a/api/preload/encryption.ts
|
|
4
|
+
+++ b/api/preload/encryption.ts
|
|
5
|
+
@@ -3,27 +3,30 @@
|
|
6
|
+
|
|
7
|
+
import "./globals.d.ts";
|
|
8
|
+
|
|
9
|
+
+// Native base64 where the engine has it (WebKit since Safari 18.2, Chromium
|
|
10
|
+
+// since 140); the fallbacks copy bytes in a loop and join strings in chunks.
|
|
11
|
+
+// Splitting the decoded string into an array of characters, or growing a
|
|
12
|
+
+// string one byte at a time, costs tens of milliseconds per megabyte on the
|
|
13
|
+
+// main thread, and every message from the host is decrypted here.
|
|
14
|
+
function base64ToUint8Array(base64: string): Uint8Array {
|
|
15
|
+
+ const native = Uint8Array as unknown as { fromBase64?: (value: string) => Uint8Array };
|
|
16
|
+
+ if (typeof native.fromBase64 === "function") return native.fromBase64(base64);
|
|
17
|
+
const binary = atob(base64);
|
|
18
|
+
- if (window.__electrobunPlatform === "linux") {
|
|
19
|
+
- // WebKitGTK becomes allocation-bound on large RPC bursts if every byte
|
|
20
|
+
- // is first expanded into a split/map array.
|
|
21
|
+
- const bytes = new Uint8Array(binary.length);
|
|
22
|
+
- for (let i = 0; i < binary.length; i++) {
|
|
23
|
+
- bytes[i] = binary.charCodeAt(i);
|
|
24
|
+
- }
|
|
25
|
+
- return bytes;
|
|
26
|
+
+ const bytes = new Uint8Array(binary.length);
|
|
27
|
+
+ for (let i = 0; i < binary.length; i++) {
|
|
28
|
+
+ bytes[i] = binary.charCodeAt(i);
|
|
29
|
+
}
|
|
30
|
+
-
|
|
31
|
+
- return new Uint8Array(binary.split("").map((char) => char.charCodeAt(0)));
|
|
32
|
+
+ return bytes;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function uint8ArrayToBase64(uint8Array: Uint8Array): string {
|
|
36
|
+
- let binary = "";
|
|
37
|
+
- for (let i = 0; i < uint8Array.length; i++) {
|
|
38
|
+
- binary += String.fromCharCode(uint8Array[i]!);
|
|
39
|
+
+ const native = (uint8Array as unknown as { toBase64?: () => string }).toBase64;
|
|
40
|
+
+ if (typeof native === "function") return native.call(uint8Array);
|
|
41
|
+
+ const parts: string[] = [];
|
|
42
|
+
+ for (let i = 0; i < uint8Array.length; i += 32768) {
|
|
43
|
+
+ parts.push(String.fromCharCode.apply(null, uint8Array.subarray(i, i + 32768) as unknown as number[]));
|
|
44
|
+
}
|
|
45
|
+
- return btoa(binary);
|
|
46
|
+
+ return btoa(parts.join(""));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function toArrayBuffer(bytes: Uint8Array): ArrayBuffer {
|
|
50
|
+
diff --git a/api/sdks/main/core/Updater.ts b/api/sdks/main/core/Updater.ts
|
|
51
|
+
index 4c47ed9..3221b5d 100644
|
|
52
|
+
--- a/api/sdks/main/core/Updater.ts
|
|
53
|
+
+++ b/api/sdks/main/core/Updater.ts
|
|
54
|
+
@@ -323,6 +323,39 @@ let updateInfo: UpdateInfo = {
|
|
55
|
+
error: "",
|
|
56
|
+
};
|
|
57
|
+
let checkedManifest: UpdateManifestV1 | undefined;
|
|
58
|
+
+
|
|
59
|
+
+// Where updates are fetched from when it is not the channel and baseUrl that
|
|
60
|
+
+// version.json names: a release whose files carry another prefix (`nightly-*`)
|
|
61
|
+
+// under its own URL. Only the URLs read it. The manifest is still checked
|
|
62
|
+
+// against the installed build's identity and channel, and the app data
|
|
63
|
+
+// folder and the "dev" check keep that channel too.
|
|
64
|
+
+let updateSource: { channel: string; baseUrl: string } | null = null;
|
|
65
|
+
+
|
|
66
|
+
+function updateSourceBaseUrl(info: LocalUpdateInfo): string {
|
|
67
|
+
+ return updateSource?.baseUrl ?? info.baseUrl;
|
|
68
|
+
+}
|
|
69
|
+
+
|
|
70
|
+
+/** The prefix of the source's files: `<channel>-<os>-<arch>`. */
|
|
71
|
+
+function updateSourcePrefix(
|
|
72
|
+
+ channel: BuildEnvironment,
|
|
73
|
+
+ os: SupportedOS,
|
|
74
|
+
+ arch: SupportedArch,
|
|
75
|
+
+): string {
|
|
76
|
+
+ if (!updateSource) return getPlatformPrefix(channel, os, arch);
|
|
77
|
+
+ return `${updateSource.channel}-${os}-${arch}`;
|
|
78
|
+
+}
|
|
79
|
+
+
|
|
80
|
+
+/**
|
|
81
|
+
+ * The manifest names its archive under the channel it was built for; a
|
|
82
|
+
+ * source that carries the files under its own prefix has it under that one.
|
|
83
|
+
+ */
|
|
84
|
+
+function updateSourceArtifactFile(manifest: UpdateManifestV1): string {
|
|
85
|
+
+ const built = `${manifest.channel}-`;
|
|
86
|
+
+ if (!updateSource || !manifest.artifact.file.startsWith(built)) {
|
|
87
|
+
+ return manifest.artifact.file;
|
|
88
|
+
+ }
|
|
89
|
+
+ return `${updateSource.channel}-${manifest.artifact.file.slice(built.length)}`;
|
|
90
|
+
+}
|
|
91
|
+
let checkInFlight: Promise<UpdateInfo> | undefined;
|
|
92
|
+
let downloadInFlight: Promise<void> | undefined;
|
|
93
|
+
let applyInFlight: Promise<void> | undefined;
|
|
94
|
+
@@ -1773,8 +1806,8 @@ async function checkForUpdateOperation(): Promise<UpdateInfo> {
|
|
95
|
+
return updateInfo;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
- const platformPrefix = getPlatformPrefix(info.channel, currentOS, currentArch);
|
|
99
|
+
- const updateInfoUrl = `${info.baseUrl.replace(/\/+$/, "")}/${platformPrefix}-update.json?${randomBytes(8).toString("hex")}`;
|
|
100
|
+
+ const platformPrefix = updateSourcePrefix(info.channel, currentOS, currentArch);
|
|
101
|
+
+ const updateInfoUrl = `${updateSourceBaseUrl(info).replace(/\/+$/, "")}/${platformPrefix}-update.json?${randomBytes(8).toString("hex")}`;
|
|
102
|
+
try {
|
|
103
|
+
const response = await fetch(updateInfoUrl, {
|
|
104
|
+
signal: AbortSignal.timeout(30_000),
|
|
105
|
+
@@ -1938,7 +1971,7 @@ export async function preparePatchChainForUpdate(
|
|
106
|
+
const bspatchPath =
|
|
107
|
+
dependencies.bspatchPath ??
|
|
108
|
+
join(dirname(process.execPath), currentOS === "win" ? "bspatch.exe" : "bspatch");
|
|
109
|
+
- const platformPrefix = getPlatformPrefix(
|
|
110
|
+
+ const platformPrefix = updateSourcePrefix(
|
|
111
|
+
channel,
|
|
112
|
+
manifest.platform,
|
|
113
|
+
manifest.arch,
|
|
114
|
+
@@ -1952,7 +1985,7 @@ export async function preparePatchChainForUpdate(
|
|
115
|
+
try {
|
|
116
|
+
while (currentHash !== manifest.hash) {
|
|
117
|
+
const patchNumber = patchesApplied + 1;
|
|
118
|
+
- patchUrl = getPatchFileUrl(info.baseUrl, platformPrefix, currentHash);
|
|
119
|
+
+ patchUrl = getPatchFileUrl(updateSourceBaseUrl(info), platformPrefix, currentHash);
|
|
120
|
+
const pathPrefix = join(
|
|
121
|
+
extractionFolder,
|
|
122
|
+
`.${transactionId}.${patchNumber}.${currentHash}`,
|
|
123
|
+
@@ -2136,8 +2169,8 @@ async function downloadUpdateOperation(): Promise<void> {
|
|
124
|
+
join(extractionFolder, `${manifest.hash}.tar`),
|
|
125
|
+
);
|
|
126
|
+
const artifactUrl = buildUpdateArtifactUrl(
|
|
127
|
+
- info.baseUrl,
|
|
128
|
+
- manifest.artifact.file,
|
|
129
|
+
+ updateSourceBaseUrl(info),
|
|
130
|
+
+ updateSourceArtifactFile(manifest),
|
|
131
|
+
);
|
|
132
|
+
const artifactRequestUrl = addUpdateArtifactCacheBuster(
|
|
133
|
+
artifactUrl,
|
|
134
|
+
@@ -2388,6 +2421,14 @@ const Updater = {
|
|
135
|
+
onStatusChangeCallback = callback;
|
|
136
|
+
if (callback) scheduleNativeUpdateResultReconciliation();
|
|
137
|
+
},
|
|
138
|
+
+ // Checks and downloads from `source` (a file prefix and the URL its files
|
|
139
|
+
+ // sit under) until it is set again; null goes back to version.json.
|
|
140
|
+
+ setUpdateSource: (source: { channel: string; baseUrl: string } | null): void => {
|
|
141
|
+
+ if (source && !/^[a-z0-9][a-z0-9-]*$/.test(source.channel)) {
|
|
142
|
+
+ throw new Error(`Invalid update source channel: ${source.channel}`);
|
|
143
|
+
+ }
|
|
144
|
+
+ updateSource = source;
|
|
145
|
+
+ },
|
|
146
|
+
checkForUpdate,
|
|
147
|
+
downloadUpdate,
|
|
148
|
+
applyUpdate,
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/cloud/bond-trades`: US corporate bond prints Gloom Cloud keeps, read by
|
|
3
|
+
* CUSIP or by company. A bond read here that its store did not keep yet is
|
|
4
|
+
* kept from then on, with the history the source still publishes for it;
|
|
5
|
+
* `keptSince` says from when prints are held, and nothing before it is.
|
|
6
|
+
* Gloom Pro.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface StoredBondPrint {
|
|
10
|
+
date: string;
|
|
11
|
+
/** New York time, as published. */
|
|
12
|
+
time: string | null;
|
|
13
|
+
status: "trade" | "cancel" | "correction";
|
|
14
|
+
/** A later cancel names this print. */
|
|
15
|
+
cancelled: boolean;
|
|
16
|
+
price: number | null;
|
|
17
|
+
yield: number | null;
|
|
18
|
+
/** Par amount; with `quantityCapped`, published only as at least this much. */
|
|
19
|
+
quantity: number | null;
|
|
20
|
+
quantityCapped: boolean;
|
|
21
|
+
/** Whether the reporting dealer bought or sold. */
|
|
22
|
+
side: "buy" | "sell" | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A day's last trade standing: the history the price chart draws. A zero price is null. */
|
|
26
|
+
export interface StoredBondDay {
|
|
27
|
+
date: string;
|
|
28
|
+
prints: number;
|
|
29
|
+
price: number | null;
|
|
30
|
+
yield: number | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface StoredBondPayload {
|
|
34
|
+
cusip: string;
|
|
35
|
+
issuerName: string;
|
|
36
|
+
coupon: number | null;
|
|
37
|
+
maturity: string | null;
|
|
38
|
+
issuer: { symbol: string; name: string };
|
|
39
|
+
from: string;
|
|
40
|
+
to: string;
|
|
41
|
+
/** Newest first. */
|
|
42
|
+
trades: StoredBondPrint[];
|
|
43
|
+
truncated: boolean;
|
|
44
|
+
/** The first date prints are held from; null before any day was read. */
|
|
45
|
+
keptSince: string | null;
|
|
46
|
+
/** The source's own history of the bond is still to be read: prints are held from the day it was first looked up until then. */
|
|
47
|
+
backfillPending: boolean;
|
|
48
|
+
/** Oldest first. */
|
|
49
|
+
days: StoredBondDay[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface StoredIssuerBondsPayload {
|
|
53
|
+
symbol: string;
|
|
54
|
+
name: string;
|
|
55
|
+
keptSince: string | null;
|
|
56
|
+
backfillPending: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const BOND_HISTORY_MAX_DAYS = 1100;
|
package/src/api-client/data.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type { EarningsEvent } from "../types/data-provider";
|
|
|
17
17
|
import type { MarketDividendsPayload, MarketHeatmapResult, MarketHeatmapUniverseId, MarketMoversPayload } from "./market-discovery";
|
|
18
18
|
import type { BankFiguresPayload } from "./bank-figures";
|
|
19
19
|
import type { DebtMaturitiesPayload } from "./debt-maturities";
|
|
20
|
+
import type { StoredBondPayload, StoredIssuerBondsPayload } from "./bond-trades";
|
|
20
21
|
import type { RevenueBreakdownPayload, RevenueBreakdownView } from "./revenue-breakdown";
|
|
21
22
|
import type { MnaDealPayload, MnaDealsParams, MnaDealsPayload } from "./mna";
|
|
22
23
|
import {
|
|
@@ -1118,6 +1119,26 @@ export class CloudDataApi {
|
|
|
1118
1119
|
return this.request<DebtMaturitiesPayload>(cloudDebtMaturitiesPath(symbol, listing), { signal: AbortSignal.timeout(45_000) });
|
|
1119
1120
|
}
|
|
1120
1121
|
|
|
1122
|
+
/** One bond's kept prints and daily closes over `from` to `to` (at most 1,100 days); reading it keeps the bond from now on. */
|
|
1123
|
+
async getCloudStoredBond(
|
|
1124
|
+
cusip: string,
|
|
1125
|
+
params: { from: string; to: string; limit?: number },
|
|
1126
|
+
options: { signal?: AbortSignal } = {},
|
|
1127
|
+
): Promise<StoredBondPayload> {
|
|
1128
|
+
const query = new URLSearchParams({ from: params.from, to: params.to, ...(params.limit ? { limit: String(params.limit) } : {}) });
|
|
1129
|
+
return this.request<StoredBondPayload>(`/cloud/bond-trades/bond/${encodeURIComponent(cusip)}?${query}`, {
|
|
1130
|
+
signal: options.signal ?? AbortSignal.timeout(20_000),
|
|
1131
|
+
});
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/** A company's bonds as kept; reading it keeps them from now on. Only the first page of bonds and prints is asked. */
|
|
1135
|
+
async getCloudStoredIssuerBonds(symbol: string, options: { signal?: AbortSignal } = {}): Promise<StoredIssuerBondsPayload> {
|
|
1136
|
+
const query = new URLSearchParams({ symbol, limit: "1", bondsLimit: "1" });
|
|
1137
|
+
return this.request<StoredIssuerBondsPayload>(`/cloud/bond-trades/issuer?${query}`, {
|
|
1138
|
+
signal: options.signal ?? AbortSignal.timeout(20_000),
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1121
1142
|
async getCloudBankFigures(symbol: string): Promise<BankFiguresPayload> {
|
|
1122
1143
|
return this.request<BankFiguresPayload>(cloudBankFiguresPath(symbol), { signal: AbortSignal.timeout(30_000) });
|
|
1123
1144
|
}
|
package/src/api-client/index.ts
CHANGED
|
@@ -992,6 +992,8 @@ class GloomApiClient {
|
|
|
992
992
|
optionsPositioning = this.data.optionsPositioning.bind(this.data);
|
|
993
993
|
getCloudBankFigures = this.data.getCloudBankFigures.bind(this.data);
|
|
994
994
|
getCloudDebtMaturities = this.data.getCloudDebtMaturities.bind(this.data);
|
|
995
|
+
getCloudStoredBond = this.data.getCloudStoredBond.bind(this.data);
|
|
996
|
+
getCloudStoredIssuerBonds = this.data.getCloudStoredIssuerBonds.bind(this.data);
|
|
995
997
|
getCloudRevenueBreakdown = this.data.getCloudRevenueBreakdown.bind(this.data);
|
|
996
998
|
getCloudMnaDeals = this.data.getCloudMnaDeals.bind(this.data);
|
|
997
999
|
getCloudMnaDeal = this.data.getCloudMnaDeal.bind(this.data);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export interface AccountProfile {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
emailVerified: boolean;
|
|
5
|
+
plan: "free" | "pro";
|
|
6
|
+
/** ISO timestamp when the free Pro trial ends; null once it has lapsed or was never started. */
|
|
7
|
+
trialEndsAt?: string | null;
|
|
8
|
+
/** Plan the server actually entitles right now, i.e. `plan` upgraded to "pro" while a trial is running. */
|
|
9
|
+
effectivePlan?: "free" | "pro";
|
|
10
|
+
username: string | null;
|
|
11
|
+
name: string;
|
|
12
|
+
company: string | null;
|
|
13
|
+
title: string | null;
|
|
14
|
+
bio: string | null;
|
|
15
|
+
profilePublic: boolean;
|
|
16
|
+
publicEmail: string | null;
|
|
17
|
+
xAccount: string | null;
|
|
18
|
+
sharedPortfolioId: string | null;
|
|
19
|
+
acceptUnknownDms: boolean;
|
|
20
|
+
chatEmailNotificationsEnabled: boolean;
|
|
21
|
+
portfolioAnalytics?: PublicPortfolioAnalytics | null;
|
|
22
|
+
/** Chat shows your local time on your card. A server that predates the setting leaves it out. */
|
|
23
|
+
showLocalTime?: boolean;
|
|
24
|
+
/** The desks chat shows beside your name; empty shows none. */
|
|
25
|
+
chatDesks?: string[];
|
|
26
|
+
/** Your answer to "What do you trade most?" at the first run: private, it pre-fills `chatDesks`. */
|
|
27
|
+
onboardingDesks?: string[];
|
|
28
|
+
syncEnabled: boolean;
|
|
29
|
+
weeklyRoundupEnabled: boolean;
|
|
30
|
+
positionAlertsEnabled: boolean;
|
|
31
|
+
lastSyncAt: string | null;
|
|
32
|
+
lastRoundupEmailAt: string | null;
|
|
33
|
+
updatedAt: string | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface PublicPortfolioAnalytics {
|
|
37
|
+
oneYearReturn?: number | null;
|
|
38
|
+
spyBeta?: number | null;
|
|
39
|
+
/** "account": the broker's own returns. "holdings": estimated from today's holdings. */
|
|
40
|
+
basis?: "account" | "holdings" | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* What an MCP key reaches beyond market data: `data` is market and filing
|
|
45
|
+
* tools only, `read` adds notes, teams and collections, `write` lets the agent
|
|
46
|
+
* save notes and change collection items.
|
|
47
|
+
*/
|
|
48
|
+
export type McpKeyScope = "data" | "read" | "write";
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A key just created with `POST /account/mcp/keys`. `token` is the secret,
|
|
52
|
+
* which the server never returns again: show it once, never store it.
|
|
53
|
+
*/
|
|
54
|
+
export interface CreatedMcpKey {
|
|
55
|
+
token: string;
|
|
56
|
+
apiKey: { id: string; name: string; scope: McpKeyScope };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The account's private calendar feed link (`/account/calendar-feed`). */
|
|
60
|
+
export interface CalendarFeed {
|
|
61
|
+
url: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
/** The last time a calendar app read it, to the hour. */
|
|
64
|
+
lastFetchedAt: string | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type AccountProfileUpdate = Partial<{
|
|
68
|
+
username: string;
|
|
69
|
+
name: string;
|
|
70
|
+
company: string | null;
|
|
71
|
+
title: string | null;
|
|
72
|
+
bio: string | null;
|
|
73
|
+
profilePublic: boolean;
|
|
74
|
+
publicEmail: string | null;
|
|
75
|
+
xAccount: string | null;
|
|
76
|
+
sharedPortfolioId: string | null;
|
|
77
|
+
acceptUnknownDms: boolean;
|
|
78
|
+
chatEmailNotificationsEnabled: boolean;
|
|
79
|
+
portfolioAnalytics: PublicPortfolioAnalytics | null;
|
|
80
|
+
syncEnabled: boolean;
|
|
81
|
+
weeklyRoundupEnabled: boolean;
|
|
82
|
+
positionAlertsEnabled: boolean;
|
|
83
|
+
showLocalTime: boolean;
|
|
84
|
+
/** Null or empty shows no desks. */
|
|
85
|
+
chatDesks: string[] | null;
|
|
86
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** One command-bar prefix described for `/assist/command`. */
|
|
2
|
+
export interface AssistCommandDescriptor {
|
|
3
|
+
prefix: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
arg?: {
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
kind: "text" | "ticker" | "ticker-list";
|
|
9
|
+
/** The command also runs with no argument at all. */
|
|
10
|
+
optional?: boolean;
|
|
11
|
+
/** Named values the argument accepts; a command may take others too (COT takes any CFTC code). */
|
|
12
|
+
options?: { value: string; label: string }[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** A command-bar line the assistant believes answers the query. */
|
|
17
|
+
export interface AssistCommandCandidate {
|
|
18
|
+
/** Exact command-bar text to run, e.g. "G NVDA AMD". */
|
|
19
|
+
input: string;
|
|
20
|
+
title: string;
|
|
21
|
+
prefix: string;
|
|
22
|
+
confidence: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface AssistCommandResponse {
|
|
26
|
+
candidates: AssistCommandCandidate[];
|
|
27
|
+
/**
|
|
28
|
+
* The server's record of this ask, for the command-search report to point
|
|
29
|
+
* at. Only present when the ask was sent with `log: true`.
|
|
30
|
+
*/
|
|
31
|
+
searchId?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { PublicPortfolioAnalytics } from "./account";
|
|
2
|
+
|
|
3
|
+
export interface AuthUser {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
email: string;
|
|
7
|
+
username: string | null;
|
|
8
|
+
emailVerified: boolean;
|
|
9
|
+
image: string | null;
|
|
10
|
+
plan?: "free" | "pro";
|
|
11
|
+
/** ISO timestamp when the free Pro trial ends; null once it has lapsed or was never started. */
|
|
12
|
+
trialEndsAt?: string | null;
|
|
13
|
+
/** Plan the server actually entitles right now, i.e. `plan` upgraded to "pro" while a trial is running. */
|
|
14
|
+
effectivePlan?: "free" | "pro";
|
|
15
|
+
company?: string | null;
|
|
16
|
+
title?: string | null;
|
|
17
|
+
bio?: string | null;
|
|
18
|
+
profilePublic?: boolean;
|
|
19
|
+
publicEmail?: string | null;
|
|
20
|
+
xAccount?: string | null;
|
|
21
|
+
sharedPortfolioId?: string | null;
|
|
22
|
+
acceptUnknownDms?: boolean;
|
|
23
|
+
chatEmailNotificationsEnabled?: boolean;
|
|
24
|
+
portfolioAnalytics?: PublicPortfolioAnalytics | null;
|
|
25
|
+
syncEnabled?: boolean;
|
|
26
|
+
weeklyRoundupEnabled?: boolean;
|
|
27
|
+
positionAlertsEnabled?: boolean;
|
|
28
|
+
lastSyncAt?: string | null;
|
|
29
|
+
lastRoundupEmailAt?: string | null;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type PersistedAuthUser = Pick<AuthUser, "id" | "emailVerified"> &
|
|
35
|
+
Partial<AuthUser>;
|
|
36
|
+
|
|
37
|
+
export interface CloudVerificationResponse {
|
|
38
|
+
sent: boolean;
|
|
39
|
+
email?: string;
|
|
40
|
+
alreadyVerified?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** A short-lived, single-use browser URL that establishes the existing desktop session. */
|
|
44
|
+
export interface CloudBrowserHandoffResponse {
|
|
45
|
+
url: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface DeviceAuthStartResponse {
|
|
49
|
+
deviceCode: string;
|
|
50
|
+
/** 8 characters formatted "XXXX-XXXX", shown so a user without the app can type it. */
|
|
51
|
+
userCode: string;
|
|
52
|
+
expiresAt: string;
|
|
53
|
+
/** Like https://gloom.sh/link/<userCode>; this is what the QR code encodes. */
|
|
54
|
+
verificationUri: string;
|
|
55
|
+
pollIntervalMs: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** The approved response is single-use; polling again returns a non-approved status. */
|
|
59
|
+
export type DeviceAuthTokenResponse =
|
|
60
|
+
| { status: "pending" }
|
|
61
|
+
| { status: "denied" }
|
|
62
|
+
| { status: "expired" }
|
|
63
|
+
| { status: "approved"; sessionToken: string; user: AuthUser };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface BuildoutAccountResponse {
|
|
2
|
+
user: {
|
|
3
|
+
id: string;
|
|
4
|
+
email: string;
|
|
5
|
+
emailVerified: boolean;
|
|
6
|
+
};
|
|
7
|
+
subscription: {
|
|
8
|
+
product: "buildout";
|
|
9
|
+
plan: "free" | "pro";
|
|
10
|
+
active: boolean;
|
|
11
|
+
billingInterval: "month" | "year" | null;
|
|
12
|
+
stripeSubscriptionId: string | null;
|
|
13
|
+
stripeSubscriptionStatus: string | null;
|
|
14
|
+
};
|
|
15
|
+
prices: {
|
|
16
|
+
monthly: {
|
|
17
|
+
priceId: string;
|
|
18
|
+
amountUsd: number;
|
|
19
|
+
interval: "month";
|
|
20
|
+
};
|
|
21
|
+
yearly: {
|
|
22
|
+
priceId: string;
|
|
23
|
+
amountUsd: number;
|
|
24
|
+
interval: "year";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface BuildoutTokenResponse {
|
|
30
|
+
token: string;
|
|
31
|
+
expiresAt: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface CloudPricingTier {
|
|
35
|
+
/** Charged amount, in integer cents. */
|
|
36
|
+
amount: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** `/account/cloud`, reduced to the plan fields the apps read. */
|
|
40
|
+
export interface CloudAccountPlan {
|
|
41
|
+
effectivePlan?: "free" | "pro";
|
|
42
|
+
/** Whether a checkout started now comes with the free trial attached. */
|
|
43
|
+
trialAvailable?: boolean;
|
|
44
|
+
/** The last charge failed; checkout opens the unpaid invoice instead. */
|
|
45
|
+
paymentFailed?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Public `/pricing` payload; no session required. */
|
|
49
|
+
export interface CloudPricing {
|
|
50
|
+
currency: "usd";
|
|
51
|
+
trialDays: number;
|
|
52
|
+
monthly: CloudPricingTier;
|
|
53
|
+
yearly: CloudPricingTier;
|
|
54
|
+
}
|