sec-edgar-api 1.0.3 → 1.0.5

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.
@@ -0,0 +1,41 @@
1
+ export interface XbrlFilingSummary {
2
+ baseTaxonomies: string[];
3
+ inputFiles: string[];
4
+ contextCount: number;
5
+ elementCount: number;
6
+ entityCount: number;
7
+ footnotesReported: boolean;
8
+ hasCalculationLinkbase: boolean;
9
+ hasPresentationLinkbase: boolean;
10
+ scenarioCount: number;
11
+ segmentCount: number;
12
+ tuplesReported: boolean;
13
+ unitCount: number;
14
+ version: string;
15
+ reportFormat: string;
16
+ reports: XbrlFilingSummaryReport[];
17
+ }
18
+ type XbrlFilingSummaryMenuCategory = 'Cover' | 'Statements' | 'Notes' | 'Policies' | 'Tables' | 'Details';
19
+ type XbrlFilingSummaryReportType = 'Sheet' | 'Notes' | 'Book';
20
+ export interface XbrlFilingSummaryReport {
21
+ longName: string;
22
+ shortName: string;
23
+ isDefault: boolean;
24
+ hasEmbeddedReports: boolean;
25
+ htmlFileName: string;
26
+ reportType: XbrlFilingSummaryReportType;
27
+ role: string;
28
+ menuCategory: XbrlFilingSummaryMenuCategory | null;
29
+ position: number;
30
+ parentRole: string | null;
31
+ instance: string;
32
+ }
33
+ /**
34
+ * Parse FilingSummary.xml
35
+ */
36
+ export default class FilingSummaryParser {
37
+ private readonly xmlParser;
38
+ private toText;
39
+ parse(xml: string): XbrlFilingSummary | null;
40
+ }
41
+ export {};
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var XMLParser_1 = require("../XMLParser");
4
+ var util_xbrl_1 = require("./util-xbrl");
5
+ /**
6
+ * Parse FilingSummary.xml
7
+ */
8
+ var FilingSummaryParser = /** @class */ (function () {
9
+ function FilingSummaryParser() {
10
+ this.xmlParser = new XMLParser_1.default();
11
+ }
12
+ FilingSummaryParser.prototype.toText = function (node) {
13
+ var _a;
14
+ return String(typeof node === 'object' && node !== null ? (_a = node['#text']) !== null && _a !== void 0 ? _a : '' : node || '');
15
+ };
16
+ FilingSummaryParser.prototype.parse = function (xml) {
17
+ var _this = this;
18
+ var _a, _b, _c, _d, _e, _f;
19
+ var parts = xml ? this.xmlParser.parse(xml) : null;
20
+ var filingSummary = parts === null || parts === void 0 ? void 0 : parts.FilingSummary;
21
+ if (!filingSummary)
22
+ return null;
23
+ var _g = filingSummary !== null && filingSummary !== void 0 ? filingSummary : {}, BaseTaxonomies = _g.BaseTaxonomies, ContextCount = _g.ContextCount, ElementCount = _g.ElementCount, EntityCount = _g.EntityCount, FootnotesReported = _g.FootnotesReported, HasCalculationLinkbase = _g.HasCalculationLinkbase, HasPresentationLinkbase = _g.HasPresentationLinkbase, InputFiles = _g.InputFiles, MyReports = _g.MyReports, ReportFormat = _g.ReportFormat, ScenarioCount = _g.ScenarioCount, SegmentCount = _g.SegmentCount, TuplesReported = _g.TuplesReported, UnitCount = _g.UnitCount, Version = _g.Version;
24
+ return {
25
+ version: util_xbrl_1.default.toString(this.toText(Version)) || '',
26
+ contextCount: util_xbrl_1.default.toNumber(this.toText(ContextCount)) || 0,
27
+ elementCount: util_xbrl_1.default.toNumber(this.toText(ElementCount)) || 0,
28
+ entityCount: util_xbrl_1.default.toNumber(this.toText(EntityCount)) || 0,
29
+ footnotesReported: util_xbrl_1.default.toBoolean(this.toText(FootnotesReported)) || false,
30
+ hasCalculationLinkbase: util_xbrl_1.default.toBoolean(this.toText(HasCalculationLinkbase)) || false,
31
+ hasPresentationLinkbase: util_xbrl_1.default.toBoolean(this.toText(HasPresentationLinkbase)) || false,
32
+ scenarioCount: util_xbrl_1.default.toNumber(this.toText(ScenarioCount)) || 0,
33
+ segmentCount: util_xbrl_1.default.toNumber(this.toText(SegmentCount)) || 0,
34
+ tuplesReported: util_xbrl_1.default.toBoolean(this.toText(TuplesReported)) || false,
35
+ unitCount: util_xbrl_1.default.toNumber(this.toText(UnitCount)) || 0,
36
+ reportFormat: util_xbrl_1.default.toString(this.toText(ReportFormat)) || '',
37
+ baseTaxonomies: (_b = (_a = BaseTaxonomies === null || BaseTaxonomies === void 0 ? void 0 : BaseTaxonomies.BaseTaxonomy) === null || _a === void 0 ? void 0 : _a.map(function (taxonomy) { return util_xbrl_1.default.toString(_this.toText(taxonomy)); })) !== null && _b !== void 0 ? _b : [],
38
+ inputFiles: (_d = (_c = InputFiles === null || InputFiles === void 0 ? void 0 : InputFiles.File) === null || _c === void 0 ? void 0 : _c.map(function (file) { return util_xbrl_1.default.toString(_this.toText(file)); })) !== null && _d !== void 0 ? _d : [],
39
+ reports: (_f = (_e = MyReports === null || MyReports === void 0 ? void 0 : MyReports.Report) === null || _e === void 0 ? void 0 : _e.map(function (report) { return ({
40
+ longName: util_xbrl_1.default.toString(_this.toText(report.LongName)) || '',
41
+ shortName: util_xbrl_1.default.toString(_this.toText(report.ShortName)) || '',
42
+ isDefault: util_xbrl_1.default.toBoolean(_this.toText(report.IsDefault)) || false,
43
+ hasEmbeddedReports: util_xbrl_1.default.toBoolean(_this.toText(report.HasEmbeddedReports)) || false,
44
+ htmlFileName: util_xbrl_1.default.toString(_this.toText(report.HtmlFileName)) || '',
45
+ reportType: util_xbrl_1.default.toString(_this.toText(report.ReportType)) || '',
46
+ role: util_xbrl_1.default.toString(_this.toText(report.Role)) || '',
47
+ menuCategory: util_xbrl_1.default.toString(_this.toText(report.MenuCategory)) || null,
48
+ position: util_xbrl_1.default.toNumber(_this.toText(report.Position)) || -1,
49
+ parentRole: util_xbrl_1.default.toString(_this.toText(report.ParentRole)) || null,
50
+ instance: util_xbrl_1.default.toString(_this.toText(report['@_instance'])) || '',
51
+ }); })) !== null && _f !== void 0 ? _f : [],
52
+ };
53
+ };
54
+ return FilingSummaryParser;
55
+ }());
56
+ exports.default = FilingSummaryParser;
@@ -0,0 +1,7 @@
1
+ import { XbrlMetaLinks } from '../../../types/metalinks.type';
2
+ /**
3
+ * Parse MetaLinks.json
4
+ */
5
+ export declare class MetaLinksParser {
6
+ parse(xml: string): XbrlMetaLinks | null;
7
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MetaLinksParser = void 0;
4
+ /**
5
+ * Parse MetaLinks.json
6
+ */
7
+ var MetaLinksParser = /** @class */ (function () {
8
+ function MetaLinksParser() {
9
+ }
10
+ MetaLinksParser.prototype.parse = function (xml) {
11
+ if (!xml)
12
+ return null;
13
+ try {
14
+ var numberKeys_1 = new Set(['decimals', 'order']);
15
+ var booleanKeys_1 = new Set(['xsiNil', 'isDefault']);
16
+ return JSON.parse(xml.substring(xml.indexOf('{'), xml.lastIndexOf('}') + 1), function (key, value) {
17
+ if (numberKeys_1.has(key) && !isNaN(value)) {
18
+ return Number(value);
19
+ }
20
+ if (booleanKeys_1.has(key)) {
21
+ if (value === 'false')
22
+ return false;
23
+ if (value === 'true')
24
+ return true;
25
+ }
26
+ return value;
27
+ });
28
+ }
29
+ catch (_a) {
30
+ return null;
31
+ }
32
+ };
33
+ return MetaLinksParser;
34
+ }());
35
+ exports.MetaLinksParser = MetaLinksParser;
@@ -1,4 +1,7 @@
1
1
  import type { XbrlInstance, XbrlLinkbase, XbrlSchema } from '../../../types';
2
+ import { XbrlMetaLinks } from '../../../types/metalinks.type';
3
+ import { DocumentData } from '../DocumentXmlSplitter';
4
+ import { XbrlFilingSummary } from './FilingSummaryParser';
2
5
  import { XbrlFormHeader } from './HeaderParser';
3
6
  export interface XbrlParseResult {
4
7
  header: XbrlFormHeader;
@@ -8,6 +11,15 @@ export interface XbrlParseResult {
8
11
  linkbaseCalculation: XbrlDocument<XbrlLinkbase> | null;
9
12
  linkbaseDefinition: XbrlDocument<XbrlLinkbase> | null;
10
13
  linkbaseLabel: XbrlDocument<XbrlLinkbase> | null;
14
+ /**
15
+ * FilingSummary.xml content
16
+ */
17
+ filingSummary: XbrlFilingSummary | null;
18
+ /**
19
+ * MetaLinks.json content
20
+ */
21
+ metaLinks: XbrlMetaLinks | null;
22
+ documents: DocumentData[];
11
23
  }
12
24
  interface XbrlDocument<T> {
13
25
  description: string;
@@ -27,6 +39,8 @@ export default class XBRLParser {
27
39
  private readonly linkbaseParser;
28
40
  private readonly instanceParser;
29
41
  private readonly schemaParser;
42
+ private readonly filingSummaryParser;
43
+ private readonly metaLinksParser;
30
44
  private filterDocuments;
31
45
  private createXbrlDocument;
32
46
  parse(xml: string, options?: ParseXbrlOptions): XbrlParseResult;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var DocumentXmlSplitter_1 = require("../DocumentXmlSplitter");
4
+ var FilingSummaryParser_1 = require("./FilingSummaryParser");
4
5
  var HeaderParser_1 = require("./HeaderParser");
5
6
  var InstanceParser_1 = require("./InstanceParser");
6
7
  var LinkbaseParser_1 = require("./LinkbaseParser");
8
+ var MetaLinksParser_1 = require("./MetaLinksParser");
7
9
  var SchemaParser_1 = require("./SchemaParser");
8
10
  var XBRLParser = /** @class */ (function () {
9
11
  function XBRLParser() {
@@ -12,9 +14,11 @@ var XBRLParser = /** @class */ (function () {
12
14
  this.linkbaseParser = new LinkbaseParser_1.default();
13
15
  this.instanceParser = new InstanceParser_1.default();
14
16
  this.schemaParser = new SchemaParser_1.default();
17
+ this.filingSummaryParser = new FilingSummaryParser_1.default();
18
+ this.metaLinksParser = new MetaLinksParser_1.MetaLinksParser();
15
19
  }
16
20
  XBRLParser.prototype.filterDocuments = function (documents) {
17
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
21
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
18
22
  var xmlDocs = documents.filter(function (doc) { return doc.fileName.endsWith('.xml') || doc.fileName.endsWith('.xsd'); });
19
23
  var instanceDoc = (_a = xmlDocs.find(function (doc) {
20
24
  return doc.description.toLowerCase().includes('instance doc') ||
@@ -28,6 +32,8 @@ var XBRLParser = /** @class */ (function () {
28
32
  linkbaseDefinitionDoc: (_f = (_e = xmlDocs.find(function (doc) { return doc.fileName.endsWith('_def.xml'); })) !== null && _e !== void 0 ? _e : xmlDocs.find(function (doc) { return doc !== instanceDoc && doc.content.includes('link:definitionLink>'); })) !== null && _f !== void 0 ? _f : null,
29
33
  linkbaseCalculationDoc: (_h = (_g = xmlDocs.find(function (doc) { return doc.fileName.endsWith('_cal.xml'); })) !== null && _g !== void 0 ? _g : xmlDocs.find(function (doc) { return doc !== instanceDoc && doc.content.includes('link:calculationLink>'); })) !== null && _h !== void 0 ? _h : null,
30
34
  linkbaseLabelDoc: (_k = (_j = xmlDocs.find(function (doc) { return doc.fileName.endsWith('_lab.xml'); })) !== null && _j !== void 0 ? _j : xmlDocs.find(function (doc) { return doc !== instanceDoc && doc.content.includes('link:labelLink>'); })) !== null && _k !== void 0 ? _k : null,
35
+ filingSummaryDoc: (_l = xmlDocs.find(function (doc) { return doc.fileName === 'FilingSummary.xml'; })) !== null && _l !== void 0 ? _l : null,
36
+ metaLinks: (_m = documents.find(function (doc) { return doc.fileName === 'MetaLinks.json'; })) !== null && _m !== void 0 ? _m : null,
31
37
  };
32
38
  };
33
39
  XBRLParser.prototype.createXbrlDocument = function (doc, xbrl) {
@@ -37,10 +43,10 @@ var XBRLParser = /** @class */ (function () {
37
43
  return xbrl ? { fileName: fileName, description: description, sequence: sequence, type: type, xbrl: xbrl } : null;
38
44
  };
39
45
  XBRLParser.prototype.parse = function (xml, options) {
40
- var _a, _b, _c, _d, _e, _f;
41
- var _g = options !== null && options !== void 0 ? options : {}, _h = _g.includeInstance, includeInstance = _h === void 0 ? true : _h, _j = _g.includeLinkbases, includeLinkbases = _j === void 0 ? true : _j, _k = _g.includeSchema, includeSchema = _k === void 0 ? true : _k;
46
+ var _a, _b, _c, _d, _e, _f, _g, _h;
47
+ var _j = options !== null && options !== void 0 ? options : {}, _k = _j.includeInstance, includeInstance = _k === void 0 ? true : _k, _l = _j.includeLinkbases, includeLinkbases = _l === void 0 ? true : _l, _m = _j.includeSchema, includeSchema = _m === void 0 ? true : _m;
42
48
  var documents = this.splitter.splitDocumentXml({ xml: xml }).documents;
43
- var _l = this.filterDocuments(documents), instanceDoc = _l.instanceDoc, linkbaseCalculationDoc = _l.linkbaseCalculationDoc, linkbaseDefinitionDoc = _l.linkbaseDefinitionDoc, linkbaseLabelDoc = _l.linkbaseLabelDoc, linkbasePresentationDoc = _l.linkbasePresentationDoc, schemaDoc = _l.schemaDoc;
49
+ var _o = this.filterDocuments(documents), instanceDoc = _o.instanceDoc, linkbaseCalculationDoc = _o.linkbaseCalculationDoc, linkbaseDefinitionDoc = _o.linkbaseDefinitionDoc, linkbaseLabelDoc = _o.linkbaseLabelDoc, linkbasePresentationDoc = _o.linkbasePresentationDoc, schemaDoc = _o.schemaDoc, filingSummaryDoc = _o.filingSummaryDoc, metaLinks = _o.metaLinks;
44
50
  var header = this.headerParser.parse(xml);
45
51
  var instance = includeInstance ? this.instanceParser.parse((_a = instanceDoc === null || instanceDoc === void 0 ? void 0 : instanceDoc.content) !== null && _a !== void 0 ? _a : '') : null;
46
52
  var schema = includeSchema ? this.schemaParser.parse((_b = schemaDoc === null || schemaDoc === void 0 ? void 0 : schemaDoc.content) !== null && _b !== void 0 ? _b : '') : null;
@@ -62,6 +68,9 @@ var XBRLParser = /** @class */ (function () {
62
68
  linkbaseCalculation: this.createXbrlDocument(linkbaseCalculationDoc, linkbaseCalculation),
63
69
  linkbaseDefinition: this.createXbrlDocument(linkbaseDefinitionDoc, linkbaseDefinition),
64
70
  linkbaseLabel: this.createXbrlDocument(linkbaseLabelDoc, linkbaseLabel),
71
+ filingSummary: this.filingSummaryParser.parse((_g = filingSummaryDoc === null || filingSummaryDoc === void 0 ? void 0 : filingSummaryDoc.content) !== null && _g !== void 0 ? _g : ''),
72
+ metaLinks: this.metaLinksParser.parse((_h = metaLinks === null || metaLinks === void 0 ? void 0 : metaLinks.content) !== null && _h !== void 0 ? _h : ''),
73
+ documents: documents,
65
74
  };
66
75
  };
67
76
  return XBRLParser;
@@ -54,6 +54,8 @@ var ReportRawBuilder = /** @class */ (function () {
54
54
  });
55
55
  var accessionByYearQuarter = new Map();
56
56
  filings === null || filings === void 0 ? void 0 : filings.forEach(function (f) {
57
+ if (!f.reportDate)
58
+ return;
57
59
  var _a = fiscalCalculator.getFiscalYearQuarter({ dateStr: f.reportDate }), year = _a.year, quarter = _a.quarter;
58
60
  accessionByYearQuarter.set(f.accessionNumber, "".concat(year, "_").concat(quarter));
59
61
  });
@@ -1,4 +1,4 @@
1
- import type { CompanyFactFrame, CompanyFactListData, CompanyTickerItem, DailyFilingFormType, FieldDataResponse, Form10KData, Form13GData, Form4Data, FormDef14aData, MultiCompanyFactFrame, ReportRaw, ReportTranslated, FilingListDetails, FilingListItemTranslated, SubmissionList, CalculationMap } from '../../types';
1
+ import type { CompanyFactFrame, CompanyFactListData, CompanyTickerItem, DailyFilingFormType, FieldDataResponse, Form10KData, Form13GData, Form4Data, FormDef14aData, MultiCompanyFactFrame, ReportRaw, ReportTranslated, FilingListDetails, FilingListItemTranslated, SubmissionList, CalculationMap, SplitData } from '../../types';
2
2
  import { IClient } from '../Client';
3
3
  import DocumentParser from '../DocumentParser';
4
4
  import ReportParser from '../ReportParser';
@@ -31,6 +31,9 @@ export interface GetReportsRawParams {
31
31
  includeNamePrefix?: boolean;
32
32
  adjustForSplits?: boolean;
33
33
  resolvePeriodValues?: boolean;
34
+ filings?: Pick<FilingListItemTranslated, 'form' | 'reportDate' | 'filingDate' | 'accessionNumber'>[];
35
+ /** useful when the latest split has not shown up yet in an XBRL report */
36
+ splits?: SplitData[];
34
37
  }
35
38
  export interface GetReportsParams extends Omit<GetReportsRawParams, 'includeNamePrefix'> {
36
39
  /** symbol or cik */
@@ -187,6 +190,9 @@ export default class SecEdgarApi {
187
190
  adjustForSplits?: boolean;
188
191
  resolvePeriodValues?: boolean;
189
192
  calculationMap?: CalculationMap<R>;
193
+ filings?: Pick<FilingListItemTranslated, 'form' | 'reportDate' | 'filingDate' | 'accessionNumber'>[];
194
+ /** useful when the latest split has not shown up yet in an XBRL report */
195
+ splits?: SplitData[];
190
196
  }): Promise<(typeof params.calculationMap extends undefined ? ReportTranslated : ReportRaw & R)[]>;
191
197
  /**
192
198
  * Parses reports from company facts.
@@ -323,11 +323,11 @@ var SecEdgarApi = /** @class */ (function () {
323
323
  */
324
324
  SecEdgarApi.prototype.getReportsRaw = function (params) {
325
325
  return __awaiter(this, void 0, void 0, function () {
326
- var symbol, _a, includeNamePrefix, _b, adjustForSplits, _c, resolvePeriodValues, companyFacts, reports;
326
+ var symbol, _a, includeNamePrefix, _b, adjustForSplits, _c, resolvePeriodValues, splits, filings, companyFacts, reports;
327
327
  return __generator(this, function (_d) {
328
328
  switch (_d.label) {
329
329
  case 0:
330
- symbol = params.symbol, _a = params.includeNamePrefix, includeNamePrefix = _a === void 0 ? false : _a, _b = params.adjustForSplits, adjustForSplits = _b === void 0 ? true : _b, _c = params.resolvePeriodValues, resolvePeriodValues = _c === void 0 ? true : _c;
330
+ symbol = params.symbol, _a = params.includeNamePrefix, includeNamePrefix = _a === void 0 ? false : _a, _b = params.adjustForSplits, adjustForSplits = _b === void 0 ? true : _b, _c = params.resolvePeriodValues, resolvePeriodValues = _c === void 0 ? true : _c, splits = params.splits, filings = params.filings;
331
331
  return [4 /*yield*/, this.getFacts({ symbol: symbol })];
332
332
  case 1:
333
333
  companyFacts = _d.sent();
@@ -335,6 +335,8 @@ var SecEdgarApi = /** @class */ (function () {
335
335
  adjustForSplits: adjustForSplits,
336
336
  resolvePeriodValues: resolvePeriodValues,
337
337
  includeNamePrefix: includeNamePrefix,
338
+ splits: splits,
339
+ filings: filings,
338
340
  });
339
341
  return [2 /*return*/, reports];
340
342
  }
@@ -12,10 +12,15 @@ export interface FieldDataResponse<Field extends string = string> {
12
12
  data: (string | number)[][];
13
13
  }
14
14
  export interface SplitData {
15
+ /** The filed date of the report in which the split was first filed */
15
16
  filedFirst: string;
17
+ /** The filed date of the report in which the split was last filed */
16
18
  filedLast: string;
19
+ /** The period end date of the report in which the split was first filed */
17
20
  endFirst: string;
21
+ /** The period end date of the report in which the split was last filed */
18
22
  endLast: string;
23
+ /** ex: forward split 1:20 = 20, reverse split 20:1 = 0.05 */
19
24
  splitRatio: number;
20
25
  }
21
26
  export interface FactGroup {
@@ -0,0 +1,131 @@
1
+ export interface XbrlMetaLinks {
2
+ version: string;
3
+ instance: Record<string, XbrlFilingMetaInstance>;
4
+ std_ref: Record<string, XbrlStdRef>;
5
+ }
6
+ export interface XbrlStdRefFlat extends XbrlStdRef {
7
+ key: string;
8
+ }
9
+ export interface XbrlFilingMetaInstance {
10
+ nsprefix: string;
11
+ nsuri: string;
12
+ dts: Dts;
13
+ keyStandard: number;
14
+ keyCustom: number;
15
+ axisStandard: number;
16
+ axisCustom: number;
17
+ memberStandard: number;
18
+ memberCustom: number;
19
+ hidden: Record<string, number>;
20
+ contextCount: number;
21
+ entityCount: number;
22
+ segmentCount: number;
23
+ elementCount: number;
24
+ unitCount: number;
25
+ baseTaxonomies: Record<string, number>;
26
+ report: Record<string, XbrlReport>;
27
+ tag: Record<string, Tag>;
28
+ }
29
+ export interface Dts {
30
+ inline: CalculationLink;
31
+ schema: Schema;
32
+ calculationLink: CalculationLink;
33
+ definitionLink: CalculationLink;
34
+ labelLink: CalculationLink;
35
+ presentationLink: CalculationLink;
36
+ }
37
+ export interface CalculationLink {
38
+ local: string[];
39
+ }
40
+ export interface Schema {
41
+ local: string[];
42
+ remote: string[];
43
+ }
44
+ export interface XbrlReport {
45
+ role: string;
46
+ longName: string;
47
+ shortName: string;
48
+ isDefault: boolean;
49
+ groupType: GroupType;
50
+ subGroupType: SubGroupType;
51
+ menuCat: MenuCategory;
52
+ order: number;
53
+ firstAnchor: Anchor;
54
+ uniqueAnchor: Anchor | null;
55
+ }
56
+ export interface Anchor {
57
+ contextRef: string;
58
+ name: string;
59
+ unitRef: UnitRef | null;
60
+ xsiNil: string;
61
+ lang: string;
62
+ decimals: number | null;
63
+ ancestors: string[];
64
+ reportCount: number;
65
+ baseRef: string;
66
+ first?: boolean;
67
+ unique?: boolean;
68
+ }
69
+ type UnitRef = 'entity' | 'number' | 'shares' | 'usd' | 'usdPerShare';
70
+ export declare enum GroupType {
71
+ Disclosure = "disclosure",
72
+ Document = "document",
73
+ Statement = "statement"
74
+ }
75
+ type MenuCategory = 'Cover' | 'Details' | 'Notes' | 'Policies' | 'Statements' | 'Tables';
76
+ type SubGroupType = 'details' | 'parenthetical' | 'policies' | 'tables';
77
+ export interface Tag {
78
+ xbrltype: XbrlType;
79
+ nsuri: string;
80
+ localname: string;
81
+ presentation?: string[];
82
+ lang: Record<string, {
83
+ role: TagRole;
84
+ }>;
85
+ auth_ref: string[];
86
+ crdr?: CreditOrDebit;
87
+ calculation?: {
88
+ [key: string]: Calculation;
89
+ };
90
+ }
91
+ export interface Calculation {
92
+ parentTag: null | string;
93
+ weight: number | null;
94
+ order: number | null;
95
+ root?: boolean;
96
+ }
97
+ type CreditOrDebit = 'credit' | 'debit';
98
+ export interface TagRole {
99
+ terseLabel?: string;
100
+ label: string;
101
+ documentation?: string;
102
+ negatedTerseLabel?: string;
103
+ verboseLabel?: string;
104
+ periodStartLabel?: string;
105
+ negatedPeriodEndLabel?: string;
106
+ negatedPeriodStartLabel?: string;
107
+ periodEndLabel?: string;
108
+ totalLabel?: string;
109
+ negatedLabel?: string;
110
+ negatedTotalLabel?: string;
111
+ netLabel?: string;
112
+ }
113
+ type XbrlType = 'booleanItemType' | 'centralIndexKeyItemType' | 'dateItemType' | 'decimalItemType' | 'domainItemType' | 'durationItemType' | 'edgarExchangeCodeItemType' | 'edgarStateCountryItemType' | 'employerIdItemType' | 'enumerationSetItemType' | 'fileNumberItemType' | 'filerCategoryItemType' | 'fiscalPeriodItemType' | 'gMonthDayItemType' | 'gYearItemType' | 'integerItemType' | 'internationalNameItemType' | 'monetaryItemType' | 'nonemptySequenceNumberItemType' | 'normalizedStringItemType' | 'perShareItemType' | 'percentItemType' | 'pureItemType' | 'securityTitleItemType' | 'sharesItemType' | 'stateOrProvinceItemType' | 'stringItemType' | 'submissionTypeItemType' | 'textBlockItemType' | 'tradingSymbolItemType' | 'yesNoItemType';
114
+ export interface XbrlStdRef {
115
+ role: string;
116
+ Name: string;
117
+ Section?: string;
118
+ Paragraph?: string;
119
+ SubTopic?: string;
120
+ Topic?: string;
121
+ Publisher: string;
122
+ URI?: string;
123
+ Subparagraph?: string;
124
+ Number?: string;
125
+ Subsection?: string;
126
+ Footnote?: string;
127
+ Sentence?: string;
128
+ Clause?: string;
129
+ Subclause?: string;
130
+ }
131
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroupType = void 0;
4
+ var GroupType;
5
+ (function (GroupType) {
6
+ GroupType["Disclosure"] = "disclosure";
7
+ GroupType["Document"] = "document";
8
+ GroupType["Statement"] = "statement";
9
+ })(GroupType || (exports.GroupType = GroupType = {}));
@@ -111,8 +111,8 @@ exports.calculationMapCondensed = {
111
111
  ['incomeNet', 1, 1],
112
112
  ],
113
113
  ],
114
- eps: [[['us-gaap:EarningsPerShareBasic', 1, 0]]],
115
- epsDiluted: [[['us-gaap:EarningsPerShareDiluted', 1, 0]]],
114
+ eps: [[['us-gaap:EarningsPerShareBasic', 1, 0]], [['us-gaap:EarningsPerShareBasicAndDiluted', 1, 0]]],
115
+ epsDiluted: [[['us-gaap:EarningsPerShareDiluted', 1, 0]], [['us-gaap:EarningsPerShareBasicAndDiluted', 1, 0]]],
116
116
  equityRetainedEarnings: [[['us-gaap:RetainedEarningsAccumulatedDeficit', 1, 0]]],
117
117
  equityTotal: [
118
118
  [['us-gaap:StockholdersEquity', 1, 0]],
@@ -287,6 +287,10 @@ exports.calculationMapCondensed = {
287
287
  [['us-gaap:WeightedAverageNumberOfSharesOutstandingBasic', 1, 0]],
288
288
  [['us-gaap:CommonStockSharesOutstanding', 1, 0]],
289
289
  [['dei:EntityCommonStockSharesOutstanding', 1, 0]],
290
+ [['us-gaap:WeightedAverageNumberOfSharesOutstandingBasicAndDiluted', 1, 0]],
291
+ ],
292
+ sharesOutstandingDiluted: [
293
+ [['us-gaap:WeightedAverageNumberOfDilutedSharesOutstanding', 1, 0]],
294
+ [['us-gaap:WeightedAverageNumberOfSharesOutstandingBasicAndDiluted', 1, 0]],
290
295
  ],
291
- sharesOutstandingDiluted: [[['us-gaap:WeightedAverageNumberOfDilutedSharesOutstanding', 1, 0]]],
292
296
  };
@@ -19,6 +19,10 @@ function getLabelByTaxonomy(labelLinkbase) {
19
19
  }
20
20
  // label, terseLabel, or verboseLabel
21
21
  var labelType = role.substring(role.lastIndexOf('/') + 1);
22
+ // skip periodStartLabel. Used for beginning cash position, but overwrites end cash position.
23
+ if (labelType === 'periodStartLabel') {
24
+ return;
25
+ }
22
26
  if (labelType === 'verboseLabel') {
23
27
  taxonomyWithVerboseLabels.add(taxonomy);
24
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sec-edgar-api",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Fetch and parse SEC earnings reports and other filings. Useful for financial analysis.",
5
5
  "main": "build/index.js",
6
6
  "author": "Andrew Evers (https://github.com/andyevers)",