@orbis-systems/orbis-api-clients 0.3.1 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aesmidas/index.d.ts +3756 -0
- package/dist/aesmidas/index.d.ts.map +1 -0
- package/dist/aesmidas/index.esm.js +2 -0
- package/dist/aesmidas/index.esm.js.map +1 -0
- package/dist/aesmidas/index.js +2 -0
- package/dist/aesmidas/index.js.map +1 -0
- package/dist/index.d.ts +12 -26962
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/insight/index.d.ts +4255 -0
- package/dist/insight/index.d.ts.map +1 -0
- package/dist/insight/index.esm.js +2 -0
- package/dist/insight/index.esm.js.map +1 -0
- package/dist/insight/index.js +2 -0
- package/dist/insight/index.js.map +1 -0
- package/dist/middleware/index.d.ts +555 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.esm.js +2 -0
- package/dist/middleware/index.esm.js.map +1 -0
- package/dist/middleware/index.js +2 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/orbis/index.d.ts +15336 -0
- package/dist/orbis/index.d.ts.map +1 -0
- package/dist/orbis/index.esm.js +2 -0
- package/dist/orbis/index.esm.js.map +1 -0
- package/dist/orbis/index.js +2 -0
- package/dist/orbis/index.js.map +1 -0
- package/dist/uma/index.d.ts +3859 -0
- package/dist/uma/index.d.ts.map +1 -0
- package/dist/uma/index.esm.js +2 -0
- package/dist/uma/index.esm.js.map +1 -0
- package/dist/uma/index.js +2 -0
- package/dist/uma/index.js.map +1 -0
- package/package.json +63 -24
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
import { AxiosError, AxiosInstance, AxiosRequestConfig, HttpStatusCode } from "axios";
|
|
2
|
+
interface BaseClientConfig<HandleError extends boolean = boolean> {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
errorHandling?: HandleError;
|
|
5
|
+
storage?: Storage;
|
|
6
|
+
defaultHeaders?: Record<string, string>;
|
|
7
|
+
defaultSecure?: boolean;
|
|
8
|
+
authDataStorageKey?: string;
|
|
9
|
+
onAxiosError?: (error: AxiosError) => void;
|
|
10
|
+
onError?: (error: unknown) => void;
|
|
11
|
+
}
|
|
12
|
+
enum ContentType {
|
|
13
|
+
Json = "application/json",
|
|
14
|
+
FormData = "multipart/form-data",
|
|
15
|
+
UrlEncoded = "application/x-www-form-urlencoded",
|
|
16
|
+
Text = "text/plain"
|
|
17
|
+
}
|
|
18
|
+
type RequestConfig<Body = unknown> = AxiosRequestConfig<Body> & {
|
|
19
|
+
secure?: boolean;
|
|
20
|
+
contentType?: ContentType;
|
|
21
|
+
};
|
|
22
|
+
type ResponseStatus = {
|
|
23
|
+
status: HttpStatusCode | -1;
|
|
24
|
+
statusText: string;
|
|
25
|
+
};
|
|
26
|
+
type SuccessClientResponse<Data = unknown> = ResponseStatus & {
|
|
27
|
+
success: true;
|
|
28
|
+
data: Data;
|
|
29
|
+
};
|
|
30
|
+
type ErrorClientResponse = ResponseStatus & {
|
|
31
|
+
success: false;
|
|
32
|
+
data?: any;
|
|
33
|
+
error: unknown;
|
|
34
|
+
};
|
|
35
|
+
type ClientResponse<Data = unknown, HandleError extends boolean = boolean> = HandleError extends true ? SuccessClientResponse<Data> | ErrorClientResponse : SuccessClientResponse<Data>;
|
|
36
|
+
declare abstract class BaseClient<HandleError extends boolean = boolean, AuthData = unknown> {
|
|
37
|
+
protected readonly config: BaseClientConfig<HandleError>;
|
|
38
|
+
protected readonly axiosInstance: AxiosInstance;
|
|
39
|
+
protected readonly storage: Storage;
|
|
40
|
+
constructor(config: BaseClientConfig<HandleError>);
|
|
41
|
+
protected stringifyFormItem(formItem: unknown): string;
|
|
42
|
+
protected createFormData(input: Record<string, unknown>): FormData;
|
|
43
|
+
request<Data = unknown, Error = unknown, Body = unknown>(requestConfig: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
|
|
44
|
+
get<Data = unknown, Error = unknown, Body = unknown>(url: string, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
|
|
45
|
+
delete<Data = unknown, Error = unknown, Body = unknown>(url: string, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
|
|
46
|
+
head<Data = unknown, Error = unknown, Body = unknown>(url: string, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
|
|
47
|
+
options<Data = unknown, Error = unknown, Body = unknown>(url: string, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
|
|
48
|
+
post<Data = unknown, Error = unknown, Body = unknown>(url: string, data?: Body, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
|
|
49
|
+
put<Data = unknown, Error = unknown, Body = unknown>(url: string, data?: Body, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
|
|
50
|
+
patch<Data = unknown, Error = unknown, Body = unknown>(url: string, data?: Body, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
|
|
51
|
+
getAxios(): AxiosInstance;
|
|
52
|
+
setAuthData(data: AuthData | null): void;
|
|
53
|
+
getAuthData(): AuthData | null;
|
|
54
|
+
getConfig(): BaseClientConfig<HandleError>;
|
|
55
|
+
abstract prepareAuthRequestConfig(): Pick<RequestConfig<any>, 'headers' | 'data' | 'params'>;
|
|
56
|
+
}
|
|
57
|
+
declare class BaseApi<HandleError extends boolean = boolean, ApiClient extends BaseClient<HandleError> = BaseClient<HandleError>> {
|
|
58
|
+
protected readonly apiClient: ApiClient;
|
|
59
|
+
constructor(apiClient: ApiClient);
|
|
60
|
+
getApiClient(): ApiClient;
|
|
61
|
+
}
|
|
62
|
+
interface JwtClientConfig<HandleError extends boolean = boolean> extends BaseClientConfig<HandleError> {
|
|
63
|
+
authSchema?: string;
|
|
64
|
+
}
|
|
65
|
+
interface JwtAuthData {
|
|
66
|
+
accessToken: string;
|
|
67
|
+
refreshToken: string;
|
|
68
|
+
}
|
|
69
|
+
declare class JwtClient<HandleError extends boolean = boolean> extends BaseClient<HandleError, JwtAuthData> {
|
|
70
|
+
protected readonly config: JwtClientConfig<HandleError>;
|
|
71
|
+
constructor(config: JwtClientConfig<HandleError>);
|
|
72
|
+
getConfig(): JwtClientConfig<HandleError>;
|
|
73
|
+
prepareAuthRequestConfig(): Pick<RequestConfig<any>, 'headers' | 'data' | 'params'>;
|
|
74
|
+
scheduleTokenRenewal(renewTokenCallback: () => Promise<JwtAuthData>): void;
|
|
75
|
+
cancelTokenRenewal(): void;
|
|
76
|
+
}
|
|
77
|
+
export interface MiddlewareValidationError {
|
|
78
|
+
message: string;
|
|
79
|
+
meta?: Record<string, string | number>;
|
|
80
|
+
}
|
|
81
|
+
export interface MiddlewareValidationExceptionDto {
|
|
82
|
+
/** @default [] */
|
|
83
|
+
errors: MiddlewareValidationError[];
|
|
84
|
+
id: string;
|
|
85
|
+
message: string;
|
|
86
|
+
/** @format date-time */
|
|
87
|
+
timestamp: string;
|
|
88
|
+
}
|
|
89
|
+
export interface MiddlewareExceptionDto {
|
|
90
|
+
id: string;
|
|
91
|
+
message: string;
|
|
92
|
+
/** @format date-time */
|
|
93
|
+
timestamp: string;
|
|
94
|
+
}
|
|
95
|
+
export interface MiddlewareAvatarUploadDto {
|
|
96
|
+
/** @format binary */
|
|
97
|
+
image: File;
|
|
98
|
+
}
|
|
99
|
+
export interface MiddlewareUserTokensDto {
|
|
100
|
+
/** Deprecated. Use `accessToken` instead */
|
|
101
|
+
apiToken: string;
|
|
102
|
+
accessToken: string;
|
|
103
|
+
refreshToken: string;
|
|
104
|
+
assetsToken: string;
|
|
105
|
+
}
|
|
106
|
+
export interface MiddlewareMessageDto {
|
|
107
|
+
id: number;
|
|
108
|
+
/** @maxLength 64 */
|
|
109
|
+
title: string;
|
|
110
|
+
/** @maxLength 512 */
|
|
111
|
+
content: string;
|
|
112
|
+
/** @default false */
|
|
113
|
+
isRtl: boolean;
|
|
114
|
+
/** @default false */
|
|
115
|
+
isNew: boolean;
|
|
116
|
+
}
|
|
117
|
+
export interface MiddlewareChartLayoutDto {
|
|
118
|
+
id: number;
|
|
119
|
+
/** @maxLength 16 */
|
|
120
|
+
symbol: string;
|
|
121
|
+
/** @maxLength 8 */
|
|
122
|
+
resolution: string;
|
|
123
|
+
timestamp: object;
|
|
124
|
+
name: string;
|
|
125
|
+
}
|
|
126
|
+
export interface MiddlewareChartLayoutDetailsDto {
|
|
127
|
+
id: number;
|
|
128
|
+
/** @maxLength 16 */
|
|
129
|
+
symbol: string;
|
|
130
|
+
/** @maxLength 8 */
|
|
131
|
+
resolution: string;
|
|
132
|
+
timestamp: object;
|
|
133
|
+
name: string;
|
|
134
|
+
content: string;
|
|
135
|
+
}
|
|
136
|
+
export interface MiddlewareChartDataDto {
|
|
137
|
+
name: string;
|
|
138
|
+
}
|
|
139
|
+
export interface MiddlewareChartTemplateDto {
|
|
140
|
+
name: string;
|
|
141
|
+
content: string;
|
|
142
|
+
}
|
|
143
|
+
export interface MiddlewareWatchlistEntryDto {
|
|
144
|
+
/**
|
|
145
|
+
* Default to `equity` if not provided
|
|
146
|
+
* @default "equity"
|
|
147
|
+
*/
|
|
148
|
+
type?: MiddlewareWatchlistEntryDtoTypeEnum;
|
|
149
|
+
symbol: string;
|
|
150
|
+
}
|
|
151
|
+
export interface MiddlewareWatchlistDto {
|
|
152
|
+
id: number;
|
|
153
|
+
/**
|
|
154
|
+
* Setting this to `true` would automatically mark other watchlists of the same user to not default
|
|
155
|
+
* @default false
|
|
156
|
+
*/
|
|
157
|
+
isDefault: boolean;
|
|
158
|
+
/** @maxLength 64 */
|
|
159
|
+
name: string;
|
|
160
|
+
/**
|
|
161
|
+
* @maxLength 256
|
|
162
|
+
* @default ""
|
|
163
|
+
*/
|
|
164
|
+
description: string;
|
|
165
|
+
/**
|
|
166
|
+
* @maxLength 10
|
|
167
|
+
* @default ""
|
|
168
|
+
*/
|
|
169
|
+
color: string;
|
|
170
|
+
/** @default null */
|
|
171
|
+
order: number | null;
|
|
172
|
+
/** @default [] */
|
|
173
|
+
entries: MiddlewareWatchlistEntryDto[];
|
|
174
|
+
}
|
|
175
|
+
export interface MiddlewarePersistWatchlistDto {
|
|
176
|
+
id: number;
|
|
177
|
+
/**
|
|
178
|
+
* Setting this to `true` would automatically mark other watchlists of the same user to not default
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
isDefault?: boolean;
|
|
182
|
+
/** @maxLength 64 */
|
|
183
|
+
name: string;
|
|
184
|
+
/**
|
|
185
|
+
* @maxLength 256
|
|
186
|
+
* @default ""
|
|
187
|
+
*/
|
|
188
|
+
description?: string;
|
|
189
|
+
/**
|
|
190
|
+
* @maxLength 10
|
|
191
|
+
* @default ""
|
|
192
|
+
*/
|
|
193
|
+
color?: string;
|
|
194
|
+
/** @default null */
|
|
195
|
+
order?: number | null;
|
|
196
|
+
/** @default [] */
|
|
197
|
+
entries?: MiddlewareWatchlistEntryDto[];
|
|
198
|
+
}
|
|
199
|
+
export interface MiddlewareWatchlistEntriesDto {
|
|
200
|
+
entries: MiddlewareWatchlistEntryDto[];
|
|
201
|
+
}
|
|
202
|
+
export interface MiddlewareWatchlistOrderDto {
|
|
203
|
+
watchlistId: number;
|
|
204
|
+
order: number;
|
|
205
|
+
}
|
|
206
|
+
export interface MiddlewareWatchlistOrdersDto {
|
|
207
|
+
orders: MiddlewareWatchlistOrderDto[];
|
|
208
|
+
}
|
|
209
|
+
export interface MiddlewareAppVersionDto {
|
|
210
|
+
token: string;
|
|
211
|
+
/**
|
|
212
|
+
* @maxLength 32
|
|
213
|
+
* @default ""
|
|
214
|
+
*/
|
|
215
|
+
versionNumber: string;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Default to `equity` if not provided
|
|
219
|
+
* @default "equity"
|
|
220
|
+
*/
|
|
221
|
+
export enum MiddlewareWatchlistEntryDtoTypeEnum {
|
|
222
|
+
Equity = "equity",
|
|
223
|
+
Option = "option",
|
|
224
|
+
Crypto = "crypto",
|
|
225
|
+
Bond = "bond",
|
|
226
|
+
MutualFund = "mutualFund"
|
|
227
|
+
}
|
|
228
|
+
export class AvatarApi<HandleError extends boolean = boolean> {
|
|
229
|
+
protected readonly apiClient: JwtClient<HandleError>;
|
|
230
|
+
constructor(apiClient: JwtClient<HandleError>);
|
|
231
|
+
/**
|
|
232
|
+
* @tags AvatarApi
|
|
233
|
+
* @name GetUserAvatar
|
|
234
|
+
* @request GET:/api/v1/avatars/users/{userId}
|
|
235
|
+
* @secure
|
|
236
|
+
*/
|
|
237
|
+
getUserAvatar(userId: number, config?: RequestConfig<HandleError>): Promise<ClientResponse<File, HandleError>>;
|
|
238
|
+
/**
|
|
239
|
+
* @tags AvatarApi
|
|
240
|
+
* @name UploadUserAvatar
|
|
241
|
+
* @request POST:/api/v1/avatars/users/{userId}
|
|
242
|
+
* @secure
|
|
243
|
+
*/
|
|
244
|
+
uploadUserAvatar(userId: number, data: MiddlewareAvatarUploadDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
245
|
+
/**
|
|
246
|
+
* @tags AvatarApi
|
|
247
|
+
* @name DeleteUserAvatar
|
|
248
|
+
* @request DELETE:/api/v1/avatars/users/{userId}
|
|
249
|
+
* @secure
|
|
250
|
+
*/
|
|
251
|
+
deleteUserAvatar(userId: number, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
252
|
+
/**
|
|
253
|
+
* @tags AvatarApi
|
|
254
|
+
* @name GetAccountAvatar
|
|
255
|
+
* @request GET:/api/v1/avatars/accounts/{accountId}
|
|
256
|
+
* @secure
|
|
257
|
+
*/
|
|
258
|
+
getAccountAvatar(accountId: number, config?: RequestConfig<HandleError>): Promise<ClientResponse<File, HandleError>>;
|
|
259
|
+
/**
|
|
260
|
+
* @tags AvatarApi
|
|
261
|
+
* @name UploadAccountAvatar
|
|
262
|
+
* @request POST:/api/v1/avatars/accounts/{accountId}
|
|
263
|
+
* @secure
|
|
264
|
+
*/
|
|
265
|
+
uploadAccountAvatar(accountId: number, data: MiddlewareAvatarUploadDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
266
|
+
/**
|
|
267
|
+
* @tags AvatarApi
|
|
268
|
+
* @name DeleteAccountAvatar
|
|
269
|
+
* @request DELETE:/api/v1/avatars/accounts/{accountId}
|
|
270
|
+
* @secure
|
|
271
|
+
*/
|
|
272
|
+
deleteAccountAvatar(accountId: number, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
273
|
+
}
|
|
274
|
+
export class MessageApi<HandleError extends boolean = boolean> {
|
|
275
|
+
protected readonly apiClient: JwtClient<HandleError>;
|
|
276
|
+
constructor(apiClient: JwtClient<HandleError>);
|
|
277
|
+
/**
|
|
278
|
+
* @tags MessageApi
|
|
279
|
+
* @name GetMessages
|
|
280
|
+
* @request GET:/api/v1/messages
|
|
281
|
+
* @secure
|
|
282
|
+
*/
|
|
283
|
+
getMessages(query?: {
|
|
284
|
+
/** Get messages in preferred language. If not provided or there is no translation for the chosen language, default one will be used. */
|
|
285
|
+
languageCode?: string;
|
|
286
|
+
}, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareMessageDto[], HandleError>>;
|
|
287
|
+
/**
|
|
288
|
+
* @tags MessageApi
|
|
289
|
+
* @name MarkAsSeen
|
|
290
|
+
* @request PATCH:/api/v1/messages/mark-as-seen
|
|
291
|
+
* @secure
|
|
292
|
+
*/
|
|
293
|
+
markAsSeen(config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
294
|
+
}
|
|
295
|
+
export class ChartApi<HandleError extends boolean = boolean> {
|
|
296
|
+
protected readonly apiClient: JwtClient<HandleError>;
|
|
297
|
+
constructor(apiClient: JwtClient<HandleError>);
|
|
298
|
+
/**
|
|
299
|
+
* @tags ChartApi
|
|
300
|
+
* @name GetChartLayouts
|
|
301
|
+
* @request GET:/api/v1/charts/layouts
|
|
302
|
+
* @secure
|
|
303
|
+
*/
|
|
304
|
+
getChartLayouts(config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartLayoutDto[], HandleError>>;
|
|
305
|
+
/**
|
|
306
|
+
* @tags ChartApi
|
|
307
|
+
* @name UpdateChartLayout
|
|
308
|
+
* @request PUT:/api/v1/charts/layouts
|
|
309
|
+
* @secure
|
|
310
|
+
*/
|
|
311
|
+
updateChartLayout(data: MiddlewareChartLayoutDetailsDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartLayoutDetailsDto, HandleError>>;
|
|
312
|
+
/**
|
|
313
|
+
* @tags ChartApi
|
|
314
|
+
* @name GetChartLayoutDetails
|
|
315
|
+
* @request GET:/api/v1/charts/layouts/{chartId}
|
|
316
|
+
* @secure
|
|
317
|
+
*/
|
|
318
|
+
getChartLayoutDetails(chartId: number, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartLayoutDetailsDto, HandleError>>;
|
|
319
|
+
/**
|
|
320
|
+
* @tags ChartApi
|
|
321
|
+
* @name DeleteChartLayout
|
|
322
|
+
* @request DELETE:/api/v1/charts/layouts/{chartId}
|
|
323
|
+
* @secure
|
|
324
|
+
*/
|
|
325
|
+
deleteChartLayout(chartId: number, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
326
|
+
/**
|
|
327
|
+
* @tags ChartApi
|
|
328
|
+
* @name GetIndicatorTemplates
|
|
329
|
+
* @request GET:/api/v1/charts/indicator-templates
|
|
330
|
+
* @secure
|
|
331
|
+
*/
|
|
332
|
+
getIndicatorTemplates(config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartDataDto[], HandleError>>;
|
|
333
|
+
/**
|
|
334
|
+
* @tags ChartApi
|
|
335
|
+
* @name UpdateIndicatorTemplate
|
|
336
|
+
* @request PUT:/api/v1/charts/indicator-templates
|
|
337
|
+
* @secure
|
|
338
|
+
*/
|
|
339
|
+
updateIndicatorTemplate(data: MiddlewareChartTemplateDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartTemplateDto, HandleError>>;
|
|
340
|
+
/**
|
|
341
|
+
* @tags ChartApi
|
|
342
|
+
* @name GetIndicatorTemplateDetails
|
|
343
|
+
* @request GET:/api/v1/charts/indicator-templates/{templateName}
|
|
344
|
+
* @secure
|
|
345
|
+
*/
|
|
346
|
+
getIndicatorTemplateDetails(templateName: string, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartTemplateDto, HandleError>>;
|
|
347
|
+
/**
|
|
348
|
+
* @tags ChartApi
|
|
349
|
+
* @name DeleteIndicatorTemplate
|
|
350
|
+
* @request DELETE:/api/v1/charts/indicator-templates/{templateName}
|
|
351
|
+
* @secure
|
|
352
|
+
*/
|
|
353
|
+
deleteIndicatorTemplate(templateName: string, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
354
|
+
/**
|
|
355
|
+
* @tags ChartApi
|
|
356
|
+
* @name GetChartTemplates
|
|
357
|
+
* @request GET:/api/v1/charts/templates
|
|
358
|
+
* @secure
|
|
359
|
+
*/
|
|
360
|
+
getChartTemplates(config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartDataDto[], HandleError>>;
|
|
361
|
+
/**
|
|
362
|
+
* @tags ChartApi
|
|
363
|
+
* @name UpdateChartTemplate
|
|
364
|
+
* @request PUT:/api/v1/charts/templates
|
|
365
|
+
* @secure
|
|
366
|
+
*/
|
|
367
|
+
updateChartTemplate(data: MiddlewareChartTemplateDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartTemplateDto, HandleError>>;
|
|
368
|
+
/**
|
|
369
|
+
* @tags ChartApi
|
|
370
|
+
* @name GetChartTemplateDetails
|
|
371
|
+
* @request GET:/api/v1/charts/templates/{templateName}
|
|
372
|
+
* @secure
|
|
373
|
+
*/
|
|
374
|
+
getChartTemplateDetails(templateName: string, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareChartTemplateDto, HandleError>>;
|
|
375
|
+
/**
|
|
376
|
+
* @tags ChartApi
|
|
377
|
+
* @name DeleteChartTemplate
|
|
378
|
+
* @request DELETE:/api/v1/charts/templates/{templateName}
|
|
379
|
+
* @secure
|
|
380
|
+
*/
|
|
381
|
+
deleteChartTemplate(templateName: string, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
382
|
+
}
|
|
383
|
+
export class WatchlistApi<HandleError extends boolean = boolean> {
|
|
384
|
+
protected readonly apiClient: JwtClient<HandleError>;
|
|
385
|
+
constructor(apiClient: JwtClient<HandleError>);
|
|
386
|
+
/**
|
|
387
|
+
* @tags WatchlistApi
|
|
388
|
+
* @name GetAllWatchlists
|
|
389
|
+
* @request GET:/api/v1/watchlists
|
|
390
|
+
* @secure
|
|
391
|
+
*/
|
|
392
|
+
getAllWatchlists(config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareWatchlistDto[], HandleError>>;
|
|
393
|
+
/**
|
|
394
|
+
* @tags WatchlistApi
|
|
395
|
+
* @name CreateWatchlist
|
|
396
|
+
* @request POST:/api/v1/watchlists
|
|
397
|
+
* @secure
|
|
398
|
+
*/
|
|
399
|
+
createWatchlist(data: MiddlewarePersistWatchlistDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareWatchlistDto, HandleError>>;
|
|
400
|
+
/**
|
|
401
|
+
* @tags WatchlistApi
|
|
402
|
+
* @name GetWatchlist
|
|
403
|
+
* @request GET:/api/v1/watchlists/{watchlistId}
|
|
404
|
+
* @secure
|
|
405
|
+
*/
|
|
406
|
+
getWatchlist(watchlistId: number, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareWatchlistDto, HandleError>>;
|
|
407
|
+
/**
|
|
408
|
+
* @tags WatchlistApi
|
|
409
|
+
* @name UpdateWatchlist
|
|
410
|
+
* @request PUT:/api/v1/watchlists/{watchlistId}
|
|
411
|
+
* @secure
|
|
412
|
+
*/
|
|
413
|
+
updateWatchlist(watchlistId: number, data: MiddlewarePersistWatchlistDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareWatchlistDto, HandleError>>;
|
|
414
|
+
/**
|
|
415
|
+
* @tags WatchlistApi
|
|
416
|
+
* @name DeleteWatchlist
|
|
417
|
+
* @request DELETE:/api/v1/watchlists/{watchlistId}
|
|
418
|
+
* @secure
|
|
419
|
+
*/
|
|
420
|
+
deleteWatchlist(watchlistId: number, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
421
|
+
/**
|
|
422
|
+
* @tags WatchlistApi
|
|
423
|
+
* @name AddWatchlistEntries
|
|
424
|
+
* @request POST:/api/v1/watchlists/{watchlistId}/entries
|
|
425
|
+
* @secure
|
|
426
|
+
*/
|
|
427
|
+
addWatchlistEntries(watchlistId: number, data: MiddlewareWatchlistEntriesDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareWatchlistDto, HandleError>>;
|
|
428
|
+
/**
|
|
429
|
+
* @tags WatchlistApi
|
|
430
|
+
* @name RemoveWatchlistEntries
|
|
431
|
+
* @request DELETE:/api/v1/watchlists/{watchlistId}/entries
|
|
432
|
+
* @secure
|
|
433
|
+
*/
|
|
434
|
+
removeWatchlistEntries(watchlistId: number, data: MiddlewareWatchlistEntriesDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareWatchlistDto, HandleError>>;
|
|
435
|
+
/**
|
|
436
|
+
* @tags WatchlistApi
|
|
437
|
+
* @name UpdateWatchlistEntries
|
|
438
|
+
* @request PUT:/api/v1/watchlists/{watchlistId}/entries
|
|
439
|
+
* @secure
|
|
440
|
+
*/
|
|
441
|
+
updateWatchlistEntries(watchlistId: number, data: MiddlewareWatchlistEntriesDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareWatchlistDto, HandleError>>;
|
|
442
|
+
/**
|
|
443
|
+
* @tags WatchlistApi
|
|
444
|
+
* @name UpdateWatchlistOrders
|
|
445
|
+
* @request POST:/api/v1/watchlists/orders
|
|
446
|
+
* @secure
|
|
447
|
+
*/
|
|
448
|
+
updateWatchlistOrders(data: MiddlewareWatchlistOrdersDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
449
|
+
/**
|
|
450
|
+
* @tags WatchlistApi
|
|
451
|
+
* @name ImportWatchmenWatchlists
|
|
452
|
+
* @request POST:/api/v1/watchlists/import
|
|
453
|
+
* @secure
|
|
454
|
+
*/
|
|
455
|
+
importWatchmenWatchlists(config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
456
|
+
}
|
|
457
|
+
export class AuthenticationApi<HandleError extends boolean = boolean> {
|
|
458
|
+
protected readonly apiClient: JwtClient<HandleError>;
|
|
459
|
+
constructor(apiClient: JwtClient<HandleError>);
|
|
460
|
+
/**
|
|
461
|
+
* @tags AuthenticationApi
|
|
462
|
+
* @name Authenticate
|
|
463
|
+
* @request POST:/api/v1/authenticate
|
|
464
|
+
*/
|
|
465
|
+
authenticate(headers: {
|
|
466
|
+
/** Application environment (for different firms) */
|
|
467
|
+
'Application-Env'?: string;
|
|
468
|
+
/** Firm's id from UMA */
|
|
469
|
+
'Firm-Id': string;
|
|
470
|
+
/** Watchmen authorization token (it's `sessionId` from Watchmen's `login` endpoint) */
|
|
471
|
+
'Watchmen-Token': string;
|
|
472
|
+
/** Name of the application using middleware */
|
|
473
|
+
'Application-Name': string;
|
|
474
|
+
}, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareUserTokensDto, HandleError>>;
|
|
475
|
+
/**
|
|
476
|
+
* @description Must use `refreshToken` instead of `accessToken` in `Authorization` header
|
|
477
|
+
* @tags AuthenticationApi
|
|
478
|
+
* @name Refresh
|
|
479
|
+
* @request POST:/api/v1/refresh
|
|
480
|
+
* @secure
|
|
481
|
+
*/
|
|
482
|
+
refresh(config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareUserTokensDto, HandleError>>;
|
|
483
|
+
/**
|
|
484
|
+
* @tags AuthenticationApi
|
|
485
|
+
* @name Invalidate
|
|
486
|
+
* @request POST:/api/v1/invalidate
|
|
487
|
+
* @secure
|
|
488
|
+
*/
|
|
489
|
+
invalidate(config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
490
|
+
}
|
|
491
|
+
export class PreferenceApi<HandleError extends boolean = boolean> {
|
|
492
|
+
protected readonly apiClient: JwtClient<HandleError>;
|
|
493
|
+
constructor(apiClient: JwtClient<HandleError>);
|
|
494
|
+
/**
|
|
495
|
+
* @tags PreferenceApi
|
|
496
|
+
* @name GetPreferences
|
|
497
|
+
* @request GET:/api/v1/preferences
|
|
498
|
+
* @secure
|
|
499
|
+
*/
|
|
500
|
+
getPreferences(config?: RequestConfig<HandleError>): Promise<ClientResponse<Record<string, string>, HandleError>>;
|
|
501
|
+
/**
|
|
502
|
+
* @tags PreferenceApi
|
|
503
|
+
* @name SavePreferences
|
|
504
|
+
* @request POST:/api/v1/preferences
|
|
505
|
+
* @secure
|
|
506
|
+
*/
|
|
507
|
+
savePreferences(config?: RequestConfig<HandleError>): Promise<ClientResponse<Record<string, string>, HandleError>>;
|
|
508
|
+
}
|
|
509
|
+
export class VersioningApi<HandleError extends boolean = boolean> {
|
|
510
|
+
protected readonly apiClient: JwtClient<HandleError>;
|
|
511
|
+
constructor(apiClient: JwtClient<HandleError>);
|
|
512
|
+
/**
|
|
513
|
+
* @tags VersioningApi
|
|
514
|
+
* @name GetAppVersion
|
|
515
|
+
* @request GET:/api/versioning/{appId}
|
|
516
|
+
*/
|
|
517
|
+
getAppVersion(appId: string, config?: RequestConfig<HandleError>): Promise<ClientResponse<MiddlewareAppVersionDto, HandleError>>;
|
|
518
|
+
/**
|
|
519
|
+
* @tags VersioningApi
|
|
520
|
+
* @name UpdateAppVersion
|
|
521
|
+
* @request POST:/api/versioning/{appId}
|
|
522
|
+
*/
|
|
523
|
+
updateAppVersion(appId: string, data: MiddlewareAppVersionDto, config?: RequestConfig<HandleError>): Promise<ClientResponse<void, HandleError>>;
|
|
524
|
+
}
|
|
525
|
+
export class AttributeApi<HandleError extends boolean = boolean> {
|
|
526
|
+
protected readonly apiClient: JwtClient<HandleError>;
|
|
527
|
+
constructor(apiClient: JwtClient<HandleError>);
|
|
528
|
+
/**
|
|
529
|
+
* @tags AttributeApi
|
|
530
|
+
* @name GetAttributeValues
|
|
531
|
+
* @request GET:/api/v1/attributes
|
|
532
|
+
* @secure
|
|
533
|
+
*/
|
|
534
|
+
getAttributeValues(config?: RequestConfig<HandleError>): Promise<ClientResponse<Record<string, string | number | boolean>, HandleError>>;
|
|
535
|
+
/**
|
|
536
|
+
* @tags AttributeApi
|
|
537
|
+
* @name GetPublicAttributeValue
|
|
538
|
+
* @request GET:/api/v1/attributes/{attributePublicId}
|
|
539
|
+
* @secure
|
|
540
|
+
*/
|
|
541
|
+
getPublicAttributeValue(attributePublicId: string, config?: RequestConfig<HandleError>): Promise<ClientResponse<string | number | boolean, HandleError>>;
|
|
542
|
+
}
|
|
543
|
+
export class MiddlewareApi<HandleError extends boolean = false> extends BaseApi<HandleError, JwtClient<HandleError>> {
|
|
544
|
+
attribute: AttributeApi<HandleError>;
|
|
545
|
+
authentication: AuthenticationApi<HandleError>;
|
|
546
|
+
avatar: AvatarApi<HandleError>;
|
|
547
|
+
chart: ChartApi<HandleError>;
|
|
548
|
+
message: MessageApi<HandleError>;
|
|
549
|
+
preference: PreferenceApi<HandleError>;
|
|
550
|
+
versioning: VersioningApi<HandleError>;
|
|
551
|
+
watchlist: WatchlistApi<HandleError>;
|
|
552
|
+
constructor(config: JwtClientConfig<HandleError>);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";AAYA,2BAAkC,WAAW,SAAS,OAAO,GAAG,OAAO;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,C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,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,CAAC,EAAE,cAAc,WAAW,CAAC;CAUrG;ACnCD,0BAA0B,WAAW,SAAS,OAAO,GAAG,OAAO;IAC/C,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU,WAAW,CAAC;gBAAjC,SAAS,EAAE,UAAU,WAAW,CAAC;IAIhE;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,CAAC,EAAE,cAAc,WAAW,CAAC;IAatD;;;;;OAKG;IACH,uBAAuB,CAAC,iBAAiB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,WAAW,CAAC;CAYzF;AEUD,2BAA2B,WAAW,SAAS,OAAO,GAAG,KAAK,CAAE,SAAQ,QAAQ,WAAW,EAAE,UAAU,WAAW,CAAC,CAAC;IAChH,SAAS,EAAE,aAAa,WAAW,CAAC,CAAC;IACrC,cAAc,EAAE,kBAAkB,WAAW,CAAC,CAAC;IAC/C,MAAM,EAAE,UAAU,WAAW,CAAC,CAAC;IAC/B,KAAK,EAAE,SAAS,WAAW,CAAC,CAAC;IAC7B,OAAO,EAAE,WAAW,WAAW,CAAC,CAAC;IACjC,UAAU,EAAE,cAAc,WAAW,CAAC,CAAC;IACvC,UAAU,EAAE,cAAc,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,aAAa,WAAW,CAAC,CAAC;gBAER,MAAM,EAAE,gBAAgB,WAAW,CAAC;CAYpE","sources":["src/apis/middleware/src/BaseClient.ts","src/apis/middleware/src/BaseApi.ts","src/apis/middleware/src/JwtClient.ts","src/apis/middleware/src/apis/middleware/__generated__/client.ts","src/apis/middleware/src/apis/middleware/__generated__/types.ts","src/apis/middleware/src/apis/middleware/__generated__/AvatarApi.ts","src/apis/middleware/src/apis/middleware/__generated__/MessageApi.ts","src/apis/middleware/src/apis/middleware/__generated__/ChartApi.ts","src/apis/middleware/src/apis/middleware/__generated__/WatchlistApi.ts","src/apis/middleware/src/apis/middleware/__generated__/AuthenticationApi.ts","src/apis/middleware/src/apis/middleware/__generated__/PreferenceApi.ts","src/apis/middleware/src/apis/middleware/__generated__/VersioningApi.ts","src/apis/middleware/src/apis/middleware/__generated__/AttributeApi.ts","src/apis/middleware/src/apis/middleware/__generated__/index.ts","src/apis/middleware/src/apis/middleware/MiddlewareApi.ts","src/apis/middleware/src/apis/middleware/index.ts","src/apis/middleware/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"export * from './MiddlewareApi';\r\nexport * from './__generated__';\r\n"],"names":[],"version":3,"file":"index.d.ts.map","sourceRoot":"../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"auto-bind";import{jwtDecode as t}from"jwt-decode";import s,{isAxiosError as r}from"axios";import a from"axios-better-stacktrace";import{isNil as i,merge as n}from"lodash";function o(e,t,s,r){Object.defineProperty(e,t,{get:s,set:r,enumerable:!0,configurable:!0})}function u(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}o({},"MiddlewareApi",()=>J);class c{constructor(t){this.apiClient=t,e(this)}getApiClient(){return this.apiClient}}var h,l,p=((h={}).Json="application/json",h.FormData="multipart/form-data",h.UrlEncoded="application/x-www-form-urlencoded",h.Text="text/plain",h);class d{constructor(t){this.config=t,e(this),this.storage=t.storage??sessionStorage,this.axiosInstance=s.create({baseURL:t.baseUrl,headers:{"Content-Type":"application/json",...t.defaultHeaders}}),a(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;i(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 a=n(e.secure??this.config.defaultSecure?this.prepareAuthRequestConfig():{},t?{headers:{"Content-Type":t}}:{},e);try{let{data:e,status:t,statusText:s}=await this.axiosInstance.request(a);return{success:!0,data:e,status:t,statusText:s}}catch(t){if(!this.config.errorHandling)throw t;let e={success:!1,status:-1,statusText:String(t),error:t};return r(t)&&(this.config.onAxiosError?.(t),e.data=t.response?.data,e.status=t.response?.status??e.status,e.statusText=t.response?.statusText??e.statusText),this.config.onError?.(t),e}}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 T extends d{constructor(e){super(e),this.config=e}getConfig(){return super.getConfig()}prepareAuthRequestConfig(){let{accessToken:e}=this.getAuthData()||{};return e?{headers:{Authorization:`${this.config.authSchema??"Bearer"} ${e}`}}:(console.warn("No access token found. Please set auth data after authorization."),{})}scheduleTokenRenewal(e){let s;this.cancelTokenRenewal();let r=this.getAuthData();try{s=t(r?.accessToken||"")}catch(e){console.error(e)}if(!s||!s.exp){console.warn("Could not schedule token renewal: invalid expiration time.");return}let a=1e3*s.exp-Date.now();this.tokenRenewalTimeout=setTimeout(async()=>{let t=await e();this.setAuthData(t),this.scheduleTokenRenewal(e)},a-6e4)}cancelTokenRenewal(){clearTimeout(this.tokenRenewalTimeout)}}var m={},f={};o(f,"AvatarApi",()=>C);class C{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:p.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:p.FormData})}deleteAccountAvatar(e,t){return this.apiClient.request({...t,url:`/v1/avatars/accounts/${e}`,method:"DELETE",secure:!0})}}var y={};o(y,"MessageApi",()=>g);class g{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 v={};o(v,"ChartApi",()=>A);class A{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:p.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:p.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:p.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 $={};o($,"MiddlewareWatchlistEntryDtoTypeEnum",()=>w);var w=((l={}).Equity="equity",l.Option="option",l.Crypto="crypto",l.Bond="bond",l.MutualFund="mutualFund",l),E={};o(E,"WatchlistApi",()=>q);class q{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:p.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:p.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:p.Json,responseType:"json"})}removeWatchlistEntries(e,t,s){return this.apiClient.request({...s,url:`/v1/watchlists/${e}/entries`,method:"DELETE",data:t,secure:!0,contentType:p.Json,responseType:"json"})}updateWatchlistEntries(e,t,s){return this.apiClient.request({...s,url:`/v1/watchlists/${e}/entries`,method:"PUT",data:t,secure:!0,contentType:p.Json,responseType:"json"})}updateWatchlistOrders(e,t){return this.apiClient.request({...t,url:"/v1/watchlists/orders",method:"POST",data:e,secure:!0,contentType:p.Json})}importWatchmenWatchlists(e){return this.apiClient.request({...e,url:"/v1/watchlists/import",method:"POST",secure:!0})}}var b={};o(b,"AuthenticationApi",()=>x);class x{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 j={};o(j,"PreferenceApi",()=>D);class D{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 P={};o(P,"VersioningApi",()=>k);class k{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:p.Json})}}var O={};o(O,"AttributeApi",()=>S);class S{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"})}}u(m,f),u(m,y),u(m,v),u(m,$),u(m,E),u(m,b),u(m,j),u(m,P),u(m,O);class G extends x{constructor(e){super(e),this.apiClient.scheduleTokenRenewal(this.renewToken)}async authenticate(e,t){let s=await super.authenticate(e,{...t,withCredentials:!0});return s.success&&(this.apiClient.setAuthData(s.data),this.apiClient.scheduleTokenRenewal(this.renewToken)),s}async renewToken(){let e=this.apiClient.getAuthData()?.refreshToken;if(!e)throw Error("Refresh token not found");let t=await this.refresh({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 J extends c{constructor(e){super(new T(e)),this.config=e,this.attribute=new S(this.apiClient),this.authentication=new G(this.apiClient),this.avatar=new C(this.apiClient),this.chart=new A(this.apiClient),this.message=new g(this.apiClient),this.preference=new D(this.apiClient),this.versioning=new k(this.apiClient),this.watchlist=new q(this.apiClient)}}export{J as MiddlewareApi,C as AvatarApi,g as MessageApi,A as ChartApi,w as MiddlewareWatchlistEntryDtoTypeEnum,q as WatchlistApi,x as AuthenticationApi,D as PreferenceApi,k as VersioningApi,S as AttributeApi};
|
|
2
|
+
//# sourceMappingURL=index.esm.js.map
|