@narative/oanda-v20
Advanced tools
Comparing version 3.0.53 to 3.0.54
@@ -41,2 +41,3 @@ /// <reference types="node" /> | ||
snapshot?: boolean; | ||
includeHomeConversions?: boolean; | ||
} | ||
@@ -43,0 +44,0 @@ export declare type StreamResponse = void; |
@@ -345,2 +345,5 @@ "use strict"; | ||
} | ||
if (typeof queryParams['includeHomeConversions'] !== 'undefined') { | ||
path = path + 'includeHomeConversions=' + queryParams['includeHomeConversions'] + '&'; | ||
} | ||
var body = {}; | ||
@@ -347,0 +350,0 @@ var handleResponse = function (err, response) { |
{ | ||
"name": "@narative/oanda-v20", | ||
"description": "OANDA v20 bindings for Javascript", | ||
"version": "3.0.53", | ||
"version": "3.0.54", | ||
"author": "OANDA Corporation", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/narative/v20-javascript", |
import * as path from 'path' | ||
import * as cheerio from 'cheerio' | ||
import { Request } from './request' | ||
import { Filewriter } from './helpers/file' | ||
import { | ||
convertEnumName, | ||
convertType, | ||
parseComments, | ||
parseTypes, | ||
toModuleName, | ||
convertEnumName, | ||
parseTypes, | ||
parseComments, | ||
} from './helpers/types' | ||
import { Filewriter } from './helpers/file' | ||
import { Request } from './request' | ||
@@ -33,4 +31,5 @@ export const moduleNames = [ | ||
path.join(__dirname, `../src/definitions/${toModuleName(moduleName)}.ts`), | ||
), | ||
) { | ||
), // private fileMain = new Filewriter( // path.join(__dirname, `../src/${toModuleName(moduleName)}.ts`), | ||
) // ), | ||
{ | ||
this.file.clean() | ||
@@ -45,2 +44,3 @@ } | ||
await this.file.flush() | ||
// await this.fileMain.flush() | ||
} | ||
@@ -56,2 +56,4 @@ | ||
const resultUnknown = [] | ||
const resultSchema = [] | ||
const resultSchemaImport = [] | ||
@@ -63,2 +65,7 @@ this.file.appendFile( | ||
) | ||
// this.fileMain.appendFile( | ||
// `${moduleNames | ||
// .map((m) => `import * as ${toModuleName(m)} from './definitions/${toModuleName(m)}'`) | ||
// .join(`\n`)}\n`, | ||
// ) | ||
@@ -77,2 +84,3 @@ $('.endpoint_header').each(function () { | ||
export type ${name} = ${typeValue}`) | ||
resultSchemaImport.push(name) | ||
return | ||
@@ -116,2 +124,3 @@ } | ||
resultEnums.push(`${enumValue}\n\n${enumDescription}`) | ||
resultSchemaImport.push(name) | ||
return | ||
@@ -123,5 +132,6 @@ } | ||
if (schema) { | ||
const result = `export class ${name} ${parseTypes(parseComments(schema), self.moduleName)}` | ||
if (self.isMissing(name)) { | ||
const result = parseTypes(parseComments(schema), self.moduleName) | ||
missingImport.push(`export class ${name} ${result}`) | ||
missingImport.push(`${result}`) | ||
return | ||
@@ -131,2 +141,3 @@ } | ||
resultExport.push(name) | ||
resultSchema.push(result) | ||
return | ||
@@ -147,2 +158,4 @@ } | ||
export type ${name} = ${implementations.join(' | ')}`) | ||
resultSchemaImport.push(name) | ||
return | ||
@@ -170,2 +183,9 @@ } | ||
${missingImport.join('\n\n')}`) | ||
// this.fileMain.appendFile( | ||
// `import { ${resultSchemaImport.join(', ')} } from './definitions/${toModuleName( | ||
// this.moduleName, | ||
// true, | ||
// )}'\n\n${resultSchema.join('\n')}`, | ||
// ) | ||
} | ||
@@ -193,3 +213,9 @@ | ||
this.moduleName === 'primitives' && | ||
['Tag', 'FinancingDayOfWeek', 'InstrumentFinancing'].includes(name) | ||
[ | ||
'Tag', | ||
'FinancingDayOfWeek', | ||
'InstrumentFinancing', | ||
'ConversionFactor', | ||
'HomeConversionFactors', | ||
].includes(name) | ||
) { | ||
@@ -196,0 +222,0 @@ return true |
import * as path from 'path' | ||
import * as cheerio from 'cheerio' | ||
import { moduleNames as definitionModuleNames } from './definitions' | ||
import { Filewriter } from './helpers/file' | ||
import { convertType, parseComments, parseTypes, toModuleName } from './helpers/types' | ||
import { Request } from './request' | ||
import { parseComments, toModuleName, parseTypes, convertType } from './helpers/types' | ||
import { Filewriter } from './helpers/file' | ||
import { moduleNames as definitionModuleNames } from './definitions' | ||
@@ -226,7 +224,2 @@ export const moduleNames = [ | ||
// doc error, forgot accountID | ||
if (self.moduleName === 'pricing' && id === '#collapse_endpoint_5') { | ||
requests.unshift({ name: 'accountID', location: 'path', type: 'account.AccountID' }) | ||
} | ||
$(paramID) // <div id=collapse_2_parameters /> | ||
@@ -233,0 +226,0 @@ .find('.body_schema > .json_schema') |
import * as oanda from '../src' | ||
import { parseAll as parseAllDefinitions } from './definitions' | ||
import { parseAll as parseAllEndpoints } from './endpoints' | ||
async function main() { | ||
async function testLib() { | ||
// const client = new oanda.Rest('test', process.env.OANDA_TOKEN, true) | ||
// const accountIDs = await client.account.list({}) | ||
// if (accountIDs.accounts.length === 0) { | ||
@@ -14,3 +12,2 @@ // console.log(`No accounts`) | ||
// } | ||
// const accounts = await Promise.all( | ||
@@ -25,3 +22,2 @@ // accountIDs.accounts.map((a) => client.account.summary({ accountID: a.id })), | ||
// }) | ||
// const transactions = await client.transaction.range({ | ||
@@ -31,3 +27,2 @@ // accountID: `101-002-12706983-001`, | ||
// }) | ||
// console.log(`Last transaction`) | ||
@@ -42,7 +37,14 @@ // transactions.transactions.forEach((t) => { | ||
// }) | ||
} | ||
async function parse() { | ||
await parseAllDefinitions() | ||
// await parseAllEndpoints() | ||
await parseAllEndpoints() | ||
} | ||
async function main() { | ||
// testLib() | ||
parse() | ||
} | ||
main() |
@@ -79,2 +79,4 @@ import * as account from '../definitions/account' | ||
snapshot?: boolean | ||
includeHomeConversions?: boolean | ||
} | ||
@@ -81,0 +83,0 @@ |
@@ -590,2 +590,5 @@ import { Definition, Field, Property } from './base' | ||
} | ||
if (typeof queryParams['includeHomeConversions'] !== 'undefined') { | ||
path = path + 'includeHomeConversions=' + queryParams['includeHomeConversions'] + '&' | ||
} | ||
@@ -592,0 +595,0 @@ let body = {} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
4076877
71756