Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@equitysim/trkd-client

Package Overview
Dependencies
Maintainers
5
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equitysim/trkd-client - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

5

package.json
{
"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",

3

src/formatting/index.js
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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc