Skip to content

Commit

Permalink
fix(schema): quoteSummary, secFilings types (fixes #646)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Aug 12, 2023
1 parent 13dcc64 commit e92702e
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 23 deletions.
49 changes: 37 additions & 12 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7230,7 +7230,21 @@
"yahooFinanceType": "date"
},
"type": {
"$ref": "#/definitions/Type"
"type": "string",
"enum": [
"10-K",
"10-Q",
"8-K",
"8-K/A",
"10-K/A",
"10-Q/A",
"SD",
"PX14A6G",
"SC 13G/A",
"DEFA14A",
"25-NSE",
"S-8 POS"
]
},
"title": {
"type": "string"
Expand All @@ -7243,6 +7257,28 @@
},
"url": {
"type": "string"
},
"exhibits": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"url": {
"type": "string"
},
"downloadUrl": {
"type": "string"
}
},
"required": [
"type",
"url"
],
"additionalProperties": false
}
}
},
"required": [
Expand All @@ -7254,17 +7290,6 @@
"maxAge"
]
},
"Type": {
"type": "string",
"enum": [
"10-K",
"10-Q",
"8-K",
"8-K/A",
"10-K/A",
"10-Q/A"
]
},
"SummaryDetail": {
"type": "object",
"properties": {
Expand Down
29 changes: 18 additions & 11 deletions src/modules/quoteSummary-iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,21 +790,28 @@ export interface Filing {
[key: string]: any;
date: string; // TODO: check the format
epochDate: Date;
type: Type;
type: FilingType;
title: string;
edgarUrl: string;
maxAge: number;
url?: string;
}

export enum Type {
The10K = "10-K",
The10Q = "10-Q",
The8K = "8-K",
The8KA = "8-K/A",
The10KA = "10-K/A",
The10QA = "10-Q/A",
}
exhibits?: { type: string; url: string; downloadUrl?: string }[];
}

// May consider switching this to string, as we keep finding more and more.
type FilingType =
| "10-K"
| "10-Q"
| "8-K"
| "8-K/A"
| "10-K/A"
| "10-Q/A"
| "SD"
| "PX14A6G"
| "SC 13G/A"
| "DEFA14A"
| "25-NSE"
| "S-8 POS";

export interface SummaryDetail {
[key: string]: any;
Expand Down
10 changes: 10 additions & 0 deletions src/modules/quoteSummary.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,16 @@ describe("quoteSummary", () => {

describe("secFilings", () => {
itValidates("secFilings");

it("something", async () => {
const result = await yf.quoteSummary(
"AAPL",
{
modules: ["secFilings"],
},
{ devel: "quoteSummary-secFilings-AAPL-new.json" }
);
});
});

describe("summaryDetail", () => {
Expand Down

0 comments on commit e92702e

Please sign in to comment.