@cyanheads/secedgar-mcp-server 0.16.0 → 0.17.1
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/AGENTS.md +38 -22
- package/CLAUDE.md +38 -22
- package/Dockerfile +13 -2
- package/README.md +51 -110
- package/changelog/0.17.x/0.17.0.md +34 -0
- package/changelog/0.17.x/0.17.1.md +36 -0
- package/dist/config/server-config.js +1 -1
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/company-search.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/company-search.tool.js +8 -4
- package/dist/mcp-server/tools/definitions/company-search.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts +8 -4
- package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/compare-companies.tool.js +169 -39
- package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/dataframe-describe.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/dataframe-describe.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/dataframe-describe.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts +4 -4
- package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fetch-frames.tool.js +24 -8
- package/dist/mcp-server/tools/definitions/fetch-frames.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts +14 -0
- package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/find-holders.tool.js +39 -8
- package/dist/mcp-server/tools/definitions/find-holders.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js +148 -79
- package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts +4 -4
- package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-filing.tool.js +311 -84
- package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js +5 -2
- package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts +14 -0
- package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js +8 -0
- package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-material-events.tool.js +8 -3
- package/dist/mcp-server/tools/definitions/get-material-events.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +453 -423
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-concepts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-concepts.tool.js +3 -1
- package/dist/mcp-server/tools/definitions/search-concepts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts +33 -0
- package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-filings.tool.js +38 -7
- package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -1
- package/dist/mcp-server/tools/limit-clamp.d.ts +50 -18
- package/dist/mcp-server/tools/limit-clamp.d.ts.map +1 -1
- package/dist/mcp-server/tools/limit-clamp.js +51 -15
- package/dist/mcp-server/tools/limit-clamp.js.map +1 -1
- package/dist/services/edgar/edgar-api-service.d.ts +75 -11
- package/dist/services/edgar/edgar-api-service.d.ts.map +1 -1
- package/dist/services/edgar/edgar-api-service.js +273 -50
- package/dist/services/edgar/edgar-api-service.js.map +1 -1
- package/dist/services/edgar/filing-to-text.d.ts +4 -3
- package/dist/services/edgar/filing-to-text.d.ts.map +1 -1
- package/dist/services/edgar/filing-to-text.js +12 -0
- package/dist/services/edgar/filing-to-text.js.map +1 -1
- package/package.json +7 -6
- package/server.json +3 -3
- package/skills/secedgar-guide/SKILL.md +68 -0
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Serving an over-cap
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* @fileoverview Serving an over-cap input at its cap. A count or size input
|
|
3
|
+
* above the cap its handler applies returns exactly what the call at the cap
|
|
4
|
+
* returns (#197), and an ID batch longer than its cap answers up to the cap and
|
|
5
|
+
* names the rest (#201), so rejecting either only costs the caller a retry.
|
|
5
6
|
*
|
|
6
7
|
* One switch, `EDGAR_CLAMP_OVERSIZED_LIMITS` (default on), governs every field
|
|
7
8
|
* built here:
|
|
8
9
|
*
|
|
9
|
-
* | Switch | Value | Schema | Handler reads | Log line + counter |
|
|
10
|
-
*
|
|
11
|
-
* | on | at most `cap` | accepted |
|
|
12
|
-
* | on | above `cap`, at most `bound` | accepted | `cap` | one each |
|
|
10
|
+
* | Switch | Value or list | Schema | Handler reads | Log line + counter |
|
|
11
|
+
* |:-------|:--------------|:-------|:--------------|:-------------------|
|
|
12
|
+
* | on | at most `cap` | accepted | all of it | none |
|
|
13
|
+
* | on | above `cap`, at most `bound` | accepted | `cap` (a list: up to `cap`, the rest deferred) | one each |
|
|
13
14
|
* | on | above `bound` | rejected | — | — |
|
|
14
|
-
* | off | at most `cap` | accepted |
|
|
15
|
-
* | off | above `cap` | rejected (`maximum` is `cap`) | — | — |
|
|
15
|
+
* | off | at most `cap` | accepted | all of it | none |
|
|
16
|
+
* | off | above `cap` | rejected (`maximum` / `maxItems` is `cap`) | — | — |
|
|
16
17
|
*
|
|
17
18
|
* The handler is the same in both modes: switched off, the schema rejects every
|
|
18
|
-
* value `apply()` would cut
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* its cap (`cap`, the page it
|
|
19
|
+
* value `apply()` would cut and every list that would defer anything, so only
|
|
20
|
+
* the advertised and validated bound changes. A clamped number carries no notice
|
|
21
|
+
* of its own — the result must equal the call at the cap — and reports the
|
|
22
|
+
* applied value wherever the tool already reports its cap (`cap`, the page it
|
|
23
|
+
* returns, its continuation). A deferred list is the exception: its tool returns
|
|
24
|
+
* the deferred items as supplied and says how to re-call with them.
|
|
22
25
|
*
|
|
23
26
|
* @module mcp-server/tools/limit-clamp
|
|
24
27
|
*/
|
|
@@ -29,6 +32,11 @@ import { ATTR_MCP_TOOL_NAME, createCounter } from '@cyanheads/mcp-ts-core/utils'
|
|
|
29
32
|
* the OTel no-op meter before the SDK registers its provider, and stays a no-op.
|
|
30
33
|
*/
|
|
31
34
|
let clampedCalls;
|
|
35
|
+
/** Add 1 to `secedgar.input.clamped`, tagged with tool and field. */
|
|
36
|
+
function countClamp(toolName, field) {
|
|
37
|
+
clampedCalls ??= createCounter('secedgar.input.clamped', 'Calls whose numeric input exceeded its cap and was served at the cap, or whose list exceeded its cap and was answered up to it, counted once per field', '{calls}');
|
|
38
|
+
clampedCalls.add(1, { [ATTR_MCP_TOOL_NAME]: toolName, 'secedgar.input.field': field });
|
|
39
|
+
}
|
|
32
40
|
/**
|
|
33
41
|
* Define a clamped numeric input. `shape` adds the field's default or optional
|
|
34
42
|
* marker; `description` is the field's own text, to which the cap sentence for
|
|
@@ -54,12 +62,40 @@ export function limitClamp(spec) {
|
|
|
54
62
|
requested: value,
|
|
55
63
|
applied: cap,
|
|
56
64
|
});
|
|
57
|
-
|
|
58
|
-
clampedCalls.add(1, { [ATTR_MCP_TOOL_NAME]: toolName, 'secedgar.input.field': field });
|
|
65
|
+
countClamp(toolName, field);
|
|
59
66
|
return cap;
|
|
60
67
|
},
|
|
61
68
|
};
|
|
62
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Define a list input answered up to its cap. Which items fill the cap is the
|
|
72
|
+
* handler's call (the first `cap` as given, or the first `cap` distinct), so it
|
|
73
|
+
* passes the rest to `defer()`. `description` is the field's own text; switched
|
|
74
|
+
* on, `overCap` follows it to say what a longer list returns, and switched off,
|
|
75
|
+
* the cap sentence does.
|
|
76
|
+
*/
|
|
77
|
+
export function batchClamp(spec) {
|
|
78
|
+
const { tool: toolName, field, item, min, cap, bound, description, overCap } = spec;
|
|
79
|
+
return {
|
|
80
|
+
field,
|
|
81
|
+
schema: (clampOversizedLimits) => z
|
|
82
|
+
.array(item)
|
|
83
|
+
.min(min)
|
|
84
|
+
.max(clampOversizedLimits ? bound : cap)
|
|
85
|
+
.describe(clampOversizedLimits ? `${description} ${overCap}` : `${description} At most ${cap}.`),
|
|
86
|
+
defer(deferred, ctx) {
|
|
87
|
+
if (deferred.length === 0)
|
|
88
|
+
return;
|
|
89
|
+
ctx.log.info('List above its cap answered up to the cap, the rest deferred', {
|
|
90
|
+
tool: toolName,
|
|
91
|
+
field,
|
|
92
|
+
cap,
|
|
93
|
+
deferred: deferred.length,
|
|
94
|
+
});
|
|
95
|
+
countClamp(toolName, field);
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
63
99
|
/**
|
|
64
100
|
* The definition to register for this deployment. Switched on, the definition
|
|
65
101
|
* as built (its clamped fields take `schema(true)`); off, the same definition
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limit-clamp.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/limit-clamp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AAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,UAAa,EACb,MAA+B,EAC/B,EAAE,oBAAoB,EAAqB;IAE3C,IAAI,oBAAoB;QAAE,OAAO,UAAU,CAAC;IAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9F,oFAAoF;IACpF,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;QAC3B,GAAI,UAAoD;QACxD,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;KACxC,CAAiB,CAAC;AACrB,CAAC"}
|
|
@@ -12,6 +12,26 @@ interface HeadCutoff {
|
|
|
12
12
|
readonly maxBytes: number;
|
|
13
13
|
readonly stopAt?: string;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* A failure EDGAR full-text search relays in a 200 body in place of its payload (#206):
|
|
17
|
+
* `errorType` is the class of the error its OpenSearch client threw, `errorMessage`
|
|
18
|
+
* that error's message, when the body carries one as a string.
|
|
19
|
+
*/
|
|
20
|
+
interface EftsBackendError {
|
|
21
|
+
readonly errorMessage: string | undefined;
|
|
22
|
+
readonly errorType: string;
|
|
23
|
+
}
|
|
24
|
+
/** How one request reads its answer. */
|
|
25
|
+
interface ReadOptions {
|
|
26
|
+
/**
|
|
27
|
+
* The transient backend failure a whole 2xx body relays, which fails the attempt
|
|
28
|
+
* like a 5xx — or `undefined` for a body to return. Opt-in per request: only EDGAR
|
|
29
|
+
* full-text search answers its backend's failures this way (#206).
|
|
30
|
+
*/
|
|
31
|
+
readonly backendFailure?: (text: string, url: string) => EftsBackendError | undefined;
|
|
32
|
+
/** Read only the body's head (`tryGetFilingDocumentHead`). */
|
|
33
|
+
readonly cutoff?: HeadCutoff;
|
|
34
|
+
}
|
|
15
35
|
/** A candidate suggestion from the trigram scan on no-result name search. */
|
|
16
36
|
export interface CompanySuggestion {
|
|
17
37
|
cik: string;
|
|
@@ -54,6 +74,15 @@ export interface SeriesFilingFeed {
|
|
|
54
74
|
* back unchanged, so the result is safe to compare against a raw lowercased name.
|
|
55
75
|
*/
|
|
56
76
|
export declare function normalizeCompanySuffix(name: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Delete every comma, period, and apostrophe (`'` and `’`) from a company name, the
|
|
79
|
+
* comparison form the name passes' folded tiers read, so `QXO Inc` meets `QXO, Inc.`,
|
|
80
|
+
* `U.S. Bancorp` meets `US BANCORP`, and `Macys` meets `Macy's, Inc.` (#210). A period
|
|
81
|
+
* is deleted, never turned into a space, so a dotted initialism meets its undotted
|
|
82
|
+
* spelling. Nothing else changes — whitespace runs, `&`, `-`, `/`, and `\` stay — and the
|
|
83
|
+
* result is for comparison only: a returned name is never folded.
|
|
84
|
+
*/
|
|
85
|
+
export declare function foldNamePunctuation(name: string): string;
|
|
57
86
|
/**
|
|
58
87
|
* Run a trigram similarity scan over the in-memory entry set. Each entry is scored
|
|
59
88
|
* on its name and on its ticker, and keeps the higher of the two — one ranked,
|
|
@@ -83,8 +112,11 @@ declare class EdgarApiService {
|
|
|
83
112
|
* any request made afterwards. Requests already sent are left to finish.
|
|
84
113
|
*/
|
|
85
114
|
dispose(): void;
|
|
86
|
-
/**
|
|
87
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Fetch and parse JSON, throwing on non-OK responses and on a body that is not JSON.
|
|
117
|
+
* `backendFailure` names the 200 bodies that fail an attempt (#206).
|
|
118
|
+
*/
|
|
119
|
+
fetchJson<T>(url: string, scope: CallScope, options?: Pick<ReadOptions, 'backendFailure'>): Promise<T>;
|
|
88
120
|
/** Fetch JSON, returning `null` on 404 and throwing on other non-OK responses. */
|
|
89
121
|
tryFetchJson<T>(url: string, scope: CallScope): Promise<T | null>;
|
|
90
122
|
/** Fetch raw text content (HTML filing documents). */
|
|
@@ -95,8 +127,9 @@ declare class EdgarApiService {
|
|
|
95
127
|
* Resolve a query (ticker, name, or CIK) to company match(es).
|
|
96
128
|
* - Numeric input → direct CIK lookup
|
|
97
129
|
* - 1-5 uppercase letters → ticker lookup (O(1))
|
|
98
|
-
* - Otherwise → name search (exact
|
|
99
|
-
*
|
|
130
|
+
* - Otherwise → name search (exact as written, exact once commas, periods, and
|
|
131
|
+
* apostrophes are folded out, prefix once folded, substring as written — resolved
|
|
132
|
+
* within the best tier a current name reaches), then the catch-all ticker lookup
|
|
100
133
|
* Returns a single match, an array of multiple matches, or an empty array (no match).
|
|
101
134
|
* On no-result name search, the returned empty array carries `suggestions` on
|
|
102
135
|
* the thrown error at the handler layer — call `suggestCompanies` there.
|
|
@@ -111,7 +144,9 @@ declare class EdgarApiService {
|
|
|
111
144
|
* a legal name under different CIKs (e.g. "VANGUARD GROUP INC" = a transfer agent and
|
|
112
145
|
* the 13F filer), so callers must disambiguate rather than auto-pick the top hit (#73).
|
|
113
146
|
* Distinct from `searchFilings`: same URL path, different query param (`keysTyped`)
|
|
114
|
-
* and response shape (`_source.entity`, not the filing-document `_source`).
|
|
147
|
+
* and response shape (`_source.entity`, not the filing-document `_source`). A
|
|
148
|
+
* failure of the search backend throws `efts_degraded_response` like a search's,
|
|
149
|
+
* never reads as no match (#206). The name is escaped like a search's `q` (#205).
|
|
115
150
|
*/
|
|
116
151
|
resolveEntityByName(name: string, scope: CallScope): Promise<EntityNameMatch[]>;
|
|
117
152
|
/** Reverse lookup: CIK → ticker symbol. */
|
|
@@ -187,7 +222,12 @@ declare class EdgarApiService {
|
|
|
187
222
|
* Returns zero or more padded 10-digit CIKs in SEC-provided order.
|
|
188
223
|
*/
|
|
189
224
|
findFilingCiks(accessionNumber: string, scope: CallScope): Promise<string[]>;
|
|
190
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* Fetch a filing's document index. Returns `null` if the filing does not exist.
|
|
227
|
+
* Entries listed with no filename are dropped: SEC lists each document of a
|
|
228
|
+
* pre-2001 SGML submission that way, with only its size, and such a document
|
|
229
|
+
* exists only inside the full submission `<accession>.txt` (#203).
|
|
230
|
+
*/
|
|
191
231
|
tryGetFilingIndex(cik: string, accessionNumber: string, scope: CallScope): Promise<FilingIndex | null>;
|
|
192
232
|
/**
|
|
193
233
|
* Fetch the SEC submission header page (`<accession>-index-headers.html`) and parse
|
|
@@ -196,6 +236,16 @@ declare class EdgarApiService {
|
|
|
196
236
|
* document TYPE values (e.g. "EX-21.1") that the directory listing JSON does not.
|
|
197
237
|
*/
|
|
198
238
|
tryGetFilingHeaders(cik: string, accessionNumber: string, scope: CallScope): Promise<FilingHeaders | null>;
|
|
239
|
+
/**
|
|
240
|
+
* Fetch a filing's index page (`<accession>-index.html`) and return the CIKs of the
|
|
241
|
+
* parties it names — filer, subject company, filed-by, reporting owner, issuer — in
|
|
242
|
+
* page order, without repeats (see {@link filingPartyCiks}). Returns `null` if the
|
|
243
|
+
* page is absent. SEC serves the page under the accession number's own prefix CIK
|
|
244
|
+
* for any filing that exists, including a filing agent's prefix whose directory has
|
|
245
|
+
* no `index.json`, so it names the filers of an accession full-text search does not
|
|
246
|
+
* cover (before 2001) (#203).
|
|
247
|
+
*/
|
|
248
|
+
tryGetFilingPartyCiks(cik: string, accessionNumber: string, scope: CallScope): Promise<string[] | null>;
|
|
199
249
|
/**
|
|
200
250
|
* Fetch the bare SGML submission header (`<accession>.hdr.sgml`, under 1 KB) and read
|
|
201
251
|
* its form, filing date, and period. Returns `null` if the file is absent. The
|
|
@@ -285,10 +335,12 @@ declare class EdgarApiService {
|
|
|
285
335
|
* 404's, a retried 5xx's, a 429's, one that lands as the caller cancels — is
|
|
286
336
|
* cancelled unread (#188); an error the last attempt earns carries a bounded head
|
|
287
337
|
* of its body, read like any other (#202). The body is read inside the ladder
|
|
288
|
-
* (#181): a 5xx, an attempt that got no HTTP response,
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
338
|
+
* (#181): a 5xx, an attempt that got no HTTP response, a 2xx whose body failed to
|
|
339
|
+
* read, and — for a request that opts in with `backendFailure` — a 2xx whose whole
|
|
340
|
+
* body relays a transient failure of the search backend (#206) all retry up to
|
|
341
|
+
* `MAX_RETRIES` attempts, and then the last attempt decides — a 5xx throws its
|
|
342
|
+
* status-classified `McpError`, a backend failure `efts_degraded_response`, the
|
|
343
|
+
* other two `sec_unreachable`. Other non-OK statuses throw at once, as does
|
|
292
344
|
* the local refusal while SEC's rate-limit block is active, and the pacer's
|
|
293
345
|
* `RequestCancelled` — those are `McpError`s from `send()`, never retried.
|
|
294
346
|
*
|
|
@@ -301,7 +353,8 @@ declare class EdgarApiService {
|
|
|
301
353
|
private rawFetch;
|
|
302
354
|
/**
|
|
303
355
|
* The error a request's last attempt earned: `sec_unreachable` for no response or
|
|
304
|
-
* an unreadable body; for
|
|
356
|
+
* an unreadable body; `efts_degraded_response` for a body relaying a failure of the
|
|
357
|
+
* search backend (#206); for an HTTP answer, its status-classified `McpError`, with
|
|
305
358
|
* the 403 and 429 hints. A 5xx ladder the failure budget stopped keeps its status
|
|
306
359
|
* mapping and `data`, and its message says the budget stopped it (#179).
|
|
307
360
|
*
|
|
@@ -413,6 +466,17 @@ export declare function parseMasterIndex(text: string): FullIndexEntry[];
|
|
|
413
466
|
* result — the caller's cue that the series is unknown. Exported for direct unit testing.
|
|
414
467
|
*/
|
|
415
468
|
export declare function parseSeriesFilingFeed(xml: string): SeriesFilingFeed;
|
|
469
|
+
/**
|
|
470
|
+
* The 10-digit CIKs a filing index page (`<accession>-index.html`) names, in page
|
|
471
|
+
* order without repeats: every party block links its company as
|
|
472
|
+
* `browse-edgar?CIK=<10 digits>&action=getcompany`, while the page's other
|
|
473
|
+
* `browse-edgar` links (latest filings, file number, SIC code) carry no `CIK`
|
|
474
|
+
* parameter (#203). One forward pass: each link's query ends at the first character
|
|
475
|
+
* that ends an `href`, the next link is searched for from there, and the `CIK`
|
|
476
|
+
* parameter is looked for inside that query alone, so no character is scanned more
|
|
477
|
+
* than twice whatever the markup. Exported for direct unit testing.
|
|
478
|
+
*/
|
|
479
|
+
export declare function filingPartyCiks(html: string): string[];
|
|
416
480
|
/**
|
|
417
481
|
* Name of the raw XML document inside a filing's archive directory. The submissions feed
|
|
418
482
|
* points at the human-readable rendering (`xslSCHEDULE_13D_X02/primary_doc.xml`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edgar-api-service.d.ts","sourceRoot":"","sources":["../../../src/services/edgar/edgar-api-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,OAAO,EAA0B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACV,QAAQ,EACR,sBAAsB,EAEtB,oBAAoB,EAEpB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,cAAc,EACd,cAAc,EACd,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AAiGpB,kHAAkH;AAClH,UAAU,UAAU;IAClB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AA0JD,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B,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