@orbis-systems/orbis-api-clients 0.6.8 → 0.6.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.
Files changed (43) hide show
  1. package/dist/aesmidas/index.d.ts +104 -95
  2. package/dist/aesmidas/index.d.ts.map +1 -1
  3. package/dist/aesmidas/index.esm.js +1 -2806
  4. package/dist/aesmidas/index.esm.js.map +1 -1
  5. package/dist/aesmidas/index.js +1 -2811
  6. package/dist/aesmidas/index.js.map +1 -1
  7. package/dist/bridgewise/index.d.ts +169 -174
  8. package/dist/bridgewise/index.d.ts.map +1 -1
  9. package/dist/bridgewise/index.esm.js +1 -1888
  10. package/dist/bridgewise/index.esm.js.map +1 -1
  11. package/dist/bridgewise/index.js +1 -1893
  12. package/dist/bridgewise/index.js.map +1 -1
  13. package/dist/index.d.ts +1 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.esm.js +1 -257
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/index.js +1 -280
  18. package/dist/index.js.map +1 -1
  19. package/dist/insight/index.d.ts +503 -305
  20. package/dist/insight/index.d.ts.map +1 -1
  21. package/dist/insight/index.esm.js +1 -3754
  22. package/dist/insight/index.esm.js.map +1 -1
  23. package/dist/insight/index.js +1 -3759
  24. package/dist/insight/index.js.map +1 -1
  25. package/dist/middleware/index.d.ts +1 -2
  26. package/dist/middleware/index.d.ts.map +1 -1
  27. package/dist/middleware/index.esm.js +1 -1066
  28. package/dist/middleware/index.esm.js.map +1 -1
  29. package/dist/middleware/index.js +1 -1071
  30. package/dist/middleware/index.js.map +1 -1
  31. package/dist/orbis/index.d.ts +1161 -1162
  32. package/dist/orbis/index.d.ts.map +1 -1
  33. package/dist/orbis/index.esm.js +1 -7009
  34. package/dist/orbis/index.esm.js.map +1 -1
  35. package/dist/orbis/index.js +1 -7014
  36. package/dist/orbis/index.js.map +1 -1
  37. package/dist/uma/index.d.ts +361 -349
  38. package/dist/uma/index.d.ts.map +1 -1
  39. package/dist/uma/index.esm.js +1 -3993
  40. package/dist/uma/index.esm.js.map +1 -1
  41. package/dist/uma/index.js +1 -3998
  42. package/dist/uma/index.js.map +1 -1
  43. package/package.json +9 -1
@@ -1,1067 +1,2 @@
1
- import $cAFGd$autobind from "auto-bind";
2
- import {Mutex as $cAFGd$Mutex, E_CANCELED as $cAFGd$E_CANCELED} from "async-mutex";
3
- import {consola as $cAFGd$consola} from "consola";
4
- import {isBefore as $cAFGd$isBefore, subMinutes as $cAFGd$subMinutes} from "date-fns";
5
- import {jwtDecode as $cAFGd$jwtDecode} from "jwt-decode";
6
- import $cAFGd$axios, {isAxiosError as $cAFGd$isAxiosError} from "axios";
7
- import $cAFGd$axiosbetterstacktrace from "axios-better-stacktrace";
8
- import {isNil as $cAFGd$isNil, merge as $cAFGd$merge} from "lodash";
9
-
10
-
11
- function $parcel$export(e, n, v, s) {
12
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
- }
14
-
15
- function $parcel$exportWildcard(dest, source) {
16
- Object.keys(source).forEach(function(key) {
17
- if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {
18
- return;
19
- }
20
-
21
- Object.defineProperty(dest, key, {
22
- enumerable: true,
23
- get: function get() {
24
- return source[key];
25
- }
26
- });
27
- });
28
-
29
- return dest;
30
- }
31
- var $59a349f17b48d4fa$exports = {};
32
-
33
- $parcel$export($59a349f17b48d4fa$exports, "MiddlewareApi", () => $59a349f17b48d4fa$export$634e9891177d90f1);
34
-
35
- class $001a7a5b1ca54b2d$export$3ad201792064a82b {
36
- // request: ApiClient['request'];
37
- // get: ApiClient['get'];
38
- // delete: ApiClient['delete'];
39
- // head: ApiClient['head'];
40
- // options: ApiClient['options'];
41
- // post: ApiClient['post'];
42
- // put: ApiClient['put'];
43
- // patch: ApiClient['patch'];
44
- constructor(apiClient){
45
- this.apiClient = apiClient;
46
- (0, $cAFGd$autobind)(this);
47
- // this.request = this.client.request;
48
- // this.get = this.client.get;
49
- // this.delete = this.client.delete;
50
- // this.head = this.client.head;
51
- // this.options = this.client.options;
52
- // this.post = this.client.post;
53
- // this.put = this.client.put;
54
- // this.patch = this.client.patch;
55
- // this.get = this.client.get;
56
- }
57
- getApiClient() {
58
- return this.apiClient;
59
- }
60
- }
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
- var $e176194f300187e4$export$e2e108cbe2e4f865 = /*#__PURE__*/ function(ContentType) {
72
- ContentType["Json"] = "application/json";
73
- ContentType["FormData"] = "multipart/form-data";
74
- ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
75
- ContentType["Text"] = "text/plain";
76
- return ContentType;
77
- }({});
78
- class $e176194f300187e4$export$4f22f74eddb7716a {
79
- constructor(config){
80
- this.config = config;
81
- (0, $cAFGd$autobind)(this);
82
- this.storage = config.storage ?? sessionStorage;
83
- this.axiosInstance = (0, $cAFGd$axios).create({
84
- baseURL: config.baseUrl,
85
- withCredentials: config.withCredentials,
86
- headers: {
87
- 'Content-Type': 'application/json',
88
- ...config.defaultHeaders
89
- }
90
- });
91
- (0, $cAFGd$axiosbetterstacktrace)(this.axiosInstance);
92
- }
93
- stringifyFormItem(formItem) {
94
- if (typeof formItem === 'object' && formItem !== null) return JSON.stringify(formItem);
95
- else return `${formItem}`;
96
- }
97
- createFormData(input) {
98
- if (input instanceof FormData) return input;
99
- return Object.keys(input).reduce((formData, key)=>{
100
- const property = input[key];
101
- const propertyContent = property instanceof Array ? property : [
102
- property
103
- ];
104
- for (const formItem of propertyContent){
105
- const isFileType = formItem instanceof Blob || formItem instanceof File;
106
- formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
107
- }
108
- return formData;
109
- }, new FormData());
110
- }
111
- async request(requestConfig) {
112
- const { contentType: contentType, data: data } = requestConfig;
113
- if (!(0, $cAFGd$isNil)(data)) {
114
- if (contentType === "multipart/form-data" && typeof data === 'object') requestConfig.data = this.createFormData(data);
115
- if (contentType === "text/plain" && typeof data !== 'string') requestConfig.data = JSON.stringify(data);
116
- }
117
- const mergedConfig = (0, $cAFGd$merge)(requestConfig.secure ?? this.config.defaultSecure ?? true ? await this.prepareAuthRequestConfig() : {}, contentType ? {
118
- headers: {
119
- 'Content-Type': contentType
120
- }
121
- } : {}, requestConfig);
122
- try {
123
- const { data: data, status: status, statusText: statusText } = await this.axiosInstance.request(mergedConfig);
124
- return {
125
- success: true,
126
- data: data,
127
- status: status,
128
- statusText: statusText
129
- };
130
- } catch (error) {
131
- if (!this.config.handleError && !requestConfig.handleError) throw error;
132
- const result = {
133
- success: false,
134
- status: -1,
135
- statusText: String(error),
136
- error: error
137
- };
138
- if ((0, $cAFGd$isAxiosError)(error)) {
139
- this.config.onAxiosError?.(error);
140
- result.data = error.response?.data;
141
- result.status = error.response?.status ?? result.status;
142
- result.statusText = error.response?.statusText ?? result.statusText;
143
- }
144
- this.config.onError?.(error);
145
- return result;
146
- }
147
- }
148
- get(url, config) {
149
- return this.request({
150
- ...config,
151
- method: 'GET',
152
- url: url
153
- });
154
- }
155
- delete(url, config) {
156
- return this.request({
157
- ...config,
158
- method: 'DELETE',
159
- url: url
160
- });
161
- }
162
- head(url, config) {
163
- return this.request({
164
- ...config,
165
- method: 'HEAD',
166
- url: url
167
- });
168
- }
169
- options(url, config) {
170
- return this.request({
171
- ...config,
172
- method: 'OPTIONS',
173
- url: url
174
- });
175
- }
176
- post(url, data, config) {
177
- return this.request({
178
- ...config,
179
- method: 'POST',
180
- url: url,
181
- data: data
182
- });
183
- }
184
- put(url, data, config) {
185
- return this.request({
186
- ...config,
187
- method: 'PUT',
188
- url: url,
189
- data: data
190
- });
191
- }
192
- patch(url, data, config) {
193
- return this.request({
194
- ...config,
195
- method: 'PATCH',
196
- url: url,
197
- data: data
198
- });
199
- }
200
- getAxios() {
201
- return this.axiosInstance;
202
- }
203
- setAuthData(data) {
204
- this.storage.setItem(this.config.authDataStorageKey || 'auth', JSON.stringify(data));
205
- }
206
- getAuthData() {
207
- const data = this.storage.getItem(this.config.authDataStorageKey || 'auth');
208
- return data ? JSON.parse(data) : null;
209
- }
210
- getConfig() {
211
- return this.config;
212
- }
213
- }
214
-
215
-
216
- class $584c124673bb843e$export$f280b732bbc5934b extends (0, $e176194f300187e4$export$4f22f74eddb7716a) {
217
- constructor(config){
218
- super(config), this.config = config, this.lock = new (0, $cAFGd$Mutex)();
219
- }
220
- getConfig() {
221
- return super.getConfig();
222
- }
223
- setRenewTokenCallback(renewTokenCallback) {
224
- this.renewTokenCallback = renewTokenCallback;
225
- }
226
- async prepareAuthRequestConfig() {
227
- if (this.config.withCredentials) return {};
228
- let { accessToken: accessToken } = this.getAuthData() || {};
229
- if (!accessToken) {
230
- (0, $cAFGd$consola).warn('No access token found. Please set auth data after authorization.');
231
- return {};
232
- }
233
- if (this.config.autoRenewToken !== false && this.isTokenExpired(accessToken)) try {
234
- await this.lock.runExclusive(async ()=>{
235
- if (this.config.debug) (0, $cAFGd$consola).debug("Token expired. Renewing\u2026");
236
- accessToken = (await this.renewToken()).accessToken;
237
- this.lock.cancel();
238
- });
239
- } catch (error) {
240
- if (error === (0, $cAFGd$E_CANCELED)) accessToken = this.getAuthData()?.accessToken;
241
- else throw error;
242
- }
243
- return {
244
- headers: {
245
- Authorization: `${this.config.authSchema ?? 'Bearer'} ${accessToken}`
246
- }
247
- };
248
- }
249
- isTokenExpired(token) {
250
- const payload = (0, $cAFGd$jwtDecode)(token);
251
- if (!payload.exp) return true;
252
- return (0, $cAFGd$isBefore)((0, $cAFGd$subMinutes)(payload.exp * 1000, 1), Date.now());
253
- }
254
- async renewToken() {
255
- const callback = this.config.onRenewToken ?? this.renewTokenCallback;
256
- if (!callback) throw new Error('No renew token callback provided');
257
- const authData = await callback();
258
- this.setAuthData(authData);
259
- return authData;
260
- }
261
- }
262
-
263
-
264
- var $3bf589023d5ae0e7$exports = {};
265
- var $eb0d2d1d09761fc9$exports = {};
266
-
267
- $parcel$export($eb0d2d1d09761fc9$exports, "AvatarApi", () => $eb0d2d1d09761fc9$export$35ebcbc76ff5f1ef);
268
- /* eslint-disable */ /* tslint:disable */ /*
269
- * ---------------------------------------------------------------
270
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
271
- * ## ##
272
- * ## AUTHOR: acacode ##
273
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
274
- * ---------------------------------------------------------------
275
- */
276
- /* eslint-disable */ /* tslint:disable */ /*
277
- * ---------------------------------------------------------------
278
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
279
- * ## ##
280
- * ## AUTHOR: acacode ##
281
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
282
- * ---------------------------------------------------------------
283
- */
284
-
285
-
286
- class $eb0d2d1d09761fc9$export$35ebcbc76ff5f1ef {
287
- constructor(apiClient){
288
- this.apiClient = apiClient;
289
- (0, $cAFGd$autobind)(this);
290
- }
291
- /**
292
- * @tags AvatarApi
293
- * @name GetUserAvatar
294
- * @request GET:/api/v1/avatars/users/{userId}
295
- * @secure
296
- */ getUserAvatar(userId, config) {
297
- return this.apiClient.request({
298
- ...config,
299
- url: `/v1/avatars/users/${userId}`,
300
- method: 'GET',
301
- secure: true,
302
- responseType: 'blob'
303
- });
304
- }
305
- /**
306
- * @tags AvatarApi
307
- * @name UploadUserAvatar
308
- * @request POST:/api/v1/avatars/users/{userId}
309
- * @secure
310
- */ uploadUserAvatar(userId, data, config) {
311
- return this.apiClient.request({
312
- ...config,
313
- url: `/v1/avatars/users/${userId}`,
314
- method: 'POST',
315
- data: data,
316
- secure: true,
317
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).FormData
318
- });
319
- }
320
- /**
321
- * @tags AvatarApi
322
- * @name DeleteUserAvatar
323
- * @request DELETE:/api/v1/avatars/users/{userId}
324
- * @secure
325
- */ deleteUserAvatar(userId, config) {
326
- return this.apiClient.request({
327
- ...config,
328
- url: `/v1/avatars/users/${userId}`,
329
- method: 'DELETE',
330
- secure: true
331
- });
332
- }
333
- /**
334
- * @tags AvatarApi
335
- * @name GetAccountAvatar
336
- * @request GET:/api/v1/avatars/accounts/{accountId}
337
- * @secure
338
- */ getAccountAvatar(accountId, config) {
339
- return this.apiClient.request({
340
- ...config,
341
- url: `/v1/avatars/accounts/${accountId}`,
342
- method: 'GET',
343
- secure: true,
344
- responseType: 'blob'
345
- });
346
- }
347
- /**
348
- * @tags AvatarApi
349
- * @name UploadAccountAvatar
350
- * @request POST:/api/v1/avatars/accounts/{accountId}
351
- * @secure
352
- */ uploadAccountAvatar(accountId, data, config) {
353
- return this.apiClient.request({
354
- ...config,
355
- url: `/v1/avatars/accounts/${accountId}`,
356
- method: 'POST',
357
- data: data,
358
- secure: true,
359
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).FormData
360
- });
361
- }
362
- /**
363
- * @tags AvatarApi
364
- * @name DeleteAccountAvatar
365
- * @request DELETE:/api/v1/avatars/accounts/{accountId}
366
- * @secure
367
- */ deleteAccountAvatar(accountId, config) {
368
- return this.apiClient.request({
369
- ...config,
370
- url: `/v1/avatars/accounts/${accountId}`,
371
- method: 'DELETE',
372
- secure: true
373
- });
374
- }
375
- }
376
-
377
-
378
- var $e8246e3069d2d6d5$exports = {};
379
-
380
- $parcel$export($e8246e3069d2d6d5$exports, "AuthenticationApi", () => $e8246e3069d2d6d5$export$762f992a2f2efa56);
381
- /* eslint-disable */ /* tslint:disable */ /*
382
- * ---------------------------------------------------------------
383
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
384
- * ## ##
385
- * ## AUTHOR: acacode ##
386
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
387
- * ---------------------------------------------------------------
388
- */
389
- class $e8246e3069d2d6d5$export$762f992a2f2efa56 {
390
- constructor(apiClient){
391
- this.apiClient = apiClient;
392
- (0, $cAFGd$autobind)(this);
393
- }
394
- /**
395
- * @tags AuthenticationApi
396
- * @name Authenticate
397
- * @request POST:/api/v1/authenticate
398
- */ authenticate(headers, config) {
399
- return this.apiClient.request({
400
- ...config,
401
- url: `/v1/authenticate`,
402
- method: 'POST',
403
- secure: false,
404
- headers: headers,
405
- responseType: 'json'
406
- });
407
- }
408
- /**
409
- * @description Must use `refreshToken` instead of `accessToken` in `Authorization` header
410
- * @tags AuthenticationApi
411
- * @name Refresh
412
- * @request POST:/api/v1/refresh
413
- * @secure
414
- */ refresh(config) {
415
- return this.apiClient.request({
416
- ...config,
417
- url: `/v1/refresh`,
418
- method: 'POST',
419
- secure: true,
420
- responseType: 'json'
421
- });
422
- }
423
- /**
424
- * @tags AuthenticationApi
425
- * @name Invalidate
426
- * @request POST:/api/v1/invalidate
427
- * @secure
428
- */ invalidate(config) {
429
- return this.apiClient.request({
430
- ...config,
431
- url: `/v1/invalidate`,
432
- method: 'POST',
433
- secure: true
434
- });
435
- }
436
- }
437
-
438
-
439
- var $8fe9008dd804475c$exports = {};
440
-
441
- $parcel$export($8fe9008dd804475c$exports, "MiddlewareWatchlistEntryDtoTypeEnum", () => $8fe9008dd804475c$export$3f452a1c96052217);
442
- /* eslint-disable */ /* tslint:disable */ /*
443
- * ---------------------------------------------------------------
444
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
445
- * ## ##
446
- * ## AUTHOR: acacode ##
447
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
448
- * ---------------------------------------------------------------
449
- */ var $8fe9008dd804475c$export$3f452a1c96052217 = /*#__PURE__*/ function(MiddlewareWatchlistEntryDtoTypeEnum) {
450
- MiddlewareWatchlistEntryDtoTypeEnum["Equity"] = "equity";
451
- MiddlewareWatchlistEntryDtoTypeEnum["Option"] = "option";
452
- MiddlewareWatchlistEntryDtoTypeEnum["Crypto"] = "crypto";
453
- MiddlewareWatchlistEntryDtoTypeEnum["Bond"] = "bond";
454
- MiddlewareWatchlistEntryDtoTypeEnum["MutualFund"] = "mutualFund";
455
- return MiddlewareWatchlistEntryDtoTypeEnum;
456
- }({});
457
-
458
-
459
- var $baddfe4aead00de2$exports = {};
460
-
461
- $parcel$export($baddfe4aead00de2$exports, "AttributeApi", () => $baddfe4aead00de2$export$4b5ccf64eb32db90);
462
- /* eslint-disable */ /* tslint:disable */ /*
463
- * ---------------------------------------------------------------
464
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
465
- * ## ##
466
- * ## AUTHOR: acacode ##
467
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
468
- * ---------------------------------------------------------------
469
- */
470
- class $baddfe4aead00de2$export$4b5ccf64eb32db90 {
471
- constructor(apiClient){
472
- this.apiClient = apiClient;
473
- (0, $cAFGd$autobind)(this);
474
- }
475
- /**
476
- * @tags AttributeApi
477
- * @name GetAttributeValues
478
- * @request GET:/api/v1/attributes
479
- * @secure
480
- */ getAttributeValues(config) {
481
- return this.apiClient.request({
482
- ...config,
483
- url: `/v1/attributes`,
484
- method: 'GET',
485
- secure: true,
486
- responseType: 'json'
487
- });
488
- }
489
- /**
490
- * @tags AttributeApi
491
- * @name GetPublicAttributeValue
492
- * @request GET:/api/v1/attributes/{attributePublicId}
493
- * @secure
494
- */ getPublicAttributeValue(attributePublicId, config) {
495
- return this.apiClient.request({
496
- ...config,
497
- url: `/v1/attributes/${attributePublicId}`,
498
- method: 'GET',
499
- secure: true,
500
- responseType: 'json'
501
- });
502
- }
503
- }
504
-
505
-
506
- var $5d1dcff56264ccdd$exports = {};
507
-
508
- $parcel$export($5d1dcff56264ccdd$exports, "MessageApi", () => $5d1dcff56264ccdd$export$adfa0441784b848e);
509
- /* eslint-disable */ /* tslint:disable */ /*
510
- * ---------------------------------------------------------------
511
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
512
- * ## ##
513
- * ## AUTHOR: acacode ##
514
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
515
- * ---------------------------------------------------------------
516
- */
517
- class $5d1dcff56264ccdd$export$adfa0441784b848e {
518
- constructor(apiClient){
519
- this.apiClient = apiClient;
520
- (0, $cAFGd$autobind)(this);
521
- }
522
- /**
523
- * @tags MessageApi
524
- * @name GetMessages
525
- * @request GET:/api/v1/messages
526
- * @secure
527
- */ getMessages(query, config) {
528
- return this.apiClient.request({
529
- ...config,
530
- url: `/v1/messages`,
531
- method: 'GET',
532
- params: query,
533
- secure: true,
534
- responseType: 'json'
535
- });
536
- }
537
- /**
538
- * @tags MessageApi
539
- * @name MarkAsSeen
540
- * @request PATCH:/api/v1/messages/mark-as-seen
541
- * @secure
542
- */ markAsSeen(config) {
543
- return this.apiClient.request({
544
- ...config,
545
- url: `/v1/messages/mark-as-seen`,
546
- method: 'PATCH',
547
- secure: true
548
- });
549
- }
550
- }
551
-
552
-
553
- var $79142c23ace4c0bc$exports = {};
554
-
555
- $parcel$export($79142c23ace4c0bc$exports, "ChartApi", () => $79142c23ace4c0bc$export$449dbf88fe955d16);
556
- /* eslint-disable */ /* tslint:disable */ /*
557
- * ---------------------------------------------------------------
558
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
559
- * ## ##
560
- * ## AUTHOR: acacode ##
561
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
562
- * ---------------------------------------------------------------
563
- */
564
-
565
- class $79142c23ace4c0bc$export$449dbf88fe955d16 {
566
- constructor(apiClient){
567
- this.apiClient = apiClient;
568
- (0, $cAFGd$autobind)(this);
569
- }
570
- /**
571
- * @tags ChartApi
572
- * @name GetChartLayouts
573
- * @request GET:/api/v1/charts/layouts
574
- * @secure
575
- */ getChartLayouts(config) {
576
- return this.apiClient.request({
577
- ...config,
578
- url: `/v1/charts/layouts`,
579
- method: 'GET',
580
- secure: true,
581
- responseType: 'json'
582
- });
583
- }
584
- /**
585
- * @tags ChartApi
586
- * @name UpdateChartLayout
587
- * @request PUT:/api/v1/charts/layouts
588
- * @secure
589
- */ updateChartLayout(data, config) {
590
- return this.apiClient.request({
591
- ...config,
592
- url: `/v1/charts/layouts`,
593
- method: 'PUT',
594
- data: data,
595
- secure: true,
596
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json,
597
- responseType: 'json'
598
- });
599
- }
600
- /**
601
- * @tags ChartApi
602
- * @name GetChartLayoutDetails
603
- * @request GET:/api/v1/charts/layouts/{chartId}
604
- * @secure
605
- */ getChartLayoutDetails(chartId, config) {
606
- return this.apiClient.request({
607
- ...config,
608
- url: `/v1/charts/layouts/${chartId}`,
609
- method: 'GET',
610
- secure: true,
611
- responseType: 'json'
612
- });
613
- }
614
- /**
615
- * @tags ChartApi
616
- * @name DeleteChartLayout
617
- * @request DELETE:/api/v1/charts/layouts/{chartId}
618
- * @secure
619
- */ deleteChartLayout(chartId, config) {
620
- return this.apiClient.request({
621
- ...config,
622
- url: `/v1/charts/layouts/${chartId}`,
623
- method: 'DELETE',
624
- secure: true
625
- });
626
- }
627
- /**
628
- * @tags ChartApi
629
- * @name GetIndicatorTemplates
630
- * @request GET:/api/v1/charts/indicator-templates
631
- * @secure
632
- */ getIndicatorTemplates(config) {
633
- return this.apiClient.request({
634
- ...config,
635
- url: `/v1/charts/indicator-templates`,
636
- method: 'GET',
637
- secure: true,
638
- responseType: 'json'
639
- });
640
- }
641
- /**
642
- * @tags ChartApi
643
- * @name UpdateIndicatorTemplate
644
- * @request PUT:/api/v1/charts/indicator-templates
645
- * @secure
646
- */ updateIndicatorTemplate(data, config) {
647
- return this.apiClient.request({
648
- ...config,
649
- url: `/v1/charts/indicator-templates`,
650
- method: 'PUT',
651
- data: data,
652
- secure: true,
653
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json,
654
- responseType: 'json'
655
- });
656
- }
657
- /**
658
- * @tags ChartApi
659
- * @name GetIndicatorTemplateDetails
660
- * @request GET:/api/v1/charts/indicator-templates/{templateName}
661
- * @secure
662
- */ getIndicatorTemplateDetails(templateName, config) {
663
- return this.apiClient.request({
664
- ...config,
665
- url: `/v1/charts/indicator-templates/${templateName}`,
666
- method: 'GET',
667
- secure: true,
668
- responseType: 'json'
669
- });
670
- }
671
- /**
672
- * @tags ChartApi
673
- * @name DeleteIndicatorTemplate
674
- * @request DELETE:/api/v1/charts/indicator-templates/{templateName}
675
- * @secure
676
- */ deleteIndicatorTemplate(templateName, config) {
677
- return this.apiClient.request({
678
- ...config,
679
- url: `/v1/charts/indicator-templates/${templateName}`,
680
- method: 'DELETE',
681
- secure: true
682
- });
683
- }
684
- /**
685
- * @tags ChartApi
686
- * @name GetChartTemplates
687
- * @request GET:/api/v1/charts/templates
688
- * @secure
689
- */ getChartTemplates(config) {
690
- return this.apiClient.request({
691
- ...config,
692
- url: `/v1/charts/templates`,
693
- method: 'GET',
694
- secure: true,
695
- responseType: 'json'
696
- });
697
- }
698
- /**
699
- * @tags ChartApi
700
- * @name UpdateChartTemplate
701
- * @request PUT:/api/v1/charts/templates
702
- * @secure
703
- */ updateChartTemplate(data, config) {
704
- return this.apiClient.request({
705
- ...config,
706
- url: `/v1/charts/templates`,
707
- method: 'PUT',
708
- data: data,
709
- secure: true,
710
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json,
711
- responseType: 'json'
712
- });
713
- }
714
- /**
715
- * @tags ChartApi
716
- * @name GetChartTemplateDetails
717
- * @request GET:/api/v1/charts/templates/{templateName}
718
- * @secure
719
- */ getChartTemplateDetails(templateName, config) {
720
- return this.apiClient.request({
721
- ...config,
722
- url: `/v1/charts/templates/${templateName}`,
723
- method: 'GET',
724
- secure: true,
725
- responseType: 'json'
726
- });
727
- }
728
- /**
729
- * @tags ChartApi
730
- * @name DeleteChartTemplate
731
- * @request DELETE:/api/v1/charts/templates/{templateName}
732
- * @secure
733
- */ deleteChartTemplate(templateName, config) {
734
- return this.apiClient.request({
735
- ...config,
736
- url: `/v1/charts/templates/${templateName}`,
737
- method: 'DELETE',
738
- secure: true
739
- });
740
- }
741
- }
742
-
743
-
744
- var $e3077392348b7887$exports = {};
745
-
746
- $parcel$export($e3077392348b7887$exports, "WatchlistApi", () => $e3077392348b7887$export$8476017e5fc20c1b);
747
- /* eslint-disable */ /* tslint:disable */ /*
748
- * ---------------------------------------------------------------
749
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
750
- * ## ##
751
- * ## AUTHOR: acacode ##
752
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
753
- * ---------------------------------------------------------------
754
- */
755
-
756
- class $e3077392348b7887$export$8476017e5fc20c1b {
757
- constructor(apiClient){
758
- this.apiClient = apiClient;
759
- (0, $cAFGd$autobind)(this);
760
- }
761
- /**
762
- * @tags WatchlistApi
763
- * @name GetAllWatchlists
764
- * @request GET:/api/v1/watchlists
765
- * @secure
766
- */ getAllWatchlists(config) {
767
- return this.apiClient.request({
768
- ...config,
769
- url: `/v1/watchlists`,
770
- method: 'GET',
771
- secure: true,
772
- responseType: 'json'
773
- });
774
- }
775
- /**
776
- * @tags WatchlistApi
777
- * @name CreateWatchlist
778
- * @request POST:/api/v1/watchlists
779
- * @secure
780
- */ createWatchlist(data, config) {
781
- return this.apiClient.request({
782
- ...config,
783
- url: `/v1/watchlists`,
784
- method: 'POST',
785
- data: data,
786
- secure: true,
787
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json,
788
- responseType: 'json'
789
- });
790
- }
791
- /**
792
- * @tags WatchlistApi
793
- * @name GetWatchlist
794
- * @request GET:/api/v1/watchlists/{watchlistId}
795
- * @secure
796
- */ getWatchlist(watchlistId, config) {
797
- return this.apiClient.request({
798
- ...config,
799
- url: `/v1/watchlists/${watchlistId}`,
800
- method: 'GET',
801
- secure: true,
802
- responseType: 'json'
803
- });
804
- }
805
- /**
806
- * @tags WatchlistApi
807
- * @name UpdateWatchlist
808
- * @request PUT:/api/v1/watchlists/{watchlistId}
809
- * @secure
810
- */ updateWatchlist(watchlistId, data, config) {
811
- return this.apiClient.request({
812
- ...config,
813
- url: `/v1/watchlists/${watchlistId}`,
814
- method: 'PUT',
815
- data: data,
816
- secure: true,
817
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json,
818
- responseType: 'json'
819
- });
820
- }
821
- /**
822
- * @tags WatchlistApi
823
- * @name DeleteWatchlist
824
- * @request DELETE:/api/v1/watchlists/{watchlistId}
825
- * @secure
826
- */ deleteWatchlist(watchlistId, config) {
827
- return this.apiClient.request({
828
- ...config,
829
- url: `/v1/watchlists/${watchlistId}`,
830
- method: 'DELETE',
831
- secure: true
832
- });
833
- }
834
- /**
835
- * @tags WatchlistApi
836
- * @name AddWatchlistEntries
837
- * @request POST:/api/v1/watchlists/{watchlistId}/entries
838
- * @secure
839
- */ addWatchlistEntries(watchlistId, data, config) {
840
- return this.apiClient.request({
841
- ...config,
842
- url: `/v1/watchlists/${watchlistId}/entries`,
843
- method: 'POST',
844
- data: data,
845
- secure: true,
846
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json,
847
- responseType: 'json'
848
- });
849
- }
850
- /**
851
- * @tags WatchlistApi
852
- * @name RemoveWatchlistEntries
853
- * @request DELETE:/api/v1/watchlists/{watchlistId}/entries
854
- * @secure
855
- */ removeWatchlistEntries(watchlistId, data, config) {
856
- return this.apiClient.request({
857
- ...config,
858
- url: `/v1/watchlists/${watchlistId}/entries`,
859
- method: 'DELETE',
860
- data: data,
861
- secure: true,
862
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json,
863
- responseType: 'json'
864
- });
865
- }
866
- /**
867
- * @tags WatchlistApi
868
- * @name UpdateWatchlistEntries
869
- * @request PUT:/api/v1/watchlists/{watchlistId}/entries
870
- * @secure
871
- */ updateWatchlistEntries(watchlistId, data, config) {
872
- return this.apiClient.request({
873
- ...config,
874
- url: `/v1/watchlists/${watchlistId}/entries`,
875
- method: 'PUT',
876
- data: data,
877
- secure: true,
878
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json,
879
- responseType: 'json'
880
- });
881
- }
882
- /**
883
- * @tags WatchlistApi
884
- * @name UpdateWatchlistOrders
885
- * @request POST:/api/v1/watchlists/orders
886
- * @secure
887
- */ updateWatchlistOrders(data, config) {
888
- return this.apiClient.request({
889
- ...config,
890
- url: `/v1/watchlists/orders`,
891
- method: 'POST',
892
- data: data,
893
- secure: true,
894
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json
895
- });
896
- }
897
- /**
898
- * @tags WatchlistApi
899
- * @name ImportWatchmenWatchlists
900
- * @request POST:/api/v1/watchlists/import
901
- * @secure
902
- */ importWatchmenWatchlists(config) {
903
- return this.apiClient.request({
904
- ...config,
905
- url: `/v1/watchlists/import`,
906
- method: 'POST',
907
- secure: true
908
- });
909
- }
910
- }
911
-
912
-
913
- var $13db695db15b59e8$exports = {};
914
-
915
- $parcel$export($13db695db15b59e8$exports, "PreferenceApi", () => $13db695db15b59e8$export$ee36c1f919e724be);
916
- /* eslint-disable */ /* tslint:disable */ /*
917
- * ---------------------------------------------------------------
918
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
919
- * ## ##
920
- * ## AUTHOR: acacode ##
921
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
922
- * ---------------------------------------------------------------
923
- */
924
- class $13db695db15b59e8$export$ee36c1f919e724be {
925
- constructor(apiClient){
926
- this.apiClient = apiClient;
927
- (0, $cAFGd$autobind)(this);
928
- }
929
- /**
930
- * @tags PreferenceApi
931
- * @name GetPreferences
932
- * @request GET:/api/v1/preferences
933
- * @secure
934
- */ getPreferences(config) {
935
- return this.apiClient.request({
936
- ...config,
937
- url: `/v1/preferences`,
938
- method: 'GET',
939
- secure: true,
940
- responseType: 'json'
941
- });
942
- }
943
- /**
944
- * @tags PreferenceApi
945
- * @name SavePreferences
946
- * @request POST:/api/v1/preferences
947
- * @secure
948
- */ savePreferences(config) {
949
- return this.apiClient.request({
950
- ...config,
951
- url: `/v1/preferences`,
952
- method: 'POST',
953
- secure: true,
954
- responseType: 'json'
955
- });
956
- }
957
- }
958
-
959
-
960
- var $acf59887331dcbd1$exports = {};
961
-
962
- $parcel$export($acf59887331dcbd1$exports, "VersioningApi", () => $acf59887331dcbd1$export$a04b2e4c36dfcee7);
963
- /* eslint-disable */ /* tslint:disable */ /*
964
- * ---------------------------------------------------------------
965
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
966
- * ## ##
967
- * ## AUTHOR: acacode ##
968
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
969
- * ---------------------------------------------------------------
970
- */
971
-
972
- class $acf59887331dcbd1$export$a04b2e4c36dfcee7 {
973
- constructor(apiClient){
974
- this.apiClient = apiClient;
975
- (0, $cAFGd$autobind)(this);
976
- }
977
- /**
978
- * @tags VersioningApi
979
- * @name GetAppVersion
980
- * @request GET:/api/versioning/{appId}
981
- */ getAppVersion(appId, config) {
982
- return this.apiClient.request({
983
- ...config,
984
- url: `/versioning/${appId}`,
985
- method: 'GET',
986
- secure: false,
987
- responseType: 'json'
988
- });
989
- }
990
- /**
991
- * @tags VersioningApi
992
- * @name UpdateAppVersion
993
- * @request POST:/api/versioning/{appId}
994
- */ updateAppVersion(appId, data, config) {
995
- return this.apiClient.request({
996
- ...config,
997
- url: `/versioning/${appId}`,
998
- method: 'POST',
999
- data: data,
1000
- secure: false,
1001
- contentType: (0, $e176194f300187e4$export$e2e108cbe2e4f865).Json
1002
- });
1003
- }
1004
- }
1005
-
1006
-
1007
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $eb0d2d1d09761fc9$exports);
1008
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $e8246e3069d2d6d5$exports);
1009
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $8fe9008dd804475c$exports);
1010
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $baddfe4aead00de2$exports);
1011
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $5d1dcff56264ccdd$exports);
1012
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $79142c23ace4c0bc$exports);
1013
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $e3077392348b7887$exports);
1014
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $13db695db15b59e8$exports);
1015
- $parcel$exportWildcard($3bf589023d5ae0e7$exports, $acf59887331dcbd1$exports);
1016
-
1017
-
1018
- class $59a349f17b48d4fa$var$AuthenticationApiWrapper extends (0, $e8246e3069d2d6d5$export$762f992a2f2efa56) {
1019
- constructor(apiClient){
1020
- super(apiClient);
1021
- this.apiClient.setRenewTokenCallback(this.renewToken);
1022
- }
1023
- async authenticate(headers, config) {
1024
- const response = await super.authenticate(headers, {
1025
- ...config,
1026
- withCredentials: true
1027
- });
1028
- if (response.success) this.apiClient.setAuthData(response.data);
1029
- return response;
1030
- }
1031
- async renewToken() {
1032
- const refreshToken = this.apiClient.getAuthData()?.refreshToken;
1033
- if (!refreshToken) throw new Error('Refresh token not found');
1034
- const response = await this.refresh({
1035
- handleError: true,
1036
- withCredentials: true,
1037
- headers: {
1038
- Authorization: `${this.apiClient.getConfig().authSchema ?? 'Bearer'} ${refreshToken}`
1039
- }
1040
- });
1041
- if (response.success) return {
1042
- accessToken: response.data.accessToken,
1043
- refreshToken: response.data.refreshToken
1044
- };
1045
- else throw new Error(`Could not renew token: ${String(response.error)}`);
1046
- }
1047
- }
1048
- class $59a349f17b48d4fa$export$634e9891177d90f1 extends (0, $001a7a5b1ca54b2d$export$3ad201792064a82b) {
1049
- constructor(config){
1050
- super(new (0, $584c124673bb843e$export$f280b732bbc5934b)(config)), this.config = config;
1051
- this.attribute = new (0, $baddfe4aead00de2$export$4b5ccf64eb32db90)(this.apiClient);
1052
- this.authentication = new $59a349f17b48d4fa$var$AuthenticationApiWrapper(this.apiClient);
1053
- this.avatar = new (0, $eb0d2d1d09761fc9$export$35ebcbc76ff5f1ef)(this.apiClient);
1054
- this.chart = new (0, $79142c23ace4c0bc$export$449dbf88fe955d16)(this.apiClient);
1055
- this.message = new (0, $5d1dcff56264ccdd$export$adfa0441784b848e)(this.apiClient);
1056
- this.preference = new (0, $13db695db15b59e8$export$ee36c1f919e724be)(this.apiClient);
1057
- this.versioning = new (0, $acf59887331dcbd1$export$a04b2e4c36dfcee7)(this.apiClient);
1058
- this.watchlist = new (0, $e3077392348b7887$export$8476017e5fc20c1b)(this.apiClient);
1059
- }
1060
- }
1061
-
1062
-
1063
-
1064
-
1065
-
1066
- export {$59a349f17b48d4fa$export$634e9891177d90f1 as MiddlewareApi, $eb0d2d1d09761fc9$export$35ebcbc76ff5f1ef as AvatarApi, $e8246e3069d2d6d5$export$762f992a2f2efa56 as AuthenticationApi, $8fe9008dd804475c$export$3f452a1c96052217 as MiddlewareWatchlistEntryDtoTypeEnum, $baddfe4aead00de2$export$4b5ccf64eb32db90 as AttributeApi, $5d1dcff56264ccdd$export$adfa0441784b848e as MessageApi, $79142c23ace4c0bc$export$449dbf88fe955d16 as ChartApi, $e3077392348b7887$export$8476017e5fc20c1b as WatchlistApi, $13db695db15b59e8$export$ee36c1f919e724be as PreferenceApi, $acf59887331dcbd1$export$a04b2e4c36dfcee7 as VersioningApi};
1
+ import e from"auto-bind";import{Mutex as t,E_CANCELED as s}from"async-mutex";import{consola as r}from"consola";import{isBefore as a,subMinutes as i}from"date-fns";import{jwtDecode as n}from"jwt-decode";import o,{isAxiosError as u}from"axios";import c from"axios-better-stacktrace";import{isNil as h,merge as l}from"lodash";function p(e,t,s,r){Object.defineProperty(e,t,{get:s,set:r,enumerable:!0,configurable:!0})}function d(e,t){return Object.keys(t).forEach(function(s){"default"===s||"__esModule"===s||Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[s]}})}),e}p({},"MiddlewareApi",()=>U);class T{constructor(t){this.apiClient=t,e(this)}getApiClient(){return this.apiClient}}var m,f,C=((m={}).Json="application/json",m.FormData="multipart/form-data",m.UrlEncoded="application/x-www-form-urlencoded",m.Text="text/plain",m);class g{constructor(t){this.config=t,e(this),this.storage=t.storage??sessionStorage,this.axiosInstance=o.create({...t.axiosConfig,baseURL:t.baseUrl,headers:{"Content-Type":"application/json",...t.axiosConfig?.headers}}),c(this.axiosInstance)}stringifyFormItem(e){return"object"==typeof e&&null!==e?JSON.stringify(e):`${e}`}createFormData(e){return e instanceof FormData?e:Object.keys(e).reduce((t,s)=>{let r=e[s];for(let e of r instanceof Array?r:[r]){let r=e instanceof Blob||e instanceof File;t.append(s,r?e:this.stringifyFormItem(e))}return t},new FormData)}async request(e){let{contentType:t,data:s}=e;h(s)||("multipart/form-data"===t&&"object"==typeof s&&(e.data=this.createFormData(s)),"text/plain"===t&&"string"!=typeof s&&(e.data=JSON.stringify(s)));let r=l(e.secure??this.config.defaultSecure??!0?await this.prepareAuthRequestConfig():{},t?{headers:{"Content-Type":t}}:{},e);try{let{data:e,status:t,statusText:s}=await this.axiosInstance.request(r);return{success:!0,data:e,status:t,statusText:s}}catch(s){let t={success:!1,status:-1,statusText:String(s),error:s};if(u(s)&&(this.config.onAxiosError?.(s),t.data=s.response?.data,t.status=s.response?.status??t.status,t.statusText=s.response?.statusText??t.statusText),this.config.onError?.(s),!this.config.handleError&&!e.handleError)throw s;return t}}get(e,t){return this.request({...t,method:"GET",url:e})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}post(e,t,s){return this.request({...s,method:"POST",url:e,data:t})}put(e,t,s){return this.request({...s,method:"PUT",url:e,data:t})}patch(e,t,s){return this.request({...s,method:"PATCH",url:e,data:t})}getAxios(){return this.axiosInstance}setAuthData(e){this.storage.setItem(this.config.authDataStorageKey||"auth",JSON.stringify(e))}getAuthData(){let e=this.storage.getItem(this.config.authDataStorageKey||"auth");return e?JSON.parse(e):null}getConfig(){return this.config}}class y extends g{constructor(e){super(e),this.config=e,this.lock=new t}getConfig(){return super.getConfig()}setRenewTokenCallback(e){this.renewTokenCallback=e}async prepareAuthRequestConfig(){if(this.config.axiosConfig?.withCredentials)return{};let{accessToken:e}=this.getAuthData()||{};if(!e)return r.warn("No access token found. Please set auth data after authorization."),{};if(!1!==this.config.autoRenewToken&&this.isTokenExpired(e))try{await this.lock.runExclusive(async()=>{this.config.debug&&r.debug("Token expired. Renewing…"),e=(await this.renewToken()).accessToken,this.lock.cancel()})}catch(t){if(t===s)e=this.getAuthData()?.accessToken;else throw t}return{headers:{Authorization:`${this.config.authSchema??"Bearer"} ${e}`}}}isTokenExpired(e){let t=n(e);return!t.exp||a(i(1e3*t.exp,1),Date.now())}async renewToken(){let e=this.config.onRenewToken??this.renewTokenCallback;if(!e)throw Error("No renew token callback provided");let t=await e();return this.setAuthData(t),t}}var v={},E={};p(E,"AvatarApi",()=>w);class w{constructor(t){this.apiClient=t,e(this)}getUserAvatar(e,t){return this.apiClient.request({...t,url:`/v1/avatars/users/${e}`,method:"GET",secure:!0,responseType:"blob"})}uploadUserAvatar(e,t,s){return this.apiClient.request({...s,url:`/v1/avatars/users/${e}`,method:"POST",data:t,secure:!0,contentType:C.FormData})}deleteUserAvatar(e,t){return this.apiClient.request({...t,url:`/v1/avatars/users/${e}`,method:"DELETE",secure:!0})}getAccountAvatar(e,t){return this.apiClient.request({...t,url:`/v1/avatars/accounts/${e}`,method:"GET",secure:!0,responseType:"blob"})}uploadAccountAvatar(e,t,s){return this.apiClient.request({...s,url:`/v1/avatars/accounts/${e}`,method:"POST",data:t,secure:!0,contentType:C.FormData})}deleteAccountAvatar(e,t){return this.apiClient.request({...t,url:`/v1/avatars/accounts/${e}`,method:"DELETE",secure:!0})}}var A={};p(A,"MiddlewareWatchlistEntryDtoTypeEnum",()=>$);var $=((f={}).Equity="equity",f.Option="option",f.Crypto="crypto",f.Bond="bond",f.MutualFund="mutualFund",f),b={};p(b,"AuthenticationApi",()=>q);class q{constructor(t){this.apiClient=t,e(this)}authenticate(e,t){return this.apiClient.request({...t,url:"/v1/authenticate",method:"POST",secure:!1,headers:e,responseType:"json"})}refresh(e){return this.apiClient.request({...e,url:"/v1/refresh",method:"POST",secure:!0,responseType:"json"})}invalidate(e){return this.apiClient.request({...e,url:"/v1/invalidate",method:"POST",secure:!0})}}var x={};p(x,"AttributeApi",()=>k);class k{constructor(t){this.apiClient=t,e(this)}getAttributeValues(e){return this.apiClient.request({...e,url:"/v1/attributes",method:"GET",secure:!0,responseType:"json"})}getPublicAttributeValue(e,t){return this.apiClient.request({...t,url:`/v1/attributes/${e}`,method:"GET",secure:!0,responseType:"json"})}}var j={};p(j,"MessageApi",()=>D);class D{constructor(t){this.apiClient=t,e(this)}getMessages(e,t){return this.apiClient.request({...t,url:"/v1/messages",method:"GET",params:e,secure:!0,responseType:"json"})}markAsSeen(e){return this.apiClient.request({...e,url:"/v1/messages/mark-as-seen",method:"PATCH",secure:!0})}}var P={};p(P,"ChartApi",()=>O);class O{constructor(t){this.apiClient=t,e(this)}getChartLayouts(e){return this.apiClient.request({...e,url:"/v1/charts/layouts",method:"GET",secure:!0,responseType:"json"})}updateChartLayout(e,t){return this.apiClient.request({...t,url:"/v1/charts/layouts",method:"PUT",data:e,secure:!0,contentType:C.Json,responseType:"json"})}getChartLayoutDetails(e,t){return this.apiClient.request({...t,url:`/v1/charts/layouts/${e}`,method:"GET",secure:!0,responseType:"json"})}deleteChartLayout(e,t){return this.apiClient.request({...t,url:`/v1/charts/layouts/${e}`,method:"DELETE",secure:!0})}getIndicatorTemplates(e){return this.apiClient.request({...e,url:"/v1/charts/indicator-templates",method:"GET",secure:!0,responseType:"json"})}updateIndicatorTemplate(e,t){return this.apiClient.request({...t,url:"/v1/charts/indicator-templates",method:"PUT",data:e,secure:!0,contentType:C.Json,responseType:"json"})}getIndicatorTemplateDetails(e,t){return this.apiClient.request({...t,url:`/v1/charts/indicator-templates/${e}`,method:"GET",secure:!0,responseType:"json"})}deleteIndicatorTemplate(e,t){return this.apiClient.request({...t,url:`/v1/charts/indicator-templates/${e}`,method:"DELETE",secure:!0})}getChartTemplates(e){return this.apiClient.request({...e,url:"/v1/charts/templates",method:"GET",secure:!0,responseType:"json"})}updateChartTemplate(e,t){return this.apiClient.request({...t,url:"/v1/charts/templates",method:"PUT",data:e,secure:!0,contentType:C.Json,responseType:"json"})}getChartTemplateDetails(e,t){return this.apiClient.request({...t,url:`/v1/charts/templates/${e}`,method:"GET",secure:!0,responseType:"json"})}deleteChartTemplate(e,t){return this.apiClient.request({...t,url:`/v1/charts/templates/${e}`,method:"DELETE",secure:!0})}}var S={};p(S,"WatchlistApi",()=>G);class G{constructor(t){this.apiClient=t,e(this)}getAllWatchlists(e){return this.apiClient.request({...e,url:"/v1/watchlists",method:"GET",secure:!0,responseType:"json"})}createWatchlist(e,t){return this.apiClient.request({...t,url:"/v1/watchlists",method:"POST",data:e,secure:!0,contentType:C.Json,responseType:"json"})}getWatchlist(e,t){return this.apiClient.request({...t,url:`/v1/watchlists/${e}`,method:"GET",secure:!0,responseType:"json"})}updateWatchlist(e,t,s){return this.apiClient.request({...s,url:`/v1/watchlists/${e}`,method:"PUT",data:t,secure:!0,contentType:C.Json,responseType:"json"})}deleteWatchlist(e,t){return this.apiClient.request({...t,url:`/v1/watchlists/${e}`,method:"DELETE",secure:!0})}addWatchlistEntries(e,t,s){return this.apiClient.request({...s,url:`/v1/watchlists/${e}/entries`,method:"POST",data:t,secure:!0,contentType:C.Json,responseType:"json"})}removeWatchlistEntries(e,t,s){return this.apiClient.request({...s,url:`/v1/watchlists/${e}/entries`,method:"DELETE",data:t,secure:!0,contentType:C.Json,responseType:"json"})}updateWatchlistEntries(e,t,s){return this.apiClient.request({...s,url:`/v1/watchlists/${e}/entries`,method:"PUT",data:t,secure:!0,contentType:C.Json,responseType:"json"})}updateWatchlistOrders(e,t){return this.apiClient.request({...t,url:"/v1/watchlists/orders",method:"POST",data:e,secure:!0,contentType:C.Json})}importWatchmenWatchlists(e){return this.apiClient.request({...e,url:"/v1/watchlists/import",method:"POST",secure:!0})}}var J={};p(J,"PreferenceApi",()=>W);class W{constructor(t){this.apiClient=t,e(this)}getPreferences(e){return this.apiClient.request({...e,url:"/v1/preferences",method:"GET",secure:!0,responseType:"json"})}savePreferences(e){return this.apiClient.request({...e,url:"/v1/preferences",method:"POST",secure:!0,responseType:"json"})}}var L={};p(L,"VersioningApi",()=>I);class I{constructor(t){this.apiClient=t,e(this)}getAppVersion(e,t){return this.apiClient.request({...t,url:`/versioning/${e}`,method:"GET",secure:!1,responseType:"json"})}updateAppVersion(e,t,s){return this.apiClient.request({...s,url:`/versioning/${e}`,method:"POST",data:t,secure:!1,contentType:C.Json})}}d(v,E),d(v,A),d(v,b),d(v,x),d(v,j),d(v,P),d(v,S),d(v,J),d(v,L);class F extends q{constructor(e){super(e),this.apiClient.setRenewTokenCallback(this.renewToken)}async authenticate(e,t){let s=await super.authenticate(e,{...t,withCredentials:!0});return s.success&&this.apiClient.setAuthData(s.data),s}async renewToken(){let e=this.apiClient.getAuthData()?.refreshToken;if(!e)throw Error("Refresh token not found");let t=await this.refresh({handleError:!0,withCredentials:!0,headers:{Authorization:`${this.apiClient.getConfig().authSchema??"Bearer"} ${e}`}});if(t.success)return{accessToken:t.data.accessToken,refreshToken:t.data.refreshToken};throw Error(`Could not renew token: ${String(t.error)}`)}}class U extends T{constructor(e){super(new y(e)),this.config=e,this.attribute=new k(this.apiClient),this.authentication=new F(this.apiClient),this.avatar=new w(this.apiClient),this.chart=new O(this.apiClient),this.message=new D(this.apiClient),this.preference=new W(this.apiClient),this.versioning=new I(this.apiClient),this.watchlist=new G(this.apiClient)}}export{U as MiddlewareApi,w as AvatarApi,$ as MiddlewareWatchlistEntryDtoTypeEnum,q as AuthenticationApi,k as AttributeApi,D as MessageApi,O as ChartApi,G as WatchlistApi,W as PreferenceApi,I as VersioningApi};
1067
2
  //# sourceMappingURL=index.esm.js.map