Socket
Socket
Sign inDemoInstall

@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.3 to 0.2.4

2

package.json
{
"name": "@equitysim/trkd-client",
"version": "0.2.3",
"version": "0.2.4",
"description": "REST Client for TRKD API",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -127,3 +127,3 @@ export default {

PUTCALLIND: {
type: Number,
type: String,
name: 'optionType',

@@ -130,0 +130,0 @@ },

@@ -25,3 +25,3 @@ import searchFields from './field-maps/search-fields'

const result = []
const items = trkdBody['Result']['Hit']
const items = trkdBody['Result'] ? trkdBody['Result']['Hit'] : []
for (const item of items) {

@@ -40,3 +40,3 @@ result.push(formatSearchItem(item))

docs: formatSearchItems(trkdResponse['GetDerivativeQuote_Response_1']),
...formatSearchHeader(trkdResponse['GetDerivativeQuote_Response_1'], header)
...formatSearchHeader(trkdResponse['GetDerivativeQuote_Response_1'], header),
})

@@ -46,3 +46,3 @@

docs: formatSearchItems(trkdResponse['GetEquityQuote_Response_1']),
... formatSearchHeader(trkdResponse['GetEquityQuote_Response_1'], header)
...formatSearchHeader(trkdResponse['GetEquityQuote_Response_1'], header),
})

@@ -52,3 +52,3 @@

docs: formatSearchItems(trkdResponse['GetFundQuote_Response_1']),
...formatSearchHeader(trkdResponse['GetEquityQuote_Response_1'], header)
...formatSearchHeader(trkdResponse['GetEquityQuote_Response_1'], header),
})

@@ -58,3 +58,3 @@

docs: formatSearchItems(trkdResponse['GetGovCorpInst_Response_1']),
...formatSearchHeader(trkdResponse['GetGovCorpInst_Response_1'], header)
...formatSearchHeader(trkdResponse['GetGovCorpInst_Response_1'], header),
})

@@ -64,9 +64,15 @@

const limit = header['MaxCount']
const responseHeader = trkdBody['ResultHeader']
return {
page: Math.floor(responseHeader['FirstHit'] / limit) + 1,
pages: Math.ceil(responseHeader['TotalHits'] / limit),
const result = {
page: 1,
pages: 0,
limit,
total: responseHeader['TotalHits'],
total: 0,
}
if (trkdBody) {
const responseHeader = trkdBody['ResultHeader']
result.page = Math.floor(responseHeader['FirstHit'] / limit) + 1
result.pages = Math.ceil(responseHeader['TotalHits'] / limit)
result.total = responseHeader['TotalHits']
}
return result
}

@@ -58,3 +58,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)

@@ -61,0 +60,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