Skip to content

Commit

Permalink
fix(quoteSummary): allow price=null in price,quoteType (fixes #197)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Jun 2, 2021
1 parent 3461013 commit 990dd4a
Show file tree
Hide file tree
Showing 40 changed files with 10,870 additions and 5 deletions.
10 changes: 8 additions & 2 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2760,7 +2760,10 @@
"yahooFinanceType": "number"
},
"shortName": {
"type": "string"
"type": [
"null",
"string"
]
},
"symbol": {
"type": "string"
Expand Down Expand Up @@ -5031,7 +5034,10 @@
"type": "string"
},
"shortName": {
"type": "string"
"type": [
"null",
"string"
]
},
"symbol": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions src/modules/quoteSummary-iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export interface Price {

symbol: string;
underlyingSymbol: null;
shortName: string;
shortName: null | string;
longName: null | string;

lastMarket: null | string;
Expand All @@ -691,7 +691,7 @@ export interface QuoteType {
quoteType: string;
symbol: string;
underlyingSymbol: string;
shortName: string;
shortName: null | string;
longName: null | string;
firstTradeDateEpochUtc: null | Date;
timeZoneFullName: string;
Expand Down
75 changes: 75 additions & 0 deletions tests/http/autoc-ORSTED.CO.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=ORSTED.CO"
},
"response": {
"ok": true,
"status": 200,
"statusText": "OK",
"headers": {
"x-content-type-options": [
"nosniff"
],
"x-yahoo-request-id": [
"3e12n1lgbeb8t"
],
"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": [
"135"
],
"date": [
"Wed, 02 Jun 2021 07:02:53 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": "ORSTED.CO",
"Result": [
{
"symbol": "ORSTED.CO",
"name": "Ørsted A/S",
"exch": "CPH",
"type": "S",
"exchDisp": "Copenhagen",
"typeDisp": "Equity"
}
]
}
}
}
}
73 changes: 73 additions & 0 deletions tests/http/historical-ORSTED.CO-2020-01-01-to-2020-01-03.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"request": {
"url": "https://query1.finance.yahoo.com/v7/finance/download/ORSTED.CO?interval=1d&events=history&includeAdjustedClose=true&period1=1577836800&period2=1578009600"
},
"response": {
"ok": true,
"status": 200,
"statusText": "OK",
"headers": {
"content-disposition": [
"attachment; filename=ORSTED.CO.csv"
],
"content-type": [
"text/csv;charset=utf-8"
],
"cache-control": [
"private, max-age=10, stale-while-revalidate=20"
],
"vary": [
"Origin"
],
"y-rid": [
"3n1kr1lgbeb8t"
],
"x-yahoo-request-id": [
"3n1kr1lgbeb8t"
],
"x-request-id": [
"789d1956-ed3c-41a2-9c27-b68ae0ca4ce8"
],
"content-length": [
"114"
],
"x-envoy-upstream-service-time": [
"15"
],
"date": [
"Wed, 02 Jun 2021 07:02:52 GMT"
],
"server": [
"ATS"
],
"x-envoy-decorator-operation": [
"finance-chart-api--mtls-production-ir2.finance-k8s.svc.yahoo.local:4080/*"
],
"age": [
"1"
],
"strict-transport-security": [
"max-age=15552000"
],
"referrer-policy": [
"no-referrer-when-downgrade"
],
"x-frame-options": [
"SAMEORIGIN"
],
"connection": [
"close"
],
"expect-ct": [
"max-age=31536000, report-uri=\"http://csp.yahoo.com/beacon/csp?src=yahoocom-expect-ct-report-only\""
],
"x-xss-protection": [
"1; mode=block"
],
"x-content-type-options": [
"nosniff"
]
},
"body": "Date,Open,High,Low,Close,Adj Close,Volume\n2020-01-02,685.799988,688.400024,677.200012,681.000000,663.206848,340491"
}
}
83 changes: 83 additions & 0 deletions tests/http/insights-ORSTED.CO.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"request": {
"url": "https://query2.finance.yahoo.com/ws/insights/v2/finance/insights?lang=en-US&region=US&getAllResearchReports=true&reportsCount=2&symbol=ORSTED.CO"
},
"response": {
"ok": true,
"status": 200,
"statusText": "OK",
"headers": {
"content-type": [
"application/json;charset=utf-8"
],
"cache-control": [
"public, max-age=300, stale-while-revalidate=120"
],
"vary": [
"Origin,Accept-Encoding"
],
"y-rid": [
"bfhuj2pgbeb8t"
],
"x-yahoo-request-id": [
"bfhuj2pgbeb8t"
],
"x-request-id": [
"7c645616-0e63-485e-88c9-ed103f32434a"
],
"content-length": [
"175"
],
"x-envoy-upstream-service-time": [
"5"
],
"date": [
"Wed, 02 Jun 2021 07:02:52 GMT"
],
"server": [
"ATS"
],
"x-envoy-decorator-operation": [
"finance-market-analytics-api--mtls-production-bf1.finance-k8s.svc.yahoo.local:4080/*"
],
"age": [
"1"
],
"strict-transport-security": [
"max-age=15552000"
],
"referrer-policy": [
"no-referrer-when-downgrade"
],
"x-frame-options": [
"SAMEORIGIN"
],
"connection": [
"close"
],
"expect-ct": [
"max-age=31536000, report-uri=\"http://csp.yahoo.com/beacon/csp?src=yahoocom-expect-ct-report-only\""
],
"x-xss-protection": [
"1; mode=block"
],
"x-content-type-options": [
"nosniff"
]
},
"bodyJson": {
"finance": {
"result": {
"symbol": "ORSTED.CO",
"sigDevs": [
{
"headline": "Ørsted And Hofor Enter Agreement On Green Power For Hydrogen Project",
"date": "2021-05-31"
}
]
},
"error": null
}
}
}
}
Loading

0 comments on commit 990dd4a

Please sign in to comment.