@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260704091052 → 0.8.1-dev.20260706114046
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/CopyButton-UPJPMJUB.mjs +57 -0
- package/dist/DateTimeViewClient-R3M6ISVK.mjs +16 -0
- package/dist/DateViewClient-VLTRN47D.mjs +9 -0
- package/dist/{chunk-SDNYBQSI.mjs → HlsPlayer-57543DTW.mjs} +3 -2
- package/dist/HlsPlayer-5AWFZ2P6.mjs +601 -0
- package/dist/IframeClient-RGJFZ5P2.mjs +98 -0
- package/dist/InputControlClient-NJV6B65M.mjs +604 -0
- package/dist/InputControlClient-OQDLYA4S.mjs +604 -0
- package/dist/InputControlClient-TW664WIJ.mjs +602 -0
- package/dist/{LinkNodeButton-WDDPNYWI.mjs → LinkNodeButton-FUL3J5HR.mjs} +6 -5
- package/dist/LinkNodeButton-IGJOGOKI.mjs +362 -0
- package/dist/LinkNodeButton-ZONM74OO.mjs +174 -0
- package/dist/Pagination-6OFACRMQ.mjs +229 -0
- package/dist/Pagination-FSYLYKUA.mjs +181 -0
- package/dist/Pagination-YCD5CU2L.mjs +183 -0
- package/dist/Slider-554BKC7N.mjs +322 -0
- package/dist/Slider-PEIVH6A5.mjs +320 -0
- package/dist/chunk-2GSYECIS.mjs +109 -0
- package/dist/chunk-3GWLDT7C.mjs +204 -0
- package/dist/chunk-3R4VVVNK.mjs +903 -0
- package/dist/chunk-47HD7QP7.mjs +199 -0
- package/dist/chunk-56HSDML5.mjs +22 -0
- package/dist/chunk-67IG5NBU.mjs +200 -0
- package/dist/chunk-7ZFZLN56.mjs +903 -0
- package/dist/chunk-CM7LUGCH.mjs +107 -0
- package/dist/chunk-IKIXEQPV.mjs +198 -0
- package/dist/chunk-IMNQO57B.mjs +25 -0
- package/dist/chunk-R2HV35IB.mjs +201 -0
- package/dist/chunk-SPRVN5IM.mjs +118 -0
- package/dist/chunk-TVL6KVD5.mjs +229 -0
- package/dist/chunk-WEV5U33G.mjs +207 -0
- package/dist/chunk-YG6FKKQJ.mjs +900 -0
- package/dist/index.d.mts +56 -169
- package/dist/index.d.ts +56 -169
- package/dist/index.js +3940 -3807
- package/dist/index.mjs +591 -2923
- package/dist/server.d.mts +72 -0
- package/dist/server.d.ts +72 -0
- package/dist/server.js +5126 -0
- package/dist/server.mjs +2698 -0
- package/package.json +18 -4
- package/dist/HlsPlayer-DZNDKG2P.mjs +0 -7
- package/dist/chunk-DOKQUUH3.mjs +0 -414
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buttonClasses
|
|
3
|
+
} from "./chunk-56HSDML5.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/dataForm/Hyperlink.tsx
|
|
6
|
+
import Link from "next/link";
|
|
7
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
8
|
+
function Hyperlink(props) {
|
|
9
|
+
let linkClass = props.linkType ? buttonClasses.get(props.linkType) : buttonClasses.get("Link" /* Link */);
|
|
10
|
+
const target = props?.href?.startsWith("http") ? "_blank" : "_self";
|
|
11
|
+
const additionalProps = {};
|
|
12
|
+
if (target == "_blank") {
|
|
13
|
+
additionalProps.rel = "noopener noreferrer";
|
|
14
|
+
}
|
|
15
|
+
return /* @__PURE__ */ jsx(Fragment, { children: props.href ? /* @__PURE__ */ jsx(
|
|
16
|
+
Link,
|
|
17
|
+
{
|
|
18
|
+
href: props.href,
|
|
19
|
+
prefetch: false,
|
|
20
|
+
className: [linkClass, props.className].filter(Boolean).join(" "),
|
|
21
|
+
...additionalProps,
|
|
22
|
+
target,
|
|
23
|
+
children: props.children
|
|
24
|
+
}
|
|
25
|
+
) : props.isHeading ? /* @__PURE__ */ jsx("h5", { className: props.className + "inline-block", children: props.children }) : /* @__PURE__ */ jsx("span", { className: props.className, children: props.children }) });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/components/controls/edit/InputControlType.tsx
|
|
29
|
+
var Constants = {
|
|
30
|
+
pagesize: 10
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/clients/OdataBuilder.tsx
|
|
34
|
+
var OdataBuilder = class {
|
|
35
|
+
constructor(url) {
|
|
36
|
+
this.baseUrl = url;
|
|
37
|
+
this.top = Constants.pagesize.toString();
|
|
38
|
+
this.skip = "0";
|
|
39
|
+
this.keyword = "";
|
|
40
|
+
this.filterBy = "";
|
|
41
|
+
this.orderBy = "";
|
|
42
|
+
}
|
|
43
|
+
// parseSearchParams(ReadonlyUrlSearchParams): DataQuery {
|
|
44
|
+
// this.top = top;
|
|
45
|
+
// return this;
|
|
46
|
+
// }
|
|
47
|
+
setQuery(odata) {
|
|
48
|
+
if (odata) {
|
|
49
|
+
for (const key in odata) {
|
|
50
|
+
if (odata[key] != null && odata[key] != "") {
|
|
51
|
+
if (key == "$skip") {
|
|
52
|
+
this.setSkip(odata[key]);
|
|
53
|
+
}
|
|
54
|
+
if (key == "$filter") {
|
|
55
|
+
this.setFilter(odata[key]);
|
|
56
|
+
}
|
|
57
|
+
if (key == "$top") {
|
|
58
|
+
this.setTop(odata[key]);
|
|
59
|
+
}
|
|
60
|
+
if (key == "$orderby") {
|
|
61
|
+
this.setOrderBy(odata[key]);
|
|
62
|
+
}
|
|
63
|
+
if (key == "searchTerm") {
|
|
64
|
+
this.searchTerm = odata[key];
|
|
65
|
+
}
|
|
66
|
+
if (key == "searchCols") {
|
|
67
|
+
this.searchCols = odata[key];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
// parseKeyValuePairs(inputString: string): { [key: string]: string } {
|
|
75
|
+
// return inputString.split('$')
|
|
76
|
+
// .map((pair) => pair.split('='))
|
|
77
|
+
// .reduce((result: { [key: string]: string }, [key, value]) => {
|
|
78
|
+
// if (key && value) {
|
|
79
|
+
// result[key.trim()] = value.trim();
|
|
80
|
+
// }
|
|
81
|
+
// return result;
|
|
82
|
+
// }, {});
|
|
83
|
+
// }
|
|
84
|
+
static getOdataQueryString(obj, defaultOrder) {
|
|
85
|
+
let queryString = "";
|
|
86
|
+
let skip = (obj && obj["$skip"]) ?? "0";
|
|
87
|
+
let top = (obj && obj["$top"]) ?? Constants.pagesize.toString();
|
|
88
|
+
queryString = `$skip=${skip}&$top=${top}&$count=true`;
|
|
89
|
+
if (obj?.["searchTerm"] && obj["searchTerm"].trim() !== "") {
|
|
90
|
+
queryString += `&searchTerm=${encodeURIComponent(obj["searchTerm"])}`;
|
|
91
|
+
}
|
|
92
|
+
if (obj?.["searchCols"] && obj["searchCols"].trim() !== "") {
|
|
93
|
+
queryString += `&searchCols=${encodeURIComponent(obj["searchCols"])}`;
|
|
94
|
+
}
|
|
95
|
+
if (obj) {
|
|
96
|
+
if (obj["$filter"] && obj["$filter"] !== null && obj["$filter"] !== "") {
|
|
97
|
+
queryString = queryString + `&$filter=${encodeURIComponent(obj["$filter"])}`;
|
|
98
|
+
}
|
|
99
|
+
if (obj["$orderby"] && obj["$orderby"] !== null && obj["$orderby"] !== "") {
|
|
100
|
+
queryString = queryString + `&$orderby=${encodeURIComponent(obj["$orderby"])}`;
|
|
101
|
+
} else if (defaultOrder) {
|
|
102
|
+
queryString = queryString + `&$orderby=${encodeURIComponent(defaultOrder)}`;
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
if (defaultOrder) {
|
|
106
|
+
queryString = queryString + `&$orderby=${encodeURIComponent(defaultOrder)}`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return queryString;
|
|
110
|
+
}
|
|
111
|
+
setTop(top) {
|
|
112
|
+
this.top = top;
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
setSkip(skip) {
|
|
116
|
+
this.skip = skip;
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
setKeyword(keyword) {
|
|
120
|
+
this.keyword = keyword;
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
setFilter(filterBy) {
|
|
124
|
+
this.filterBy = filterBy;
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
setOrderBy(orderBy) {
|
|
128
|
+
this.orderBy = orderBy;
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
getPageNumber(pageSize) {
|
|
132
|
+
let pageNumber = 1;
|
|
133
|
+
if (this.skip && this.top) {
|
|
134
|
+
const skip = parseInt(this.skip);
|
|
135
|
+
const top = parseInt(this.top);
|
|
136
|
+
if (!isNaN(skip) && !isNaN(top)) {
|
|
137
|
+
pageNumber = skip / pageSize + 1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return pageNumber;
|
|
141
|
+
}
|
|
142
|
+
getUrl() {
|
|
143
|
+
let url = `${this.baseUrl}?$skip=${this.skip}&$top=${this.top}&$count=true`;
|
|
144
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
145
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
146
|
+
}
|
|
147
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
148
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
149
|
+
}
|
|
150
|
+
if (this.searchTerm) {
|
|
151
|
+
url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
|
|
152
|
+
}
|
|
153
|
+
if (this.searchCols) {
|
|
154
|
+
url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
|
|
155
|
+
}
|
|
156
|
+
console.log(url);
|
|
157
|
+
return url;
|
|
158
|
+
}
|
|
159
|
+
getNewOrderByUrl(orderBy) {
|
|
160
|
+
let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
|
|
161
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
162
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
163
|
+
}
|
|
164
|
+
if (this.searchTerm) {
|
|
165
|
+
url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
|
|
166
|
+
}
|
|
167
|
+
if (this.searchCols) {
|
|
168
|
+
url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
|
|
169
|
+
}
|
|
170
|
+
url = url + `&$orderby=${encodeURIComponent(orderBy)}`;
|
|
171
|
+
return url;
|
|
172
|
+
}
|
|
173
|
+
getNewFilterUrl(filterBy) {
|
|
174
|
+
let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
|
|
175
|
+
if (filterBy !== null && filterBy !== "") {
|
|
176
|
+
url = url + `&$filter=${encodeURIComponent(filterBy)}`;
|
|
177
|
+
}
|
|
178
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
179
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
180
|
+
}
|
|
181
|
+
if (this.searchTerm) {
|
|
182
|
+
url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
|
|
183
|
+
}
|
|
184
|
+
if (this.searchCols) {
|
|
185
|
+
url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
|
|
186
|
+
}
|
|
187
|
+
return url;
|
|
188
|
+
}
|
|
189
|
+
getNewPageUrl(page) {
|
|
190
|
+
let skip = page * Constants.pagesize - Constants.pagesize;
|
|
191
|
+
let url = `${this.baseUrl}?$skip=${skip}&$top=${this.top}&$count=true`;
|
|
192
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
193
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
194
|
+
}
|
|
195
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
196
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
197
|
+
}
|
|
198
|
+
if (this.searchTerm) {
|
|
199
|
+
url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
|
|
200
|
+
}
|
|
201
|
+
if (this.searchCols) {
|
|
202
|
+
url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
|
|
203
|
+
}
|
|
204
|
+
return url;
|
|
205
|
+
}
|
|
206
|
+
getNewPageSizeUrl(pageSize) {
|
|
207
|
+
const currentPage = this.getPageNumber(
|
|
208
|
+
parseInt(this.top || Constants.pagesize.toString())
|
|
209
|
+
);
|
|
210
|
+
const skip = (currentPage - 1) * pageSize;
|
|
211
|
+
let url = `${this.baseUrl}?$skip=${skip}&$top=${pageSize}&$count=true`;
|
|
212
|
+
if (this.filterBy !== null && this.filterBy !== "") {
|
|
213
|
+
url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
|
|
214
|
+
}
|
|
215
|
+
if (this.orderBy !== null && this.orderBy !== "") {
|
|
216
|
+
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
217
|
+
}
|
|
218
|
+
return url;
|
|
219
|
+
}
|
|
220
|
+
getOrderBy() {
|
|
221
|
+
return this.orderBy;
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export {
|
|
226
|
+
Hyperlink,
|
|
227
|
+
Constants,
|
|
228
|
+
OdataBuilder
|
|
229
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// src/clients/CacheManage.tsx
|
|
5
|
+
import NodeCache from "node-cache";
|
|
6
|
+
var CacheManager = class _CacheManager {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.maxCacheSize = 1e3;
|
|
9
|
+
this.cache = new NodeCache({ stdTTL: 0, checkperiod: 300 });
|
|
10
|
+
}
|
|
11
|
+
static getInstance() {
|
|
12
|
+
if (!_CacheManager.instance) {
|
|
13
|
+
_CacheManager.instance = new _CacheManager();
|
|
14
|
+
}
|
|
15
|
+
return _CacheManager.instance;
|
|
16
|
+
}
|
|
17
|
+
get(key) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
set(key, data, ttl) {
|
|
21
|
+
}
|
|
22
|
+
clear() {
|
|
23
|
+
this.cache.flushAll();
|
|
24
|
+
}
|
|
25
|
+
size() {
|
|
26
|
+
return this.cache.keys().length;
|
|
27
|
+
}
|
|
28
|
+
destroy() {
|
|
29
|
+
this.cache.close();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/clients/ServiceClient.tsx
|
|
34
|
+
var ServerApiError = class extends Error {
|
|
35
|
+
constructor(data, status) {
|
|
36
|
+
super(data.message || "---");
|
|
37
|
+
this.status = status;
|
|
38
|
+
this.data = data;
|
|
39
|
+
this.data.isSuccessful = false;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var ServiceClient = class {
|
|
43
|
+
constructor(apiBaseUrl, session) {
|
|
44
|
+
this.cacheManager = CacheManager.getInstance();
|
|
45
|
+
this.baseUrl = apiBaseUrl;
|
|
46
|
+
this.session = session;
|
|
47
|
+
}
|
|
48
|
+
buildFullPath(path, params) {
|
|
49
|
+
let updatedPath = path;
|
|
50
|
+
if (params) {
|
|
51
|
+
Object.keys(params).forEach((key) => {
|
|
52
|
+
updatedPath = updatedPath.replace(
|
|
53
|
+
`{${key}}`,
|
|
54
|
+
String(params[key])
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return this.baseUrl + updatedPath;
|
|
59
|
+
}
|
|
60
|
+
getConfig() {
|
|
61
|
+
const config = { headers: {} };
|
|
62
|
+
if (this.session) {
|
|
63
|
+
if (this.session.oAuthToken) {
|
|
64
|
+
config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
|
|
65
|
+
}
|
|
66
|
+
config.headers["cid"] = this.session.cid || "";
|
|
67
|
+
config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
|
|
68
|
+
config.headers["MarketCode"] = this.session?.marketCode || "IND";
|
|
69
|
+
}
|
|
70
|
+
return config;
|
|
71
|
+
}
|
|
72
|
+
handleFetchError(error) {
|
|
73
|
+
console.log(error);
|
|
74
|
+
return {
|
|
75
|
+
message: error.message || "There is some error. Please try after sometime.",
|
|
76
|
+
isSuccessful: false
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
async fetchJsonWithCache(fullPath, config) {
|
|
80
|
+
const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
|
|
81
|
+
const cachedData = this.cacheManager.get(cacheKey);
|
|
82
|
+
if (cachedData) {
|
|
83
|
+
return cachedData;
|
|
84
|
+
}
|
|
85
|
+
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
86
|
+
const response = await fetch(fullPath, { headers: config.headers });
|
|
87
|
+
if (!response.ok) {
|
|
88
|
+
const apiErrorData = await response.json();
|
|
89
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
90
|
+
}
|
|
91
|
+
const cacheControl = response.headers.get("Cache-Control");
|
|
92
|
+
let revalidate = null;
|
|
93
|
+
if (cacheControl) {
|
|
94
|
+
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
95
|
+
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
96
|
+
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
97
|
+
revalidate = maxAge * 1e3;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const data = await response.json();
|
|
101
|
+
data.isSuccessful = true;
|
|
102
|
+
if (revalidate !== null && revalidate > 0) {
|
|
103
|
+
console.log("revalidate............I am caching:" + revalidate);
|
|
104
|
+
this.cacheManager.set(cacheKey, data, revalidate);
|
|
105
|
+
}
|
|
106
|
+
return data;
|
|
107
|
+
}
|
|
108
|
+
// private async refreshToken(): Promise<void> {
|
|
109
|
+
// console.log("*******************calling refresh token***********************");
|
|
110
|
+
// try {
|
|
111
|
+
// const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
|
|
112
|
+
// method: 'POST',
|
|
113
|
+
// headers: {
|
|
114
|
+
// 'Content-Type': 'application/json'
|
|
115
|
+
// },
|
|
116
|
+
// body: JSON.stringify({ refreshToken: this.session.refreshToken })
|
|
117
|
+
// });
|
|
118
|
+
// if (!response.ok) {
|
|
119
|
+
// throw new Error("Failed to refresh token");
|
|
120
|
+
// }
|
|
121
|
+
// const responseData = await response.json();
|
|
122
|
+
// this.session.oAuthToken = responseData.result.accessToken;
|
|
123
|
+
// if (typeof window === "undefined") {
|
|
124
|
+
// // Running on the server
|
|
125
|
+
// } else {
|
|
126
|
+
// await fetch("/api/login", {
|
|
127
|
+
// method: "post",
|
|
128
|
+
// headers: {
|
|
129
|
+
// "Content-Type": "application/json",
|
|
130
|
+
// },
|
|
131
|
+
// body: JSON.stringify({ session: this.session }),
|
|
132
|
+
// });
|
|
133
|
+
// }
|
|
134
|
+
// } catch (error: any) {
|
|
135
|
+
// throw new Error("Failed to refresh token");
|
|
136
|
+
// }
|
|
137
|
+
// }
|
|
138
|
+
async handleRequest(request) {
|
|
139
|
+
try {
|
|
140
|
+
return await request();
|
|
141
|
+
} catch (error) {
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async post(path, data) {
|
|
146
|
+
const request = async () => {
|
|
147
|
+
const fullPath = this.baseUrl + path;
|
|
148
|
+
const config = this.getConfig();
|
|
149
|
+
const response = await fetch(fullPath, {
|
|
150
|
+
method: "POST",
|
|
151
|
+
headers: {
|
|
152
|
+
...config.headers,
|
|
153
|
+
"Content-Type": "application/json"
|
|
154
|
+
},
|
|
155
|
+
body: JSON.stringify(data)
|
|
156
|
+
});
|
|
157
|
+
if (!response.ok) {
|
|
158
|
+
const apiErrorData = await response.json();
|
|
159
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
160
|
+
}
|
|
161
|
+
const responseData = await response.json();
|
|
162
|
+
responseData.isSuccessful = true;
|
|
163
|
+
return responseData;
|
|
164
|
+
};
|
|
165
|
+
try {
|
|
166
|
+
return await this.handleRequest(request);
|
|
167
|
+
} catch (error) {
|
|
168
|
+
return this.handleFetchError(error);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
async getSingle(path, params) {
|
|
172
|
+
const request = async () => {
|
|
173
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
174
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
175
|
+
) : void 0;
|
|
176
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
177
|
+
const config = this.getConfig();
|
|
178
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
179
|
+
};
|
|
180
|
+
try {
|
|
181
|
+
return await this.handleRequest(request);
|
|
182
|
+
} catch (error) {
|
|
183
|
+
return this.handleFetchError(error);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
async get(path, params) {
|
|
187
|
+
const request = async () => {
|
|
188
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
189
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
190
|
+
) : void 0;
|
|
191
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
192
|
+
const config = this.getConfig();
|
|
193
|
+
console.log(fullPath);
|
|
194
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
195
|
+
};
|
|
196
|
+
try {
|
|
197
|
+
return await this.handleRequest(request);
|
|
198
|
+
} catch (error) {
|
|
199
|
+
return this.handleFetchError(error);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
var ServiceClient_default = ServiceClient;
|
|
204
|
+
|
|
205
|
+
export {
|
|
206
|
+
ServiceClient_default
|
|
207
|
+
};
|