@orbis-systems/orbis-api-clients 0.6.8 → 0.6.9

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