Skip to content

Commit

Permalink
Merge pull request #118 from PythonCreator27/fix/fix-quote-validation
Browse files Browse the repository at this point in the history
fix(validation): add a few new properties and mark a few properties optional
  • Loading branch information
gadicc authored Apr 8, 2021
2 parents cb95518 + 65d4486 commit 264ed17
Show file tree
Hide file tree
Showing 1,842 changed files with 448,034 additions and 85,636 deletions.
38 changes: 29 additions & 9 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,9 @@
},
"type": {
"$ref": "#/definitions/Type"
},
"url": {
"type": "string"
}
},
"required": [
Expand All @@ -1024,7 +1027,8 @@
"type",
"title",
"edgarUrl",
"maxAge"
"maxAge",
"url"
],
"type": "object"
},
Expand Down Expand Up @@ -1505,9 +1509,7 @@
"maxAge",
"family",
"categoryName",
"legalType",
"managementInfo",
"brokerages"
"legalType"
],
"type": "object"
},
Expand Down Expand Up @@ -1598,6 +1600,8 @@
"enum": [
"Accumulate",
"Add",
"Average",
"Below Average",
"Buy",
"",
"Equal-Weight",
Expand Down Expand Up @@ -2372,8 +2376,7 @@
"longName",
"lastMarket",
"marketState",
"fromCurrency",
"toCurrency"
"fromCurrency"
],
"type": "object"
},
Expand Down Expand Up @@ -2405,6 +2408,9 @@
"askSize": {
"yahooFinanceType": "number"
},
"averageAnalystRating": {
"type": "string"
},
"averageDailyVolume10Day": {
"yahooFinanceType": "number"
},
Expand Down Expand Up @@ -2693,6 +2699,9 @@
"askSize": {
"yahooFinanceType": "number"
},
"averageAnalystRating": {
"type": "string"
},
"averageDailyVolume10Day": {
"yahooFinanceType": "number"
},
Expand Down Expand Up @@ -3014,6 +3023,9 @@
"askSize": {
"yahooFinanceType": "number"
},
"averageAnalystRating": {
"type": "string"
},
"averageDailyVolume10Day": {
"yahooFinanceType": "number"
},
Expand Down Expand Up @@ -3303,6 +3315,9 @@
"askSize": {
"yahooFinanceType": "number"
},
"averageAnalystRating": {
"type": "string"
},
"averageDailyVolume10Day": {
"yahooFinanceType": "number"
},
Expand Down Expand Up @@ -3592,6 +3607,9 @@
"askSize": {
"yahooFinanceType": "number"
},
"averageAnalystRating": {
"type": "string"
},
"averageDailyVolume10Day": {
"yahooFinanceType": "number"
},
Expand Down Expand Up @@ -3966,7 +3984,8 @@
"ipoExpectedDate",
"newListingDate",
"nameChangeDate",
"prevName"
"prevName",
"averageAnalystRating"
],
"type": "string"
},
Expand All @@ -3979,6 +3998,9 @@
"askSize": {
"yahooFinanceType": "number"
},
"averageAnalystRating": {
"type": "string"
},
"averageDailyVolume10Day": {
"yahooFinanceType": "number"
},
Expand Down Expand Up @@ -4533,7 +4555,6 @@
"timeZoneFullName",
"timeZoneShortName",
"uuid",
"messageBoardId",
"gmtOffSetMilliseconds",
"maxAge"
],
Expand Down Expand Up @@ -5556,7 +5577,6 @@
"algorithm",
"tradeable",
"fromCurrency",
"toCurrency",
"lastMarket"
],
"type": "object"
Expand Down
1 change: 1 addition & 0 deletions src/modules/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export interface QuoteBase {
newListingDate?: Date; // "2021-02-16",
nameChangeDate?: Date;
prevName?: string;
averageAnalystRating?: string;
}

/*
Expand Down
13 changes: 8 additions & 5 deletions src/modules/quoteSummary-iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ export interface FundProfile {
family: null | string;
categoryName: null | string;
legalType: null | string;
managementInfo: FundProfileManagementInfo;
managementInfo?: FundProfileManagementInfo;
feesExpensesInvestment?: FundProfileFeesExpensesInvestment;
feesExpensesInvestmentCat?: FundProfileFeesExpensesInvestmentCat;
brokerages: FundProfileBrokerage[];
brokerages?: FundProfileBrokerage[];
initInvestment?: number;
initIraInvestment?: number;
initAipInvestment?: number;
Expand Down Expand Up @@ -680,7 +680,7 @@ export interface Price {
currency?: string;
currencySymbol?: string;
fromCurrency: string | null;
toCurrency: string | null;
toCurrency?: string | null;
volume24Hr?: number;
volumeAllCurrencies?: number;
circulatingSupply?: number;
Expand All @@ -697,7 +697,7 @@ export interface QuoteType {
timeZoneFullName: string;
timeZoneShortName: string;
uuid: string;
messageBoardId: null | string;
messageBoardId?: null | string;
gmtOffSetMilliseconds: number;
maxAge: number;
}
Expand Down Expand Up @@ -728,6 +728,7 @@ export interface Filing {
title: string;
edgarUrl: string;
maxAge: number;
url: string;
}

export enum Type {
Expand Down Expand Up @@ -785,7 +786,7 @@ export interface SummaryDetail {
// crypto only (optional, or null in other types)
// TODO: how does Price / SummaryDetail compare? common base?
fromCurrency: string | null; // 'BTC'
toCurrency: string | null; // 'USD-X'
toCurrency?: string | null; // 'USD-X'
lastMarket: string | null; // 'CoinMarketCap'
volume24Hr?: number; // 62650314752
volumeAllCurrencies?: number; // 62650314752
Expand Down Expand Up @@ -904,6 +905,8 @@ export enum Action {
export enum Grade {
Accumulate = "Accumulate",
Add = "Add",
Average = "Average",
BelowAverage = "Below Average",
Buy = "Buy",
Empty = "",
EqualWeight = "Equal-Weight",
Expand Down
75 changes: 75 additions & 0 deletions tests/http/4-7-2021/autoc-0P000071W8.TO.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"request": {
"url": "https://autoc.finance.yahoo.com/autoc?region=1&lang=en&query=0P000071W8.TO"
},
"response": {
"ok": true,
"status": 200,
"statusText": "OK",
"headers": {
"x-content-type-options": [
"nosniff"
],
"x-yahoo-request-id": [
"eg6f4jhg2qdlb"
],
"cache-control": [
"public, max-age=300, stale-while-revalidate=30, stale-if-error=3600"
],
"content-encoding": [
"gzip"
],
"content-type": [
"application/json;charset=utf-8"
],
"content-length": [
"141"
],
"date": [
"Wed, 17 Feb 2021 15:30:51 GMT"
],
"age": [
"0"
],
"strict-transport-security": [
"max-age=31536000"
],
"server": [
"ATS"
],
"expect-ct": [
"max-age=31536000, report-uri=\"http://csp.yahoo.com/beacon/csp?src=yahoocom-expect-ct-report-only\""
],
"public-key-pins-report-only": [
"max-age=2592000; pin-sha256=\"2fRAUXyxl4A1/XHrKNBmc8bTkzA7y4FB/GLJuNAzCqY=\"; pin-sha256=\"I/Lt/z7ekCWanjD0Cvj5EqXls2lOaThEA0H2Bg4BT/o=\"; pin-sha256=\"K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q=\"; pin-sha256=\"Wd8xe/qfTwq3ylFNd3IpaqLHZbh2ZNCLluVzmeNkcpw=\"; pin-sha256=\"WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=\"; pin-sha256=\"cGuxAXyFXFkWm61cF4HPWX8S0srS9j0aSqN0k4AP+4A=\"; pin-sha256=\"dolnbtzEBnELx/9lOEQ22e6OZO/QNb6VSSX2XHA3E7A=\"; pin-sha256=\"i7WTqTvh0OioIruIfFR4kMPnBqrS2rdiVPl/s2uC/CY=\"; pin-sha256=\"r/mIkG3eEpVdm+u/ko/cwxzOMo1bk4TyHIlByibiA5E=\"; pin-sha256=\"uUwZgwDOxcBXrQcntwu+kYFpkiVkOaezL0WYEZ3anJc=\"; includeSubdomains; report-uri=\"http://csp.yahoo.com/beacon/csp?src=yahoocom-hpkp-report-only\""
],
"x-frame-options": [
"SAMEORIGIN"
],
"x-xss-protection": [
"1; mode=block"
],
"referrer-policy": [
"no-referrer-when-downgrade"
],
"connection": [
"close"
]
},
"bodyJson": {
"ResultSet": {
"Query": "0P000071W8.TO",
"Result": [
{
"symbol": "0P000071W8.TO",
"name": "TD U.S. Index Fund - e",
"exch": "TOR",
"type": "M",
"exchDisp": "Toronto",
"typeDisp": "Fund"
}
]
}
}
}
}
Loading

0 comments on commit 264ed17

Please sign in to comment.