snaptrade-typescript-sdk 6.3.0 → 7.0.0
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/.konfig/generate-id.txt +1 -1
- package/README.md +11 -24
- package/api/account-information-api-custom.ts +3 -0
- package/api/account-information-api.ts +2 -1
- package/api/api-disclaimer-api-custom.ts +3 -0
- package/api/api-disclaimer-api.ts +2 -1
- package/api/api-status-api-custom.ts +3 -0
- package/api/api-status-api.ts +2 -1
- package/api/authentication-api-custom.ts +3 -0
- package/api/authentication-api.ts +2 -1
- package/api/connections-api-custom.ts +3 -0
- package/api/connections-api.ts +2 -1
- package/api/error-logs-api-custom.ts +3 -0
- package/api/error-logs-api.ts +2 -1
- package/api/options-api-custom.ts +3 -0
- package/api/options-api.ts +2 -1
- package/api/portfolio-management-api-custom.ts +3 -0
- package/api/portfolio-management-api.ts +2 -1
- package/api/reference-data-api-custom.ts +3 -0
- package/api/reference-data-api.ts +2 -1
- package/api/trading-api-custom.ts +3 -0
- package/api/trading-api.ts +2 -1
- package/api/transactions-and-reporting-api-custom.ts +3 -0
- package/api/transactions-and-reporting-api.ts +28 -19
- package/client-custom.ts +5 -0
- package/client.ts +3 -1
- package/configuration.ts +1 -1
- package/dist/api/account-information-api-custom.d.ts +3 -0
- package/dist/api/account-information-api-custom.js +27 -0
- package/dist/api/account-information-api.d.ts +3 -2
- package/dist/api/account-information-api.js +2 -1
- package/dist/api/api-disclaimer-api-custom.d.ts +3 -0
- package/dist/api/api-disclaimer-api-custom.js +27 -0
- package/dist/api/api-disclaimer-api.d.ts +3 -2
- package/dist/api/api-disclaimer-api.js +2 -1
- package/dist/api/api-status-api-custom.d.ts +3 -0
- package/dist/api/api-status-api-custom.js +27 -0
- package/dist/api/api-status-api.d.ts +3 -2
- package/dist/api/api-status-api.js +2 -1
- package/dist/api/authentication-api-custom.d.ts +3 -0
- package/dist/api/authentication-api-custom.js +27 -0
- package/dist/api/authentication-api.d.ts +3 -2
- package/dist/api/authentication-api.js +2 -1
- package/dist/api/connections-api-custom.d.ts +3 -0
- package/dist/api/connections-api-custom.js +27 -0
- package/dist/api/connections-api.d.ts +3 -2
- package/dist/api/connections-api.js +2 -1
- package/dist/api/error-logs-api-custom.d.ts +3 -0
- package/dist/api/error-logs-api-custom.js +27 -0
- package/dist/api/error-logs-api.d.ts +3 -2
- package/dist/api/error-logs-api.js +2 -1
- package/dist/api/options-api-custom.d.ts +3 -0
- package/dist/api/options-api-custom.js +27 -0
- package/dist/api/options-api.d.ts +3 -2
- package/dist/api/options-api.js +2 -1
- package/dist/api/portfolio-management-api-custom.d.ts +3 -0
- package/dist/api/portfolio-management-api-custom.js +27 -0
- package/dist/api/portfolio-management-api.d.ts +3 -2
- package/dist/api/portfolio-management-api.js +2 -1
- package/dist/api/reference-data-api-custom.d.ts +3 -0
- package/dist/api/reference-data-api-custom.js +27 -0
- package/dist/api/reference-data-api.d.ts +3 -2
- package/dist/api/reference-data-api.js +2 -1
- package/dist/api/trading-api-custom.d.ts +3 -0
- package/dist/api/trading-api-custom.js +27 -0
- package/dist/api/trading-api.d.ts +3 -2
- package/dist/api/trading-api.js +2 -1
- package/dist/api/transactions-and-reporting-api-custom.d.ts +3 -0
- package/dist/api/transactions-and-reporting-api-custom.js +27 -0
- package/dist/api/transactions-and-reporting-api.d.ts +17 -16
- package/dist/api/transactions-and-reporting-api.js +18 -9
- package/dist/client-custom.d.ts +4 -0
- package/dist/client-custom.js +9 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.js +32 -13
- package/dist/configuration.js +1 -1
- package/dist/models/snap-trade-holdings-account.d.ts +2 -3
- package/dist/models/symbol.d.ts +6 -0
- package/docs/TransactionsAndReportingApi.md +4 -4
- package/index.test.ts +60 -0
- package/models/snap-trade-holdings-account.ts +2 -5
- package/models/symbol.ts +6 -0
- package/package.json +1 -1
package/.konfig/generate-id.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4174766a-a000-448d-907d-7b028d62bca9
|
package/README.md
CHANGED
|
@@ -1,36 +1,24 @@
|
|
|
1
|
-
## snaptrade-typescript-sdk@
|
|
1
|
+
## snaptrade-typescript-sdk@7.0.0
|
|
2
|
+
Connect brokerage accounts to your app for live positions and trading
|
|
2
3
|
|
|
3
|
-
This library that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* Webpack
|
|
8
|
-
* Browserify
|
|
5
|
+
**Important note: this library is can be used in both the client-side or server-side, but using it
|
|
6
|
+
in client-side browser code is not recommended as you would expose security credentials.**
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
* ES5 - you must have a Promises/A+ library installed
|
|
12
|
-
* ES6
|
|
8
|
+
### Installing
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
* CommonJS
|
|
16
|
-
* ES6 module system
|
|
17
|
-
|
|
18
|
-
### Building
|
|
19
|
-
|
|
20
|
-
To build and compile the typescript sources to javascript use:
|
|
10
|
+
#### npm
|
|
21
11
|
```
|
|
22
|
-
npm install
|
|
23
|
-
npm run build
|
|
12
|
+
npm install snaptrade-typescript-sdk --save
|
|
24
13
|
```
|
|
25
14
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
navigate to the folder of your consuming project and run the following command.
|
|
29
|
-
|
|
15
|
+
#### yarn
|
|
30
16
|
```
|
|
31
|
-
|
|
17
|
+
yarn add snaptrade-typescript-sdk
|
|
32
18
|
```
|
|
33
19
|
|
|
20
|
+
|
|
21
|
+
|
|
34
22
|
### Getting Started
|
|
35
23
|
|
|
36
24
|
```typescript
|
|
@@ -197,4 +185,3 @@ Class | Method | HTTP request | Description
|
|
|
197
185
|
*TransactionsAndReportingApi* | [**getActivities**](docs/TransactionsAndReportingApi.md#getActivities) | **GET** /activities | Get transaction history for a user
|
|
198
186
|
*TransactionsAndReportingApi* | [**getReportingCustomRange**](docs/TransactionsAndReportingApi.md#getReportingCustomRange) | **GET** /performance/custom | Get performance information for a specific timeframe
|
|
199
187
|
|
|
200
|
-
|
|
@@ -35,6 +35,7 @@ import { Model403FailedRequestResponse } from '../models';
|
|
|
35
35
|
import { Position } from '../models';
|
|
36
36
|
import { paginate } from "../pagination/paginate";
|
|
37
37
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
38
|
+
import { AccountInformationApiCustom } from "./account-information-api-custom";
|
|
38
39
|
/**
|
|
39
40
|
* AccountInformationApi - axios parameter creator
|
|
40
41
|
* @export
|
|
@@ -960,7 +961,7 @@ export type AccountInformationApiUpdateUserAccountRequest = {
|
|
|
960
961
|
* @class AccountInformationApi
|
|
961
962
|
* @extends {BaseAPI}
|
|
962
963
|
*/
|
|
963
|
-
export class AccountInformationApi extends
|
|
964
|
+
export class AccountInformationApi extends AccountInformationApiCustom {
|
|
964
965
|
/**
|
|
965
966
|
*
|
|
966
967
|
* @summary List all accounts for the user, plus balances and positions for each account.
|
|
@@ -25,6 +25,7 @@ import { APIDisclaimerAcceptRequest } from '../models';
|
|
|
25
25
|
import { SnapTradeAPIDisclaimerAcceptStatus } from '../models';
|
|
26
26
|
import { paginate } from "../pagination/paginate";
|
|
27
27
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
28
|
+
import { ApiDisclaimerApiCustom } from "./api-disclaimer-api-custom";
|
|
28
29
|
/**
|
|
29
30
|
* ApiDisclaimerApi - axios parameter creator
|
|
30
31
|
* @export
|
|
@@ -167,7 +168,7 @@ export type ApiDisclaimerApiAcceptRequest = {
|
|
|
167
168
|
* @class ApiDisclaimerApi
|
|
168
169
|
* @extends {BaseAPI}
|
|
169
170
|
*/
|
|
170
|
-
export class ApiDisclaimerApi extends
|
|
171
|
+
export class ApiDisclaimerApi extends ApiDisclaimerApiCustom {
|
|
171
172
|
/**
|
|
172
173
|
*
|
|
173
174
|
* @summary Accept or Reject SnapTrade disclaimer agreement
|
package/api/api-status-api.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr
|
|
|
23
23
|
import { Status } from '../models';
|
|
24
24
|
import { paginate } from "../pagination/paginate";
|
|
25
25
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
26
|
+
import { ApiStatusApiCustom } from "./api-status-api-custom";
|
|
26
27
|
/**
|
|
27
28
|
* ApiStatusApi - axios parameter creator
|
|
28
29
|
* @export
|
|
@@ -113,7 +114,7 @@ export const ApiStatusApiFactory = function (configuration?: Configuration, base
|
|
|
113
114
|
* @class ApiStatusApi
|
|
114
115
|
* @extends {BaseAPI}
|
|
115
116
|
*/
|
|
116
|
-
export class ApiStatusApi extends
|
|
117
|
+
export class ApiStatusApi extends ApiStatusApiCustom {
|
|
117
118
|
/**
|
|
118
119
|
* Check whether the API is operational and verify timestamps.
|
|
119
120
|
* @summary Get API Status
|
|
@@ -39,6 +39,7 @@ import { SnapTradeRegisterUserRequestBody } from '../models';
|
|
|
39
39
|
import { UserIDandSecret } from '../models';
|
|
40
40
|
import { paginate } from "../pagination/paginate";
|
|
41
41
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
42
|
+
import { AuthenticationApiCustom } from "./authentication-api-custom";
|
|
42
43
|
/**
|
|
43
44
|
* AuthenticationApi - axios parameter creator
|
|
44
45
|
* @export
|
|
@@ -505,7 +506,7 @@ export type AuthenticationApiRegisterSnapTradeUserRequest = {
|
|
|
505
506
|
* @class AuthenticationApi
|
|
506
507
|
* @extends {BaseAPI}
|
|
507
508
|
*/
|
|
508
|
-
export class AuthenticationApi extends
|
|
509
|
+
export class AuthenticationApi extends AuthenticationApiCustom {
|
|
509
510
|
/**
|
|
510
511
|
*
|
|
511
512
|
* @summary Delete user from SnapTrade, disabling all brokerage authorizations and permanently deleting all data associated with the user
|
package/api/connections-api.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { BrokerageAuthorization } from '../models';
|
|
|
25
25
|
import { ConnectionsSessionEvents200ResponseInner } from '../models';
|
|
26
26
|
import { paginate } from "../pagination/paginate";
|
|
27
27
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
28
|
+
import { ConnectionsApiCustom } from "./connections-api-custom";
|
|
28
29
|
/**
|
|
29
30
|
* ConnectionsApi - axios parameter creator
|
|
30
31
|
* @export
|
|
@@ -480,7 +481,7 @@ export type ConnectionsApiSessionEventsRequest = {
|
|
|
480
481
|
* @class ConnectionsApi
|
|
481
482
|
* @extends {BaseAPI}
|
|
482
483
|
*/
|
|
483
|
-
export class ConnectionsApi extends
|
|
484
|
+
export class ConnectionsApi extends ConnectionsApiCustom {
|
|
484
485
|
/**
|
|
485
486
|
*
|
|
486
487
|
* @summary Get detail of a specific brokerage authorizations for the user
|
package/api/error-logs-api.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr
|
|
|
23
23
|
import { UserErrorLog } from '../models';
|
|
24
24
|
import { paginate } from "../pagination/paginate";
|
|
25
25
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
26
|
+
import { ErrorLogsApiCustom } from "./error-logs-api-custom";
|
|
26
27
|
/**
|
|
27
28
|
* ErrorLogsApi - axios parameter creator
|
|
28
29
|
* @export
|
|
@@ -158,7 +159,7 @@ export type ErrorLogsApiListUserErrorsRequest = {
|
|
|
158
159
|
* @class ErrorLogsApi
|
|
159
160
|
* @extends {BaseAPI}
|
|
160
161
|
*/
|
|
161
|
-
export class ErrorLogsApi extends
|
|
162
|
+
export class ErrorLogsApi extends ErrorLogsApiCustom {
|
|
162
163
|
/**
|
|
163
164
|
*
|
|
164
165
|
* @summary Retrieve error logs on behalf of your SnapTrade users
|
package/api/options-api.ts
CHANGED
|
@@ -33,6 +33,7 @@ import { StrategyOrderRecord } from '../models';
|
|
|
33
33
|
import { StrategyQuotes } from '../models';
|
|
34
34
|
import { paginate } from "../pagination/paginate";
|
|
35
35
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
36
|
+
import { OptionsApiCustom } from "./options-api-custom";
|
|
36
37
|
/**
|
|
37
38
|
* OptionsApi - axios parameter creator
|
|
38
39
|
* @export
|
|
@@ -673,7 +674,7 @@ export type OptionsApiPlaceOptionStrategyRequest = {
|
|
|
673
674
|
* @class OptionsApi
|
|
674
675
|
* @extends {BaseAPI}
|
|
675
676
|
*/
|
|
676
|
-
export class OptionsApi extends
|
|
677
|
+
export class OptionsApi extends OptionsApiCustom {
|
|
677
678
|
/**
|
|
678
679
|
*
|
|
679
680
|
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
@@ -49,6 +49,7 @@ import { Trade } from '../models';
|
|
|
49
49
|
import { UniversalSymbol } from '../models';
|
|
50
50
|
import { paginate } from "../pagination/paginate";
|
|
51
51
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
52
|
+
import { PortfolioManagementApiCustom } from "./portfolio-management-api-custom";
|
|
52
53
|
/**
|
|
53
54
|
* PortfolioManagementApi - axios parameter creator
|
|
54
55
|
* @export
|
|
@@ -2889,7 +2890,7 @@ export type PortfolioManagementApiUpdatePortfolioTargetByIdRequest = {
|
|
|
2889
2890
|
* @class PortfolioManagementApi
|
|
2890
2891
|
* @extends {BaseAPI}
|
|
2891
2892
|
*/
|
|
2892
|
-
export class PortfolioManagementApi extends
|
|
2893
|
+
export class PortfolioManagementApi extends PortfolioManagementApiCustom {
|
|
2893
2894
|
/**
|
|
2894
2895
|
*
|
|
2895
2896
|
* @summary Adds an asset to exclude to a portfolio group
|
|
@@ -45,6 +45,7 @@ import { SymbolQuery } from '../models';
|
|
|
45
45
|
import { UniversalSymbol } from '../models';
|
|
46
46
|
import { paginate } from "../pagination/paginate";
|
|
47
47
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
48
|
+
import { ReferenceDataApiCustom } from "./reference-data-api-custom";
|
|
48
49
|
/**
|
|
49
50
|
* ReferenceDataApi - axios parameter creator
|
|
50
51
|
* @export
|
|
@@ -901,7 +902,7 @@ export type ReferenceDataApiSymbolSearchUserAccountRequest = {
|
|
|
901
902
|
* @class ReferenceDataApi
|
|
902
903
|
* @extends {BaseAPI}
|
|
903
904
|
*/
|
|
904
|
-
export class ReferenceDataApi extends
|
|
905
|
+
export class ReferenceDataApi extends ReferenceDataApiCustom {
|
|
905
906
|
/**
|
|
906
907
|
*
|
|
907
908
|
* @summary Return the exchange rate of a currency pair
|
package/api/trading-api.ts
CHANGED
|
@@ -43,6 +43,7 @@ import { TradingCancelUserAccountOrderRequest } from '../models';
|
|
|
43
43
|
import { TradingPlaceOCOOrderRequest } from '../models';
|
|
44
44
|
import { paginate } from "../pagination/paginate";
|
|
45
45
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
46
|
+
import { TradingApiCustom } from "./trading-api-custom";
|
|
46
47
|
/**
|
|
47
48
|
* TradingApi - axios parameter creator
|
|
48
49
|
* @export
|
|
@@ -1168,7 +1169,7 @@ export type TradingApiPlaceOrderRequest = {
|
|
|
1168
1169
|
* @class TradingApi
|
|
1169
1170
|
* @extends {BaseAPI}
|
|
1170
1171
|
*/
|
|
1171
|
-
export class TradingApi extends
|
|
1172
|
+
export class TradingApi extends TradingApiCustom {
|
|
1172
1173
|
/**
|
|
1173
1174
|
*
|
|
1174
1175
|
* @summary Cancel open order in account
|
|
@@ -25,6 +25,7 @@ import { PerformanceCustom } from '../models';
|
|
|
25
25
|
import { UniversalActivity } from '../models';
|
|
26
26
|
import { paginate } from "../pagination/paginate";
|
|
27
27
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
28
|
+
import { TransactionsAndReportingApiCustom } from "./transactions-and-reporting-api-custom";
|
|
28
29
|
/**
|
|
29
30
|
* TransactionsAndReportingApi - axios parameter creator
|
|
30
31
|
* @export
|
|
@@ -36,14 +37,14 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
36
37
|
* @summary Get transaction history for a user
|
|
37
38
|
* @param {string} userId
|
|
38
39
|
* @param {string} userSecret
|
|
39
|
-
* @param {string} [startDate]
|
|
40
|
-
* @param {string} [endDate]
|
|
40
|
+
* @param {string | Date} [startDate]
|
|
41
|
+
* @param {string | Date} [endDate]
|
|
41
42
|
* @param {string} [accounts] Optional comma seperated list of account IDs used to filter the request on specific accounts
|
|
42
43
|
* @param {string} [brokerageAuthorizations] Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
|
|
43
44
|
* @param {*} [options] Override http request option.
|
|
44
45
|
* @throws {RequiredError}
|
|
45
46
|
*/
|
|
46
|
-
getActivities: async (userId: string, userSecret: string, startDate?: string, endDate?: string, accounts?: string, brokerageAuthorizations?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
47
|
+
getActivities: async (userId: string, userSecret: string, startDate?: string | Date, endDate?: string | Date, accounts?: string, brokerageAuthorizations?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
47
48
|
// verify required parameter 'userId' is not null or undefined
|
|
48
49
|
assertParamExists('getActivities', 'userId', userId)
|
|
49
50
|
// verify required parameter 'userSecret' is not null or undefined
|
|
@@ -67,11 +68,15 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
67
68
|
// authentication PartnerTimestamp required
|
|
68
69
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
69
70
|
if (startDate !== undefined) {
|
|
70
|
-
localVarQueryParameter['startDate'] = startDate
|
|
71
|
+
localVarQueryParameter['startDate'] = (startDate as any instanceof Date) ?
|
|
72
|
+
(startDate as any).toISOString().substr(0,10) :
|
|
73
|
+
startDate;
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
if (endDate !== undefined) {
|
|
74
|
-
localVarQueryParameter['endDate'] = endDate
|
|
77
|
+
localVarQueryParameter['endDate'] = (endDate as any instanceof Date) ?
|
|
78
|
+
(endDate as any).toISOString().substr(0,10) :
|
|
79
|
+
endDate;
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
if (accounts !== undefined) {
|
|
@@ -110,8 +115,8 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
110
115
|
/**
|
|
111
116
|
* Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Total Equity Timeframe and Rate of Returns are experimental and should not be trusted to be 100% accurate
|
|
112
117
|
* @summary Get performance information for a specific timeframe
|
|
113
|
-
* @param {string} startDate
|
|
114
|
-
* @param {string} endDate
|
|
118
|
+
* @param {string | Date} startDate
|
|
119
|
+
* @param {string | Date} endDate
|
|
115
120
|
* @param {string} userId
|
|
116
121
|
* @param {string} userSecret
|
|
117
122
|
* @param {string} [accounts] Optional comma seperated list of account IDs used to filter the request on specific accounts
|
|
@@ -120,7 +125,7 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
120
125
|
* @param {*} [options] Override http request option.
|
|
121
126
|
* @throws {RequiredError}
|
|
122
127
|
*/
|
|
123
|
-
getReportingCustomRange: async (startDate: string, endDate: string, userId: string, userSecret: string, accounts?: string, detailed?: boolean, frequency?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
128
|
+
getReportingCustomRange: async (startDate: string | Date, endDate: string | Date, userId: string, userSecret: string, accounts?: string, detailed?: boolean, frequency?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
124
129
|
// verify required parameter 'startDate' is not null or undefined
|
|
125
130
|
assertParamExists('getReportingCustomRange', 'startDate', startDate)
|
|
126
131
|
// verify required parameter 'endDate' is not null or undefined
|
|
@@ -148,11 +153,15 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
148
153
|
// authentication PartnerTimestamp required
|
|
149
154
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
150
155
|
if (startDate !== undefined) {
|
|
151
|
-
localVarQueryParameter['startDate'] = startDate
|
|
156
|
+
localVarQueryParameter['startDate'] = (startDate as any instanceof Date) ?
|
|
157
|
+
(startDate as any).toISOString().substr(0,10) :
|
|
158
|
+
startDate;
|
|
152
159
|
}
|
|
153
160
|
|
|
154
161
|
if (endDate !== undefined) {
|
|
155
|
-
localVarQueryParameter['endDate'] = endDate
|
|
162
|
+
localVarQueryParameter['endDate'] = (endDate as any instanceof Date) ?
|
|
163
|
+
(endDate as any).toISOString().substr(0,10) :
|
|
164
|
+
endDate;
|
|
156
165
|
}
|
|
157
166
|
|
|
158
167
|
if (accounts !== undefined) {
|
|
@@ -280,17 +289,17 @@ export type TransactionsAndReportingApiGetActivitiesRequest = {
|
|
|
280
289
|
|
|
281
290
|
/**
|
|
282
291
|
*
|
|
283
|
-
* @type {string}
|
|
292
|
+
* @type {string | Date}
|
|
284
293
|
* @memberof TransactionsAndReportingApiGetActivities
|
|
285
294
|
*/
|
|
286
|
-
readonly startDate?: string
|
|
295
|
+
readonly startDate?: string | Date
|
|
287
296
|
|
|
288
297
|
/**
|
|
289
298
|
*
|
|
290
|
-
* @type {string}
|
|
299
|
+
* @type {string | Date}
|
|
291
300
|
* @memberof TransactionsAndReportingApiGetActivities
|
|
292
301
|
*/
|
|
293
|
-
readonly endDate?: string
|
|
302
|
+
readonly endDate?: string | Date
|
|
294
303
|
|
|
295
304
|
/**
|
|
296
305
|
* Optional comma seperated list of account IDs used to filter the request on specific accounts
|
|
@@ -317,17 +326,17 @@ export type TransactionsAndReportingApiGetReportingCustomRangeRequest = {
|
|
|
317
326
|
|
|
318
327
|
/**
|
|
319
328
|
*
|
|
320
|
-
* @type {string}
|
|
329
|
+
* @type {string | Date}
|
|
321
330
|
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
322
331
|
*/
|
|
323
|
-
readonly startDate: string
|
|
332
|
+
readonly startDate: string | Date
|
|
324
333
|
|
|
325
334
|
/**
|
|
326
335
|
*
|
|
327
|
-
* @type {string}
|
|
336
|
+
* @type {string | Date}
|
|
328
337
|
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
329
338
|
*/
|
|
330
|
-
readonly endDate: string
|
|
339
|
+
readonly endDate: string | Date
|
|
331
340
|
|
|
332
341
|
/**
|
|
333
342
|
*
|
|
@@ -372,7 +381,7 @@ export type TransactionsAndReportingApiGetReportingCustomRangeRequest = {
|
|
|
372
381
|
* @class TransactionsAndReportingApi
|
|
373
382
|
* @extends {BaseAPI}
|
|
374
383
|
*/
|
|
375
|
-
export class TransactionsAndReportingApi extends
|
|
384
|
+
export class TransactionsAndReportingApi extends TransactionsAndReportingApiCustom {
|
|
376
385
|
/**
|
|
377
386
|
* Returns activities (transactions) for a user. Specifing start and end date is highly recommended for automatic calls for better performance
|
|
378
387
|
* @summary Get transaction history for a user
|
package/client-custom.ts
ADDED
package/client.ts
CHANGED
|
@@ -25,8 +25,9 @@ import {
|
|
|
25
25
|
TransactionsAndReportingApi,
|
|
26
26
|
} from "./api";
|
|
27
27
|
import { Configuration, ConfigurationParameters } from "./configuration";
|
|
28
|
+
import { SnaptradeCustom } from "./client-custom";
|
|
28
29
|
|
|
29
|
-
export class Snaptrade {
|
|
30
|
+
export class Snaptrade extends SnaptradeCustom {
|
|
30
31
|
readonly accountInformation: AccountInformationApi;
|
|
31
32
|
readonly apiDisclaimer: ApiDisclaimerApi;
|
|
32
33
|
readonly apiStatus: ApiStatusApi;
|
|
@@ -40,6 +41,7 @@ export class Snaptrade {
|
|
|
40
41
|
readonly transactionsAndReporting: TransactionsAndReportingApi;
|
|
41
42
|
|
|
42
43
|
constructor(configurationParameters: ConfigurationParameters) {
|
|
44
|
+
super(configurationParameters);
|
|
43
45
|
const configuration = new Configuration(configurationParameters);
|
|
44
46
|
this.accountInformation = new AccountInformationApi(configuration);
|
|
45
47
|
this.apiDisclaimer = new ApiDisclaimerApi(configuration);
|
package/configuration.ts
CHANGED
|
@@ -110,7 +110,7 @@ export class Configuration {
|
|
|
110
110
|
this.accessToken = param.accessToken;
|
|
111
111
|
this.basePath = param.basePath;
|
|
112
112
|
this.baseOptions = param.baseOptions ?? {};
|
|
113
|
-
this.userAgent = param.userAgent === undefined ? "Konfig/
|
|
113
|
+
this.userAgent = param.userAgent === undefined ? "Konfig/7.0.0/typescript" : param.userAgent;
|
|
114
114
|
this.formDataCtor = param.formDataCtor;
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AccountInformationApiCustom = void 0;
|
|
19
|
+
var base_1 = require("../base");
|
|
20
|
+
var AccountInformationApiCustom = /** @class */ (function (_super) {
|
|
21
|
+
__extends(AccountInformationApiCustom, _super);
|
|
22
|
+
function AccountInformationApiCustom() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return AccountInformationApiCustom;
|
|
26
|
+
}(base_1.BaseAPI));
|
|
27
|
+
exports.AccountInformationApiCustom = AccountInformationApiCustom;
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
13
13
|
import { Configuration } from '../configuration';
|
|
14
|
-
import { RequestArgs
|
|
14
|
+
import { RequestArgs } from '../base';
|
|
15
15
|
import { Account } from '../models';
|
|
16
16
|
import { AccountHoldings } from '../models';
|
|
17
17
|
import { AccountOrderRecord } from '../models';
|
|
18
18
|
import { Balance } from '../models';
|
|
19
19
|
import { Position } from '../models';
|
|
20
|
+
import { AccountInformationApiCustom } from "./account-information-api-custom";
|
|
20
21
|
/**
|
|
21
22
|
* AccountInformationApi - axios parameter creator
|
|
22
23
|
* @export
|
|
@@ -449,7 +450,7 @@ export type AccountInformationApiUpdateUserAccountRequest = {
|
|
|
449
450
|
* @class AccountInformationApi
|
|
450
451
|
* @extends {BaseAPI}
|
|
451
452
|
*/
|
|
452
|
-
export declare class AccountInformationApi extends
|
|
453
|
+
export declare class AccountInformationApi extends AccountInformationApiCustom {
|
|
453
454
|
/**
|
|
454
455
|
*
|
|
455
456
|
* @summary List all accounts for the user, plus balances and positions for each account.
|
|
@@ -83,6 +83,7 @@ var common_1 = require("../common");
|
|
|
83
83
|
// @ts-ignore
|
|
84
84
|
var base_1 = require("../base");
|
|
85
85
|
var requestBeforeHook_1 = require("../requestBeforeHook");
|
|
86
|
+
var account_information_api_custom_1 = require("./account-information-api-custom");
|
|
86
87
|
/**
|
|
87
88
|
* AccountInformationApi - axios parameter creator
|
|
88
89
|
* @export
|
|
@@ -1045,5 +1046,5 @@ var AccountInformationApi = /** @class */ (function (_super) {
|
|
|
1045
1046
|
return (0, exports.AccountInformationApiFp)(this.configuration).updateUserAccount(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1046
1047
|
};
|
|
1047
1048
|
return AccountInformationApi;
|
|
1048
|
-
}(
|
|
1049
|
+
}(account_information_api_custom_1.AccountInformationApiCustom));
|
|
1049
1050
|
exports.AccountInformationApi = AccountInformationApi;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ApiDisclaimerApiCustom = void 0;
|
|
19
|
+
var base_1 = require("../base");
|
|
20
|
+
var ApiDisclaimerApiCustom = /** @class */ (function (_super) {
|
|
21
|
+
__extends(ApiDisclaimerApiCustom, _super);
|
|
22
|
+
function ApiDisclaimerApiCustom() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return ApiDisclaimerApiCustom;
|
|
26
|
+
}(base_1.BaseAPI));
|
|
27
|
+
exports.ApiDisclaimerApiCustom = ApiDisclaimerApiCustom;
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
13
13
|
import { Configuration } from '../configuration';
|
|
14
|
-
import { RequestArgs
|
|
14
|
+
import { RequestArgs } from '../base';
|
|
15
15
|
import { APIDisclaimerAcceptRequest } from '../models';
|
|
16
16
|
import { SnapTradeAPIDisclaimerAcceptStatus } from '../models';
|
|
17
|
+
import { ApiDisclaimerApiCustom } from "./api-disclaimer-api-custom";
|
|
17
18
|
/**
|
|
18
19
|
* ApiDisclaimerApi - axios parameter creator
|
|
19
20
|
* @export
|
|
@@ -83,7 +84,7 @@ export type ApiDisclaimerApiAcceptRequest = {
|
|
|
83
84
|
* @class ApiDisclaimerApi
|
|
84
85
|
* @extends {BaseAPI}
|
|
85
86
|
*/
|
|
86
|
-
export declare class ApiDisclaimerApi extends
|
|
87
|
+
export declare class ApiDisclaimerApi extends ApiDisclaimerApiCustom {
|
|
87
88
|
/**
|
|
88
89
|
*
|
|
89
90
|
* @summary Accept or Reject SnapTrade disclaimer agreement
|
|
@@ -83,6 +83,7 @@ var common_1 = require("../common");
|
|
|
83
83
|
// @ts-ignore
|
|
84
84
|
var base_1 = require("../base");
|
|
85
85
|
var requestBeforeHook_1 = require("../requestBeforeHook");
|
|
86
|
+
var api_disclaimer_api_custom_1 = require("./api-disclaimer-api-custom");
|
|
86
87
|
/**
|
|
87
88
|
* ApiDisclaimerApi - axios parameter creator
|
|
88
89
|
* @export
|
|
@@ -242,5 +243,5 @@ var ApiDisclaimerApi = /** @class */ (function (_super) {
|
|
|
242
243
|
return (0, exports.ApiDisclaimerApiFp)(this.configuration).accept(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
243
244
|
};
|
|
244
245
|
return ApiDisclaimerApi;
|
|
245
|
-
}(
|
|
246
|
+
}(api_disclaimer_api_custom_1.ApiDisclaimerApiCustom));
|
|
246
247
|
exports.ApiDisclaimerApi = ApiDisclaimerApi;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ApiStatusApiCustom = void 0;
|
|
19
|
+
var base_1 = require("../base");
|
|
20
|
+
var ApiStatusApiCustom = /** @class */ (function (_super) {
|
|
21
|
+
__extends(ApiStatusApiCustom, _super);
|
|
22
|
+
function ApiStatusApiCustom() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return ApiStatusApiCustom;
|
|
26
|
+
}(base_1.BaseAPI));
|
|
27
|
+
exports.ApiStatusApiCustom = ApiStatusApiCustom;
|