diff --git a/src/fugle.ts b/src/fugle.ts index 6abfba9..3a4da00 100644 --- a/src/fugle.ts +++ b/src/fugle.ts @@ -15,7 +15,7 @@ export interface FugleParams { export class Fugle { private static BASE_REALTIME_URL = 'https://api.fugle.tw/realtime'; private static BASE_REALTIME_WS = 'wss://api.fugle.tw/realtime'; - private static VERSION = 'v0.2'; + private static VERSION = 'v0.3'; private _apiToken: string; constructor(options: FugleOptions = {}) { diff --git a/test/fugle.spec.ts b/test/fugle.spec.ts index e738059..c3c229b 100644 --- a/test/fugle.spec.ts +++ b/test/fugle.spec.ts @@ -30,7 +30,7 @@ describe('Fugle', () => { describe('#api', () => { it('should invoke axios with compiled url', () => { const fugle = new Fugle({ apiToken: 'demo' }); - const url = 'https://api.fugle.tw/realtime/v0/intraday/quote?apiToken=demo&oddLot=false&symbolId=2884'; + const url = 'https://api.fugle.tw/realtime/v0.3/intraday/quote?apiToken=demo&oddLot=false&symbolId=2884'; fugle.api('/intraday/quote', { symbolId: '2884' }); expect(axios).toBeCalledWith(url); }); @@ -38,7 +38,7 @@ describe('Fugle', () => { it('should invoke axios with compiled url for intraday odd lot trading', () => { const fugle = new Fugle({ apiToken: 'demo' }); - const url = 'https://api.fugle.tw/realtime/v0/intraday/quote?apiToken=demo&oddLot=true&symbolId=2884'; + const url = 'https://api.fugle.tw/realtime/v0.3/intraday/quote?apiToken=demo&oddLot=true&symbolId=2884'; fugle.api('/intraday/quote', { symbolId: '2884', oddLot: true }); expect(axios).toBeCalledWith(url); }); @@ -46,7 +46,7 @@ describe('Fugle', () => { describe('#ws', () => { it('should invoke ws with compiled url', () => { const fugle = new Fugle({ apiToken: 'demo' }); - const url = 'wss://api.fugle.tw/realtime/v0/intraday/quote?apiToken=demo&symbolId=2884'; + const url = 'wss://api.fugle.tw/realtime/v0.3/intraday/quote?apiToken=demo&symbolId=2884'; fugle.ws('/intraday/quote', { symbolId: '2884' }); expect(WebSocket).toBeCalledWith(url); }); diff --git a/yarn.lock b/yarn.lock index f5312f8..d8bd9d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3786,9 +3786,9 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-type@^1.0.0: version "1.1.0"