@brokerize/client 1.3.8 → 1.3.10
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/authorizedApiContext.d.ts +21 -22
- package/dist/authorizedApiContext.js +36 -41
- package/dist/client.d.ts +746 -393
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/modelExports.d.ts +1 -0
- package/dist/swagger/apis/DecoupledOperationsApi.d.ts +35 -0
- package/dist/swagger/apis/DecoupledOperationsApi.js +86 -0
- package/dist/swagger/apis/DemobrokerApi.d.ts +2 -2
- package/dist/swagger/apis/DemobrokerApi.js +2 -2
- package/dist/swagger/apis/{ChangeOrderApi.d.ts → OrderApi.d.ts} +35 -2
- package/dist/swagger/apis/{ChangeOrderApi.js → OrderApi.js} +117 -2
- package/dist/swagger/apis/{DefaultApi.d.ts → PortfolioApi.d.ts} +2 -160
- package/dist/swagger/apis/{DefaultApi.js → PortfolioApi.js} +2 -568
- package/dist/swagger/apis/SessionApi.d.ts +146 -0
- package/dist/swagger/apis/SessionApi.js +474 -0
- package/dist/swagger/apis/UserApi.d.ts +89 -1
- package/dist/swagger/apis/UserApi.js +309 -1
- package/dist/swagger/apis/WebsocketApi.d.ts +24 -0
- package/dist/swagger/apis/WebsocketApi.js +38 -0
- package/dist/swagger/apis/index.d.ts +5 -4
- package/dist/swagger/apis/index.js +5 -4
- package/dist/swagger/models/CheckRecoveryPhrase200Response.d.ts +27 -0
- package/dist/swagger/models/CheckRecoveryPhrase200Response.js +37 -0
- package/dist/swagger/models/CreateRecoveryPhraseParams.d.ts +28 -0
- package/dist/swagger/models/CreateRecoveryPhraseParams.js +37 -0
- package/dist/swagger/models/CreateRecoveryPhraseResult.d.ts +27 -0
- package/dist/swagger/models/CreateRecoveryPhraseResult.js +37 -0
- package/dist/swagger/models/GetRecoveryPhrasesResponse.d.ts +28 -0
- package/dist/swagger/models/GetRecoveryPhrasesResponse.js +38 -0
- package/dist/swagger/models/GetUserResponse.d.ts +6 -0
- package/dist/swagger/models/GetUserResponse.js +2 -0
- package/dist/swagger/models/LogoutOkResponseBody.d.ts +33 -0
- package/dist/swagger/models/LogoutOkResponseBody.js +42 -0
- package/dist/swagger/models/ObtainTokenByRecoveryPhraseParams.d.ts +27 -0
- package/dist/swagger/models/ObtainTokenByRecoveryPhraseParams.js +37 -0
- package/dist/swagger/models/RecoveryPhraseItem.d.ts +51 -0
- package/dist/swagger/models/RecoveryPhraseItem.js +45 -0
- package/dist/swagger/models/index.d.ts +7 -0
- package/dist/swagger/models/index.js +7 -0
- package/package.json +1 -1
- package/dist/swagger/apis/BrokerLoginApi.d.ts +0 -59
- package/dist/swagger/apis/BrokerLoginApi.js +0 -169
- package/dist/swagger/apis/CancelOrderApi.d.ts +0 -41
- package/dist/swagger/apis/CancelOrderApi.js +0 -101
|
@@ -3,29 +3,28 @@ import * as openApiClient from "./swagger";
|
|
|
3
3
|
import { AddSessionParams, ConfirmOAuthParams, CreateTradeChallengeRequest, CreateTradeRequest, DeleteDemoAccountRequest, DemoAccountSettings, GenericTable, GetCostEstimationParams, GetQuoteRequest, OrderChanges, PrepareOAuthRedirectParams, PrepareTradeRequest } from "./swagger";
|
|
4
4
|
import { BrokerizeWebSocketClient, Callback, Subscription } from "./websocketClient";
|
|
5
5
|
export declare class AuthorizedApiContext {
|
|
6
|
-
private _cfg;
|
|
7
|
-
private _auth;
|
|
8
|
-
private _defaultApi;
|
|
9
|
-
private _demoBrokerApi;
|
|
10
|
-
private _tradeApi;
|
|
11
|
-
private _tradeApiCryptoService;
|
|
12
6
|
private _isDestroyed;
|
|
13
|
-
private _abortController;
|
|
14
|
-
private _metaApi;
|
|
15
|
-
private _brokerLoginApi;
|
|
16
|
-
private _tradeDraftApi;
|
|
17
|
-
private _cancelOrderApi;
|
|
18
|
-
private _cancelOrderApiCryptoService;
|
|
19
|
-
private _changeOrderApi;
|
|
20
|
-
private _changeOrderApiCryptoService;
|
|
21
|
-
private _logoutSubject;
|
|
22
7
|
private _childContexts;
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
8
|
+
private readonly _cfg;
|
|
9
|
+
private readonly _auth;
|
|
10
|
+
private readonly _demoBrokerApi;
|
|
11
|
+
private readonly _tradeApi;
|
|
12
|
+
private readonly _tradeApiCryptoService;
|
|
13
|
+
private readonly _abortController;
|
|
14
|
+
private readonly _metaApi;
|
|
15
|
+
private readonly _sessionApi;
|
|
16
|
+
private readonly _tradeDraftApi;
|
|
17
|
+
private readonly _orderApi;
|
|
18
|
+
private readonly _orderApiCryptoService;
|
|
19
|
+
private readonly _logoutSubject;
|
|
20
|
+
private readonly _wsClient;
|
|
21
|
+
private readonly _cache;
|
|
22
|
+
private readonly _exportApi;
|
|
23
|
+
private readonly _adminApi;
|
|
24
|
+
private readonly _userApi;
|
|
25
|
+
private readonly _securitiesApi;
|
|
26
|
+
private readonly _portfolioApi;
|
|
27
|
+
private readonly _decoupledOperationsApi;
|
|
29
28
|
constructor(cfg: BrokerizeConfig, auth: Auth, wsClient?: BrokerizeWebSocketClient);
|
|
30
29
|
createChildContext(): AuthorizedApiContext;
|
|
31
30
|
private _initRequestInit;
|
|
@@ -70,7 +69,7 @@ export declare class AuthorizedApiContext {
|
|
|
70
69
|
cancelDecoupledOperation(req: openApiClient.CancelDecoupledOperationRequest): Promise<void>;
|
|
71
70
|
triggerSessionSync(sessionId: string): Promise<openApiClient.OkResponseBody>;
|
|
72
71
|
triggerDemoSessionSyncError(sessionId: string): Promise<openApiClient.OkResponseBody>;
|
|
73
|
-
logoutSession(sessionId: string): Promise<openApiClient.
|
|
72
|
+
logoutSession(sessionId: string): Promise<openApiClient.LogoutOkResponseBody>;
|
|
74
73
|
getUser(): Promise<openApiClient.GetUserResponse>;
|
|
75
74
|
deleteGuestUser(): Promise<void>;
|
|
76
75
|
prepareTrade(req: PrepareTradeRequest): Promise<openApiClient.PrepareTradeResponse>;
|
|
@@ -33,20 +33,19 @@ export class AuthorizedApiContext {
|
|
|
33
33
|
throw err;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
this._defaultApi = new openApiClient.DefaultApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
37
36
|
this._demoBrokerApi = new openApiClient.DemobrokerApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
38
37
|
this._tradeApi = new openApiClient.TradeApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
39
38
|
this._tradeApiCryptoService = new openApiClient.TradeApi(apiConfigCryptoService).withPostMiddleware(postMiddleware);
|
|
40
39
|
this._metaApi = new openApiClient.MetaApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
41
|
-
this.
|
|
40
|
+
this._sessionApi = new openApiClient.SessionApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
42
41
|
this._tradeDraftApi = new openApiClient.TradeDraftApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this._changeOrderApi = new openApiClient.ChangeOrderApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
46
|
-
this._changeOrderApiCryptoService = new openApiClient.ChangeOrderApi(apiConfigCryptoService).withPostMiddleware(postMiddleware);
|
|
42
|
+
this._orderApi = new openApiClient.OrderApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
43
|
+
this._orderApiCryptoService = new openApiClient.OrderApi(apiConfigCryptoService).withPostMiddleware(postMiddleware);
|
|
47
44
|
this._exportApi = new openApiClient.ExportApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
48
45
|
this._adminApi = new openApiClient.AdminApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
49
46
|
this._securitiesApi = new openApiClient.SecuritiesApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
47
|
+
this._portfolioApi = new openApiClient.PortfolioApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
48
|
+
this._decoupledOperationsApi = new openApiClient.DecoupledOperationsApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
50
49
|
this._userApi = new openApiClient.UserApi(apiConfig).withPostMiddleware(postMiddleware);
|
|
51
50
|
if (!cfg.createAbortController) {
|
|
52
51
|
throw new Error("createAbortController not provided. This should not happen as there should be a default implementation.");
|
|
@@ -116,10 +115,10 @@ export class AuthorizedApiContext {
|
|
|
116
115
|
return this._metaApi.getExchanges(await this._initRequestInit());
|
|
117
116
|
}
|
|
118
117
|
async addSession(params) {
|
|
119
|
-
return this.
|
|
118
|
+
return this._sessionApi.addSession({ addSessionParams: params }, await this._initRequestInit());
|
|
120
119
|
}
|
|
121
120
|
async getSessions() {
|
|
122
|
-
return this.
|
|
121
|
+
return this._sessionApi.getSessions(await this._initRequestInit());
|
|
123
122
|
}
|
|
124
123
|
async createDemoAccount(demoAccountSettings) {
|
|
125
124
|
return this._demoBrokerApi.createDemoAccount({
|
|
@@ -147,92 +146,88 @@ export class AuthorizedApiContext {
|
|
|
147
146
|
return this._demoBrokerApi.deleteDemoAccount(del, await this._initRequestInit());
|
|
148
147
|
}
|
|
149
148
|
async getOrder(orderId) {
|
|
150
|
-
return this.
|
|
149
|
+
return this._orderApi.getOrder({ id: orderId }, await this._initRequestInit());
|
|
151
150
|
}
|
|
152
151
|
async createCancelOrderChallenge(req) {
|
|
153
|
-
return this.
|
|
152
|
+
return this._orderApi.createCancelOrderChallenge(req, await this._initRequestInit());
|
|
154
153
|
}
|
|
155
154
|
async cancelOrder(req, viaCryptoService) {
|
|
156
|
-
const api = viaCryptoService
|
|
157
|
-
? this._cancelOrderApiCryptoService
|
|
158
|
-
: this._cancelOrderApi;
|
|
155
|
+
const api = viaCryptoService ? this._orderApiCryptoService : this._orderApi;
|
|
159
156
|
return api.cancelOrder(req, await this._initRequestInit());
|
|
160
157
|
}
|
|
161
158
|
async createChangeOrderChallenge(req) {
|
|
162
|
-
return this.
|
|
159
|
+
return this._orderApi.createChangeOrderChallenge(req, await this._initRequestInit());
|
|
163
160
|
}
|
|
164
161
|
async changeOrder(req, viaCryptoService) {
|
|
165
|
-
const api = viaCryptoService
|
|
166
|
-
? this._changeOrderApiCryptoService
|
|
167
|
-
: this._changeOrderApi;
|
|
162
|
+
const api = viaCryptoService ? this._orderApiCryptoService : this._orderApi;
|
|
168
163
|
return api.changeOrder(req, await this._initRequestInit());
|
|
169
164
|
}
|
|
170
165
|
async getPortfolios() {
|
|
171
|
-
return this.
|
|
166
|
+
return this._portfolioApi.getPortfolios(await this._initRequestInit());
|
|
172
167
|
}
|
|
173
168
|
async renamePortfolio(portfolioId, newPortfolioName) {
|
|
174
|
-
return this.
|
|
169
|
+
return this._portfolioApi.renamePortfolio({ portfolioId, renamePortfolioRequest: { newPortfolioName } }, await this._initRequestInit());
|
|
175
170
|
}
|
|
176
171
|
async deletePortfolio(portfolioId) {
|
|
177
|
-
return this.
|
|
172
|
+
return this._portfolioApi.deletePortfolio({ portfolioId }, await this._initRequestInit());
|
|
178
173
|
}
|
|
179
174
|
async getPortfolioQuotes(portfolioId) {
|
|
180
|
-
return this.
|
|
175
|
+
return this._portfolioApi.getPortfolioQuotes({ portfolioId }, await this._initRequestInit());
|
|
181
176
|
}
|
|
182
177
|
async getPortfolioPositions(portfolioId) {
|
|
183
|
-
return this.
|
|
178
|
+
return this._portfolioApi.getPortfolioPositions({ portfolioId }, await this._initRequestInit());
|
|
184
179
|
}
|
|
185
180
|
async getPortfolioOrders(req) {
|
|
186
|
-
return this.
|
|
181
|
+
return this._portfolioApi.getPortfolioOrders(req, await this._initRequestInit());
|
|
187
182
|
}
|
|
188
183
|
async getPortfolioTrades(req) {
|
|
189
|
-
return this.
|
|
184
|
+
return this._portfolioApi.getPortfolioTrades(req, await this._initRequestInit());
|
|
190
185
|
}
|
|
191
186
|
async getPortfolioCalendar(req) {
|
|
192
|
-
return this.
|
|
187
|
+
return this._portfolioApi.getPortfolioCalendar(req, await this._initRequestInit());
|
|
193
188
|
}
|
|
194
189
|
async getPortfolioTradeWarnings(req) {
|
|
195
|
-
return this.
|
|
190
|
+
return this._portfolioApi.getPortfolioTradeWarnings(req, await this._initRequestInit());
|
|
196
191
|
}
|
|
197
192
|
async getPortfolioTradeStatistics(req) {
|
|
198
|
-
return this.
|
|
193
|
+
return this._portfolioApi.getPortfolioTradeStatistics(req, await this._initRequestInit());
|
|
199
194
|
}
|
|
200
195
|
async getAuthInfo(portfolioId) {
|
|
201
|
-
return this.
|
|
196
|
+
return this._portfolioApi.getAuthInfo({ portfolioId }, await this._initRequestInit());
|
|
202
197
|
}
|
|
203
198
|
async addSessionCompleteChallenge(req) {
|
|
204
|
-
return this.
|
|
199
|
+
return this._sessionApi.addSessionCompleteChallenge(req, await this._initRequestInit());
|
|
205
200
|
}
|
|
206
201
|
async createSessionTanChallenge(req) {
|
|
207
|
-
return this.
|
|
202
|
+
return this._sessionApi.createSessionTanChallenge(req, await this._initRequestInit());
|
|
208
203
|
}
|
|
209
204
|
// XXX improve "kind" enum
|
|
210
205
|
async enableSessionTan(req) {
|
|
211
|
-
return this.
|
|
206
|
+
return this._sessionApi.enableSessionTan(req, await this._initRequestInit());
|
|
212
207
|
}
|
|
213
208
|
async endSessionTan(sessionId) {
|
|
214
|
-
return this.
|
|
209
|
+
return this._sessionApi.endSessionTan({ sessionId }, await this._initRequestInit());
|
|
215
210
|
}
|
|
216
211
|
async getDecoupledOperationStatus(req) {
|
|
217
|
-
return this.
|
|
212
|
+
return this._decoupledOperationsApi.getDecoupledOperationStatus(req, await this._initRequestInit());
|
|
218
213
|
}
|
|
219
214
|
async cancelDecoupledOperation(req) {
|
|
220
|
-
return this.
|
|
215
|
+
return this._decoupledOperationsApi.cancelDecoupledOperation(req, await this._initRequestInit());
|
|
221
216
|
}
|
|
222
217
|
async triggerSessionSync(sessionId) {
|
|
223
|
-
return this.
|
|
218
|
+
return this._sessionApi.triggerSessionSync({ sessionId }, await this._initRequestInit());
|
|
224
219
|
}
|
|
225
220
|
async triggerDemoSessionSyncError(sessionId) {
|
|
226
221
|
return this._demoBrokerApi.triggerDemoSessionSyncError({ sessionId }, await this._initRequestInit());
|
|
227
222
|
}
|
|
228
223
|
async logoutSession(sessionId) {
|
|
229
|
-
return this.
|
|
224
|
+
return this._sessionApi.logoutSession({ sessionId }, await this._initRequestInit());
|
|
230
225
|
}
|
|
231
226
|
async getUser() {
|
|
232
|
-
return this.
|
|
227
|
+
return this._userApi.getUser(await this._initRequestInit());
|
|
233
228
|
}
|
|
234
229
|
async deleteGuestUser() {
|
|
235
|
-
return this.
|
|
230
|
+
return this._userApi.deleteGuestUser(await this._initRequestInit());
|
|
236
231
|
}
|
|
237
232
|
async prepareTrade(req) {
|
|
238
233
|
return this._tradeApi.prepareTrade(req, await this._initRequestInit());
|
|
@@ -250,7 +245,7 @@ export class AuthorizedApiContext {
|
|
|
250
245
|
}, await this._initRequestInit());
|
|
251
246
|
}
|
|
252
247
|
async getChangeOrderCostEstimation(orderId, changes) {
|
|
253
|
-
return this.
|
|
248
|
+
return this._orderApi.getChangeOrderCostEstimation({
|
|
254
249
|
estimateChangeOrderCostsParams: {
|
|
255
250
|
changes,
|
|
256
251
|
},
|
|
@@ -261,10 +256,10 @@ export class AuthorizedApiContext {
|
|
|
261
256
|
return this._tradeApi.getQuote(p, await this._initRequestInit());
|
|
262
257
|
}
|
|
263
258
|
async prepareOAuthRedirect(p) {
|
|
264
|
-
return this.
|
|
259
|
+
return this._sessionApi.prepareOAuthRedirect({ prepareOAuthRedirectParams: p }, await this._initRequestInit());
|
|
265
260
|
}
|
|
266
261
|
async confirmOAuth(p) {
|
|
267
|
-
return this.
|
|
262
|
+
return this._sessionApi.confirmOAuth({ confirmOAuthParams: p }, await this._initRequestInit());
|
|
268
263
|
}
|
|
269
264
|
async getSecurityDetailedInfo(token) {
|
|
270
265
|
return this._tradeApi.getSecurityDetailedInfo({
|