@equitysim/trkd-client
Advanced tools
Comparing version 0.2.6 to 0.2.7
{ | ||
"name": "@equitysim/trkd-client", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"description": "REST Client for TRKD API", | ||
@@ -19,3 +19,4 @@ "main": "index.js", | ||
"trkd", | ||
"thomson reuters" | ||
"thomson reuters", | ||
"refinitiv" | ||
], | ||
@@ -22,0 +23,0 @@ "author": "equitysim", |
export * from './time-series' | ||
export * from './quotes' | ||
export * from './search' | ||
export * from './search' | ||
export * from './street-events' |
@@ -5,18 +5,28 @@ import { formatItem } from './search' | ||
export const formatEventHeadlines = (trkdResponse) => { | ||
const data = trkdResponse['GetEventHeadlines_Response_1']['EventHeadlines']['Headline'] | ||
const header = trkdResponse['GetEventHeadlines_Response_1']['PaginationResult'] | ||
try { | ||
const data = trkdResponse['GetEventHeadlines_Response_1']['EventHeadlines']['Headline'] | ||
const header = trkdResponse['GetEventHeadlines_Response_1']['PaginationResult'] | ||
const docs = data.map(headline => { | ||
const base = formatItem(headline, eventHeadlines) | ||
const org = headline['Organization']; | ||
return { ...base, issuer: org['Name'], securityIds: org['Symbols']['Symbol'].map(({ Value }) => Value )} | ||
}) | ||
const docs = data.map((headline) => { | ||
const base = formatItem(headline, eventHeadlines) | ||
const org = headline['Organization'] | ||
return { ...base, issuer: org['Name'], securityIds: org['Symbols']['Symbol'].map(({ Value }) => Value) } | ||
}) | ||
return { | ||
page: header['PageNumber'], | ||
pages: Math.ceil(header['TotalRecores'] / header['RecordsPerPage']), | ||
limit: header['RecordsPerPage'], | ||
total: header['TotalRecords'], | ||
docs | ||
return { | ||
page: header['PageNumber'], | ||
pages: Math.ceil(header['TotalRecores'] / header['RecordsPerPage']), | ||
limit: header['RecordsPerPage'], | ||
total: header['TotalRecords'], | ||
docs, | ||
} | ||
} catch (err) { | ||
return { | ||
page: 0, | ||
pages: 0, | ||
limit: 0, | ||
total: 0, | ||
docs: [] | ||
} | ||
} | ||
} | ||
} |
@@ -10,3 +10,2 @@ import { fileURLToPath } from 'url' | ||
formatSearchDerivativeQuote, | ||
formatSearchHeader, | ||
} from '../formatting' | ||
@@ -13,0 +12,0 @@ |
import { fileURLToPath } from 'url' | ||
import path from 'path' | ||
import { formatFile } from '../utils' | ||
import { formatEventHeadlines } from '../formatting/street-events' | ||
import { formatEventHeadlines } from '../formatting' | ||
@@ -6,0 +6,0 @@ const __filename = fileURLToPath(import.meta.url) |
@@ -25,3 +25,2 @@ import { ValidationError } from '../dto/errors' | ||
if (!(startTime instanceof Date) || startTime > new Date()) throw new ValidationError('startTime must be less than now', startTime) | ||
if (!(endTime instanceof Date) || endTime > new Date()) throw new ValidationError('endTime must be less than now', endTime) | ||
if (!intervals.includes(interval)) throw new ValidationError(`interval must be one of the following: ${intervals.toString()}`, interval) | ||
@@ -28,0 +27,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43152
1329