@invinite-org/invinite-data-cli 3.0.0 → 4.1.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 +341 -374
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/agents/invinite-data.md +59 -28
- package/claude-plugin/commands/analyze-earnings-call.md +15 -14
- package/claude-plugin/commands/analyze-filing.md +8 -7
- package/claude-plugin/commands/compare-companies.md +5 -5
- package/claude-plugin/commands/financial-research.md +9 -9
- package/claude-plugin/commands/ownership-review.md +6 -6
- package/claude-plugin/skills/invinite-data-cli/SKILL.md +466 -570
- package/dist/bin/invd.js +11 -2
- package/dist/bin/invd.js.map +1 -1
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +48 -29
- package/dist/src/cli.js.map +1 -1
- package/dist/src/client/api-client.d.ts +24 -24
- package/dist/src/client/api-client.js +52 -70
- package/dist/src/client/api-client.js.map +1 -1
- package/dist/src/client/pagination.d.ts +12 -11
- package/dist/src/client/pagination.js +47 -56
- package/dist/src/client/pagination.js.map +1 -1
- package/dist/src/commands/agent-setup.d.ts +21 -0
- package/dist/src/commands/agent-setup.js +112 -0
- package/dist/src/commands/agent-setup.js.map +1 -0
- package/dist/src/commands/api.d.ts +27 -0
- package/dist/src/commands/api.js +180 -0
- package/dist/src/commands/api.js.map +1 -0
- package/dist/src/commands/auth.d.ts +37 -0
- package/dist/src/commands/auth.js +336 -0
- package/dist/src/commands/auth.js.map +1 -0
- package/dist/src/commands/completion.d.ts +7 -0
- package/dist/src/commands/completion.js +115 -0
- package/dist/src/commands/completion.js.map +1 -0
- package/dist/src/commands/config.d.ts +4 -0
- package/dist/src/commands/config.js +85 -48
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/plugin.d.ts +8 -0
- package/dist/src/commands/plugin.js +8 -10
- package/dist/src/commands/plugin.js.map +1 -1
- package/dist/src/config/auth.d.ts +17 -1
- package/dist/src/config/auth.js +50 -36
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config-manager.d.ts +56 -4
- package/dist/src/config/config-manager.js +173 -29
- package/dist/src/config/config-manager.js.map +1 -1
- package/dist/src/config/toml.d.ts +7 -0
- package/dist/src/config/toml.js +79 -0
- package/dist/src/config/toml.js.map +1 -0
- package/dist/src/examples.d.ts +22 -0
- package/dist/src/examples.js +56 -0
- package/dist/src/examples.js.map +1 -0
- package/dist/src/generated/cli-manifest.json +5573 -5140
- package/dist/src/hand-written-commands.d.ts +11 -41
- package/dist/src/hand-written-commands.js +7 -17
- package/dist/src/hand-written-commands.js.map +1 -1
- package/dist/src/output/jq.d.ts +15 -0
- package/dist/src/output/jq.js +234 -0
- package/dist/src/output/jq.js.map +1 -0
- package/dist/src/output/options.d.ts +29 -0
- package/dist/src/output/options.js +72 -0
- package/dist/src/output/options.js.map +1 -0
- package/dist/src/output/render.d.ts +54 -0
- package/dist/src/output/render.js +160 -0
- package/dist/src/output/render.js.map +1 -0
- package/dist/src/shared/errors.d.ts +59 -15
- package/dist/src/shared/errors.js +126 -38
- package/dist/src/shared/errors.js.map +1 -1
- package/dist/src/shared/prompt.d.ts +10 -0
- package/dist/src/shared/prompt.js +24 -0
- package/dist/src/shared/prompt.js.map +1 -0
- package/dist/src/shared/spinner.js +2 -1
- package/dist/src/shared/spinner.js.map +1 -1
- package/dist/src/spec-commands.d.ts +14 -6
- package/dist/src/spec-commands.js +454 -174
- package/dist/src/spec-commands.js.map +1 -1
- package/dist/src/spec-flags.d.ts +11 -6
- package/dist/src/spec-flags.js +14 -7
- package/dist/src/spec-flags.js.map +1 -1
- package/dist/src/spec-manifest.d.ts +416 -116
- package/dist/src/spec-manifest.js +44 -13
- package/dist/src/spec-manifest.js.map +1 -1
- package/dist/src/update-notifier.d.ts +9 -0
- package/dist/src/update-notifier.js +63 -0
- package/dist/src/update-notifier.js.map +1 -0
- package/package.json +2 -3
- package/dist/src/client/earnings-live.d.ts +0 -194
- package/dist/src/client/earnings-live.js +0 -300
- package/dist/src/client/earnings-live.js.map +0 -1
- package/dist/src/client/news-live.d.ts +0 -72
- package/dist/src/client/news-live.js +0 -120
- package/dist/src/client/news-live.js.map +0 -1
- package/dist/src/client/pdf.d.ts +0 -15
- package/dist/src/client/pdf.js +0 -15
- package/dist/src/client/pdf.js.map +0 -1
- package/dist/src/client/websocket-client.d.ts +0 -19
- package/dist/src/client/websocket-client.js +0 -174
- package/dist/src/client/websocket-client.js.map +0 -1
- package/dist/src/commands/earnings.d.ts +0 -16
- package/dist/src/commands/earnings.js +0 -464
- package/dist/src/commands/earnings.js.map +0 -1
- package/dist/src/commands/login.d.ts +0 -15
- package/dist/src/commands/login.js +0 -249
- package/dist/src/commands/login.js.map +0 -1
- package/dist/src/commands/news.d.ts +0 -2
- package/dist/src/commands/news.js +0 -69
- package/dist/src/commands/news.js.map +0 -1
- package/dist/src/commands/sec.d.ts +0 -47
- package/dist/src/commands/sec.js +0 -191
- package/dist/src/commands/sec.js.map +0 -1
- package/dist/src/commands/ws.d.ts +0 -33
- package/dist/src/commands/ws.js +0 -116
- package/dist/src/commands/ws.js.map +0 -1
- package/dist/src/formatters/json-formatter.d.ts +0 -1
- package/dist/src/formatters/json-formatter.js +0 -4
- package/dist/src/formatters/json-formatter.js.map +0 -1
- package/dist/src/formatters/table-formatter.d.ts +0 -4
- package/dist/src/formatters/table-formatter.js +0 -73
- package/dist/src/formatters/table-formatter.js.map +0 -1
- package/dist/src/formatters/time.d.ts +0 -2
- package/dist/src/formatters/time.js +0 -14
- package/dist/src/formatters/time.js.map +0 -1
- package/dist/src/shared/output.d.ts +0 -3
- package/dist/src/shared/output.js +0 -13
- package/dist/src/shared/output.js.map +0 -1
- package/dist/src/shared/readiness.d.ts +0 -4
- package/dist/src/shared/readiness.js +0 -60
- package/dist/src/shared/readiness.js.map +0 -1
- package/dist/src/shared/types.d.ts +0 -11
- package/dist/src/shared/types.js +0 -2
- package/dist/src/shared/types.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/**
|
|
3
|
-
* The compact, committed form of the Data API spec that `invd` registers its generated commands from
|
|
3
|
+
* The compact, committed form of the Data API v2 spec that `invd` registers its generated commands from
|
|
4
4
|
* (`src/generated/cli-manifest.json`, written by `scripts/build-cli-manifest.ts` from `openapi.json`'s `x-cli`).
|
|
5
5
|
* One schema for the builder's output, the startup loader and the dispatcher.
|
|
6
6
|
*/
|
|
@@ -8,53 +8,82 @@ export const MANIFEST_PARAM_TYPES = ['string', 'integer', 'number', 'boolean', '
|
|
|
8
8
|
export const MANIFEST_ITEM_TYPES = ['string', 'integer', 'number'];
|
|
9
9
|
export const MANIFEST_METHODS = ['get', 'post', 'put', 'patch', 'delete'];
|
|
10
10
|
export const MANIFEST_VIEWS = ['table', 'keyValue', 'json'];
|
|
11
|
-
export const MANIFEST_PAGINATIONS = ['none', 'top', 'perCompany'];
|
|
12
11
|
const manifestParamSchema = z.object({
|
|
13
12
|
name: z.string().min(1),
|
|
14
|
-
in: z.enum(['query', 'path']),
|
|
13
|
+
in: z.enum(['query', 'path', 'header']),
|
|
15
14
|
required: z.boolean(),
|
|
16
15
|
type: z.enum(MANIFEST_PARAM_TYPES),
|
|
17
16
|
/** Arrays only: the item type; the value is sent as a repeated parameter. */
|
|
18
17
|
items: z.enum(MANIFEST_ITEM_TYPES).optional(),
|
|
19
18
|
/** Allowed values, stringified; on an array they apply to each item. */
|
|
20
19
|
enum: z.array(z.string()).optional(),
|
|
20
|
+
/** The spec's `pattern` (comma lists like `income-statement,balance-sheet` are patterns, not arrays). */
|
|
21
|
+
pattern: z.string().optional(),
|
|
21
22
|
/** Shown in help, never sent — the API applies its own default. */
|
|
22
23
|
default: z.unknown().optional(),
|
|
23
|
-
/** The spec's `example`: shown in help and the
|
|
24
|
+
/** The spec's `example`: shown in help and in the examples, never sent. */
|
|
24
25
|
example: z.unknown().optional(),
|
|
25
26
|
description: z.string().optional(),
|
|
26
27
|
/** One-letter short flag (`-q`). */
|
|
27
28
|
alias: z.string().length(1).optional(),
|
|
29
|
+
/** The long flag without dashes (`filed_at.gte` → `filed-at-gte`). */
|
|
30
|
+
flag: z.string().min(1),
|
|
31
|
+
}).strict();
|
|
32
|
+
const bodyFieldSchema = z.object({
|
|
33
|
+
/** The property's path in the JSON body (`["filters", "ciks"]`). */
|
|
34
|
+
path: z.array(z.string().min(1)).min(1),
|
|
35
|
+
type: z.enum(MANIFEST_PARAM_TYPES),
|
|
36
|
+
items: z.enum(MANIFEST_ITEM_TYPES).optional(),
|
|
37
|
+
required: z.boolean(),
|
|
38
|
+
description: z.string().optional(),
|
|
39
|
+
alias: z.string().length(1).optional(),
|
|
40
|
+
flag: z.string().min(1),
|
|
28
41
|
}).strict();
|
|
29
42
|
const manifestOperationSchema = z.object({
|
|
30
43
|
operationId: z.string().min(1),
|
|
31
44
|
group: z.string().min(1),
|
|
32
|
-
/** `""` = the group itself is the command (`invd
|
|
45
|
+
/** `""` = the group itself is the command (`invd financials`, the `x-cli.command` operations). */
|
|
33
46
|
action: z.string(),
|
|
34
47
|
method: z.enum(MANIFEST_METHODS),
|
|
35
48
|
path: z.string().startsWith('/'),
|
|
36
|
-
/** `false` = the operation needs no API key
|
|
49
|
+
/** `false` = the operation needs no API key: no key is resolved or sent. */
|
|
37
50
|
auth: z.boolean(),
|
|
38
51
|
summary: z.string(),
|
|
52
|
+
/** The spec's `x-credits`: the base cost of one response (`--dry-run`, the `--all` confirmation). */
|
|
53
|
+
credits: z.number().nonnegative(),
|
|
54
|
+
/** The spec's `x-tier` (free, lite, standard, pro). */
|
|
55
|
+
tier: z.string(),
|
|
39
56
|
params: z.array(manifestParamSchema),
|
|
57
|
+
/** The parameter the first positional fills: a company list (`AAPL MSFT` → `company=AAPL,MSFT`), a member id, `q`. */
|
|
58
|
+
positional: z.object({
|
|
59
|
+
name: z.string().min(1),
|
|
60
|
+
required: z.boolean(),
|
|
61
|
+
/** Several words: joined with `,` (a company list) or ` ` (a search text). */
|
|
62
|
+
variadic: z.enum(['comma', 'space']).optional(),
|
|
63
|
+
}).strict().optional(),
|
|
64
|
+
/** One command over several operations (`invd financials`): the `--basis` / `--view` values that pick this one. */
|
|
65
|
+
select: z.record(z.string()).optional(),
|
|
40
66
|
/** The spec's `x-example-params`: the OPTIONAL params an example invocation passes beside the required ones. */
|
|
41
67
|
exampleParams: z.array(z.string().min(1)).min(1).optional(),
|
|
42
68
|
body: z.object({
|
|
43
69
|
required: z.boolean(),
|
|
44
70
|
contentType: z.literal('application/json'),
|
|
45
|
-
/** The spec's request-body `example
|
|
71
|
+
/** The spec's request-body `example`. */
|
|
46
72
|
example: z.unknown().optional(),
|
|
73
|
+
/** Flags for the body's scalar / list properties (`--url`, `--events a,b`, `--ciks` → `filters.ciks`). */
|
|
74
|
+
fields: z.array(bodyFieldSchema),
|
|
47
75
|
}).strict().optional(),
|
|
76
|
+
/** A cursor-paginated list (`{data, has_more, next_cursor, meta}`): `--all`, `--cursor`, JSONL / CSV rows. */
|
|
77
|
+
list: z.boolean(),
|
|
48
78
|
view: z.enum(MANIFEST_VIEWS),
|
|
49
|
-
/** Dotted path to the table's rows, or to the ONE object a `keyValue` view shows (absent = the response root). */
|
|
50
|
-
rowsPath: z.string().optional(),
|
|
51
79
|
columns: z.array(z.string()).optional(),
|
|
52
|
-
|
|
80
|
+
/** The JSON fields of one row (a list's `data[]` item, else the object): `--json a,b` and `--help`. */
|
|
81
|
+
fields: z.array(z.string()),
|
|
53
82
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
83
|
+
* Where the response carries a downloadable file (`{url, sha256?, bytes?, content_type?}`): `""` = the response
|
|
84
|
+
* root, else a dotted path (`pdf`, `deck`). Present = the command takes `--save <file>`.
|
|
56
85
|
*/
|
|
57
|
-
|
|
86
|
+
download: z.string().optional(),
|
|
58
87
|
}).strict();
|
|
59
88
|
export const manifestSchema = z.object({
|
|
60
89
|
specVersion: z.string(),
|
|
@@ -64,6 +93,8 @@ export const manifestSchema = z.object({
|
|
|
64
93
|
}).strict();
|
|
65
94
|
/** A param's spec example as its flag takes it: an array comma-joined, anything else as its text. */
|
|
66
95
|
export const exampleValue = (example) => Array.isArray(example) ? example.map(item => String(item)).join(',') : String(example);
|
|
96
|
+
/** `invd <group> <action>` without the program name (`financials`, `companies get`). */
|
|
97
|
+
export const commandName = (operation) => [operation.group, operation.action].filter(Boolean).join(' ');
|
|
67
98
|
/** Parses a loaded manifest; a corrupt file fails by name rather than registering half a CLI. */
|
|
68
99
|
export function parseManifest(raw, source = 'src/generated/cli-manifest.json') {
|
|
69
100
|
const result = manifestSchema.safeParse(raw);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-manifest.js","sourceRoot":"","sources":["../../src/spec-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AACjG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AACnF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"spec-manifest.js","sourceRoot":"","sources":["../../src/spec-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AACjG,MAAM,CAAC,MA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AAG,CAAC,CAAC;AAEhE,iGAAiG;AACjG,MAAM,UAAU,aAAa,CAAC,GAAY,EAAE,MAAM,GAAG,iCAAiC;IACpF,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,KAAK,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,KAAK,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A once-a-day look at npm's `latest` for this package; the notice prints on stderr from the cached answer. Never
|
|
3
|
+
* in CI, under a test runner, without a terminal on stderr, or with `INVD_NO_UPDATE_NOTIFIER` set.
|
|
4
|
+
*/
|
|
5
|
+
export declare function updateCheckEnabled(env?: NodeJS.ProcessEnv, stderrIsTty?: boolean): boolean;
|
|
6
|
+
/** `a` newer than `b` (plain `x.y.z`; anything else is never newer). */
|
|
7
|
+
export declare function isNewer(a: string, b: string): boolean;
|
|
8
|
+
/** Prints the cached notice and, at most once a day, refreshes the cache (≤ 1.5 s, failures ignored). */
|
|
9
|
+
export declare function runUpdateNotifier(current: string): Promise<void>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { configDir } from './config/config-manager.js';
|
|
5
|
+
const PACKAGE = '@invinite-org/invinite-data-cli';
|
|
6
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
7
|
+
/**
|
|
8
|
+
* A once-a-day look at npm's `latest` for this package; the notice prints on stderr from the cached answer. Never
|
|
9
|
+
* in CI, under a test runner, without a terminal on stderr, or with `INVD_NO_UPDATE_NOTIFIER` set.
|
|
10
|
+
*/
|
|
11
|
+
export function updateCheckEnabled(env = process.env, stderrIsTty = Boolean(process.stderr.isTTY)) {
|
|
12
|
+
return stderrIsTty && !env.CI && !env.INVD_NO_UPDATE_NOTIFIER && !env.VITEST && env.NODE_ENV !== 'test';
|
|
13
|
+
}
|
|
14
|
+
/** `a` newer than `b` (plain `x.y.z`; anything else is never newer). */
|
|
15
|
+
export function isNewer(a, b) {
|
|
16
|
+
const parse = (version) => /^(\d+)\.(\d+)\.(\d+)$/.exec(version)?.slice(1).map(Number);
|
|
17
|
+
const [x, y] = [parse(a), parse(b)];
|
|
18
|
+
if (!x || !y)
|
|
19
|
+
return false;
|
|
20
|
+
for (let index = 0; index < 3; index += 1) {
|
|
21
|
+
if ((x[index] ?? 0) !== (y[index] ?? 0))
|
|
22
|
+
return (x[index] ?? 0) > (y[index] ?? 0);
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const statePath = () => join(configDir(), 'update-check.json');
|
|
27
|
+
function readState() {
|
|
28
|
+
try {
|
|
29
|
+
return JSON.parse(readFileSync(statePath(), 'utf8'));
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Prints the cached notice and, at most once a day, refreshes the cache (≤ 1.5 s, failures ignored). */
|
|
36
|
+
export async function runUpdateNotifier(current) {
|
|
37
|
+
if (!updateCheckEnabled())
|
|
38
|
+
return;
|
|
39
|
+
const state = readState();
|
|
40
|
+
if (state.latest && isNewer(state.latest, current)) {
|
|
41
|
+
console.error(chalk.yellow(`invd ${state.latest} is available (you have ${current}): npm install -g ${PACKAGE}`));
|
|
42
|
+
}
|
|
43
|
+
if (state.checkedAt && Date.now() - state.checkedAt < DAY_MS)
|
|
44
|
+
return;
|
|
45
|
+
let latest = state.latest;
|
|
46
|
+
try {
|
|
47
|
+
const response = await fetch(`https://registry.npmjs.org/${PACKAGE}/latest`, { signal: AbortSignal.timeout(1500) });
|
|
48
|
+
const body = await response.json();
|
|
49
|
+
if (typeof body.version === 'string')
|
|
50
|
+
latest = body.version;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// offline or slow: the next check is tomorrow either way
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
mkdirSync(configDir(), { recursive: true });
|
|
57
|
+
writeFileSync(statePath(), JSON.stringify({ checkedAt: Date.now(), ...(latest ? { latest } : {}) }));
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// a read-only config dir: no cache, no notice
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=update-notifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-notifier.js","sourceRoot":"","sources":["../../src/update-notifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,OAAO,GAAG,iCAAiC,CAAC;AAClD,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAyB,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IAClH,OAAO,WAAW,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,uBAAuB,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,Q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|
1
1
|
{
|
|
2
2
|
"name": "@invinite-org/invinite-data-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "CLI for the Invinite Data API",
|
|
5
|
+
"description": "CLI for the Invinite Data API (v2)",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"chalk": "^5.3.0",
|
|
29
29
|
"commander": "^12.1.0",
|
|
30
|
-
"conf": "^13.0.1",
|
|
31
30
|
"enquirer": "^2.4.1",
|
|
32
31
|
"ora": "^8.1.1",
|
|
33
32
|
"zod": "^3.23.8"
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure pieces of `invd ws listen --earnings`: the subscribe frame and one step per server
|
|
3
|
-
* frame of IDA's `earnings-calls.live` channel (`src/routes/websocket/types/earningsMessages.ts`).
|
|
4
|
-
*/
|
|
5
|
-
export declare const EARNINGS_LIVE_CHANNEL = "earnings-calls.live";
|
|
6
|
-
/** One call (event ID / CIK), or every live call at once (`scope: "all_live"`, keywords required). */
|
|
7
|
-
export type LiveTarget = {
|
|
8
|
-
event_id: string;
|
|
9
|
-
} | {
|
|
10
|
-
cik: string;
|
|
11
|
-
} | {
|
|
12
|
-
scope: 'all_live';
|
|
13
|
-
};
|
|
14
|
-
export declare const KEYWORD_MATCH_MODES: readonly ["exact", "stem"];
|
|
15
|
-
export type KeywordMatch = (typeof KEYWORD_MATCH_MODES)[number];
|
|
16
|
-
export declare const SPEAKER_ROLES: readonly ["executive", "ir_host", "analyst", "operator"];
|
|
17
|
-
export type SpeakerRole = (typeof SPEAKER_ROLES)[number];
|
|
18
|
-
/** Keyword alerts of the subscribe frame (`keywords` required for the global scope). */
|
|
19
|
-
export interface KeywordOptions {
|
|
20
|
-
keywords: string[];
|
|
21
|
-
keywordMatch?: KeywordMatch;
|
|
22
|
-
speakerRoles?: SpeakerRole[];
|
|
23
|
-
/** Global scope only: companies ranked ≤ N by market cap. */
|
|
24
|
-
minRank?: number;
|
|
25
|
-
}
|
|
26
|
-
export interface KeywordHit {
|
|
27
|
-
cik: string;
|
|
28
|
-
symbol: string;
|
|
29
|
-
conference_date: string;
|
|
30
|
-
keyword: string;
|
|
31
|
-
seq: number;
|
|
32
|
-
start_ms: number;
|
|
33
|
-
end_ms: number;
|
|
34
|
-
text: string;
|
|
35
|
-
context_before: string;
|
|
36
|
-
speaker_label: string | null;
|
|
37
|
-
speaker_name: string | null;
|
|
38
|
-
speaker_role: string | null;
|
|
39
|
-
layer: 'live' | 'final';
|
|
40
|
-
latency_ms: number;
|
|
41
|
-
}
|
|
42
|
-
export interface GuidanceFlash {
|
|
43
|
-
symbol: string;
|
|
44
|
-
conference_date: string;
|
|
45
|
-
seq: number;
|
|
46
|
-
revision: number;
|
|
47
|
-
metric: string;
|
|
48
|
-
metric_normalized: string | null;
|
|
49
|
-
period_label: string | null;
|
|
50
|
-
low: number | null;
|
|
51
|
-
high: number | null;
|
|
52
|
-
point: number | null;
|
|
53
|
-
unit: string | null;
|
|
54
|
-
currency: string | null;
|
|
55
|
-
source_sentence: string;
|
|
56
|
-
start_ms: number;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* One second of the call's stock (`price_tick`, `prices: true` subscriptions only; ≤ 1 / s, only seconds with a
|
|
60
|
-
* trade) — the API's `WebSocketPriceTickEvent`, field for field.
|
|
61
|
-
*/
|
|
62
|
-
export interface PriceTickFrame {
|
|
63
|
-
type: 'price_tick';
|
|
64
|
-
subscription_id: string;
|
|
65
|
-
event_id: string;
|
|
66
|
-
/** 10-digit CIK. */
|
|
67
|
-
cik: string;
|
|
68
|
-
symbol: string;
|
|
69
|
-
conference_date: string;
|
|
70
|
-
/** Bar start (ISO, wall time). */
|
|
71
|
-
at: string;
|
|
72
|
-
/** Bar start on the transcript clock; null before the call's first audio. */
|
|
73
|
-
call_ms: number | null;
|
|
74
|
-
price: number;
|
|
75
|
-
open: number;
|
|
76
|
-
high: number;
|
|
77
|
-
low: number;
|
|
78
|
-
volume: number;
|
|
79
|
-
cumulative_volume: number | null;
|
|
80
|
-
/** The last trade before the call start (a late join: the previous close). */
|
|
81
|
-
reference_price: number | null;
|
|
82
|
-
/** vs `reference_price`. */
|
|
83
|
-
return_bps: number | null;
|
|
84
|
-
prev_close: number | null;
|
|
85
|
-
/** vs `prev_close`. */
|
|
86
|
-
day_return_bps: number | null;
|
|
87
|
-
source: 'stream' | 'snapshot';
|
|
88
|
-
}
|
|
89
|
-
export interface SpeakerAssignment {
|
|
90
|
-
speaker_label: string;
|
|
91
|
-
from_seq: number;
|
|
92
|
-
to_seq: number | null;
|
|
93
|
-
name: string;
|
|
94
|
-
role?: string;
|
|
95
|
-
title?: string | null;
|
|
96
|
-
firm?: string | null;
|
|
97
|
-
}
|
|
98
|
-
export interface LiveSegment {
|
|
99
|
-
seq: number;
|
|
100
|
-
start_ms: number;
|
|
101
|
-
speaker_label: string | null;
|
|
102
|
-
text: string;
|
|
103
|
-
is_final: boolean;
|
|
104
|
-
}
|
|
105
|
-
export interface LiveState {
|
|
106
|
-
/** Highest final seq printed (or the `since_seq` asked for): a reconnect resumes after it. */
|
|
107
|
-
lastSeq: number;
|
|
108
|
-
eventId: string | null;
|
|
109
|
-
names: {
|
|
110
|
-
revision: number;
|
|
111
|
-
assignments: SpeakerAssignment[];
|
|
112
|
-
} | null;
|
|
113
|
-
}
|
|
114
|
-
export interface LiveOptions {
|
|
115
|
-
partials: boolean;
|
|
116
|
-
names: boolean;
|
|
117
|
-
/** Global scope: every hit line names its company. */
|
|
118
|
-
allLive?: boolean;
|
|
119
|
-
}
|
|
120
|
-
export interface LiveStep {
|
|
121
|
-
state: LiveState;
|
|
122
|
-
lines: string[];
|
|
123
|
-
/** A partial to show in place of the previous one (TTY only). */
|
|
124
|
-
partial?: string;
|
|
125
|
-
/** Stop: exit code + a closing line. */
|
|
126
|
-
end?: {
|
|
127
|
-
code: 0 | 1;
|
|
128
|
-
message: string;
|
|
129
|
-
};
|
|
130
|
-
/** Close the socket and resubscribe through the backoff. */
|
|
131
|
-
reconnect?: boolean;
|
|
132
|
-
}
|
|
133
|
-
/** `--earnings`: a UUID is an event_id, 1–10 digits a CIK. */
|
|
134
|
-
export declare function parseTarget(value: string): LiveTarget;
|
|
135
|
-
/** `--since-seq`: an integer ≥ -1; default -1 (the whole call from its first final). */
|
|
136
|
-
export declare function parseSinceSeq(value: string | undefined): number;
|
|
137
|
-
/** `--keywords`: 1–20 keywords of 2–64 characters (the API's limits), trimmed and de-duplicated. */
|
|
138
|
-
export declare function parseKeywords(value: string | undefined): string[];
|
|
139
|
-
/** `--keyword-match`: `exact` (default) or `stem`. */
|
|
140
|
-
export declare function parseKeywordMatch(value: string | undefined): KeywordMatch | undefined;
|
|
141
|
-
/** `--speaker-roles`: a comma-separated subset of executive, ir_host, analyst, operator. */
|
|
142
|
-
export declare function parseSpeakerRoles(value: string | undefined): SpeakerRole[] | undefined;
|
|
143
|
-
/** `--min-rank`: a positive integer (market-cap rank). */
|
|
144
|
-
export declare function parseMinRank(value: string | undefined): number | undefined;
|
|
145
|
-
export declare function isAllLive(target: LiveTarget): target is {
|
|
146
|
-
scope: 'all_live';
|
|
147
|
-
};
|
|
148
|
-
/** What a global subscription receives (the API defaults to keyword hits only; `ws listen` wants the flashes too). */
|
|
149
|
-
export declare const ALL_LIVE_EVENTS: readonly ["keyword_hit", "guidance_flash"];
|
|
150
|
-
/**
|
|
151
|
-
* The subscribe frame. One call: target + `since_seq` + `partials`. Global scope: `scope: "all_live"`
|
|
152
|
-
* carries no call target, no replay, no partials and no prices — only the keyword fields (the API refuses it
|
|
153
|
-
* without keywords, and so does `ws listen`) and `events` = keyword hits + guidance flashes.
|
|
154
|
-
*/
|
|
155
|
-
export declare function subscribeFrame(target: LiveTarget, sinceSeq: number, partials: boolean, keywords?: KeywordOptions, prices?: boolean): {
|
|
156
|
-
min_rank?: number | undefined;
|
|
157
|
-
events: ("keyword_hit" | "guidance_flash")[];
|
|
158
|
-
type: string;
|
|
159
|
-
channel: string;
|
|
160
|
-
scope: string;
|
|
161
|
-
} | {
|
|
162
|
-
prices?: boolean | undefined;
|
|
163
|
-
since_seq: number;
|
|
164
|
-
partials: boolean;
|
|
165
|
-
event_id: string;
|
|
166
|
-
type: string;
|
|
167
|
-
channel: string;
|
|
168
|
-
} | {
|
|
169
|
-
prices?: boolean | undefined;
|
|
170
|
-
since_seq: number;
|
|
171
|
-
partials: boolean;
|
|
172
|
-
cik: string;
|
|
173
|
-
type: string;
|
|
174
|
-
channel: string;
|
|
175
|
-
};
|
|
176
|
-
export declare function initialLiveState(sinceSeq: number): LiveState;
|
|
177
|
-
/** The assignment of `label` covering `seq` (the latest-starting one wins), else null. */
|
|
178
|
-
export declare function nameFor(assignments: SpeakerAssignment[], label: string | null, seq: number): string | null;
|
|
179
|
-
/** `[m:ss] name: text`, the name from the snapshot, else `Speaker <label>`. */
|
|
180
|
-
export declare function formatSegment(segment: LiveSegment, assignments: SpeakerAssignment[]): string;
|
|
181
|
-
/** One highlighted line per keyword hit: `[m:ss] keyword "x" · speaker: text` (+ the company in the global scope). */
|
|
182
|
-
export declare function formatKeywordHit(hit: KeywordHit, allLive?: boolean): string;
|
|
183
|
-
/** One line per guidance flash: `[m:ss] guidance flash · metric period: value — "sentence"`. */
|
|
184
|
-
export declare function formatGuidanceFlash(flash: GuidanceFlash, allLive?: boolean): string;
|
|
185
|
-
/**
|
|
186
|
-
* One price tick as the in-place line: `[16:32:05 ET · 12:34] AAPL 336.08 +42.5 bp since call −127.5 bp on day
|
|
187
|
-
* (vol 1,240)` — green / red by the since-call return, dim from the snapshot fallback.
|
|
188
|
-
*/
|
|
189
|
-
export declare function formatPriceTick(tick: PriceTickFrame): string;
|
|
190
|
-
export declare function finalTranscriptHint(eventId: string | null): string;
|
|
191
|
-
/** One server frame → the new state and what to print / do. Unknown frames are ignored. */
|
|
192
|
-
export declare function liveStep(state: LiveState, frame: Record<string, any>, opts: LiveOptions): LiveStep;
|
|
193
|
-
/** Frames of the earnings channel (the socket also carries `new_filing` broadcasts and pings). */
|
|
194
|
-
export declare function isEarningsFrame(frame: Record<string, any>): boolean;
|