snaptrade-typescript-sdk 8.19.0 → 8.20.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 (75) hide show
  1. package/README.md +2 -2
  2. package/dist/api/account-information-api-generated.d.ts +525 -0
  3. package/dist/api/account-information-api-generated.js +765 -0
  4. package/dist/api/account-information-api.d.ts +3 -525
  5. package/dist/api/account-information-api.js +17 -1044
  6. package/dist/api/api-status-api-generated.d.ts +69 -0
  7. package/dist/api/api-status-api-generated.js +131 -0
  8. package/dist/api/api-status-api.d.ts +3 -69
  9. package/dist/api/api-status-api.js +17 -198
  10. package/dist/api/authentication-api-generated.d.ts +266 -0
  11. package/dist/api/authentication-api-generated.js +461 -0
  12. package/dist/api/authentication-api.d.ts +3 -266
  13. package/dist/api/authentication-api.js +17 -656
  14. package/dist/api/connections-api-generated.d.ts +274 -0
  15. package/dist/api/connections-api-generated.js +411 -0
  16. package/dist/api/connections-api.d.ts +3 -274
  17. package/dist/api/connections-api.js +17 -578
  18. package/dist/api/error-logs-api-generated.d.ts +93 -0
  19. package/dist/api/error-logs-api-generated.js +152 -0
  20. package/dist/api/error-logs-api.d.ts +3 -93
  21. package/dist/api/error-logs-api.js +17 -235
  22. package/dist/api/options-api-generated.d.ts +368 -0
  23. package/dist/api/options-api-generated.js +530 -0
  24. package/dist/api/options-api.d.ts +3 -368
  25. package/dist/api/options-api.js +17 -725
  26. package/dist/api/reference-data-api-generated.d.ts +467 -0
  27. package/dist/api/reference-data-api-generated.js +872 -0
  28. package/dist/api/reference-data-api.d.ts +3 -467
  29. package/dist/api/reference-data-api.js +17 -1241
  30. package/dist/api/trading-api-generated.d.ts +402 -0
  31. package/dist/api/trading-api-generated.js +613 -0
  32. package/dist/api/trading-api.d.ts +3 -402
  33. package/dist/api/trading-api.js +17 -836
  34. package/dist/api/transactions-and-reporting-api-generated.d.ts +217 -0
  35. package/dist/api/transactions-and-reporting-api-generated.js +287 -0
  36. package/dist/api/transactions-and-reporting-api.d.ts +3 -217
  37. package/dist/api/transactions-and-reporting-api.js +17 -398
  38. package/dist/base.js +10 -31
  39. package/dist/client-custom.js +3 -5
  40. package/dist/client.d.ts +1 -1
  41. package/dist/client.js +17 -35
  42. package/dist/common.js +64 -123
  43. package/dist/configuration.d.ts +1 -1
  44. package/dist/configuration.js +9 -11
  45. package/dist/error.d.ts +56 -0
  46. package/dist/error.js +104 -0
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.js +1 -0
  49. package/dist/jest.config.js +1 -1
  50. package/dist/pagination/page.js +15 -43
  51. package/dist/pagination/pageable.js +32 -88
  52. package/dist/pagination/paginate.js +15 -53
  53. package/dist/requestAfterHook.js +14 -14
  54. package/dist/requestBeforeHook.js +1 -1
  55. package/dist/requestBeforeUrlHook.d.ts +7 -0
  56. package/dist/requestBeforeUrlHook.js +5 -0
  57. package/package.json +2 -2
  58. package/dist/api/account-information-api-custom.d.ts +0 -3
  59. package/dist/api/account-information-api-custom.js +0 -27
  60. package/dist/api/api-status-api-custom.d.ts +0 -3
  61. package/dist/api/api-status-api-custom.js +0 -27
  62. package/dist/api/authentication-api-custom.d.ts +0 -3
  63. package/dist/api/authentication-api-custom.js +0 -27
  64. package/dist/api/connections-api-custom.d.ts +0 -3
  65. package/dist/api/connections-api-custom.js +0 -27
  66. package/dist/api/error-logs-api-custom.d.ts +0 -3
  67. package/dist/api/error-logs-api-custom.js +0 -27
  68. package/dist/api/options-api-custom.d.ts +0 -3
  69. package/dist/api/options-api-custom.js +0 -27
  70. package/dist/api/reference-data-api-custom.d.ts +0 -3
  71. package/dist/api/reference-data-api-custom.js +0 -27
  72. package/dist/api/trading-api-custom.d.ts +0 -3
  73. package/dist/api/trading-api-custom.js +0 -27
  74. package/dist/api/transactions-and-reporting-api-custom.d.ts +0 -3
  75. package/dist/api/transactions-and-reporting-api-custom.js +0 -27
@@ -1,730 +1,22 @@
1
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
- * Do not edit the class manually.
13
- */
14
- var __extends = (this && this.__extends) || (function () {
15
- var extendStatics = function (d, b) {
16
- extendStatics = Object.setPrototypeOf ||
17
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
19
- return extendStatics(d, b);
20
- };
21
- return function (d, b) {
22
- if (typeof b !== "function" && b !== null)
23
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
24
- extendStatics(d, b);
25
- function __() { this.constructor = d; }
26
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
27
- };
28
- })();
29
- var __assign = (this && this.__assign) || function () {
30
- __assign = Object.assign || function(t) {
31
- for (var s, i = 1, n = arguments.length; i < n; i++) {
32
- s = arguments[i];
33
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
34
- t[p] = s[p];
35
- }
36
- return t;
37
- };
38
- return __assign.apply(this, arguments);
39
- };
40
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
41
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
42
- return new (P || (P = Promise))(function (resolve, reject) {
43
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
44
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
45
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
46
- step((generator = generator.apply(thisArg, _arguments || [])).next());
47
- });
48
- };
49
- var __generator = (this && this.__generator) || function (thisArg, body) {
50
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
51
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
52
- function verb(n) { return function (v) { return step([n, v]); }; }
53
- function step(op) {
54
- if (f) throw new TypeError("Generator is already executing.");
55
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
56
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
57
- if (y = 0, t) op = [op[0] & 2, t.value];
58
- switch (op[0]) {
59
- case 0: case 1: t = op; break;
60
- case 4: _.label++; return { value: op[1], done: false };
61
- case 5: _.label++; y = op[1]; op = [0]; continue;
62
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
63
- default:
64
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
65
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
66
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
67
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
68
- if (t[2]) _.ops.pop();
69
- _.trys.pop(); continue;
70
- }
71
- op = body.call(thisArg, _);
72
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
73
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
74
7
  }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
75
15
  };
76
16
  Object.defineProperty(exports, "__esModule", { value: true });
77
- exports.OptionsApi = exports.OptionsApiFactory = exports.OptionsApiFp = exports.OptionsApiAxiosParamCreator = void 0;
78
- var axios_1 = require("axios");
79
- // Some imports not used depending on template conditions
80
- // @ts-ignore
81
- var common_1 = require("../common");
82
- // @ts-ignore
83
- var base_1 = require("../base");
84
- var requestBeforeHook_1 = require("../requestBeforeHook");
85
- var options_api_custom_1 = require("./options-api-custom");
86
- /**
87
- * OptionsApi - axios parameter creator
88
- * @export
89
- */
90
- var OptionsApiAxiosParamCreator = function (configuration) {
91
- var _this = this;
92
- return {
93
- /**
94
- *
95
- * @summary Creates an option strategy object that will be used to place an option strategy order
96
- * @param {string} userId
97
- * @param {string} userSecret
98
- * @param {string} accountId The ID of the account get positions.
99
- * @param {OptionsGetOptionStrategyRequest} optionsGetOptionStrategyRequest
100
- * @param {*} [options] Override http request option.
101
- * @throws {RequiredError}
102
- */
103
- getOptionStrategy: function (userId, userSecret, accountId, optionsGetOptionStrategyRequest, options) {
104
- if (options === void 0) { options = {}; }
105
- return __awaiter(_this, void 0, void 0, function () {
106
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
109
- case 0:
110
- // verify required parameter 'userId' is not null or undefined
111
- (0, common_1.assertParamExists)('getOptionStrategy', 'userId', userId);
112
- // verify required parameter 'userSecret' is not null or undefined
113
- (0, common_1.assertParamExists)('getOptionStrategy', 'userSecret', userSecret);
114
- // verify required parameter 'accountId' is not null or undefined
115
- (0, common_1.assertParamExists)('getOptionStrategy', 'accountId', accountId);
116
- // verify required parameter 'optionsGetOptionStrategyRequest' is not null or undefined
117
- (0, common_1.assertParamExists)('getOptionStrategy', 'optionsGetOptionStrategyRequest', optionsGetOptionStrategyRequest);
118
- localVarPath = "/accounts/{accountId}/optionStrategy"
119
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
120
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
121
- if (configuration) {
122
- baseOptions = configuration.baseOptions;
123
- }
124
- localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
125
- localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
126
- localVarQueryParameter = {};
127
- // authentication PartnerClientId required
128
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
129
- // authentication PartnerSignature required
130
- ];
131
- case 1:
132
- // authentication PartnerClientId required
133
- _a.sent();
134
- // authentication PartnerSignature required
135
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
136
- // authentication PartnerTimestamp required
137
- ];
138
- case 2:
139
- // authentication PartnerSignature required
140
- _a.sent();
141
- // authentication PartnerTimestamp required
142
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
143
- case 3:
144
- // authentication PartnerTimestamp required
145
- _a.sent();
146
- if (userId !== undefined) {
147
- localVarQueryParameter['userId'] = userId;
148
- }
149
- if (userSecret !== undefined) {
150
- localVarQueryParameter['userSecret'] = userSecret;
151
- }
152
- localVarHeaderParameter['Content-Type'] = 'application/json';
153
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
154
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
155
- (0, requestBeforeHook_1.requestBeforeHook)({
156
- requestBody: optionsGetOptionStrategyRequest,
157
- queryParameters: localVarQueryParameter,
158
- requestConfig: localVarRequestOptions,
159
- path: localVarPath,
160
- configuration: configuration
161
- });
162
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsGetOptionStrategyRequest, localVarRequestOptions, configuration);
163
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
164
- return [2 /*return*/, {
165
- url: (0, common_1.toPathString)(localVarUrlObj),
166
- options: localVarRequestOptions,
167
- }];
168
- }
169
- });
170
- });
171
- },
172
- /**
173
- *
174
- * @summary Get the options chain
175
- * @param {string} userId
176
- * @param {string} userSecret
177
- * @param {string} accountId The ID of the account get positions.
178
- * @param {string} symbol Universal symbol ID if symbol
179
- * @param {*} [options] Override http request option.
180
- * @throws {RequiredError}
181
- */
182
- getOptionsChain: function (userId, userSecret, accountId, symbol, options) {
183
- if (options === void 0) { options = {}; }
184
- return __awaiter(_this, void 0, void 0, function () {
185
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
186
- return __generator(this, function (_a) {
187
- switch (_a.label) {
188
- case 0:
189
- // verify required parameter 'userId' is not null or undefined
190
- (0, common_1.assertParamExists)('getOptionsChain', 'userId', userId);
191
- // verify required parameter 'userSecret' is not null or undefined
192
- (0, common_1.assertParamExists)('getOptionsChain', 'userSecret', userSecret);
193
- // verify required parameter 'accountId' is not null or undefined
194
- (0, common_1.assertParamExists)('getOptionsChain', 'accountId', accountId);
195
- // verify required parameter 'symbol' is not null or undefined
196
- (0, common_1.assertParamExists)('getOptionsChain', 'symbol', symbol);
197
- localVarPath = "/accounts/{accountId}/optionsChain"
198
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
199
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
200
- if (configuration) {
201
- baseOptions = configuration.baseOptions;
202
- }
203
- localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
204
- localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
205
- localVarQueryParameter = {};
206
- // authentication PartnerClientId required
207
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
208
- // authentication PartnerSignature required
209
- ];
210
- case 1:
211
- // authentication PartnerClientId required
212
- _a.sent();
213
- // authentication PartnerSignature required
214
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
215
- // authentication PartnerTimestamp required
216
- ];
217
- case 2:
218
- // authentication PartnerSignature required
219
- _a.sent();
220
- // authentication PartnerTimestamp required
221
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
222
- case 3:
223
- // authentication PartnerTimestamp required
224
- _a.sent();
225
- if (userId !== undefined) {
226
- localVarQueryParameter['userId'] = userId;
227
- }
228
- if (userSecret !== undefined) {
229
- localVarQueryParameter['userSecret'] = userSecret;
230
- }
231
- if (symbol !== undefined) {
232
- localVarQueryParameter['symbol'] = symbol;
233
- }
234
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
235
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
236
- (0, requestBeforeHook_1.requestBeforeHook)({
237
- queryParameters: localVarQueryParameter,
238
- requestConfig: localVarRequestOptions,
239
- path: localVarPath,
240
- configuration: configuration
241
- });
242
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
243
- return [2 /*return*/, {
244
- url: (0, common_1.toPathString)(localVarUrlObj),
245
- options: localVarRequestOptions,
246
- }];
247
- }
248
- });
249
- });
250
- },
251
- /**
252
- *
253
- * @summary Get latest market data of option strategy
254
- * @param {string} userId
255
- * @param {string} userSecret
256
- * @param {string} accountId The ID of the account get positions.
257
- * @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
258
- * @param {*} [options] Override http request option.
259
- * @throws {RequiredError}
260
- */
261
- getOptionsStrategyQuote: function (userId, userSecret, accountId, optionStrategyId, options) {
262
- if (options === void 0) { options = {}; }
263
- return __awaiter(_this, void 0, void 0, function () {
264
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
265
- return __generator(this, function (_a) {
266
- switch (_a.label) {
267
- case 0:
268
- // verify required parameter 'userId' is not null or undefined
269
- (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userId', userId);
270
- // verify required parameter 'userSecret' is not null or undefined
271
- (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userSecret', userSecret);
272
- // verify required parameter 'accountId' is not null or undefined
273
- (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'accountId', accountId);
274
- // verify required parameter 'optionStrategyId' is not null or undefined
275
- (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'optionStrategyId', optionStrategyId);
276
- localVarPath = "/accounts/{accountId}/optionStrategy/{optionStrategyId}"
277
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
278
- .replace("{".concat("optionStrategyId", "}"), encodeURIComponent(String(optionStrategyId)));
279
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
280
- if (configuration) {
281
- baseOptions = configuration.baseOptions;
282
- }
283
- localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
284
- localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
285
- localVarQueryParameter = {};
286
- // authentication PartnerClientId required
287
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
288
- // authentication PartnerSignature required
289
- ];
290
- case 1:
291
- // authentication PartnerClientId required
292
- _a.sent();
293
- // authentication PartnerSignature required
294
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
295
- // authentication PartnerTimestamp required
296
- ];
297
- case 2:
298
- // authentication PartnerSignature required
299
- _a.sent();
300
- // authentication PartnerTimestamp required
301
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
302
- case 3:
303
- // authentication PartnerTimestamp required
304
- _a.sent();
305
- if (userId !== undefined) {
306
- localVarQueryParameter['userId'] = userId;
307
- }
308
- if (userSecret !== undefined) {
309
- localVarQueryParameter['userSecret'] = userSecret;
310
- }
311
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
312
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
313
- (0, requestBeforeHook_1.requestBeforeHook)({
314
- queryParameters: localVarQueryParameter,
315
- requestConfig: localVarRequestOptions,
316
- path: localVarPath,
317
- configuration: configuration
318
- });
319
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
320
- return [2 /*return*/, {
321
- url: (0, common_1.toPathString)(localVarUrlObj),
322
- options: localVarRequestOptions,
323
- }];
324
- }
325
- });
326
- });
327
- },
328
- /**
329
- *
330
- * @summary Get the options holdings in the account
331
- * @param {string} userId
332
- * @param {string} userSecret
333
- * @param {string} accountId The ID of the account get positions.
334
- * @param {*} [options] Override http request option.
335
- * @throws {RequiredError}
336
- */
337
- listOptionHoldings: function (userId, userSecret, accountId, options) {
338
- if (options === void 0) { options = {}; }
339
- return __awaiter(_this, void 0, void 0, function () {
340
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
341
- return __generator(this, function (_a) {
342
- switch (_a.label) {
343
- case 0:
344
- // verify required parameter 'userId' is not null or undefined
345
- (0, common_1.assertParamExists)('listOptionHoldings', 'userId', userId);
346
- // verify required parameter 'userSecret' is not null or undefined
347
- (0, common_1.assertParamExists)('listOptionHoldings', 'userSecret', userSecret);
348
- // verify required parameter 'accountId' is not null or undefined
349
- (0, common_1.assertParamExists)('listOptionHoldings', 'accountId', accountId);
350
- localVarPath = "/accounts/{accountId}/options"
351
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
352
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
353
- if (configuration) {
354
- baseOptions = configuration.baseOptions;
355
- }
356
- localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
357
- localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
358
- localVarQueryParameter = {};
359
- // authentication PartnerClientId required
360
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
361
- // authentication PartnerSignature required
362
- ];
363
- case 1:
364
- // authentication PartnerClientId required
365
- _a.sent();
366
- // authentication PartnerSignature required
367
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
368
- // authentication PartnerTimestamp required
369
- ];
370
- case 2:
371
- // authentication PartnerSignature required
372
- _a.sent();
373
- // authentication PartnerTimestamp required
374
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
375
- case 3:
376
- // authentication PartnerTimestamp required
377
- _a.sent();
378
- if (userId !== undefined) {
379
- localVarQueryParameter['userId'] = userId;
380
- }
381
- if (userSecret !== undefined) {
382
- localVarQueryParameter['userSecret'] = userSecret;
383
- }
384
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
385
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
386
- (0, requestBeforeHook_1.requestBeforeHook)({
387
- queryParameters: localVarQueryParameter,
388
- requestConfig: localVarRequestOptions,
389
- path: localVarPath,
390
- configuration: configuration
391
- });
392
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
393
- return [2 /*return*/, {
394
- url: (0, common_1.toPathString)(localVarUrlObj),
395
- options: localVarRequestOptions,
396
- }];
397
- }
398
- });
399
- });
400
- },
401
- /**
402
- *
403
- * @summary Place an option strategy order on the brokerage
404
- * @param {string} userId
405
- * @param {string} userSecret
406
- * @param {string} accountId The ID of the account get positions.
407
- * @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
408
- * @param {OptionsPlaceOptionStrategyRequest} optionsPlaceOptionStrategyRequest
409
- * @param {*} [options] Override http request option.
410
- * @throws {RequiredError}
411
- */
412
- placeOptionStrategy: function (userId, userSecret, accountId, optionStrategyId, optionsPlaceOptionStrategyRequest, options) {
413
- if (options === void 0) { options = {}; }
414
- return __awaiter(_this, void 0, void 0, function () {
415
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
416
- return __generator(this, function (_a) {
417
- switch (_a.label) {
418
- case 0:
419
- // verify required parameter 'userId' is not null or undefined
420
- (0, common_1.assertParamExists)('placeOptionStrategy', 'userId', userId);
421
- // verify required parameter 'userSecret' is not null or undefined
422
- (0, common_1.assertParamExists)('placeOptionStrategy', 'userSecret', userSecret);
423
- // verify required parameter 'accountId' is not null or undefined
424
- (0, common_1.assertParamExists)('placeOptionStrategy', 'accountId', accountId);
425
- // verify required parameter 'optionStrategyId' is not null or undefined
426
- (0, common_1.assertParamExists)('placeOptionStrategy', 'optionStrategyId', optionStrategyId);
427
- // verify required parameter 'optionsPlaceOptionStrategyRequest' is not null or undefined
428
- (0, common_1.assertParamExists)('placeOptionStrategy', 'optionsPlaceOptionStrategyRequest', optionsPlaceOptionStrategyRequest);
429
- localVarPath = "/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute"
430
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
431
- .replace("{".concat("optionStrategyId", "}"), encodeURIComponent(String(optionStrategyId)));
432
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
433
- if (configuration) {
434
- baseOptions = configuration.baseOptions;
435
- }
436
- localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
437
- localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
438
- localVarQueryParameter = {};
439
- // authentication PartnerClientId required
440
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
441
- // authentication PartnerSignature required
442
- ];
443
- case 1:
444
- // authentication PartnerClientId required
445
- _a.sent();
446
- // authentication PartnerSignature required
447
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
448
- // authentication PartnerTimestamp required
449
- ];
450
- case 2:
451
- // authentication PartnerSignature required
452
- _a.sent();
453
- // authentication PartnerTimestamp required
454
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
455
- case 3:
456
- // authentication PartnerTimestamp required
457
- _a.sent();
458
- if (userId !== undefined) {
459
- localVarQueryParameter['userId'] = userId;
460
- }
461
- if (userSecret !== undefined) {
462
- localVarQueryParameter['userSecret'] = userSecret;
463
- }
464
- localVarHeaderParameter['Content-Type'] = 'application/json';
465
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
466
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
467
- (0, requestBeforeHook_1.requestBeforeHook)({
468
- requestBody: optionsPlaceOptionStrategyRequest,
469
- queryParameters: localVarQueryParameter,
470
- requestConfig: localVarRequestOptions,
471
- path: localVarPath,
472
- configuration: configuration
473
- });
474
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsPlaceOptionStrategyRequest, localVarRequestOptions, configuration);
475
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
476
- return [2 /*return*/, {
477
- url: (0, common_1.toPathString)(localVarUrlObj),
478
- options: localVarRequestOptions,
479
- }];
480
- }
481
- });
482
- });
483
- },
484
- };
485
- };
486
- exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
487
- /**
488
- * OptionsApi - functional programming interface
489
- * @export
490
- */
491
- var OptionsApiFp = function (configuration) {
492
- var localVarAxiosParamCreator = (0, exports.OptionsApiAxiosParamCreator)(configuration);
493
- return {
494
- /**
495
- *
496
- * @summary Creates an option strategy object that will be used to place an option strategy order
497
- * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
498
- * @param {*} [options] Override http request option.
499
- * @throws {RequiredError}
500
- */
501
- getOptionStrategy: function (requestParameters, options) {
502
- return __awaiter(this, void 0, void 0, function () {
503
- var localVarAxiosArgs;
504
- return __generator(this, function (_a) {
505
- switch (_a.label) {
506
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters, options)];
507
- case 1:
508
- localVarAxiosArgs = _a.sent();
509
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
510
- }
511
- });
512
- });
513
- },
514
- /**
515
- *
516
- * @summary Get the options chain
517
- * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
518
- * @param {*} [options] Override http request option.
519
- * @throws {RequiredError}
520
- */
521
- getOptionsChain: function (requestParameters, options) {
522
- return __awaiter(this, void 0, void 0, function () {
523
- var localVarAxiosArgs;
524
- return __generator(this, function (_a) {
525
- switch (_a.label) {
526
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionsChain(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.symbol, options)];
527
- case 1:
528
- localVarAxiosArgs = _a.sent();
529
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
530
- }
531
- });
532
- });
533
- },
534
- /**
535
- *
536
- * @summary Get latest market data of option strategy
537
- * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
538
- * @param {*} [options] Override http request option.
539
- * @throws {RequiredError}
540
- */
541
- getOptionsStrategyQuote: function (requestParameters, options) {
542
- return __awaiter(this, void 0, void 0, function () {
543
- var localVarAxiosArgs;
544
- return __generator(this, function (_a) {
545
- switch (_a.label) {
546
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionsStrategyQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, options)];
547
- case 1:
548
- localVarAxiosArgs = _a.sent();
549
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
550
- }
551
- });
552
- });
553
- },
554
- /**
555
- *
556
- * @summary Get the options holdings in the account
557
- * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
558
- * @param {*} [options] Override http request option.
559
- * @throws {RequiredError}
560
- */
561
- listOptionHoldings: function (requestParameters, options) {
562
- return __awaiter(this, void 0, void 0, function () {
563
- var localVarAxiosArgs;
564
- return __generator(this, function (_a) {
565
- switch (_a.label) {
566
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.listOptionHoldings(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, options)];
567
- case 1:
568
- localVarAxiosArgs = _a.sent();
569
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
570
- }
571
- });
572
- });
573
- },
574
- /**
575
- *
576
- * @summary Place an option strategy order on the brokerage
577
- * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
578
- * @param {*} [options] Override http request option.
579
- * @throws {RequiredError}
580
- */
581
- placeOptionStrategy: function (requestParameters, options) {
582
- return __awaiter(this, void 0, void 0, function () {
583
- var localVarAxiosArgs;
584
- return __generator(this, function (_a) {
585
- switch (_a.label) {
586
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.placeOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, requestParameters, options)];
587
- case 1:
588
- localVarAxiosArgs = _a.sent();
589
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
590
- }
591
- });
592
- });
593
- },
594
- };
595
- };
596
- exports.OptionsApiFp = OptionsApiFp;
597
- /**
598
- * OptionsApi - factory interface
599
- * @export
600
- */
601
- var OptionsApiFactory = function (configuration, basePath, axios) {
602
- var localVarFp = (0, exports.OptionsApiFp)(configuration);
603
- return {
604
- /**
605
- *
606
- * @summary Creates an option strategy object that will be used to place an option strategy order
607
- * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
608
- * @param {*} [options] Override http request option.
609
- * @throws {RequiredError}
610
- */
611
- getOptionStrategy: function (requestParameters, options) {
612
- return localVarFp.getOptionStrategy(requestParameters, options).then(function (request) { return request(axios, basePath); });
613
- },
614
- /**
615
- *
616
- * @summary Get the options chain
617
- * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
618
- * @param {*} [options] Override http request option.
619
- * @throws {RequiredError}
620
- */
621
- getOptionsChain: function (requestParameters, options) {
622
- return localVarFp.getOptionsChain(requestParameters, options).then(function (request) { return request(axios, basePath); });
623
- },
624
- /**
625
- *
626
- * @summary Get latest market data of option strategy
627
- * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
628
- * @param {*} [options] Override http request option.
629
- * @throws {RequiredError}
630
- */
631
- getOptionsStrategyQuote: function (requestParameters, options) {
632
- return localVarFp.getOptionsStrategyQuote(requestParameters, options).then(function (request) { return request(axios, basePath); });
633
- },
634
- /**
635
- *
636
- * @summary Get the options holdings in the account
637
- * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
638
- * @param {*} [options] Override http request option.
639
- * @throws {RequiredError}
640
- */
641
- listOptionHoldings: function (requestParameters, options) {
642
- return localVarFp.listOptionHoldings(requestParameters, options).then(function (request) { return request(axios, basePath); });
643
- },
644
- /**
645
- *
646
- * @summary Place an option strategy order on the brokerage
647
- * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
648
- * @param {*} [options] Override http request option.
649
- * @throws {RequiredError}
650
- */
651
- placeOptionStrategy: function (requestParameters, options) {
652
- return localVarFp.placeOptionStrategy(requestParameters, options).then(function (request) { return request(axios, basePath); });
653
- },
654
- };
655
- };
656
- exports.OptionsApiFactory = OptionsApiFactory;
657
- /**
658
- * OptionsApi - object-oriented interface
659
- * @export
660
- * @class OptionsApi
661
- * @extends {BaseAPI}
662
- */
663
- var OptionsApi = /** @class */ (function (_super) {
664
- __extends(OptionsApi, _super);
665
- function OptionsApi() {
666
- return _super !== null && _super.apply(this, arguments) || this;
667
- }
668
- /**
669
- *
670
- * @summary Creates an option strategy object that will be used to place an option strategy order
671
- * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
672
- * @param {*} [options] Override http request option.
673
- * @throws {RequiredError}
674
- * @memberof OptionsApi
675
- */
676
- OptionsApi.prototype.getOptionStrategy = function (requestParameters, options) {
677
- var _this = this;
678
- return (0, exports.OptionsApiFp)(this.configuration).getOptionStrategy(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
679
- };
680
- /**
681
- *
682
- * @summary Get the options chain
683
- * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
684
- * @param {*} [options] Override http request option.
685
- * @throws {RequiredError}
686
- * @memberof OptionsApi
687
- */
688
- OptionsApi.prototype.getOptionsChain = function (requestParameters, options) {
689
- var _this = this;
690
- return (0, exports.OptionsApiFp)(this.configuration).getOptionsChain(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
691
- };
692
- /**
693
- *
694
- * @summary Get latest market data of option strategy
695
- * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
696
- * @param {*} [options] Override http request option.
697
- * @throws {RequiredError}
698
- * @memberof OptionsApi
699
- */
700
- OptionsApi.prototype.getOptionsStrategyQuote = function (requestParameters, options) {
701
- var _this = this;
702
- return (0, exports.OptionsApiFp)(this.configuration).getOptionsStrategyQuote(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
703
- };
704
- /**
705
- *
706
- * @summary Get the options holdings in the account
707
- * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
708
- * @param {*} [options] Override http request option.
709
- * @throws {RequiredError}
710
- * @memberof OptionsApi
711
- */
712
- OptionsApi.prototype.listOptionHoldings = function (requestParameters, options) {
713
- var _this = this;
714
- return (0, exports.OptionsApiFp)(this.configuration).listOptionHoldings(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
715
- };
716
- /**
717
- *
718
- * @summary Place an option strategy order on the brokerage
719
- * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
720
- * @param {*} [options] Override http request option.
721
- * @throws {RequiredError}
722
- * @memberof OptionsApi
723
- */
724
- OptionsApi.prototype.placeOptionStrategy = function (requestParameters, options) {
725
- var _this = this;
726
- return (0, exports.OptionsApiFp)(this.configuration).placeOptionStrategy(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
727
- };
728
- return OptionsApi;
729
- }(options_api_custom_1.OptionsApiCustom));
17
+ exports.OptionsApi = void 0;
18
+ const options_api_generated_1 = require("./options-api-generated");
19
+ __exportStar(require("./options-api-generated"), exports);
20
+ class OptionsApi extends options_api_generated_1.OptionsApiGenerated {
21
+ }
730
22
  exports.OptionsApi = OptionsApi;