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