snaptrade-typescript-sdk 6.1.0 → 6.3.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.
Files changed (46) hide show
  1. package/.konfig/generate-id.txt +1 -1
  2. package/README.md +3 -2
  3. package/api/account-information-api.ts +57 -89
  4. package/api/api-disclaimer-api.ts +10 -13
  5. package/api/api-status-api.ts +5 -6
  6. package/api/authentication-api.ts +40 -58
  7. package/api/connections-api.ts +133 -33
  8. package/api/error-logs-api.ts +8 -12
  9. package/api/options-api.ts +40 -58
  10. package/api/portfolio-management-api.ts +248 -372
  11. package/api/reference-data-api.ts +82 -124
  12. package/api/trading-api.ts +81 -116
  13. package/api/transactions-and-reporting-api.ts +29 -25
  14. package/common.ts +35 -15
  15. package/configuration.ts +3 -2
  16. package/dist/api/account-information-api.js +24 -24
  17. package/dist/api/api-disclaimer-api.js +5 -4
  18. package/dist/api/authentication-api.js +19 -17
  19. package/dist/api/connections-api.d.ts +54 -0
  20. package/dist/api/connections-api.js +118 -9
  21. package/dist/api/error-logs-api.js +3 -3
  22. package/dist/api/options-api.js +19 -17
  23. package/dist/api/portfolio-management-api.js +115 -107
  24. package/dist/api/reference-data-api.js +37 -35
  25. package/dist/api/trading-api.js +40 -35
  26. package/dist/api/transactions-and-reporting-api.d.ts +8 -1
  27. package/dist/api/transactions-and-reporting-api.js +12 -8
  28. package/dist/common.d.ts +8 -1
  29. package/dist/common.js +21 -14
  30. package/dist/configuration.js +3 -2
  31. package/dist/models/account-order-record.d.ts +7 -0
  32. package/dist/models/connections-session-events200-response-inner.d.ts +17 -0
  33. package/dist/models/connections-session-events200-response-inner.js +15 -0
  34. package/dist/models/index.d.ts +2 -0
  35. package/dist/models/index.js +2 -0
  36. package/dist/models/session-event.d.ts +59 -0
  37. package/dist/models/session-event.js +25 -0
  38. package/dist/requestBeforeHook.d.ts +1 -0
  39. package/docs/ConnectionsApi.md +55 -0
  40. package/docs/TransactionsAndReportingApi.md +2 -0
  41. package/models/account-order-record.ts +9 -0
  42. package/models/connections-session-events200-response-inner.ts +25 -0
  43. package/models/index.ts +2 -0
  44. package/models/session-event.ts +68 -0
  45. package/package.json +1 -1
  46. package/requestBeforeHook.ts +1 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * SnapTrade
3
+ * Connect brokerage accounts to your app for live positions and trading
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: api@snaptrade.com
7
+ *
8
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
9
+ * https://konfigthis.com
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface SessionEvent
16
+ */
17
+ export interface SessionEvent {
18
+ [key: string]: any;
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof SessionEvent
23
+ */
24
+ 'id'?: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof SessionEvent
29
+ */
30
+ 'session_event_type'?: SessionEventSessionEventTypeEnum;
31
+ /**
32
+ *
33
+ * @type {string}
34
+ * @memberof SessionEvent
35
+ */
36
+ 'session_id'?: string;
37
+ /**
38
+ * SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it\'s unique to a user
39
+ * @type {string}
40
+ * @memberof SessionEvent
41
+ */
42
+ 'user_id'?: string;
43
+ /**
44
+ * Time
45
+ * @type {string}
46
+ * @memberof SessionEvent
47
+ */
48
+ 'created_date'?: string;
49
+ }
50
+ export declare const SessionEventSessionEventTypeEnum: {
51
+ readonly DisclaimerAccepted: "DISCLAIMER_ACCEPTED";
52
+ readonly BrokerageConnectionInitiated: "BROKERAGE_CONNECTION_INITIATED";
53
+ readonly BrokerageAuthentication: "BROKERAGE_AUTHENTICATION";
54
+ readonly MfaAuthorization: "MFA_AUTHORIZATION";
55
+ readonly ConnectionSuccessful: "CONNECTION_SUCCESSFUL";
56
+ readonly ConnectionFailed: "CONNECTION_FAILED";
57
+ readonly PartnerRedirect: "PARTNER_REDIRECT";
58
+ };
59
+ export type SessionEventSessionEventTypeEnum = typeof SessionEventSessionEventTypeEnum[keyof typeof SessionEventSessionEventTypeEnum];
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * SnapTrade
6
+ * Connect brokerage accounts to your app for live positions and trading
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: api@snaptrade.com
10
+ *
11
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
12
+ * https://konfigthis.com
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.SessionEventSessionEventTypeEnum = void 0;
17
+ exports.SessionEventSessionEventTypeEnum = {
18
+ DisclaimerAccepted: 'DISCLAIMER_ACCEPTED',
19
+ BrokerageConnectionInitiated: 'BROKERAGE_CONNECTION_INITIATED',
20
+ BrokerageAuthentication: 'BROKERAGE_AUTHENTICATION',
21
+ MfaAuthorization: 'MFA_AUTHORIZATION',
22
+ ConnectionSuccessful: 'CONNECTION_SUCCESSFUL',
23
+ ConnectionFailed: 'CONNECTION_FAILED',
24
+ PartnerRedirect: 'PARTNER_REDIRECT'
25
+ };
@@ -1,6 +1,7 @@
1
1
  import { Configuration } from "./configuration";
2
2
  import { AxiosRequestConfig } from "axios";
3
3
  export declare function requestBeforeHook(request: {
4
+ requestBody?: any;
4
5
  queryParameters: Record<string, any>;
5
6
  path: string;
6
7
  requestConfig: AxiosRequestConfig;
@@ -7,6 +7,7 @@ Method | HTTP request | Description
7
7
  [**detailBrokerageAuthorization**](ConnectionsApi.md#detailBrokerageAuthorization) | **GET** /authorizations/{authorizationId} | Get detail of a specific brokerage authorizations for the user
8
8
  [**listBrokerageAuthorizations**](ConnectionsApi.md#listBrokerageAuthorizations) | **GET** /authorizations | List all brokerage authorizations for the user
9
9
  [**removeBrokerageAuthorization**](ConnectionsApi.md#removeBrokerageAuthorization) | **DELETE** /authorizations/{authorizationId} | Remove a brokerage authorization.
10
+ [**sessionEvents**](ConnectionsApi.md#sessionEvents) | **GET** /sessionEvents | List all session events for the partner
10
11
 
11
12
 
12
13
  # **detailBrokerageAuthorization**
@@ -177,4 +178,58 @@ void (empty response body)
177
178
 
178
179
  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
179
180
 
181
+ # **sessionEvents**
182
+
183
+ #### **GET** /sessionEvents
184
+
185
+
186
+ ### Example
187
+
188
+
189
+ ```typescript
190
+ import { Snaptrade } from "snaptrade-typescript-sdk"
191
+
192
+ const snaptrade = new Snaptrade({
193
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
194
+ // basePath: "https://api.snaptrade.com/api/v1",
195
+ consumerKey: "YOUR_CONSUMER_KEY",
196
+ clientId: "YOUR_CLIENT_ID",
197
+ })
198
+
199
+ const sessionEventsResponse = await snaptrade.connections.sessionEvents({
200
+ "partnerClientId": "PASSIVTEST",
201
+ "userId": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
202
+ })
203
+
204
+ console.log(sessionEventsResponse)
205
+
206
+ ```
207
+
208
+
209
+ ### Parameters
210
+
211
+ Name | Type | Description | Notes
212
+ ------------- | ------------- | ------------- | -------------
213
+ **partnerClientId** | [**string**] | | defaults to undefined
214
+ **userId** | [**string**] | Optional comma seperated list of user IDs used to filter the request on specific users | (optional) defaults to undefined
215
+
216
+
217
+ ### Return type
218
+
219
+ **Array<ConnectionsSessionEvents200ResponseInner>**
220
+
221
+ ### HTTP request headers
222
+
223
+ - **Content-Type**: Not defined
224
+ - **Accept**: application/json
225
+
226
+
227
+ ### HTTP response details
228
+ | Status code | Description | Response headers |
229
+ |-------------|-------------|------------------|
230
+ **200** | A list of all Session Events for the Partner. | - |
231
+ **0** | Unexpected error. | - |
232
+
233
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
234
+
180
235
 
@@ -32,6 +32,7 @@ const getActivitiesResponse = await snaptrade.transactionsAndReporting.getActivi
32
32
  "startDate": "2022-01-24",
33
33
  "endDate": "2022-01-24",
34
34
  "accounts": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
35
+ "brokerageAuthorizations": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
35
36
  "userId": "John.doe@snaptrade.com",
36
37
  "userSecret": "USERSECRET123",
37
38
  })
@@ -50,6 +51,7 @@ Name | Type | Description | Notes
50
51
  **startDate** | [**string**] | | (optional) defaults to undefined
51
52
  **endDate** | [**string**] | | (optional) defaults to undefined
52
53
  **accounts** | [**string**] | Optional comma seperated list of account IDs used to filter the request on specific accounts | (optional) defaults to undefined
54
+ **brokerageAuthorizations** | [**string**] | Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations | (optional) defaults to undefined
53
55
 
54
56
 
55
57
  ### Return type
@@ -20,6 +20,9 @@ import { AccountOrderRecordStatus } from './account-order-record-status';
20
20
  import { Action } from './action';
21
21
  // May contain unused imports in some cases
22
22
  // @ts-ignore
23
+ import { OptionsSymbol } from './options-symbol';
24
+ // May contain unused imports in some cases
25
+ // @ts-ignore
23
26
  import { OrderType } from './order-type';
24
27
  // May contain unused imports in some cases
25
28
  // @ts-ignore
@@ -60,6 +63,12 @@ export interface AccountOrderRecord {
60
63
  * @memberof AccountOrderRecord
61
64
  */
62
65
  'universal_symbol'?: UniversalSymbol;
66
+ /**
67
+ *
68
+ * @type {OptionsSymbol}
69
+ * @memberof AccountOrderRecord
70
+ */
71
+ 'option_symbol'?: OptionsSymbol;
63
72
  /**
64
73
  *
65
74
  * @type {Action}
@@ -0,0 +1,25 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnapTrade
5
+ * Connect brokerage accounts to your app for live positions and trading
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: api@snaptrade.com
9
+ *
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
+ * https://konfigthis.com
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ // May contain unused imports in some cases
16
+ // @ts-ignore
17
+ import { SessionEvent } from './session-event';
18
+
19
+ /**
20
+ * @type ConnectionsSessionEvents200ResponseInner
21
+ * @export
22
+ */
23
+ export type ConnectionsSessionEvents200ResponseInner = SessionEvent;
24
+
25
+
package/models/index.ts CHANGED
@@ -16,6 +16,7 @@ export * from './brokerage-symbol';
16
16
  export * from './brokerage-type';
17
17
  export * from './calculated-trade';
18
18
  export * from './cash-restriction';
19
+ export * from './connections-session-events200-response-inner';
19
20
  export * from './currency';
20
21
  export * from './delete-user-response';
21
22
  export * from './dividend-at-date';
@@ -68,6 +69,7 @@ export * from './position';
68
69
  export * from './position-symbol';
69
70
  export * from './redirect-tokenand-pin';
70
71
  export * from './security-type';
72
+ export * from './session-event';
71
73
  export * from './snap-trade-apidisclaimer-accept-status';
72
74
  export * from './snap-trade-holdings-account';
73
75
  export * from './snap-trade-holdings-total-value';
@@ -0,0 +1,68 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnapTrade
5
+ * Connect brokerage accounts to your app for live positions and trading
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: api@snaptrade.com
9
+ *
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
+ * https://konfigthis.com
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface SessionEvent
20
+ */
21
+ export interface SessionEvent {
22
+ [key: string]: any;
23
+
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof SessionEvent
28
+ */
29
+ 'id'?: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof SessionEvent
34
+ */
35
+ 'session_event_type'?: SessionEventSessionEventTypeEnum;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof SessionEvent
40
+ */
41
+ 'session_id'?: string;
42
+ /**
43
+ * SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it\'s unique to a user
44
+ * @type {string}
45
+ * @memberof SessionEvent
46
+ */
47
+ 'user_id'?: string;
48
+ /**
49
+ * Time
50
+ * @type {string}
51
+ * @memberof SessionEvent
52
+ */
53
+ 'created_date'?: string;
54
+ }
55
+
56
+ export const SessionEventSessionEventTypeEnum = {
57
+ DisclaimerAccepted: 'DISCLAIMER_ACCEPTED',
58
+ BrokerageConnectionInitiated: 'BROKERAGE_CONNECTION_INITIATED',
59
+ BrokerageAuthentication: 'BROKERAGE_AUTHENTICATION',
60
+ MfaAuthorization: 'MFA_AUTHORIZATION',
61
+ ConnectionSuccessful: 'CONNECTION_SUCCESSFUL',
62
+ ConnectionFailed: 'CONNECTION_FAILED',
63
+ PartnerRedirect: 'PARTNER_REDIRECT'
64
+ } as const;
65
+
66
+ export type SessionEventSessionEventTypeEnum = typeof SessionEventSessionEventTypeEnum[keyof typeof SessionEventSessionEventTypeEnum];
67
+
68
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snaptrade-typescript-sdk",
3
- "version": "6.1.0",
3
+ "version": "6.3.0",
4
4
  "description": "Client for SnapTrade",
5
5
  "author": "Konfig",
6
6
  "repository": {
@@ -2,6 +2,7 @@ import { Configuration } from "./configuration";
2
2
  import { AxiosRequestConfig } from "axios";
3
3
 
4
4
  export function requestBeforeHook(request: {
5
+ requestBody?: any;
5
6
  queryParameters: Record<string, any>;
6
7
  path: string;
7
8
  requestConfig: AxiosRequestConfig;