sec-edgar-api 0.2.2 → 0.2.4

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.
Files changed (58) hide show
  1. package/README.md +5 -3
  2. package/build/services/DocumentParser/XMLParser.d.ts +5 -20
  3. package/build/services/DocumentParser/XMLParser.js +118 -122
  4. package/build/services/DocumentParser/parsers/index.d.ts +3 -5
  5. package/build/services/DocumentParser/parsers/index.js +3 -5
  6. package/build/services/DocumentParser/parsers/parse-form-13g.js +2 -2
  7. package/build/services/DocumentParser/parsers/parse-form-4.d.ts +1 -6
  8. package/build/services/DocumentParser/parsers/parse-form-4.js +204 -134
  9. package/build/services/DocumentParser/parsers/parse-form-def14a.d.ts +2 -1
  10. package/build/services/DocumentParser/parsers/parse-form-def14a.js +106 -157
  11. package/build/services/ReportBuilder/FactFiscalCalculator.d.ts +4 -0
  12. package/build/services/ReportBuilder/FactFiscalCalculator.js +4 -0
  13. package/build/services/ReportBuilder/FactPeriodResolver.d.ts +6 -2
  14. package/build/services/ReportBuilder/FactPeriodResolver.js +6 -1
  15. package/build/services/ReportBuilder/FactRecordBuilder.d.ts +4 -1
  16. package/build/services/ReportBuilder/FactRecordBuilder.js +26 -4
  17. package/build/services/ReportBuilder/FactSplitAdjuster.d.ts +12 -1
  18. package/build/services/ReportBuilder/FactSplitAdjuster.js +41 -19
  19. package/build/services/ReportBuilder/ReportBuilder.d.ts +3 -0
  20. package/build/services/ReportBuilder/ReportBuilder.js +33 -13
  21. package/build/services/ReportParser/ReportParser.d.ts +3 -3
  22. package/build/services/ReportParser/ReportParser.js +7 -4
  23. package/build/services/ReportParser/ReportRawParser.d.ts +3 -9
  24. package/build/services/ReportParser/ReportRawParser.js +5 -33
  25. package/build/services/ReportParser/ReportWrapper.js +2 -0
  26. package/build/services/ReportParser/resolvers/resolve-fiscal-year-cumulative-properties.js +2 -1
  27. package/build/services/SecEdgarApi/SecEdgarApi.d.ts +45 -84
  28. package/build/services/SecEdgarApi/SecEdgarApi.js +108 -246
  29. package/build/types/index.d.ts +2 -2
  30. package/build/types/index.js +2 -2
  31. package/build/types/parsed-filings.type.d.ts +5 -144
  32. package/build/types/report-raw.type.d.ts +3 -1
  33. package/build/types/report-translated.type.d.ts +4 -1
  34. package/build/types/submission.type.d.ts +2 -3
  35. package/build/util/key-translations.js +5 -1
  36. package/package.json +2 -5
  37. package/build/services/DocumentParser/HtmlTableExtractor.d.ts +0 -41
  38. package/build/services/DocumentParser/HtmlTableExtractor.js +0 -408
  39. package/build/services/DocumentParser/parsers/parse-current-filings.d.ts +0 -3
  40. package/build/services/DocumentParser/parsers/parse-current-filings.js +0 -98
  41. package/build/services/DocumentParser/parsers/parse-form-13f.d.ts +0 -6
  42. package/build/services/DocumentParser/parsers/parse-form-13f.js +0 -91
  43. package/build/services/ReportParser/FactItem.d.ts +0 -66
  44. package/build/services/ReportParser/FactItem.js +0 -50
  45. package/build/services/ReportParser/FactItemFactory.d.ts +0 -22
  46. package/build/services/ReportParser/FactItemFactory.js +0 -150
  47. package/build/services/ReportParser/FactIterator.d.ts +0 -18
  48. package/build/services/ReportParser/FactIterator.js +0 -35
  49. package/build/services/ReportParser/FactSplitMap.d.ts +0 -16
  50. package/build/services/ReportParser/FactSplitMap.js +0 -101
  51. package/build/types/current-filings-xml.type.d.ts +0 -74
  52. package/build/types/current-filings-xml.type.js +0 -6
  53. package/build/types/current-filings.type.d.ts +0 -44
  54. package/build/types/current-filings.type.js +0 -2
  55. package/build/types/form-13f-xml.type.d.ts +0 -105
  56. package/build/types/form-13f-xml.type.js +0 -2
  57. package/build/types/form-4-xml.type.d.ts +0 -132
  58. package/build/types/form-4-xml.type.js +0 -2
@@ -4,6 +4,9 @@ var FactFiscalCalculator_1 = require("./FactFiscalCalculator");
4
4
  var FactPeriodResolver_1 = require("./FactPeriodResolver");
5
5
  var FactRecordBuilder_1 = require("./FactRecordBuilder");
6
6
  var FactSplitAdjuster_1 = require("./FactSplitAdjuster");
7
+ /**
8
+ * Builds ReportRaw objects from facts. also applies splits and adjusts for fiscal periods.
9
+ */
7
10
  var ReportBuilder = /** @class */ (function () {
8
11
  function ReportBuilder() {
9
12
  this.factRecordBuilder = new FactRecordBuilder_1.default();
@@ -12,7 +15,7 @@ var ReportBuilder = /** @class */ (function () {
12
15
  return this.factRecordBuilder.createFacts(companyFacts);
13
16
  };
14
17
  ReportBuilder.prototype.buildReports = function (params) {
15
- var _a, _b, _c, _d, _e, _f, _g;
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
16
19
  var facts = params.facts, reportDates = params.reportDates;
17
20
  if (facts.length === 0) {
18
21
  return [];
@@ -34,6 +37,8 @@ var ReportBuilder = /** @class */ (function () {
34
37
  var minYear = Infinity;
35
38
  var maxYear = -Infinity;
36
39
  var countByAccnByYearQuarter = new Map();
40
+ var filedByPropertyYearQuarterValue = new Map();
41
+ var filedLastByPropertyYearQuarterValue = new Map();
37
42
  for (var _i = 0, facts_1 = facts; _i < facts_1.length; _i++) {
38
43
  var fact = facts_1[_i];
39
44
  var end = fact.end, name_1 = fact.name, unit = fact.unit, segments = fact.segments, start = fact.start, value = fact.value, cik = fact.cik, form = fact.form, filed = fact.filed, accn = fact.accn;
@@ -43,27 +48,41 @@ var ReportBuilder = /** @class */ (function () {
43
48
  var segmentValue = segments === null || segments === void 0 ? void 0 : segments.map(function (seg) { return "".concat(seg.dimension, "_").concat(seg.value); }).join('&');
44
49
  var propertyName = (_a = name_1.split(':').pop()) !== null && _a !== void 0 ? _a : '';
45
50
  var propertyNameWithSegment = propertyName + (segmentValue ? "_".concat(segmentValue) : '');
46
- var _h = factFiscalCalculator.getFiscalYearQuarter({ dateStr: end }), quarter = _h.quarter, year = _h.year;
51
+ var _m = factFiscalCalculator.getFiscalYearQuarter({ dateStr: end }), quarter = _m.quarter, year = _m.year;
47
52
  if (year < minYear)
48
53
  minYear = year;
49
54
  if (year > maxYear)
50
55
  maxYear = year;
51
56
  var splitKey = "".concat(year, "_").concat(value);
57
+ var factFiledKey = "".concat(year, "_").concat(quarter, "_").concat(propertyNameWithSegment, "_").concat(value);
52
58
  var isSplit = factSplitAdjuster.isSplitProperty(propertyName);
53
59
  unitByPropertyName.set(propertyNameWithSegment, unit);
54
- if (isSplit && new Date(end) > new Date((_c = (_b = splitDateDataByKey.get(splitKey)) === null || _b === void 0 ? void 0 : _b.end) !== null && _c !== void 0 ? _c : 0)) {
55
- splitDateDataByKey.set(splitKey, { end: end, quarter: quarter });
60
+ var prevFirstFiled = filedByPropertyYearQuarterValue.get(factFiledKey);
61
+ var prevLastFiled = filedLastByPropertyYearQuarterValue.get(factFiledKey);
62
+ if (!prevFirstFiled || prevFirstFiled > filed) {
63
+ filedByPropertyYearQuarterValue.set(factFiledKey, filed);
64
+ }
65
+ if (!prevLastFiled || prevLastFiled < filed) {
66
+ filedLastByPropertyYearQuarterValue.set(factFiledKey, filed);
67
+ }
68
+ if (isSplit) {
69
+ var isNewLatestDate = new Date(end) > new Date((_c = (_b = splitDateDataByKey.get(splitKey)) === null || _b === void 0 ? void 0 : _b.end) !== null && _c !== void 0 ? _c : 0);
70
+ splitDateDataByKey.set(splitKey, {
71
+ end: isNewLatestDate ? end : (_e = (_d = splitDateDataByKey.get(splitKey)) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : end,
72
+ quarter: isNewLatestDate ? quarter : (_g = (_f = splitDateDataByKey.get(splitKey)) === null || _f === void 0 ? void 0 : _f.quarter) !== null && _g !== void 0 ? _g : quarter,
73
+ firstFiled: (_h = filedByPropertyYearQuarterValue.get(factFiledKey)) !== null && _h !== void 0 ? _h : filed,
74
+ lastFiled: (_j = filedLastByPropertyYearQuarterValue.get(factFiledKey)) !== null && _j !== void 0 ? _j : filed,
75
+ });
56
76
  }
57
77
  var accnKey = "".concat(year, "_").concat(quarter);
58
78
  var accnGiven = accessionByYearQuarter.get(accnKey);
59
79
  var filedDistance = Math.abs(new Date(filed).getTime() - new Date(end !== null && end !== void 0 ? end : 0).getTime()) / 86400000;
60
80
  var isFiledRecent = filedDistance < 60;
61
81
  if (!accnGiven && isFiledRecent && accn && (!form || form === '10-K' || form === '10-Q')) {
62
- var countByAccn = (_d = countByAccnByYearQuarter.get(accnKey)) !== null && _d !== void 0 ? _d : new Map();
63
- countByAccn.set(accn, ((_e = countByAccn.get(accn)) !== null && _e !== void 0 ? _e : 0) + 1);
82
+ var countByAccn = (_k = countByAccnByYearQuarter.get(accnKey)) !== null && _k !== void 0 ? _k : new Map();
83
+ countByAccn.set(accn, ((_l = countByAccn.get(accn)) !== null && _l !== void 0 ? _l : 0) + 1);
64
84
  countByAccnByYearQuarter.set(accnKey, countByAccn);
65
85
  }
66
- var dates = factFiscalCalculator.getDatesByYearQuarter({ quarter: quarter, year: year });
67
86
  factPeriodResolver.add({
68
87
  year: year,
69
88
  start: start,
@@ -71,8 +90,7 @@ var ReportBuilder = /** @class */ (function () {
71
90
  name: propertyNameWithSegment,
72
91
  quarter: quarter,
73
92
  value: value,
74
- dateFiled: (_f = dates === null || dates === void 0 ? void 0 : dates.filed) !== null && _f !== void 0 ? _f : '',
75
- dateReport: (_g = dates === null || dates === void 0 ? void 0 : dates.end) !== null && _g !== void 0 ? _g : '',
93
+ filed: filed,
76
94
  });
77
95
  }
78
96
  countByAccnByYearQuarter.forEach(function (countByAccn, yearQuarter) {
@@ -93,12 +111,12 @@ var ReportBuilder = /** @class */ (function () {
93
111
  var reportsByKey = new Map();
94
112
  // resolves quarterly and annual properties and creates reports
95
113
  factPeriodResolver.forEach(function (data) {
96
- var _a;
114
+ var _a, _b;
97
115
  var fiscalPeriod = data.fiscalPeriod, propertyName = data.propertyName, value = data.value, year = data.year;
98
116
  var key = "".concat(year, "_").concat(fiscalPeriod);
99
117
  var quarter = fiscalPeriod === 'FY' ? 4 : Number(fiscalPeriod[1]);
100
118
  var dates = factFiscalCalculator.getDatesByYearQuarter({ quarter: quarter, year: year });
101
- var _b = dates !== null && dates !== void 0 ? dates : { filed: '', end: '' }, filed = _b.filed, end = _b.end;
119
+ var _c = dates !== null && dates !== void 0 ? dates : { filed: '', end: '' }, filed = _c.filed, end = _c.end;
102
120
  var accessionNumber = accessionByYearQuarter.get("".concat(year, "_").concat(quarter));
103
121
  var accessionNoHyphen = accessionNumber === null || accessionNumber === void 0 ? void 0 : accessionNumber.replace(/-/g, '');
104
122
  var url = accessionNumber
@@ -116,13 +134,15 @@ var ReportBuilder = /** @class */ (function () {
116
134
  splitRatio: null,
117
135
  });
118
136
  }
137
+ var filedKey = "".concat(year, "_").concat(quarter, "_").concat(propertyName, "_").concat(value);
119
138
  // add facts to adjust for splits
120
139
  factSplitAdjuster.add({
121
140
  end: end,
122
- filed: filed,
141
+ // use the original fact filed date instead of the report filed date to know if the fact has been split.
142
+ filed: (_a = filedByPropertyYearQuarterValue.get(filedKey)) !== null && _a !== void 0 ? _a : filed,
123
143
  fiscalPeriod: fiscalPeriod,
124
144
  name: propertyName,
125
- unit: (_a = unitByPropertyName.get(propertyName)) !== null && _a !== void 0 ? _a : '',
145
+ unit: (_b = unitByPropertyName.get(propertyName)) !== null && _b !== void 0 ? _b : '',
126
146
  year: year,
127
147
  value: Number(value),
128
148
  accn: accessionNumber !== null && accessionNumber !== void 0 ? accessionNumber : '',
@@ -23,7 +23,7 @@ export default class ReportParser {
23
23
  *
24
24
  * @param companyFactListData This is the json file contents of CIK[number].json file from the SEC website. You can find these using their API or by downloading the companyfacts.zip file: https://www.sec.gov/edgar/sec-api-documentation
25
25
  */
26
- parseReports(companyFactListData: Pick<CompanyFactListData, 'facts'>, usePropertyResolver?: boolean): ReportWrapper[];
26
+ parseReports(companyFactListData: CompanyFactListData, usePropertyResolver?: boolean): ReportWrapper[];
27
27
  /**
28
28
  * Same as parseReports but accepts ReportRaw[] instead of CompanyFactListData
29
29
  */
@@ -33,11 +33,11 @@ export default class ReportParser {
33
33
  *
34
34
  * @see https://www.sec.gov/edgar/sec-api-documentation
35
35
  */
36
- parseReportsRaw(companyFactListData: Pick<CompanyFactListData, 'facts'>): ReportRaw[];
36
+ parseReportsRaw(companyFactListData: CompanyFactListData): ReportRaw[];
37
37
  /**
38
38
  * parseReportsRaw but removes meta data from the report
39
39
  */
40
- parseReportsRawNoMeta(companyFactListData: Pick<CompanyFactListData, 'facts'>): Record<string, number>[];
40
+ parseReportsRawNoMeta(companyFactListData: CompanyFactListData): Record<string, number>[];
41
41
  /**
42
42
  * Translate ReportRaw to ReportTranslated by default, but can be used to translate to any object using both the callback and keyTranslator
43
43
  *
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var key_translations_1 = require("../../util/key-translations");
4
+ var ReportRawResolvable_1 = require("../ReportBuilder/ReportRawResolvable");
4
5
  var PropertyResolver_1 = require("./PropertyResolver");
5
6
  var ReportRawParser_1 = require("./ReportRawParser");
6
7
  var ReportWrapper_1 = require("./ReportWrapper");
@@ -79,22 +80,24 @@ var ReportParser = /** @class */ (function () {
79
80
  ReportParser.prototype.translateReportsRaw = function (reportsRaw, callback, keyTranslator) {
80
81
  var keyTranslations = (keyTranslator !== null && keyTranslator !== void 0 ? keyTranslator : this.keyTranslator);
81
82
  var reports = [];
82
- reportsRaw.forEach(function (reportRaw) {
83
+ reportsRaw.forEach(function (report) {
83
84
  var reportNew = {};
85
+ var reportRaw = new ReportRawResolvable_1.default(report);
84
86
  // iterate translation keys, ensuring same order and priority
85
87
  for (var key in keyTranslations) {
86
88
  var keysRaw = keyTranslations[key];
87
89
  reportNew[key] = null;
88
90
  for (var _i = 0, keysRaw_1 = keysRaw; _i < keysRaw_1.length; _i++) {
89
91
  var keyRaw = keysRaw_1[_i];
90
- if (reportRaw[keyRaw] === undefined)
92
+ var value = reportRaw.get(keyRaw);
93
+ if (value === undefined)
91
94
  continue;
92
- reportNew[key] = reportRaw[keyRaw];
95
+ reportNew[key] = value;
93
96
  break;
94
97
  }
95
98
  }
96
99
  var reportFiltered = callback
97
- ? callback(reportNew, reportRaw, keyTranslations)
100
+ ? callback(reportNew, reportRaw.report, keyTranslations)
98
101
  : reportNew;
99
102
  reports.push(reportFiltered);
100
103
  });
@@ -1,11 +1,5 @@
1
- import { CompanyFactListData, ReportRaw } from '../../types';
2
- import FactItemFactory from './FactItemFactory';
3
- interface ReportRawParserArgs {
4
- factItemFactory?: FactItemFactory;
5
- }
1
+ import { CompanyFactListData } from '../../types';
6
2
  export default class ReportRawParser {
7
- private readonly factItemFactory;
8
- constructor(args?: ReportRawParserArgs);
9
- parseReports(companyFactListData: Pick<CompanyFactListData, 'facts'>): ReportRaw[];
3
+ private readonly reportBuilder;
4
+ parseReports(companyFactListData: CompanyFactListData): import("../../types").ReportRaw[];
10
5
  }
11
- export {};
@@ -1,41 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var FactItemFactory_1 = require("./FactItemFactory");
3
+ var ReportBuilder_1 = require("../ReportBuilder");
4
4
  var ReportRawParser = /** @class */ (function () {
5
- function ReportRawParser(args) {
6
- var _a = (args !== null && args !== void 0 ? args : {}).factItemFactory, factItemFactory = _a === void 0 ? new FactItemFactory_1.default() : _a;
7
- this.factItemFactory = factItemFactory;
5
+ function ReportRawParser() {
6
+ this.reportBuilder = new ReportBuilder_1.default();
8
7
  }
9
8
  ReportRawParser.prototype.parseReports = function (companyFactListData) {
10
- var _a;
11
- var _b = this.factItemFactory.createFactItems(companyFactListData), factItems = _b.factItems, factSplitMap = _b.factSplitMap;
12
- var reportByYearPeriod = new Map();
13
- for (var _i = 0, factItems_1 = factItems; _i < factItems_1.length; _i++) {
14
- var factItem = factItems_1[_i];
15
- if (!factItem.factValue.frame) {
16
- continue;
17
- }
18
- var key = "".concat(factItem.fiscalYear, "-").concat(factItem.fiscalPeriod);
19
- var report = (_a = reportByYearPeriod.get(key)) !== null && _a !== void 0 ? _a : {
20
- dateReport: factItem.fiscalPeriodEnd,
21
- dateFiled: factItem.fiscalPeriodFiled,
22
- fiscalPeriod: factItem.fiscalPeriod,
23
- fiscalYear: factItem.fiscalYear,
24
- splitRatio: null,
25
- splitDate: null,
26
- };
27
- if (factSplitMap.isSplitFact(factItem)) {
28
- report.splitRatio = factItem.factValue.val;
29
- report.splitDate = factItem.factValue.end;
30
- }
31
- report[factItem.propertyName] = factSplitMap.getSplitAdjustedValue(factItem);
32
- reportByYearPeriod.set(key, report);
33
- }
34
- return Array.from(reportByYearPeriod.values()).sort(function (a, b) {
35
- var keyA = "".concat(a.dateReport, "_").concat(a.fiscalPeriod === 'FY' ? 'Q5' : a.fiscalPeriod);
36
- var keyB = "".concat(b.dateReport, "_").concat(b.fiscalPeriod === 'FY' ? 'Q5' : b.fiscalPeriod);
37
- return keyA < keyB ? -1 : 1;
38
- });
9
+ var facts = this.reportBuilder.createFacts(companyFactListData).facts;
10
+ return this.reportBuilder.buildReports({ facts: facts });
39
11
  };
40
12
  return ReportRawParser;
41
13
  }());
@@ -28,6 +28,8 @@ var ReportWrapper = /** @class */ (function (_super) {
28
28
  _this.report = report;
29
29
  _this.reportMap = reportMap !== null && reportMap !== void 0 ? reportMap : new Map();
30
30
  _this.reportRaw = reportRaw !== null && reportRaw !== void 0 ? reportRaw : {
31
+ cik: report.cik,
32
+ url: report.url,
31
33
  dateFiled: report.dateFiled,
32
34
  dateReport: report.dateReport,
33
35
  fiscalPeriod: (_a = report.fiscalPeriod) !== null && _a !== void 0 ? _a : '',
@@ -62,7 +62,8 @@ function resolveFiscalYearCumulativeProperties(report) {
62
62
  var rep = _c[_b];
63
63
  if (rep && typeof rep[key] !== 'number') {
64
64
  ;
65
- rep[key] = valueFY - sumQuarters;
65
+ rep[key] =
66
+ Math.round((valueFY - sumQuarters) * 10000) / 10000;
66
67
  break;
67
68
  }
68
69
  }
@@ -1,16 +1,17 @@
1
- import { CompanyFactFrame, CompanyFactListData, CompanyTickerItem, FieldDataResponse, FiscalPeriod, MultiCompanyFactFrame, ReportRaw, ReportTranslated } from '../../types';
1
+ import { CompanyFactFrame, CompanyFactListData, CompanyTickerItem, FieldDataResponse, Form10KData, Form13GData, Form4Data, FormDef14aData, MultiCompanyFactFrame, ReportRaw, ReportTranslated } from '../../types';
2
2
  import { FilingListDetails, FilingListItemTranslated, SubmissionList } from '../../types/submission.type';
3
3
  import { IClient } from '../Client';
4
- import _parsers from '../DocumentParser/parsers';
4
+ import DocumentParser from '../DocumentParser';
5
5
  import ReportParser from '../ReportParser';
6
6
  import ReportWrapper from '../ReportParser/ReportWrapper';
7
+ import SubmissionRequestWrapper from './RequestWrapper';
7
8
  import { IThrottler } from './Throttler';
8
9
  interface SecApiArgs {
9
10
  throttler: IThrottler;
10
11
  client: IClient;
11
12
  cikBySymbol: Record<string, number>;
12
13
  reportParser: ReportParser;
13
- parsers: typeof _parsers;
14
+ documentParser: DocumentParser;
14
15
  }
15
16
  export interface CreateRequestWrapperParams {
16
17
  /** symbol or cik */
@@ -46,7 +47,12 @@ export interface GetDocumentXMLParams {
46
47
  /** symbol or cik */
47
48
  symbol: string | number;
48
49
  accessionNumber: string;
49
- primaryDocument?: string;
50
+ primaryDocument: string;
51
+ }
52
+ export interface GetSubmissionsParams {
53
+ /** symbol or cik */
54
+ symbol: string;
55
+ includeTranslated?: boolean;
50
56
  }
51
57
  /**
52
58
  * Gets reports from companies filed with the SEC
@@ -60,12 +66,11 @@ export default class SecEdgarApi {
60
66
  private readonly client;
61
67
  readonly cikBySymbol: Record<string, number>;
62
68
  readonly reportParser: ReportParser;
63
- private readonly parsers;
69
+ readonly documentParser: DocumentParser;
64
70
  constructor(args?: SecApiArgs);
65
71
  private request;
66
72
  private mapFilingListDetails;
67
- private filterSubmissionsInFiscalPeriodAsc;
68
- private extractSubmissionsWithXml;
73
+ private getCreateRequestSubmissions;
69
74
  /**
70
75
  * If symbol is not in cikBySymbol, assume it is a cik. does not make a request
71
76
  */
@@ -80,7 +85,7 @@ export default class SecEdgarApi {
80
85
  *
81
86
  * endpoint: `/submissions/CIK${cik}.json`
82
87
  */
83
- getSubmissions(params: GetSymbolParams): Promise<SubmissionList>;
88
+ getSubmissions(params: GetSubmissionsParams): Promise<SubmissionList>;
84
89
  /**
85
90
  * The company-concept API returns all the XBRL disclosures from a single company (CIK)
86
91
  * and concept (a taxonomy and tag) into a single JSON file, with a separate array
@@ -153,8 +158,7 @@ export default class SecEdgarApi {
153
158
  */
154
159
  getMutualFundList(): Promise<FieldDataResponse<'cik' | 'seriesId' | 'classId' | 'symbol'>>;
155
160
  /**
156
- * Gets a raw xml document string. the parameters are found in the submission list response.
157
- * (response.filings.recent or response.filings.recentTranslated)
161
+ * Gets a raw xml document string. the parameters are found in the submission list response. (response.filings.recent or response.filings.recentTranslated)
158
162
  *
159
163
  * Some form types can be parsed using the DocumentParser such as form 4 (insider transactions) and form 13g (institutional holders)
160
164
  *
@@ -176,94 +180,51 @@ export default class SecEdgarApi {
176
180
  url: string;
177
181
  }): Promise<string>;
178
182
  /**
179
- * Used for getting security holdings.
180
- *
181
- * Forms: 13F, 13F/A, 13F-HR, 13F-HR/A
183
+ * Used for getting insider transactions. extracts insider transaction urls from submission list response, and parses the xml doc.
182
184
  *
183
- * Extracts holdings urls from submission list response, and parses the xml doc.
185
+ * ```ts
186
+ * const submissions = await secEdgarApi.getSubmissions({ symbol: 'AAPL' })
187
+ * const requestWrapper = secEdgarApi.createRequestInsiderTransactions({ symbol: 'AAPL', filings: submissions.filings.recent })
184
188
  *
185
- * Sends 2 requests by default, 1 request if submissions is provided, and 0 requests if documentXml is provided.
186
- *
187
- * WARNING: XML and HTML docs can be formatted differently and is prone to innacuracies.
189
+ * const transactions1 = (await requestWrapper.requestNext()).result.transactions // array of transactions from most recent doc
190
+ * const transactions2 = (await requestWrapper.requestNext()).result.transactions // array of transactions from second most recent doc
191
+ * ```
188
192
  */
189
- getHoldings(params: {
190
- symbol: string;
191
- lookback?: number;
192
- fiscalYear?: number;
193
- fiscalPeriod?: FiscalPeriod;
194
- submissions?: SubmissionList;
195
- documentXml?: string;
196
- }): Promise<{
197
- url: string | null;
198
- holdingsForm: import("../../types").Form13FData | null;
199
- submissions: FilingListItemTranslated[];
200
- }>;
193
+ createRequestInsiderTransactions(params: CreateRequestWrapperParams): SubmissionRequestWrapper<Form4Data>;
201
194
  /**
202
- * Gets institutional holders that have a large stake in the company.
203
- * If multiple submissions are found within the fiscal period, uses the first submission.
204
- *
205
- * Forms: SC 13G, SC 13G/A
195
+ * Used for getting institutional holders. extracts holders urls from submission list response, and parses the xml doc.
206
196
  *
207
- * Sends 2 requests by default, 1 request if submissions is provided, and 0 requests if documentXml is provided.
197
+ * ```ts
198
+ * const submissions = await secEdgarApi.getSubmissions({ symbol: 'AAPL' })
199
+ * const requestWrapper = secEdgarApi.createRequestInstitutionalHolders({ symbol: 'AAPL', filings: submissions.filings.recent })
208
200
  *
209
- * WARNING: XML and HTML docs can be formatted differently and is prone to innacuracies.
201
+ * const holders1 = (await requestWrapper.requestNext()).result.holders // array of holders from most recent doc
202
+ * const holders2 = (await requestWrapper.requestNext()).result.holders // array of holders from second most recent doc
203
+ * ```
210
204
  */
211
- getInstitutionalHolders(params: {
212
- symbol: string;
213
- lookback?: number;
214
- fiscalPeriod?: FiscalPeriod;
215
- fiscalYear?: number;
216
- submissions?: SubmissionList;
217
- documentXml?: string;
218
- }): Promise<{
219
- url: string | null;
220
- institutionalHolders: import("../../types").InstitutionalHolder[];
221
- submissions: FilingListItemTranslated[];
222
- }>;
205
+ createRequestInstitutionalHolders(params: CreateRequestWrapperParams): SubmissionRequestWrapper<Form13GData>;
223
206
  /**
224
- * Gets executive compensation from the proxy statement.
207
+ * Used for getting earnings report tables from submission files.
225
208
  *
226
- * Forms: DEF 14A
209
+ * ```ts
210
+ * const submissions = await secEdgarApi.getSubmissions({ symbol: 'AAPL' })
211
+ * const requestWrapper = secEdgarApi.createRequesEarningsReports({ symbol: 'AAPL', filings: submissions.filings.recent })
227
212
  *
228
- * Sends 2 requests by default, 1 request if submissions is provided, and 0 requests if documentXml is provided.
229
- *
230
- * WARNING: XML and HTML docs can be formatted differently and is prone to innacuracies.
213
+ * const tables1 = (await requestWrapper.requestNext()).result.tables // array of tables from most recent doc
214
+ * const tables2 = (await requestWrapper.requestNext()).result.tables // array of tables from second most recent doc
215
+ * ```
231
216
  */
232
- getExecutivesCompensation(params: {
233
- symbol: string;
234
- lookback?: number;
235
- fiscalYear?: number;
236
- submissions?: SubmissionList;
237
- documentXml?: string;
238
- }): Promise<{
239
- url: string | null;
240
- executiveCompensation: import("../../types").ExecutiveCompensation[];
241
- submissions: FilingListItemTranslated[];
242
- }>;
217
+ createRequestEarningsReports(params: CreateRequestWrapperParams): SubmissionRequestWrapper<Form10KData>;
243
218
  /**
244
- * Gets insider transactions - when a company's executives buy or sell shares, options, or other securities in the company.
245
- *
246
- * Forms: 4, 4/A, 5, 5/A
219
+ * Proxy statement includes list of holders, executiveCompensation, and other tables. returns FormDef14aData
247
220
  *
248
- * Sends 2 requests by default, 1 request if submissions is provided, and 0 requests if documentXml is provided.
221
+ * ```ts
222
+ * const submissions = await secEdgarApi.getSubmissions({ symbol: 'AAPL' })
223
+ * const requestWrapper = secEdgarApi.createRequesProxyStatement({ symbol: 'AAPL', filings: submissions.filings.recent })
249
224
  *
250
- * WARNING: XML and HTML docs can be formatted differently and is prone to innacuracies.
251
- */
252
- getInsiderTransaction(params: {
253
- symbol: string;
254
- lookback: number;
255
- submissions?: SubmissionList;
256
- documentXml?: string;
257
- }): Promise<{
258
- url: string | null;
259
- insiderTransaction: import("../../types").Form4Data | null;
260
- submissions: FilingListItemTranslated[];
261
- }>;
262
- /**
263
- * @see https://www.sec.gov/structureddata/rss-feeds-submitted-filings
225
+ * const { holders, executiveCompensation } = (await requestWrapper.requestNext()).result
226
+ * ```
264
227
  */
265
- getCurrentFilings(params?: {
266
- taxonomy?: 'usGaap' | 'mutualFund' | 'inlineXbrl' | 'allXbrl';
267
- }): Promise<import("../../types/current-filings.type").CurrentFilingsList | null>;
228
+ createRequestProxyStatement(params: CreateRequestWrapperParams): SubmissionRequestWrapper<FormDef14aData>;
268
229
  }
269
230
  export {};