@invinite-org/invinite-data-cli 0.3.1 → 0.3.2

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 CHANGED
@@ -80,7 +80,7 @@ This repo includes plugins for AI coding tools that enable AI-powered financial
80
80
  ### Choose an integration
81
81
 
82
82
  - **Standalone skill:** installs the Invinite workflow and CLI reference. It prefers MCP when connected and falls back to the local `invd` CLI.
83
- - **Standalone MCP connector:** add `https://data.invinite.com/t/<teamId>/mcp` in Claude's connector settings, leave OAuth client ID/secret empty, and complete browser OAuth. This supplies tools but not the packaged research workflows.
83
+ - **Standalone MCP connector:** add `https://api.data.invinite.com/t/<teamId>/mcp` in Claude's connector settings, leave OAuth client ID/secret empty, and complete browser OAuth. This supplies tools but not the packaged research workflows.
84
84
  - **Claude plugin:** bundles the skill, remote MCP connector, data agent, and research commands. During setup, enter the team ID shown in the team-pinned MCP URL on the Data API dashboard's keys page; OAuth still uses Dynamic Client Registration and PKCE.
85
85
 
86
86
  The team ID controls access, usage, and billing for MCP calls. CLI calls use the team selected by `invd login --team <teamId>` and do not inherit the plugin's connector setting.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "invinite-financial-data",
3
3
  "description": "Fetch and analyze financial data using the Invinite Data API — company fundamentals, financial statements, SEC filings, earnings calls (transcripts, guidance, Q&A, live calls), institutional ownership, insider trades, and more.",
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "author": {
6
6
  "name": "Invinite"
7
7
  },
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "invinite-financial-data": {
4
4
  "type": "http",
5
- "url": "https://data.invinite.com/t/${user_config.team_id}/mcp"
5
+ "url": "https://api.data.invinite.com/t/${user_config.team_id}/mcp"
6
6
  }
7
7
  }
8
8
  }
@@ -42,7 +42,7 @@ The discovery rules below apply to both transports: call `list_available_metrics
42
42
 
43
43
  ### MCP
44
44
 
45
- Connect `https://data.invinite.com/t/<teamId>/mcp` through OAuth (the team-pinned URL is shown on the Data API dashboard's keys page, https://invinite.com/data-api/keys). The team in the URL controls data billing. Leave OAuth client ID and secret empty so the client uses Dynamic Client Registration and PKCE.
45
+ Connect `https://api.data.invinite.com/t/<teamId>/mcp` through OAuth (the team-pinned URL is shown on the Data API dashboard's keys page, https://invinite.com/data-api/keys). The team in the URL controls data billing. Leave OAuth client ID and secret empty so the client uses Dynamic Client Registration and PKCE.
46
46
 
47
47
  ### CLI
48
48
 
@@ -1,5 +1,13 @@
1
1
  /** The Data API dashboard in the Invinite app (keys, usage, plan) — the APP origin, never the API's. */
2
2
  export declare const DASHBOARD_URL = "https://invinite.com/data-api";
3
+ /** The Data API's public origin (REST, `/v1/ws`, MCP). */
4
+ export declare const DEFAULT_BASE_URL = "https://api.data.invinite.com";
5
+ /**
6
+ * Retired API origins. `conf` WRITES its defaults into the config file, so every install that ran an older version
7
+ * holds one of these as if the person had chosen it; `getBaseUrl()` rewrites it once. A host the person set
8
+ * themselves (`invd config set-url`) is never touched.
9
+ */
10
+ export declare const LEGACY_BASE_URLS: readonly string[];
3
11
  export declare function getBaseUrl(): string;
4
12
  export declare function setBaseUrl(url: string): void;
5
13
  export declare function getStoredApiKey(): string | undefined;
@@ -1,12 +1,22 @@
1
1
  import Conf from 'conf';
2
2
  /** The Data API dashboard in the Invinite app (keys, usage, plan) — the APP origin, never the API's. */
3
3
  export const DASHBOARD_URL = 'https://invinite.com/data-api';
4
+ /** The Data API's public origin (REST, `/v1/ws`, MCP). */
5
+ export const DEFAULT_BASE_URL = 'https://api.data.invinite.com';
6
+ /**
7
+ * Retired API origins. `conf` WRITES its defaults into the config file, so every install that ran an older version
8
+ * holds one of these as if the person had chosen it; `getBaseUrl()` rewrites it once. A host the person set
9
+ * themselves (`invd config set-url`) is never touched.
10
+ */
11
+ export const LEGACY_BASE_URLS = ['https://data.invinite.com'];
4
12
  const config = new Conf({
5
13
  projectName: 'invinite-data-cli',
14
+ // The test suite points this at a temp dir: its `resetConfig()` would otherwise clear the person's real config.
15
+ cwd: process.env.INVD_CONFIG_DIR || undefined,
6
16
  schema: {
7
17
  baseUrl: {
8
18
  type: 'string',
9
- default: 'https://data.invinite.com',
19
+ default: DEFAULT_BASE_URL,
10
20
  },
11
21
  apiKey: {
12
22
  type: 'string',
@@ -15,7 +25,13 @@ const config = new Conf({
15
25
  },
16
26
  });
17
27
  export function getBaseUrl() {
18
- return config.get('baseUrl');
28
+ const stored = config.get('baseUrl');
29
+ if (!LEGACY_BASE_URLS.includes(stored.replace(/\/+$/, '')))
30
+ return stored;
31
+ config.set('baseUrl', DEFAULT_BASE_URL);
32
+ // stderr: `getBaseUrl()` runs inside `--json` commands, whose stdout is machine output.
33
+ console.error(`Updated API host to ${DEFAULT_BASE_URL}`);
34
+ return DEFAULT_BASE_URL;
19
35
  }
20
36
  export function setBaseUrl(url) {
21
37
  config.set('baseUrl', url);
@@ -1 +1 @@
1
- {"version":3,"file":"config-manager.js","sourceRoot":"","sources":["../../../src/config/config-manager.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAOxB,wGAAwG;AACxG,MAAM,CAAC,MAAM,aAAa,GAAG,+BAA+B,CAAC;AAE7D,MAAM,MAAM,GAAG,IAAI,IAAI,CAAe;IACpC,WAAW,EAAE,mBAAmB;IAChC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,2BAA2B;SACrC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;SACZ;KACF;CACF,CAAC,CAAC;AAEH,MAAM,UAAU,UAAU;IACxB,OAAO,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,MAAM,GA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SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC;IAC1E,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IACxC,wFAAwF;IACxF,OAAO,CAAC,KAAK,CAAC,uBAAuB,gBAAgB,EAAE,CAAC,CAAC;IACzD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,OAAO,GAAG,IAAI,SAAS,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO;QACL,OAAO,EAAE,UAAU,EAAE;QACrB,SAAS,EAAE,CAAC,CAAC,eAAe,EAAE;KAC/B,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invinite-org/invinite-data-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "CLI for the Invinite Data API",
6
6
  "publishConfig": {