diff --git a/schema.json b/schema.json index e92a608c..0d45c04c 100644 --- a/schema.json +++ b/schema.json @@ -11,6 +11,16 @@ ], "type": "string" }, + "AnySchemaObject": { + "anyOf": [ + { + "$ref": "#/definitions/SchemaObject" + }, + { + "$ref": "#/definitions/AsyncSchema" + } + ] + }, "AssetProfile": { "additionalProperties": false, "properties": { @@ -85,21 +95,31 @@ } }, "required": [ - "address1", - "city", - "zip", - "country", "phone", - "website", - "industry", - "sector", "longBusinessSummary", - "fullTimeEmployees", "companyOfficers", "maxAge" ], "type": "object" }, + "AsyncSchema": { + "properties": { + "$async": { + "const": true, + "type": "boolean" + }, + "$id": { + "type": "string" + }, + "$schema": { + "type": "string" + } + }, + "required": [ + "$async" + ], + "type": "object" + }, "AutocOptions": { "additionalProperties": false, "properties": { @@ -163,6 +183,25 @@ ], "type": "object" }, + "BadRequestError": { + "additionalProperties": false, + "properties": { + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "stack": { + "type": "string" + } + }, + "required": [ + "message", + "name" + ], + "type": "object" + }, "BalanceSheetHistory": { "additionalProperties": false, "properties": { @@ -510,11 +549,17 @@ "beta": { "yahooFinanceType": "number" }, + "beta3Year": { + "yahooFinanceType": "number" + }, "bookValue": { "yahooFinanceType": "number" }, "category": { - "type": "null" + "type": [ + "null", + "string" + ] }, "dateShortInterest": { "yahooFinanceType": "number" @@ -531,6 +576,9 @@ "enterpriseValue": { "yahooFinanceType": "number" }, + "fiveYearAverageReturn": { + "yahooFinanceType": "number" + }, "floatShares": { "yahooFinanceType": "number" }, @@ -541,7 +589,13 @@ "yahooFinanceType": "number" }, "fundFamily": { - "type": "null" + "type": [ + "null", + "string" + ] + }, + "fundInceptionDate": { + "yahooFinanceType": "date" }, "heldPercentInsiders": { "yahooFinanceType": "number" @@ -568,7 +622,10 @@ ] }, "legalType": { - "type": "null" + "type": [ + "null", + "string" + ] }, "maxAge": { "yahooFinanceType": "number" @@ -615,32 +672,29 @@ "shortRatio": { "yahooFinanceType": "number" }, + "threeYearAverageReturn": { + "yahooFinanceType": "number" + }, + "totalAssets": { + "yahooFinanceType": "number" + }, "trailingEps": { "yahooFinanceType": "number" + }, + "yield": { + "yahooFinanceType": "number" + }, + "ytdReturn": { + "yahooFinanceType": "number" } }, "required": [ "maxAge", "priceHint", - "enterpriseValue", - "profitMargins", - "floatShares", - "sharesOutstanding", - "heldPercentInsiders", - "heldPercentInstitutions", - "beta", "category", - "bookValue", - "priceToBook", "fundFamily", "legalType", - "lastFiscalYearEnd", - "nextFiscalYearEnd", - "mostRecentQuarter", - "trailingEps", - "lastSplitFactor", - "52WeekChange", - "SandP52WeekChange" + "lastSplitFactor" ], "type": "object" }, @@ -904,6 +958,41 @@ ], "type": "object" }, + "ErrorObject": { + "additionalProperties": false, + "properties": { + "data": {}, + "dataPath": { + "type": "string" + }, + "keyword": { + "type": "string" + }, + "message": { + "type": "string" + }, + "params": { + "type": "object" + }, + "parentSchema": { + "$ref": "#/definitions/AnySchemaObject" + }, + "propertyName": { + "type": "string" + }, + "schema": {}, + "schemaPath": { + "type": "string" + } + }, + "required": [ + "keyword", + "dataPath", + "schemaPath", + "params" + ], + "type": "object" + }, "Estimate": { "additionalProperties": false, "properties": { @@ -919,6 +1008,40 @@ ], "type": "object" }, + "FailedYahooValidationError": { + "additionalProperties": false, + "properties": { + "errors": { + "anyOf": [ + { + "type": "null" + }, + { + "items": { + "$ref": "#/definitions/ErrorObject" + }, + "type": "array" + } + ] + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "result": {}, + "stack": { + "type": "string" + } + }, + "required": [ + "message", + "name", + "result" + ], + "type": "object" + }, "Filing": { "additionalProperties": false, "properties": { @@ -1111,6 +1234,358 @@ ], "type": "object" }, + "FundPerformance": { + "additionalProperties": false, + "properties": { + "annualTotalReturns": { + "$ref": "#/definitions/FundPerformanceReturns" + }, + "maxAge": { + "yahooFinanceType": "number" + }, + "pastQuarterlyReturns": { + "$ref": "#/definitions/FundPerformanceReturns" + }, + "performanceOverview": { + "$ref": "#/definitions/FundPerformancePerformanceOverview" + }, + "performanceOverviewCat": { + "$ref": "#/definitions/FundPerformancePerformanceOverviewCat" + }, + "riskOverviewStatistics": { + "$ref": "#/definitions/FundPerformanceRiskOverviewStats" + }, + "riskOverviewStatisticsCat": { + "$ref": "#/definitions/FundPerformanceRiskOverviewStatsCat" + }, + "trailingReturns": { + "$ref": "#/definitions/FundPerformanceTrailingReturns" + }, + "trailingReturnsCat": { + "$ref": "#/definitions/FundPerformanceTrailingReturns" + }, + "trailingReturnsNav": { + "$ref": "#/definitions/FundPerformanceTrailingReturns" + } + }, + "required": [ + "maxAge", + "performanceOverview", + "performanceOverviewCat", + "trailingReturns", + "trailingReturnsNav", + "trailingReturnsCat", + "annualTotalReturns", + "pastQuarterlyReturns", + "riskOverviewStatistics", + "riskOverviewStatisticsCat" + ], + "type": "object" + }, + "FundPerformancePerformanceOverview": { + "additionalProperties": false, + "properties": { + "asOfDate": { + "yahooFinanceType": "date" + }, + "oneYearTotalReturn": { + "yahooFinanceType": "number" + }, + "threeYearTotalReturn": { + "yahooFinanceType": "number" + }, + "ytdReturnPct": { + "yahooFinanceType": "number" + } + }, + "required": [ + "asOfDate", + "ytdReturnPct", + "oneYearTotalReturn", + "threeYearTotalReturn" + ], + "type": "object" + }, + "FundPerformancePerformanceOverviewCat": { + "additionalProperties": false, + "properties": { + "fiveYrAvgReturnPct": { + "yahooFinanceType": "number" + }, + "ytdReturnPct": { + "yahooFinanceType": "number" + } + }, + "required": [ + "ytdReturnPct", + "fiveYrAvgReturnPct" + ], + "type": "object" + }, + "FundPerformanceReturns": { + "additionalProperties": false, + "properties": { + "returns": { + "items": { + "$ref": "#/definitions/FundPerformanceReturnsRow" + }, + "type": "array" + }, + "returnsCat": { + "items": { + "$ref": "#/definitions/FundPerformanceReturnsRow" + }, + "type": "array" + } + }, + "required": [ + "returns" + ], + "type": "object" + }, + "FundPerformanceReturnsRow": { + "additionalProperties": false, + "properties": { + "annualValue": { + "yahooFinanceType": "number" + }, + "year": { + "yahooFinanceType": "number" + } + }, + "required": [ + "year" + ], + "type": "object" + }, + "FundPerformanceRiskOverviewStats": { + "additionalProperties": false, + "properties": { + "riskStatistics": { + "items": { + "$ref": "#/definitions/FundPerformanceRiskOverviewStatsRow" + }, + "type": "array" + } + }, + "required": [ + "riskStatistics" + ], + "type": "object" + }, + "FundPerformanceRiskOverviewStatsCat": { + "additionalProperties": false, + "properties": { + "riskStatisticsCat": { + "items": { + "$ref": "#/definitions/FundPerformanceRiskOverviewStatsRow" + }, + "type": "array" + } + }, + "required": [ + "riskStatisticsCat" + ], + "type": "object" + }, + "FundPerformanceRiskOverviewStatsRow": { + "additionalProperties": false, + "properties": { + "alpha": { + "yahooFinanceType": "number" + }, + "beta": { + "yahooFinanceType": "number" + }, + "meanAnnualReturn": { + "yahooFinanceType": "number" + }, + "rSquared": { + "yahooFinanceType": "number" + }, + "sharpeRatio": { + "yahooFinanceType": "number" + }, + "stdDev": { + "yahooFinanceType": "number" + }, + "treynorRatio": { + "yahooFinanceType": "number" + }, + "year": { + "type": "string" + } + }, + "required": [ + "year", + "alpha", + "beta", + "meanAnnualReturn", + "rSquared", + "stdDev", + "sharpeRatio", + "treynorRatio" + ], + "type": "object" + }, + "FundPerformanceTrailingReturns": { + "additionalProperties": false, + "properties": { + "asOfDate": { + "yahooFinanceType": "date" + }, + "fiveYear": { + "yahooFinanceType": "number" + }, + "lastBearMkt": { + "yahooFinanceType": "number" + }, + "lastBullMkt": { + "yahooFinanceType": "number" + }, + "oneMonth": { + "yahooFinanceType": "number" + }, + "oneYear": { + "yahooFinanceType": "number" + }, + "tenYear": { + "yahooFinanceType": "number" + }, + "threeMonth": { + "yahooFinanceType": "number" + }, + "threeYear": { + "yahooFinanceType": "number" + }, + "ytd": { + "yahooFinanceType": "number" + } + }, + "required": [ + "ytd", + "oneMonth" + ], + "type": "object" + }, + "FundProfile": { + "additionalProperties": false, + "properties": { + "brokerages": { + "items": { + "$ref": "#/definitions/FundProfileBrokerage" + }, + "type": "array" + }, + "categoryName": { + "type": "string" + }, + "family": { + "type": "string" + }, + "feesExpensesInvestment": { + "$ref": "#/definitions/FundProfileFeesExpensesInvestment" + }, + "feesExpensesInvestmentCat": { + "$ref": "#/definitions/FundProfileFeesExpensesInvestmentCat" + }, + "legalType": { + "type": "string" + }, + "managementInfo": { + "$ref": "#/definitions/FundProfileManagementInfo" + }, + "maxAge": { + "yahooFinanceType": "number" + }, + "styleBoxUrl": { + "type": "string" + } + }, + "required": [ + "maxAge", + "family", + "categoryName", + "legalType", + "managementInfo", + "brokerages" + ], + "type": "object" + }, + "FundProfileBrokerage": { + "additionalProperties": false, + "type": "object" + }, + "FundProfileFeesExpensesInvestment": { + "additionalProperties": false, + "properties": { + "annualHoldingsTurnover": { + "yahooFinanceType": "number" + }, + "annualReportExpenseRatio": { + "yahooFinanceType": "number" + }, + "projectionValues": { + "type": "object" + }, + "totalNetAssets": { + "yahooFinanceType": "number" + } + }, + "required": [ + "annualReportExpenseRatio", + "annualHoldingsTurnover", + "totalNetAssets", + "projectionValues" + ], + "type": "object" + }, + "FundProfileFeesExpensesInvestmentCat": { + "additionalProperties": false, + "properties": { + "annualHoldingsTurnover": { + "yahooFinanceType": "number" + }, + "annualReportExpenseRatio": { + "yahooFinanceType": "number" + }, + "projectionValuesCat": { + "type": "object" + }, + "totalNetAssets": { + "yahooFinanceType": "number" + } + }, + "required": [ + "annualHoldingsTurnover", + "annualReportExpenseRatio", + "projectionValuesCat", + "totalNetAssets" + ], + "type": "object" + }, + "FundProfileManagementInfo": { + "additionalProperties": false, + "properties": { + "managerBio": { + "type": [ + "null", + "string" + ] + }, + "managerName": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "managerName", + "managerBio" + ], + "type": "object" + }, "Grade": { "enum": [ "Accumulate", @@ -1140,6 +1615,25 @@ ], "type": "string" }, + "HTTPError": { + "additionalProperties": false, + "properties": { + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "stack": { + "type": "string" + } + }, + "required": [ + "message", + "name" + ], + "type": "object" + }, "HistoricalOptions": { "additionalProperties": false, "properties": { @@ -1466,6 +1960,25 @@ ], "type": "object" }, + "InvalidOptionsError": { + "additionalProperties": false, + "properties": { + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "stack": { + "type": "string" + } + }, + "required": [ + "message", + "name" + ], + "type": "object" + }, "MajorHoldersBreakdown": { "additionalProperties": false, "properties": { @@ -1494,6 +2007,93 @@ ], "type": "object" }, + "ModuleOptions": { + "additionalProperties": false, + "properties": { + "devel": { + "type": [ + "boolean", + "string" + ] + }, + "fetchOptions": { + "type": "object" + }, + "validateResult": { + "type": "boolean" + } + }, + "type": "object" + }, + "ModuleOptionsWithValidateFalse": { + "additionalProperties": false, + "properties": { + "devel": { + "type": [ + "boolean", + "string" + ] + }, + "fetchOptions": { + "type": "object" + }, + "validateResult": { + "const": false, + "type": "boolean" + } + }, + "required": [ + "validateResult" + ], + "type": "object" + }, + "ModuleOptionsWithValidateTrue": { + "additionalProperties": false, + "properties": { + "devel": { + "type": [ + "boolean", + "string" + ] + }, + "fetchOptions": { + "type": "object" + }, + "validateResult": { + "const": true, + "type": "boolean" + } + }, + "type": "object" + }, + "ModuleThis": { + "properties": { + "_moduleExec": { + "additionalProperties": false, + "properties": { + "arguments": {}, + "caller": { + "$ref": "#/definitions/interface-731470504-9814-11278-731470504-0-210955" + }, + "length": { + "yahooFinanceType": "number" + }, + "prototype": {} + }, + "required": [ + "prototype", + "length", + "arguments", + "caller" + ], + "type": "object" + } + }, + "required": [ + "_moduleExec" + ], + "type": "object" + }, "NetSharePurchaseActivity": { "additionalProperties": false, "properties": { @@ -1547,6 +2147,25 @@ ], "type": "object" }, + "NoEnvironmentError": { + "additionalProperties": false, + "properties": { + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "stack": { + "type": "string" + } + }, + "required": [ + "message", + "name" + ], + "type": "object" + }, "Ownership": { "additionalProperties": false, "properties": { @@ -1893,6 +2512,12 @@ "fundOwnership": { "$ref": "#/definitions/Ownership" }, + "fundPerformance": { + "$ref": "#/definitions/FundPerformance" + }, + "fundProfile": { + "$ref": "#/definitions/FundProfile" + }, "incomeStatementHistory": { "$ref": "#/definitions/IncomeStatementHistory" }, @@ -2135,6 +2760,21 @@ ], "type": "object" }, + "SchemaObject": { + "properties": { + "$async": { + "const": false, + "type": "boolean" + }, + "$id": { + "type": "string" + }, + "$schema": { + "type": "string" + } + }, + "type": "object" + }, "SearchNews": { "additionalProperties": false, "properties": { @@ -2485,6 +3125,9 @@ "maxAge": { "yahooFinanceType": "number" }, + "navPrice": { + "yahooFinanceType": "number" + }, "open": { "yahooFinanceType": "number" }, @@ -2518,6 +3161,9 @@ "toCurrency": { "type": "null" }, + "totalAssets": { + "yahooFinanceType": "number" + }, "tradeable": { "type": "boolean" }, @@ -2535,6 +3181,9 @@ }, "volume": { "yahooFinanceType": "number" + }, + "yield": { + "yahooFinanceType": "number" } }, "required": [ @@ -2621,16 +3270,6 @@ } }, "required": [ - "address1", - "city", - "zip", - "country", - "phone", - "website", - "industry", - "sector", - "longBusinessSummary", - "fullTimeEmployees", "companyOfficers", "maxAge" ], @@ -2943,6 +3582,26 @@ "earnings" ], "type": "object" + }, + "interface-731470504-9814-11278-731470504-0-210955": { + "additionalProperties": false, + "properties": { + "arguments": {}, + "caller": { + "$ref": "#/definitions/interface-731470504-9814-11278-731470504-0-210955" + }, + "length": { + "yahooFinanceType": "number" + }, + "prototype": {} + }, + "required": [ + "prototype", + "length", + "arguments", + "caller" + ], + "type": "object" } } } diff --git a/src/modules/quoteSummary-iface.ts b/src/modules/quoteSummary-iface.ts index b4ac2f19..2f2659d8 100644 --- a/src/modules/quoteSummary-iface.ts +++ b/src/modules/quoteSummary-iface.ts @@ -24,6 +24,8 @@ export interface QuoteSummaryResult { earningsTrend?: EarningsTrend; financialData?: FinancialData; fundOwnership?: Ownership; + fundPerformance?: FundPerformance; + fundProfile?: FundProfile; incomeStatementHistory?: IncomeStatementHistory; incomeStatementHistoryQuarterly?: IncomeStatementHistory; indexTrend?: IndexTrend; @@ -46,17 +48,17 @@ export interface QuoteSummaryResult { } export interface AssetProfile { - address1: string; - city: string; + address1?: string; + city?: string; state?: string; - zip: string; - country: string; + zip?: string; + country?: string; phone: string; - website: string; - industry: string; - sector: string; + website?: string; + industry?: string; + sector?: string; longBusinessSummary: string; - fullTimeEmployees: number; + fullTimeEmployees?: number; companyOfficers: CompanyOfficer[]; auditRisk?: number; boardRisk?: number; @@ -171,42 +173,51 @@ export interface CashflowStatement { export interface DefaultKeyStatistics { maxAge: number; priceHint: number; - enterpriseValue: number; + enterpriseValue?: number; forwardPE?: number; - profitMargins: number; - floatShares: number; - sharesOutstanding: number; + profitMargins?: number; + floatShares?: number; + sharesOutstanding?: number; sharesShort?: number; sharesShortPriorMonth?: number; sharesShortPreviousMonthDate?: number; dateShortInterest?: number; sharesPercentSharesOut?: number; - heldPercentInsiders: number; - heldPercentInstitutions: number; + heldPercentInsiders?: number; + heldPercentInstitutions?: number; shortRatio?: number; shortPercentOfFloat?: number; - beta: number; - category: null; - bookValue: number; - priceToBook: number; - fundFamily: null; - legalType: null; - lastFiscalYearEnd: number; - nextFiscalYearEnd: number; - mostRecentQuarter: number; + beta?: number; + category: null | string; + bookValue?: number; + priceToBook?: number; + fundFamily: null | string; + legalType: null | string; + lastFiscalYearEnd?: number; + nextFiscalYearEnd?: number; + mostRecentQuarter?: number; earningsQuarterlyGrowth?: number; netIncomeToCommon?: number; - trailingEps: number; + trailingEps?: number; forwardEps?: number; pegRatio?: number; lastSplitFactor: null | string; lastSplitDate?: number; enterpriseToRevenue?: number; enterpriseToEbitda?: number; - "52WeekChange": number; - SandP52WeekChange: number; + "52WeekChange"?: number; + SandP52WeekChange?: number; lastDividendValue?: number; lastDividendDate?: number; + ytdReturn?: number; + beta3Year?: number; + totalAssets?: number; + yield?: number; + fundInceptionDate?: Date; + threeYearAverageReturn?: number; + fiveYearAverageReturn?: number; + + } export interface QuoteSummaryEarnings { @@ -361,6 +372,105 @@ export interface OwnershipList { value: number; } +export interface FundPerformance { + maxAge: number; + performanceOverview: FundPerformancePerformanceOverview; + performanceOverviewCat: FundPerformancePerformanceOverviewCat; + trailingReturns: FundPerformanceTrailingReturns; + trailingReturnsNav: FundPerformanceTrailingReturns; + trailingReturnsCat: FundPerformanceTrailingReturns; + annualTotalReturns: FundPerformanceReturns; + pastQuarterlyReturns: FundPerformanceReturns; + riskOverviewStatistics: FundPerformanceRiskOverviewStats; + riskOverviewStatisticsCat: FundPerformanceRiskOverviewStatsCat; +} + +export interface FundPerformancePerformanceOverview { + asOfDate: Date; + ytdReturnPct: number; + oneYearTotalReturn: number; + threeYearTotalReturn: number; +} + +export interface FundPerformancePerformanceOverviewCat { + ytdReturnPct: number; + fiveYrAvgReturnPct: number; +} + +export interface FundPerformanceTrailingReturns { + asOfDate?: Date; + ytd: number; + oneMonth: number; + threeMonth?: number; + oneYear?: number; + threeYear?: number; + fiveYear?: number; + tenYear?: number; + lastBullMkt?: number; + lastBearMkt?: number; +} + +export interface FundPerformanceReturns { + returns: FundPerformanceReturnsRow[]; + returnsCat?: FundPerformanceReturnsRow[]; +} + +export interface FundPerformanceReturnsRow { + year: number; // coerce to number from string "2020" + annualValue?: number; +} + +export interface FundPerformanceRiskOverviewStats { + riskStatistics: FundPerformanceRiskOverviewStatsRow[]; +} + +export interface FundPerformanceRiskOverviewStatsCat { + riskStatisticsCat: FundPerformanceRiskOverviewStatsRow[]; +} + +export interface FundPerformanceRiskOverviewStatsRow { + year: string; // "5y" | "3y" | "10y" | anything else? + alpha: number; // 7.76 + beta: number; // 1.04 + meanAnnualReturn: number; // 2.05 + rSquared: number; // 84.03 + stdDev: number; // 17.12 + sharpeRatio: number; // 1.37 + treynorRatio: number; // 23.61 +} + +export interface FundProfile { + maxAge: number; + styleBoxUrl?: string; + family: string; + categoryName: string; + legalType: string; + managementInfo: FundProfileManagementInfo; + feesExpensesInvestment?: FundProfileFeesExpensesInvestment; + feesExpensesInvestmentCat?: FundProfileFeesExpensesInvestmentCat; + brokerages: FundProfileBrokerage[]; +} + +export interface FundProfileManagementInfo { + managerName: null | string; + managerBio: null | string; +} + +export interface FundProfileFeesExpensesInvestment { + annualReportExpenseRatio: number; + annualHoldingsTurnover: number; + totalNetAssets: number; + projectionValues: object; +} + +export interface FundProfileFeesExpensesInvestmentCat extends + Omit { + projectionValuesCat: object; +} + +export interface FundProfileBrokerage { +} + export interface IncomeStatementHistory { incomeStatementHistory: IncomeStatementHistoryElement[]; maxAge: number; @@ -634,24 +744,27 @@ export interface SummaryDetail { lastMarket: null; algorithm: null; tradeable: boolean; + yield?: number; + totalAssets?: number; + navPrice?: number; } export interface SummaryProfile { - address1: string; - city: string; - state?: string; - zip: string; - country: string; - phone: string; - website: string; - industry: string; - sector: string; - longBusinessSummary: string; - fullTimeEmployees: number; - companyOfficers: any[]; - maxAge: number; - address2?: string; - fax?: string; + address1?: string; + city?: string; + state?: string; + zip?: string; + country?: string; + phone?: string; + website?: string; + industry?: string; + sector?: string; + longBusinessSummary?: string; + fullTimeEmployees?: number; + companyOfficers: any[]; + maxAge: number; + address2?: string; + fax?: string; } export interface TopHoldings {