tradestation-client 1.0.15 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authMiddleware.d.ts.map +1 -1
- package/dist/authMiddleware.js +2 -1
- package/dist/authMiddleware.js.map +1 -1
- package/dist/commands/barsCommand.d.ts.map +1 -1
- package/dist/commands/barsCommand.js +9 -5
- package/dist/commands/barsCommand.js.map +1 -1
- package/dist/{tradestation-client.d.ts → index.d.ts} +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/{tradestation-client.js → index.js} +1 -1
- package/dist/index.js.map +1 -0
- package/dist/scripts/downloadOpenAPI.d.ts.map +1 -0
- package/dist/scripts/downloadOpenAPI.js.map +1 -0
- package/dist/spike.js +1 -1
- package/dist/spike.js.map +1 -1
- package/dist/test/cli.test.d.ts +2 -0
- package/dist/test/cli.test.d.ts.map +1 -0
- package/dist/test/cli.test.js +32 -0
- package/dist/test/cli.test.js.map +1 -0
- package/package.json +14 -7
- package/.env.example +0 -2
- package/.prettierrc +0 -5
- package/authMiddleware.ts +0 -243
- package/cli.ts +0 -19
- package/commands/auth.ts +0 -13
- package/commands/barsCommand.ts +0 -83
- package/config.ts +0 -2
- package/dist/config.d.ts +0 -3
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -3
- package/dist/config.js.map +0 -1
- package/dist/downloadOpenAPI.d.ts.map +0 -1
- package/dist/downloadOpenAPI.js.map +0 -1
- package/dist/tradestation-client.d.ts.map +0 -1
- package/dist/tradestation-client.js.map +0 -1
- package/downloadOpenAPI.ts +0 -31
- package/generated/tradestation-api.d.ts +0 -8115
- package/openapi.json +0 -12928
- package/spike.ts +0 -30
- package/tradestation-client.ts +0 -15
- package/tsconfig.json +0 -42
- /package/dist/{downloadOpenAPI.d.ts → scripts/downloadOpenAPI.d.ts} +0 -0
- /package/dist/{downloadOpenAPI.js → scripts/downloadOpenAPI.js} +0 -0
package/spike.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import process from 'node:process'
|
|
2
|
-
|
|
3
|
-
process.loadEnvFile()
|
|
4
|
-
|
|
5
|
-
import { createTradeStationClient } from './tradestation-client.js'
|
|
6
|
-
|
|
7
|
-
const tradestationClient = createTradeStationClient(
|
|
8
|
-
process.env.CLIENT_ID!,
|
|
9
|
-
process.env.CLIENT_SECRET!
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
const { data } = await tradestationClient.GET(
|
|
13
|
-
'/v3/marketdata/stream/barcharts/{symbol}',
|
|
14
|
-
{
|
|
15
|
-
params: {
|
|
16
|
-
path: { symbol: 'SPY' },
|
|
17
|
-
query: {
|
|
18
|
-
interval: '1',
|
|
19
|
-
unit: 'minute',
|
|
20
|
-
barsback: '2',
|
|
21
|
-
sessiontemplate: 'USEQ24Hour',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
parseAs: 'stream',
|
|
25
|
-
}
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
for await (const chunk of data!) {
|
|
29
|
-
console.log(new TextDecoder().decode(chunk))
|
|
30
|
-
}
|
package/tradestation-client.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import createClient from 'openapi-fetch'
|
|
2
|
-
|
|
3
|
-
import type { paths } from './generated/tradestation-api.js'
|
|
4
|
-
import { createAuthMiddleware } from './authMiddleware.js'
|
|
5
|
-
|
|
6
|
-
export function createTradeStationClient(
|
|
7
|
-
clientId: string,
|
|
8
|
-
clientSecret: string
|
|
9
|
-
) {
|
|
10
|
-
const client = createClient<paths>({
|
|
11
|
-
baseUrl: 'https://api.tradestation.com',
|
|
12
|
-
})
|
|
13
|
-
client.use(createAuthMiddleware(clientId, clientSecret))
|
|
14
|
-
return client
|
|
15
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// File Layout
|
|
5
|
-
"rootDir": ".",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
|
|
8
|
-
// Environment Settings
|
|
9
|
-
// See also https://aka.ms/tsconfig/module
|
|
10
|
-
"module": "nodenext",
|
|
11
|
-
"target": "esnext",
|
|
12
|
-
// For nodejs:
|
|
13
|
-
"lib": ["esnext"],
|
|
14
|
-
"types": ["node"],
|
|
15
|
-
|
|
16
|
-
// Other Outputs
|
|
17
|
-
"sourceMap": true,
|
|
18
|
-
"declaration": true,
|
|
19
|
-
"declarationMap": true,
|
|
20
|
-
|
|
21
|
-
// Stricter Typechecking Options
|
|
22
|
-
"noUncheckedIndexedAccess": true,
|
|
23
|
-
"exactOptionalPropertyTypes": true,
|
|
24
|
-
|
|
25
|
-
// Style Options
|
|
26
|
-
// "noImplicitReturns": true,
|
|
27
|
-
// "noImplicitOverride": true,
|
|
28
|
-
// "noUnusedLocals": true,
|
|
29
|
-
// "noUnusedParameters": true,
|
|
30
|
-
// "noFallthroughCasesInSwitch": true,
|
|
31
|
-
// "noPropertyAccessFromIndexSignature": true,
|
|
32
|
-
|
|
33
|
-
// Recommended Options
|
|
34
|
-
"strict": true,
|
|
35
|
-
"jsx": "react-jsx",
|
|
36
|
-
"verbatimModuleSyntax": true,
|
|
37
|
-
"isolatedModules": true,
|
|
38
|
-
"noUncheckedSideEffectImports": true,
|
|
39
|
-
"moduleDetection": "force",
|
|
40
|
-
"skipLibCheck": true
|
|
41
|
-
}
|
|
42
|
-
}
|
|
File without changes
|
|
File without changes
|