@exyconn/common 2.3.2 → 2.3.4
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/README.md +117 -12
- package/dist/client/http/index.d.mts +280 -49
- package/dist/client/http/index.d.ts +280 -49
- package/dist/client/http/index.js +564 -90
- package/dist/client/http/index.js.map +1 -1
- package/dist/client/http/index.mjs +520 -80
- package/dist/client/http/index.mjs.map +1 -1
- package/dist/client/index.d.mts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +573 -316
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +529 -287
- package/dist/client/index.mjs.map +1 -1
- package/dist/client/utils/index.d.mts +3 -279
- package/dist/client/utils/index.d.ts +3 -279
- package/dist/{index-D9a9oxQy.d.ts → index-CdbQ8YPt.d.ts} +51 -39
- package/dist/{index-D3yCCjBZ.d.mts → index-Ckhm_HaX.d.mts} +21 -2
- package/dist/{index-01hoqibP.d.ts → index-br6POSyA.d.ts} +21 -2
- package/dist/{index-DuxL84IW.d.mts → index-guYdqefq.d.mts} +51 -39
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1214 -326
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1226 -338
- package/dist/index.mjs.map +1 -1
- package/dist/packageCheck-B_qfsD6R.d.ts +280 -0
- package/dist/packageCheck-C2_FT_Rl.d.mts +280 -0
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +631 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +625 -2
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/middleware/index.d.mts +283 -2
- package/dist/server/middleware/index.d.ts +283 -2
- package/dist/server/middleware/index.js +761 -0
- package/dist/server/middleware/index.js.map +1 -1
- package/dist/server/middleware/index.mjs +751 -1
- package/dist/server/middleware/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -29,108 +29,548 @@ function _interopNamespace(e) {
|
|
|
29
29
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
30
30
|
var Yup__namespace = /*#__PURE__*/_interopNamespace(Yup);
|
|
31
31
|
|
|
32
|
-
// src/client/http/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
headers: {
|
|
47
|
-
"Content-Type": "application/json"
|
|
32
|
+
// src/client/http/http.ts
|
|
33
|
+
|
|
34
|
+
// src/client/http/logger.ts
|
|
35
|
+
var Logger = class {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.isDevelopment = typeof window !== "undefined" && window.location.hostname === "localhost";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Log informational messages
|
|
41
|
+
*/
|
|
42
|
+
info(message, data, options) {
|
|
43
|
+
if (this.isDevelopment) {
|
|
44
|
+
const prefix = options?.context ? `[${options.context}]` : "";
|
|
45
|
+
console.log(`${prefix} ${message}`, data ?? "");
|
|
48
46
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Log warning messages
|
|
50
|
+
*/
|
|
51
|
+
warn(message, data, options) {
|
|
52
|
+
if (this.isDevelopment) {
|
|
53
|
+
const prefix = options?.context ? `[${options.context}]` : "";
|
|
54
|
+
console.warn(`${prefix} ${message}`, data ?? "");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Log error messages
|
|
59
|
+
*/
|
|
60
|
+
error(message, error, options) {
|
|
61
|
+
const prefix = options?.context ? `[${options.context}]` : "";
|
|
62
|
+
if (this.isDevelopment) {
|
|
63
|
+
console.error(`${prefix} ${message}`, error, options?.metadata || "");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Log debug messages (only in development)
|
|
68
|
+
*/
|
|
69
|
+
debug(message, data, options) {
|
|
70
|
+
if (this.isDevelopment) {
|
|
71
|
+
const prefix = options?.context ? `[${options.context}]` : "";
|
|
72
|
+
console.debug(`${prefix} ${message}`, data || "");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Log API errors with structured information
|
|
77
|
+
*/
|
|
78
|
+
apiError(endpoint, error, metadata) {
|
|
79
|
+
this.error(`API Error: ${endpoint}`, error, {
|
|
80
|
+
context: "API",
|
|
81
|
+
metadata: {
|
|
82
|
+
endpoint,
|
|
83
|
+
...metadata
|
|
57
84
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var logger = new Logger();
|
|
89
|
+
|
|
90
|
+
// src/client/http/response-parser.ts
|
|
91
|
+
var STATUS_CODES = {
|
|
92
|
+
SUCCESS: 200,
|
|
93
|
+
CREATED: 201,
|
|
94
|
+
NO_CONTENT: 204,
|
|
95
|
+
BAD_REQUEST: 400,
|
|
96
|
+
UNAUTHORIZED: 401,
|
|
97
|
+
FORBIDDEN: 403,
|
|
98
|
+
NOT_FOUND: 404,
|
|
99
|
+
CONFLICT: 409,
|
|
100
|
+
ERROR: 500
|
|
101
|
+
};
|
|
102
|
+
var STATUS_MESSAGES = {
|
|
103
|
+
SUCCESS: "success",
|
|
104
|
+
CREATED: "created",
|
|
105
|
+
NO_CONTENT: "no_content",
|
|
106
|
+
BAD_REQUEST: "bad_request",
|
|
107
|
+
UNAUTHORIZED: "unauthorized",
|
|
108
|
+
FORBIDDEN: "forbidden",
|
|
109
|
+
NOT_FOUND: "not_found",
|
|
110
|
+
CONFLICT: "conflict",
|
|
111
|
+
ERROR: "error"
|
|
112
|
+
};
|
|
113
|
+
var SUCCESS_CODES = [200, 201, 204];
|
|
114
|
+
var ERROR_CODES = [400, 401, 403, 404, 409, 500];
|
|
115
|
+
var parseResponseData = (response, fallback = null) => {
|
|
116
|
+
try {
|
|
117
|
+
if (!response || typeof response !== "object") {
|
|
118
|
+
return fallback;
|
|
119
|
+
}
|
|
120
|
+
const resp = response;
|
|
121
|
+
if ("data" in resp) {
|
|
122
|
+
return resp["data"] ?? fallback;
|
|
123
|
+
}
|
|
124
|
+
return response;
|
|
125
|
+
} catch (error) {
|
|
126
|
+
logger.error("Error parsing response data", error);
|
|
127
|
+
return fallback;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
var parseResponseMessage = (response, fallback = "") => {
|
|
131
|
+
try {
|
|
132
|
+
if (!response || typeof response !== "object") {
|
|
133
|
+
return fallback;
|
|
134
|
+
}
|
|
135
|
+
const resp = response;
|
|
136
|
+
if ("message" in resp && typeof resp["message"] === "string") {
|
|
137
|
+
return resp["message"];
|
|
138
|
+
}
|
|
139
|
+
return fallback;
|
|
140
|
+
} catch (error) {
|
|
141
|
+
logger.error("Error parsing response message", error);
|
|
142
|
+
return fallback;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
var parseResponseStatus = (response) => {
|
|
146
|
+
try {
|
|
147
|
+
if (!response || typeof response !== "object") {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
const resp = response;
|
|
151
|
+
if ("statusCode" in resp && typeof resp["statusCode"] === "number") {
|
|
152
|
+
return resp["statusCode"];
|
|
153
|
+
}
|
|
154
|
+
if ("status" in resp && typeof resp["status"] === "number") {
|
|
155
|
+
return resp["status"];
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
} catch (error) {
|
|
159
|
+
logger.error("Error parsing response status", error);
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
var parseResponseStatusMessage = (response, fallback = "") => {
|
|
164
|
+
try {
|
|
165
|
+
if (!response || typeof response !== "object") {
|
|
166
|
+
return fallback;
|
|
167
|
+
}
|
|
168
|
+
const resp = response;
|
|
169
|
+
if ("status" in resp && typeof resp["status"] === "string") {
|
|
170
|
+
return resp["status"];
|
|
171
|
+
}
|
|
172
|
+
return fallback;
|
|
173
|
+
} catch (error) {
|
|
174
|
+
logger.error("Error parsing response status message", error);
|
|
175
|
+
return fallback;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
var isSuccessResponse = (response) => {
|
|
179
|
+
try {
|
|
180
|
+
const statusCode = parseResponseStatus(response);
|
|
181
|
+
if (statusCode !== null) {
|
|
182
|
+
return SUCCESS_CODES.includes(statusCode);
|
|
183
|
+
}
|
|
184
|
+
const status = parseResponseStatusMessage(response);
|
|
185
|
+
return [STATUS_MESSAGES.SUCCESS, STATUS_MESSAGES.CREATED, STATUS_MESSAGES.NO_CONTENT].includes(
|
|
186
|
+
status
|
|
187
|
+
);
|
|
188
|
+
} catch (error) {
|
|
189
|
+
logger.error("Error checking response success", error);
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
var isErrorResponse = (response) => {
|
|
194
|
+
try {
|
|
195
|
+
const statusCode = parseResponseStatus(response);
|
|
196
|
+
if (statusCode !== null) {
|
|
197
|
+
return ERROR_CODES.includes(statusCode);
|
|
198
|
+
}
|
|
199
|
+
return false;
|
|
200
|
+
} catch (error) {
|
|
201
|
+
logger.error("Error checking response error", error);
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
var parsePaginatedResponse = (response) => {
|
|
206
|
+
try {
|
|
207
|
+
if (!response || typeof response !== "object") {
|
|
208
|
+
return { items: [], total: 0, page: 1, limit: 10 };
|
|
209
|
+
}
|
|
210
|
+
const resp = response;
|
|
211
|
+
let items = [];
|
|
212
|
+
if ("data" in resp && Array.isArray(resp["data"])) {
|
|
213
|
+
items = resp["data"];
|
|
214
|
+
}
|
|
215
|
+
let total = items.length;
|
|
216
|
+
let page = 1;
|
|
217
|
+
let limit = 10;
|
|
218
|
+
let totalPages;
|
|
219
|
+
if ("paginationData" in resp && resp["paginationData"] && typeof resp["paginationData"] === "object") {
|
|
220
|
+
const paginationData = resp["paginationData"];
|
|
221
|
+
if ("total" in paginationData && typeof paginationData["total"] === "number") {
|
|
222
|
+
total = paginationData["total"];
|
|
223
|
+
}
|
|
224
|
+
if ("page" in paginationData && typeof paginationData["page"] === "number") {
|
|
225
|
+
page = paginationData["page"];
|
|
226
|
+
}
|
|
227
|
+
if ("limit" in paginationData && typeof paginationData["limit"] === "number") {
|
|
228
|
+
limit = paginationData["limit"];
|
|
229
|
+
}
|
|
230
|
+
if ("totalPages" in paginationData && typeof paginationData["totalPages"] === "number") {
|
|
231
|
+
totalPages = paginationData["totalPages"];
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
let columns;
|
|
235
|
+
if ("columns" in resp && Array.isArray(resp["columns"])) {
|
|
236
|
+
columns = resp["columns"];
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
items,
|
|
240
|
+
total,
|
|
241
|
+
page,
|
|
242
|
+
limit,
|
|
243
|
+
...totalPages !== void 0 && { totalPages },
|
|
244
|
+
...columns !== void 0 && { columns }
|
|
245
|
+
};
|
|
246
|
+
} catch (error) {
|
|
247
|
+
logger.error("Error parsing paginated response", error);
|
|
248
|
+
return { items: [], total: 0, page: 1, limit: 10 };
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
var extractNestedData = (response, path, fallback = null) => {
|
|
252
|
+
try {
|
|
253
|
+
const keys = path.split(".");
|
|
254
|
+
let current = response;
|
|
255
|
+
for (const key of keys) {
|
|
256
|
+
if (current && typeof current === "object" && key in current) {
|
|
257
|
+
current = current[key];
|
|
258
|
+
} else {
|
|
259
|
+
return fallback;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return current;
|
|
263
|
+
} catch (error) {
|
|
264
|
+
logger.error("Error extracting nested data", error);
|
|
265
|
+
return fallback;
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
var safeJsonParse = (json, fallback = null) => {
|
|
269
|
+
try {
|
|
270
|
+
return JSON.parse(json);
|
|
271
|
+
} catch (error) {
|
|
272
|
+
logger.error("Error parsing JSON", error);
|
|
273
|
+
return fallback;
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
var parseAxiosErrorMessage = (error) => {
|
|
277
|
+
try {
|
|
278
|
+
if (!error || typeof error !== "object") {
|
|
279
|
+
return "An unexpected error occurred";
|
|
280
|
+
}
|
|
281
|
+
const err = error;
|
|
282
|
+
if ("response" in err && err["response"] && typeof err["response"] === "object") {
|
|
283
|
+
const response = err["response"];
|
|
284
|
+
if ("data" in response && response["data"] && typeof response["data"] === "object") {
|
|
285
|
+
const data = response["data"];
|
|
286
|
+
if ("data" in data && data["data"] && typeof data["data"] === "object") {
|
|
287
|
+
const nestedData = data["data"];
|
|
288
|
+
if ("message" in nestedData && typeof nestedData["message"] === "string") {
|
|
289
|
+
return nestedData["message"];
|
|
290
|
+
}
|
|
69
291
|
}
|
|
70
|
-
if (
|
|
71
|
-
|
|
292
|
+
if ("message" in data && typeof data["message"] === "string") {
|
|
293
|
+
return data["message"];
|
|
294
|
+
}
|
|
295
|
+
if ("error" in data && typeof data["error"] === "string") {
|
|
296
|
+
return data["error"];
|
|
72
297
|
}
|
|
73
298
|
}
|
|
74
|
-
return Promise.reject(error);
|
|
75
299
|
}
|
|
76
|
-
|
|
77
|
-
|
|
300
|
+
if ("message" in err && typeof err["message"] === "string") {
|
|
301
|
+
return err["message"];
|
|
302
|
+
}
|
|
303
|
+
if (typeof error === "string") {
|
|
304
|
+
return error;
|
|
305
|
+
}
|
|
306
|
+
return "An unexpected error occurred";
|
|
307
|
+
} catch (parseError2) {
|
|
308
|
+
logger.error("Error parsing axios error message", parseError2);
|
|
309
|
+
return "An unexpected error occurred";
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
var parseError = (error) => {
|
|
313
|
+
try {
|
|
314
|
+
if (!error || typeof error !== "object") {
|
|
315
|
+
return {
|
|
316
|
+
message: "An unexpected error occurred",
|
|
317
|
+
statusCode: null,
|
|
318
|
+
data: null
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
const err = error;
|
|
322
|
+
let statusCode = null;
|
|
323
|
+
let data = null;
|
|
324
|
+
let status;
|
|
325
|
+
if ("response" in err && err["response"] && typeof err["response"] === "object") {
|
|
326
|
+
const response = err["response"];
|
|
327
|
+
if ("status" in response && typeof response["status"] === "number") {
|
|
328
|
+
statusCode = response["status"];
|
|
329
|
+
}
|
|
330
|
+
if ("data" in response && response["data"] !== void 0) {
|
|
331
|
+
data = response["data"];
|
|
332
|
+
if (data && typeof data === "object" && "status" in data) {
|
|
333
|
+
const dataObj = data;
|
|
334
|
+
if (typeof dataObj["status"] === "string") {
|
|
335
|
+
status = dataObj["status"];
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (statusCode === null && "statusCode" in err && typeof err["statusCode"] === "number") {
|
|
341
|
+
statusCode = err["statusCode"];
|
|
342
|
+
}
|
|
343
|
+
if (data === null && "data" in err && err["data"] !== void 0) {
|
|
344
|
+
data = err["data"];
|
|
345
|
+
}
|
|
346
|
+
if (!status && "status" in err && typeof err["status"] === "string") {
|
|
347
|
+
status = err["status"];
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
message: parseAxiosErrorMessage(error),
|
|
351
|
+
statusCode,
|
|
352
|
+
data,
|
|
353
|
+
...status !== void 0 && { status }
|
|
354
|
+
};
|
|
355
|
+
} catch (err) {
|
|
356
|
+
logger.error("Error parsing error object", err);
|
|
357
|
+
return {
|
|
358
|
+
message: "An unexpected error occurred",
|
|
359
|
+
statusCode: null,
|
|
360
|
+
data: null
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
var simpleParseResponse = (response) => {
|
|
365
|
+
return response?.data?.data?.data;
|
|
366
|
+
};
|
|
367
|
+
var simpleMetaParseResponse = (response) => {
|
|
368
|
+
return response?.data?.data?.meta;
|
|
78
369
|
};
|
|
79
|
-
var
|
|
370
|
+
var simpleParseDualDataResponse = (response) => {
|
|
371
|
+
return response?.data?.data;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
// src/client/http/http.ts
|
|
375
|
+
var defaultConfig = {
|
|
376
|
+
baseUrl: typeof window !== "undefined" && window.location.hostname === "localhost" ? "http://localhost:4002" : "https://service-api.exyconn.com",
|
|
377
|
+
apiPrefix: "/v1/api",
|
|
378
|
+
timeout: 3e4,
|
|
379
|
+
defaultHeaders: {}
|
|
380
|
+
};
|
|
381
|
+
var currentConfig = { ...defaultConfig };
|
|
382
|
+
var axiosInstance = axios__default.default.create({
|
|
383
|
+
baseURL: defaultConfig.baseUrl,
|
|
384
|
+
timeout: defaultConfig.timeout,
|
|
80
385
|
headers: {
|
|
81
|
-
"Content-Type": "
|
|
386
|
+
"Content-Type": "application/json"
|
|
82
387
|
}
|
|
83
388
|
});
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
|
|
389
|
+
var getApiBaseUrl = () => {
|
|
390
|
+
return currentConfig.baseUrl || defaultConfig.baseUrl;
|
|
391
|
+
};
|
|
392
|
+
var setApiBaseUrl = (baseUrl) => {
|
|
393
|
+
currentConfig.baseUrl = baseUrl;
|
|
394
|
+
axiosInstance.defaults.baseURL = baseUrl;
|
|
395
|
+
logger.info(`API Base URL updated to: ${baseUrl}`);
|
|
396
|
+
};
|
|
397
|
+
var getApiPrefix = () => {
|
|
398
|
+
return currentConfig.apiPrefix || defaultConfig.apiPrefix;
|
|
399
|
+
};
|
|
400
|
+
var setApiPrefix = (prefix) => {
|
|
401
|
+
currentConfig.apiPrefix = prefix;
|
|
402
|
+
logger.info(`API Prefix updated to: ${prefix}`);
|
|
403
|
+
};
|
|
404
|
+
var getCustomHeaders = () => {
|
|
405
|
+
return { ...currentConfig.defaultHeaders };
|
|
406
|
+
};
|
|
407
|
+
var setCustomHeader = (key, value) => {
|
|
408
|
+
if (!currentConfig.defaultHeaders) {
|
|
409
|
+
currentConfig.defaultHeaders = {};
|
|
95
410
|
}
|
|
96
|
-
|
|
411
|
+
currentConfig.defaultHeaders[key] = value;
|
|
412
|
+
axiosInstance.defaults.headers.common[key] = value;
|
|
413
|
+
logger.info(`Custom header added: ${key}`);
|
|
97
414
|
};
|
|
98
|
-
var
|
|
99
|
-
|
|
415
|
+
var removeCustomHeader = (key) => {
|
|
416
|
+
if (currentConfig.defaultHeaders) {
|
|
417
|
+
delete currentConfig.defaultHeaders[key];
|
|
418
|
+
}
|
|
419
|
+
delete axiosInstance.defaults.headers.common[key];
|
|
420
|
+
logger.info(`Custom header removed: ${key}`);
|
|
100
421
|
};
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
|
|
422
|
+
var setCustomHeaders = (headers) => {
|
|
423
|
+
currentConfig.defaultHeaders = { ...currentConfig.defaultHeaders, ...headers };
|
|
424
|
+
Object.entries(headers).forEach(([key, value]) => {
|
|
425
|
+
axiosInstance.defaults.headers.common[key] = value;
|
|
426
|
+
});
|
|
427
|
+
logger.info(`Multiple custom headers added: ${Object.keys(headers).join(", ")}`);
|
|
428
|
+
};
|
|
429
|
+
var clearCustomHeaders = () => {
|
|
430
|
+
if (currentConfig.defaultHeaders) {
|
|
431
|
+
Object.keys(currentConfig.defaultHeaders).forEach((key) => {
|
|
432
|
+
delete axiosInstance.defaults.headers.common[key];
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
currentConfig.defaultHeaders = {};
|
|
436
|
+
logger.info("All custom headers cleared");
|
|
437
|
+
};
|
|
438
|
+
var configureHttp = (config) => {
|
|
439
|
+
if (config.baseUrl) {
|
|
440
|
+
setApiBaseUrl(config.baseUrl);
|
|
104
441
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
442
|
+
if (config.apiPrefix) {
|
|
443
|
+
setApiPrefix(config.apiPrefix);
|
|
107
444
|
}
|
|
108
|
-
if (
|
|
109
|
-
|
|
445
|
+
if (config.timeout !== void 0) {
|
|
446
|
+
currentConfig.timeout = config.timeout;
|
|
447
|
+
axiosInstance.defaults.timeout = config.timeout;
|
|
110
448
|
}
|
|
111
|
-
if (
|
|
112
|
-
|
|
449
|
+
if (config.defaultHeaders) {
|
|
450
|
+
setCustomHeaders(config.defaultHeaders);
|
|
113
451
|
}
|
|
114
|
-
|
|
452
|
+
logger.info("HTTP client configured successfully");
|
|
115
453
|
};
|
|
116
|
-
var
|
|
117
|
-
return
|
|
454
|
+
var getHttpConfig = () => {
|
|
455
|
+
return { ...currentConfig };
|
|
118
456
|
};
|
|
119
|
-
var
|
|
120
|
-
|
|
457
|
+
var resetHttpConfig = () => {
|
|
458
|
+
currentConfig = { ...defaultConfig };
|
|
459
|
+
axiosInstance.defaults.baseURL = defaultConfig.baseUrl;
|
|
460
|
+
axiosInstance.defaults.timeout = defaultConfig.timeout;
|
|
461
|
+
clearCustomHeaders();
|
|
462
|
+
logger.info("HTTP configuration reset to defaults");
|
|
121
463
|
};
|
|
122
|
-
var
|
|
123
|
-
|
|
464
|
+
var API_BASE_URL = getApiBaseUrl();
|
|
465
|
+
var API_PREFIX = getApiPrefix();
|
|
466
|
+
axiosInstance.interceptors.request.use(
|
|
467
|
+
(config) => {
|
|
468
|
+
try {
|
|
469
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
470
|
+
const selectedOrg = localStorage.getItem("selectedOrganization");
|
|
471
|
+
if (selectedOrg) {
|
|
472
|
+
const org = JSON.parse(selectedOrg);
|
|
473
|
+
if (org && org._id) {
|
|
474
|
+
config.headers["x-organization-id"] = org._id;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
} catch (error) {
|
|
479
|
+
logger.warn("Failed to read organization from localStorage", error);
|
|
480
|
+
}
|
|
481
|
+
return config;
|
|
482
|
+
},
|
|
483
|
+
(error) => {
|
|
484
|
+
return Promise.reject(error);
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
axiosInstance.interceptors.response.use(
|
|
488
|
+
(response) => response,
|
|
489
|
+
(error) => {
|
|
490
|
+
const parsedError = parseError(error);
|
|
491
|
+
logger.error("API Error", parsedError);
|
|
492
|
+
return Promise.reject(parsedError);
|
|
493
|
+
}
|
|
494
|
+
);
|
|
495
|
+
var buildHeaders = (customHeaders) => {
|
|
496
|
+
const headers = {
|
|
497
|
+
"Content-Type": "application/json",
|
|
498
|
+
...currentConfig.defaultHeaders,
|
|
499
|
+
// Add global custom headers
|
|
500
|
+
...customHeaders
|
|
501
|
+
// Request-specific headers override global ones
|
|
502
|
+
};
|
|
503
|
+
return headers;
|
|
504
|
+
};
|
|
505
|
+
var buildConfig = (params, customHeaders) => {
|
|
506
|
+
const config = {
|
|
507
|
+
headers: buildHeaders(customHeaders)
|
|
508
|
+
};
|
|
509
|
+
if (params) {
|
|
510
|
+
config.params = params;
|
|
511
|
+
}
|
|
512
|
+
return config;
|
|
124
513
|
};
|
|
125
|
-
var
|
|
126
|
-
|
|
514
|
+
var getRequest = async (url, params, customHeaders) => {
|
|
515
|
+
const config = buildConfig(params, customHeaders);
|
|
516
|
+
return axiosInstance.get(url, config);
|
|
127
517
|
};
|
|
128
|
-
var
|
|
129
|
-
|
|
518
|
+
var postRequest = async (url, data, customHeaders) => {
|
|
519
|
+
const config = buildConfig(void 0, customHeaders);
|
|
520
|
+
return axiosInstance.post(url, data, config);
|
|
130
521
|
};
|
|
131
|
-
var
|
|
132
|
-
const
|
|
133
|
-
return
|
|
522
|
+
var putRequest = async (url, data, customHeaders) => {
|
|
523
|
+
const config = buildConfig(void 0, customHeaders);
|
|
524
|
+
return axiosInstance.put(url, data, config);
|
|
525
|
+
};
|
|
526
|
+
var patchRequest = async (url, data, customHeaders) => {
|
|
527
|
+
const config = buildConfig(void 0, customHeaders);
|
|
528
|
+
return axiosInstance.patch(url, data, config);
|
|
529
|
+
};
|
|
530
|
+
var deleteRequest = async (url, params, customHeaders) => {
|
|
531
|
+
const config = buildConfig(params, customHeaders);
|
|
532
|
+
return axiosInstance.delete(url, config);
|
|
533
|
+
};
|
|
534
|
+
var uploadFile = async (url, file, additionalData) => {
|
|
535
|
+
const formData = new FormData();
|
|
536
|
+
formData.append("file", file);
|
|
537
|
+
if (additionalData) {
|
|
538
|
+
Object.entries(additionalData).forEach(([key, value]) => {
|
|
539
|
+
formData.append(key, String(value));
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
const config = {
|
|
543
|
+
headers: {
|
|
544
|
+
"Content-Type": "multipart/form-data"
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
return axiosInstance.post(url, formData, config);
|
|
548
|
+
};
|
|
549
|
+
var extractData = (response) => {
|
|
550
|
+
return parseResponseData(response.data);
|
|
551
|
+
};
|
|
552
|
+
var extractMessage = (response) => {
|
|
553
|
+
return parseResponseMessage(response, "");
|
|
554
|
+
};
|
|
555
|
+
var isSuccess = (response) => {
|
|
556
|
+
return response.status >= 200 && response.status < 300;
|
|
557
|
+
};
|
|
558
|
+
var extractPaginatedData = (response) => {
|
|
559
|
+
return parsePaginatedResponse(response.data);
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
// src/client/http/slug.ts
|
|
563
|
+
var generateSlug = (text) => {
|
|
564
|
+
if (!text) return "";
|
|
565
|
+
return text.trim().replace(/[^\w\s]/g, "").replace(/\s+(.)/g, (_, char) => char.toUpperCase()).replace(/\s+/g, "").replace(/^(.)/, (_, char) => char.toLowerCase());
|
|
566
|
+
};
|
|
567
|
+
var generateUrlSlug = (text) => {
|
|
568
|
+
if (!text) return "";
|
|
569
|
+
return text.trim().toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
570
|
+
};
|
|
571
|
+
var generateSnakeSlug = (text) => {
|
|
572
|
+
if (!text) return "";
|
|
573
|
+
return text.trim().toLowerCase().replace(/[^\w\s]/g, "").replace(/\s+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "");
|
|
134
574
|
};
|
|
135
575
|
|
|
136
576
|
// src/client/logger/client-logger.ts
|
|
@@ -286,40 +726,6 @@ var formatRelativeTime = (date) => {
|
|
|
286
726
|
}
|
|
287
727
|
return "just now";
|
|
288
728
|
};
|
|
289
|
-
var formatDateForInput = (date) => {
|
|
290
|
-
const dateObj = new Date(date);
|
|
291
|
-
return dateObj.toISOString().split("T")[0];
|
|
292
|
-
};
|
|
293
|
-
var formatDateTimeForInput = (date) => {
|
|
294
|
-
const dateObj = new Date(date);
|
|
295
|
-
return dateObj.toISOString().slice(0, 16);
|
|
296
|
-
};
|
|
297
|
-
var isToday = (date) => {
|
|
298
|
-
const dateObj = new Date(date);
|
|
299
|
-
const today = /* @__PURE__ */ new Date();
|
|
300
|
-
return dateObj.getDate() === today.getDate() && dateObj.getMonth() === today.getMonth() && dateObj.getFullYear() === today.getFullYear();
|
|
301
|
-
};
|
|
302
|
-
var isPast = (date) => {
|
|
303
|
-
return new Date(date).getTime() < Date.now();
|
|
304
|
-
};
|
|
305
|
-
var isFuture = (date) => {
|
|
306
|
-
return new Date(date).getTime() > Date.now();
|
|
307
|
-
};
|
|
308
|
-
var addDays = (date, days) => {
|
|
309
|
-
const dateObj = new Date(date);
|
|
310
|
-
dateObj.setDate(dateObj.getDate() + days);
|
|
311
|
-
return dateObj;
|
|
312
|
-
};
|
|
313
|
-
var startOfDay = (date) => {
|
|
314
|
-
const dateObj = new Date(date);
|
|
315
|
-
dateObj.setHours(0, 0, 0, 0);
|
|
316
|
-
return dateObj;
|
|
317
|
-
};
|
|
318
|
-
var endOfDay = (date) => {
|
|
319
|
-
const dateObj = new Date(date);
|
|
320
|
-
dateObj.setHours(23, 59, 59, 999);
|
|
321
|
-
return dateObj;
|
|
322
|
-
};
|
|
323
729
|
|
|
324
730
|
// src/client/utils/clipboard.ts
|
|
325
731
|
var copyToClipboard = async (text) => {
|
|
@@ -344,20 +750,6 @@ var copyToClipboard = async (text) => {
|
|
|
344
750
|
return false;
|
|
345
751
|
}
|
|
346
752
|
};
|
|
347
|
-
var readFromClipboard = async () => {
|
|
348
|
-
try {
|
|
349
|
-
if (navigator.clipboard && window.isSecureContext) {
|
|
350
|
-
return await navigator.clipboard.readText();
|
|
351
|
-
}
|
|
352
|
-
return null;
|
|
353
|
-
} catch (error) {
|
|
354
|
-
console.error("Failed to read from clipboard:", error);
|
|
355
|
-
return null;
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
var isClipboardAvailable = () => {
|
|
359
|
-
return !!(navigator.clipboard && window.isSecureContext);
|
|
360
|
-
};
|
|
361
753
|
|
|
362
754
|
// src/client/utils/slug.ts
|
|
363
755
|
var slugify = (text) => {
|
|
@@ -394,165 +786,15 @@ var kebabToCamel = (text) => {
|
|
|
394
786
|
return text.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
395
787
|
};
|
|
396
788
|
|
|
397
|
-
// src/client/utils/events.ts
|
|
398
|
-
var EventEmitter = class {
|
|
399
|
-
constructor() {
|
|
400
|
-
this.handlers = /* @__PURE__ */ new Map();
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Subscribe to an event
|
|
404
|
-
* @returns Unsubscribe function
|
|
405
|
-
*/
|
|
406
|
-
on(event, handler) {
|
|
407
|
-
if (!this.handlers.has(event)) {
|
|
408
|
-
this.handlers.set(event, /* @__PURE__ */ new Set());
|
|
409
|
-
}
|
|
410
|
-
this.handlers.get(event).add(handler);
|
|
411
|
-
return () => this.off(event, handler);
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Subscribe to an event once
|
|
415
|
-
*/
|
|
416
|
-
once(event, handler) {
|
|
417
|
-
const wrappedHandler = (data) => {
|
|
418
|
-
this.off(event, wrappedHandler);
|
|
419
|
-
handler(data);
|
|
420
|
-
};
|
|
421
|
-
return this.on(event, wrappedHandler);
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Unsubscribe from an event
|
|
425
|
-
*/
|
|
426
|
-
off(event, handler) {
|
|
427
|
-
const eventHandlers = this.handlers.get(event);
|
|
428
|
-
if (eventHandlers) {
|
|
429
|
-
eventHandlers.delete(handler);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
* Emit an event
|
|
434
|
-
*/
|
|
435
|
-
emit(event, data) {
|
|
436
|
-
const eventHandlers = this.handlers.get(event);
|
|
437
|
-
if (eventHandlers) {
|
|
438
|
-
eventHandlers.forEach((handler) => {
|
|
439
|
-
try {
|
|
440
|
-
handler(data);
|
|
441
|
-
} catch (error) {
|
|
442
|
-
console.error(`Error in event handler for "${String(event)}":`, error);
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Remove all handlers for an event (or all events)
|
|
449
|
-
*/
|
|
450
|
-
removeAllListeners(event) {
|
|
451
|
-
if (event) {
|
|
452
|
-
this.handlers.delete(event);
|
|
453
|
-
} else {
|
|
454
|
-
this.handlers.clear();
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Get count of listeners for an event
|
|
459
|
-
*/
|
|
460
|
-
listenerCount(event) {
|
|
461
|
-
return this.handlers.get(event)?.size ?? 0;
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
var createEventEmitter = () => {
|
|
465
|
-
return new EventEmitter();
|
|
466
|
-
};
|
|
467
|
-
var appEvents = new EventEmitter();
|
|
468
|
-
|
|
469
|
-
// src/client/utils/api-urls.ts
|
|
470
|
-
var ApiUrlBuilder = class {
|
|
471
|
-
constructor(config) {
|
|
472
|
-
this.baseUrl = config.baseUrl.replace(/\/$/, "");
|
|
473
|
-
this.version = config.version || "";
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Build full URL from path
|
|
477
|
-
*/
|
|
478
|
-
build(path) {
|
|
479
|
-
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
480
|
-
const versionPath = this.version ? `/${this.version}` : "";
|
|
481
|
-
return `${this.baseUrl}${versionPath}${normalizedPath}`;
|
|
482
|
-
}
|
|
483
|
-
/**
|
|
484
|
-
* Build URL with query parameters
|
|
485
|
-
*/
|
|
486
|
-
buildWithParams(path, params) {
|
|
487
|
-
const url = this.build(path);
|
|
488
|
-
const filteredParams = Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`).join("&");
|
|
489
|
-
return filteredParams ? `${url}?${filteredParams}` : url;
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Build URL with path parameters
|
|
493
|
-
*/
|
|
494
|
-
buildWithPathParams(template, params) {
|
|
495
|
-
let path = template;
|
|
496
|
-
Object.entries(params).forEach(([key, value]) => {
|
|
497
|
-
path = path.replace(`:${key}`, String(value));
|
|
498
|
-
path = path.replace(`{${key}}`, String(value));
|
|
499
|
-
});
|
|
500
|
-
return this.build(path);
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Get base URL
|
|
504
|
-
*/
|
|
505
|
-
getBaseUrl() {
|
|
506
|
-
return this.baseUrl;
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Set new base URL
|
|
510
|
-
*/
|
|
511
|
-
setBaseUrl(baseUrl) {
|
|
512
|
-
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
var createApiUrlBuilder = (config) => {
|
|
516
|
-
return new ApiUrlBuilder(config);
|
|
517
|
-
};
|
|
518
|
-
var createApiEndpoints = (builder) => ({
|
|
519
|
-
// Auth endpoints
|
|
520
|
-
auth: {
|
|
521
|
-
login: () => builder.build("/auth/login"),
|
|
522
|
-
register: () => builder.build("/auth/register"),
|
|
523
|
-
logout: () => builder.build("/auth/logout"),
|
|
524
|
-
refresh: () => builder.build("/auth/refresh"),
|
|
525
|
-
me: () => builder.build("/auth/me"),
|
|
526
|
-
forgotPassword: () => builder.build("/auth/forgot-password"),
|
|
527
|
-
resetPassword: () => builder.build("/auth/reset-password")
|
|
528
|
-
},
|
|
529
|
-
// User endpoints
|
|
530
|
-
users: {
|
|
531
|
-
list: () => builder.build("/users"),
|
|
532
|
-
get: (id) => builder.buildWithPathParams("/users/:id", { id }),
|
|
533
|
-
create: () => builder.build("/users"),
|
|
534
|
-
update: (id) => builder.buildWithPathParams("/users/:id", { id }),
|
|
535
|
-
delete: (id) => builder.buildWithPathParams("/users/:id", { id })
|
|
536
|
-
},
|
|
537
|
-
// Generic CRUD factory
|
|
538
|
-
crud: (resource) => ({
|
|
539
|
-
list: () => builder.build(`/${resource}`),
|
|
540
|
-
get: (id) => builder.buildWithPathParams(`/${resource}/:id`, { id }),
|
|
541
|
-
create: () => builder.build(`/${resource}`),
|
|
542
|
-
update: (id) => builder.buildWithPathParams(`/${resource}/:id`, { id }),
|
|
543
|
-
delete: (id) => builder.buildWithPathParams(`/${resource}/:id`, { id })
|
|
544
|
-
})
|
|
545
|
-
});
|
|
546
|
-
|
|
547
789
|
// src/client/utils/response-parser.ts
|
|
548
|
-
var
|
|
790
|
+
var isSuccessResponse2 = (response) => {
|
|
549
791
|
return response.success === true;
|
|
550
792
|
};
|
|
551
|
-
var
|
|
793
|
+
var isErrorResponse2 = (response) => {
|
|
552
794
|
return response.success === false;
|
|
553
795
|
};
|
|
554
796
|
var getResponseData = (response, defaultValue) => {
|
|
555
|
-
if (
|
|
797
|
+
if (isSuccessResponse2(response) && response.data !== void 0) {
|
|
556
798
|
return response.data;
|
|
557
799
|
}
|
|
558
800
|
return defaultValue;
|
|
@@ -2793,18 +3035,18 @@ function useLogger(componentName, props, options = {}) {
|
|
|
2793
3035
|
const {
|
|
2794
3036
|
logProps = true,
|
|
2795
3037
|
logLifecycle = true,
|
|
2796
|
-
logger = console.log
|
|
3038
|
+
logger: logger2 = console.log
|
|
2797
3039
|
} = options;
|
|
2798
3040
|
const previousProps = react.useRef(props);
|
|
2799
3041
|
const renderCount = react.useRef(0);
|
|
2800
3042
|
renderCount.current++;
|
|
2801
3043
|
react.useEffect(() => {
|
|
2802
3044
|
if (logLifecycle) {
|
|
2803
|
-
|
|
3045
|
+
logger2(`[${componentName}] Mounted`);
|
|
2804
3046
|
}
|
|
2805
3047
|
return () => {
|
|
2806
3048
|
if (logLifecycle) {
|
|
2807
|
-
|
|
3049
|
+
logger2(`[${componentName}] Unmounted (rendered ${renderCount.current} times)`);
|
|
2808
3050
|
}
|
|
2809
3051
|
};
|
|
2810
3052
|
}, []);
|
|
@@ -2836,12 +3078,12 @@ function useLogger(componentName, props, options = {}) {
|
|
|
2836
3078
|
});
|
|
2837
3079
|
}
|
|
2838
3080
|
if (hasChanges) {
|
|
2839
|
-
|
|
3081
|
+
logger2(`[${componentName}] Props changed:`, changedProps);
|
|
2840
3082
|
}
|
|
2841
3083
|
previousProps.current = props;
|
|
2842
|
-
}, [componentName, props, logProps,
|
|
3084
|
+
}, [componentName, props, logProps, logger2]);
|
|
2843
3085
|
if (process.env.NODE_ENV === "development") {
|
|
2844
|
-
|
|
3086
|
+
logger2(`[${componentName}] Render #${renderCount.current}`);
|
|
2845
3087
|
}
|
|
2846
3088
|
}
|
|
2847
3089
|
var useLogger_default = useLogger;
|
|
@@ -5628,34 +5870,34 @@ function RegisterForm({
|
|
|
5628
5870
|
) });
|
|
5629
5871
|
}
|
|
5630
5872
|
|
|
5631
|
-
exports.
|
|
5873
|
+
exports.API_BASE_URL = API_BASE_URL;
|
|
5874
|
+
exports.API_PREFIX = API_PREFIX;
|
|
5632
5875
|
exports.ClientLogger = ClientLogger;
|
|
5633
5876
|
exports.ContactForm = ContactForm;
|
|
5634
|
-
exports.
|
|
5877
|
+
exports.ERROR_CODES = ERROR_CODES;
|
|
5635
5878
|
exports.LoginForm = LoginForm;
|
|
5636
5879
|
exports.NewsletterForm = NewsletterForm;
|
|
5637
5880
|
exports.RegisterForm = RegisterForm;
|
|
5881
|
+
exports.STATUS_CODES = STATUS_CODES;
|
|
5882
|
+
exports.STATUS_MESSAGES = STATUS_MESSAGES;
|
|
5883
|
+
exports.SUCCESS_CODES = SUCCESS_CODES;
|
|
5638
5884
|
exports.ThemeContext = ThemeContext;
|
|
5639
5885
|
exports.ThemeProvider = ThemeProvider;
|
|
5640
5886
|
exports.ThemeToggle = ThemeToggle;
|
|
5641
5887
|
exports.VALIDATION_MESSAGES = VALIDATION_MESSAGES;
|
|
5642
|
-
exports.addDays = addDays;
|
|
5643
5888
|
exports.adjustColor = adjustColor;
|
|
5644
|
-
exports.
|
|
5889
|
+
exports.axios = axiosInstance;
|
|
5645
5890
|
exports.camelToKebab = camelToKebab;
|
|
5646
5891
|
exports.capitalize = capitalize;
|
|
5647
5892
|
exports.capitalizeWords = capitalizeWords;
|
|
5648
|
-
exports.
|
|
5893
|
+
exports.clearCustomHeaders = clearCustomHeaders;
|
|
5649
5894
|
exports.clientLogger = clientLogger;
|
|
5895
|
+
exports.configureHttp = configureHttp;
|
|
5650
5896
|
exports.contactFormSchema = contactFormSchema;
|
|
5651
5897
|
exports.copyToClipboard = copyToClipboard;
|
|
5652
|
-
exports.createApiEndpoints = createApiEndpoints;
|
|
5653
|
-
exports.createApiUrlBuilder = createApiUrlBuilder;
|
|
5654
5898
|
exports.createClientLogger = createClientLogger;
|
|
5655
5899
|
exports.createEmptyPaginationMeta = createEmptyPaginationMeta;
|
|
5656
5900
|
exports.createErrorResponse = createErrorResponse;
|
|
5657
|
-
exports.createEventEmitter = createEventEmitter;
|
|
5658
|
-
exports.createHttpClient = createHttpClient;
|
|
5659
5901
|
exports.createRegisterFormSchema = createRegisterFormSchema;
|
|
5660
5902
|
exports.createSuccessResponse = createSuccessResponse;
|
|
5661
5903
|
exports.createTheme = createTheme;
|
|
@@ -5664,6 +5906,7 @@ exports.cssVar = cssVar;
|
|
|
5664
5906
|
exports.deepMerge = deepMerge;
|
|
5665
5907
|
exports.defaultDarkTheme = defaultDarkTheme;
|
|
5666
5908
|
exports.defaultLightTheme = defaultLightTheme;
|
|
5909
|
+
exports.deleteRequest = deleteRequest;
|
|
5667
5910
|
exports.dummyBannerData = dummyBannerData;
|
|
5668
5911
|
exports.dummyFaqItems = dummyFaqItems;
|
|
5669
5912
|
exports.dummyFeatures = dummyFeatures;
|
|
@@ -5672,59 +5915,76 @@ exports.dummyHeaderData = dummyHeaderData;
|
|
|
5672
5915
|
exports.dummyImage = dummyImage;
|
|
5673
5916
|
exports.dummyPricingPlans = dummyPricingPlans;
|
|
5674
5917
|
exports.dummyTestimonials = dummyTestimonials;
|
|
5675
|
-
exports.
|
|
5918
|
+
exports.extractData = extractData;
|
|
5919
|
+
exports.extractMessage = extractMessage;
|
|
5920
|
+
exports.extractNestedData = extractNestedData;
|
|
5921
|
+
exports.extractPaginatedData = extractPaginatedData;
|
|
5676
5922
|
exports.flattenToCssVars = flattenToCssVars;
|
|
5677
5923
|
exports.formatDate = formatDate;
|
|
5678
|
-
exports.formatDateForInput = formatDateForInput;
|
|
5679
5924
|
exports.formatDateTime = formatDateTime;
|
|
5680
|
-
exports.formatDateTimeForInput = formatDateTimeForInput;
|
|
5681
|
-
exports.formatPackageCheckResult = formatPackageCheckResult;
|
|
5682
5925
|
exports.formatRelativeTime = formatRelativeTime;
|
|
5683
5926
|
exports.generateCssVars = generateCssVars;
|
|
5684
|
-
exports.
|
|
5927
|
+
exports.generateSlug = generateSlug;
|
|
5928
|
+
exports.generateSnakeSlug = generateSnakeSlug;
|
|
5929
|
+
exports.generateUrlSlug = generateUrlSlug;
|
|
5930
|
+
exports.getApiBaseUrl = getApiBaseUrl;
|
|
5931
|
+
exports.getApiPrefix = getApiPrefix;
|
|
5685
5932
|
exports.getContrastColor = getContrastColor;
|
|
5933
|
+
exports.getCustomHeaders = getCustomHeaders;
|
|
5686
5934
|
exports.getErrorMessage = getErrorMessage;
|
|
5935
|
+
exports.getHttpConfig = getHttpConfig;
|
|
5687
5936
|
exports.getNextPage = getNextPage;
|
|
5688
5937
|
exports.getPrevPage = getPrevPage;
|
|
5938
|
+
exports.getRequest = getRequest;
|
|
5689
5939
|
exports.getResponseData = getResponseData;
|
|
5690
5940
|
exports.getSystemColorScheme = getSystemColorScheme;
|
|
5691
5941
|
exports.hasData = hasData;
|
|
5692
5942
|
exports.hasMorePages = hasMorePages;
|
|
5693
5943
|
exports.hexToRgba = hexToRgba;
|
|
5694
5944
|
exports.injectCssVars = injectCssVars;
|
|
5695
|
-
exports.isClipboardAvailable = isClipboardAvailable;
|
|
5696
5945
|
exports.isErrorResponse = isErrorResponse;
|
|
5697
|
-
exports.isForbidden = isForbidden;
|
|
5698
|
-
exports.isFuture = isFuture;
|
|
5699
|
-
exports.isNotFound = isNotFound;
|
|
5700
|
-
exports.isPast = isPast;
|
|
5701
|
-
exports.isServerError = isServerError;
|
|
5702
|
-
exports.isStatusError = isStatusError;
|
|
5703
5946
|
exports.isSuccess = isSuccess;
|
|
5704
5947
|
exports.isSuccessResponse = isSuccessResponse;
|
|
5705
|
-
exports.
|
|
5706
|
-
exports.
|
|
5948
|
+
exports.isUtilErrorResponse = isErrorResponse2;
|
|
5949
|
+
exports.isUtilSuccessResponse = isSuccessResponse2;
|
|
5707
5950
|
exports.kebabToCamel = kebabToCamel;
|
|
5708
5951
|
exports.loadThemeFromUrl = loadThemeFromUrl;
|
|
5709
5952
|
exports.loadThemeMode = loadThemeMode;
|
|
5953
|
+
exports.logger = logger;
|
|
5710
5954
|
exports.loginFormSchema = loginFormSchema;
|
|
5711
5955
|
exports.loremIpsum = loremIpsum;
|
|
5712
5956
|
exports.newsletterFormSchema = newsletterFormSchema;
|
|
5713
5957
|
exports.packageCheck = packageCheck;
|
|
5958
|
+
exports.parseAxiosErrorMessage = parseAxiosErrorMessage;
|
|
5714
5959
|
exports.parseError = parseError;
|
|
5715
|
-
exports.
|
|
5716
|
-
exports.
|
|
5717
|
-
exports.
|
|
5960
|
+
exports.parsePaginatedResponse = parsePaginatedResponse;
|
|
5961
|
+
exports.parseResponseData = parseResponseData;
|
|
5962
|
+
exports.parseResponseMessage = parseResponseMessage;
|
|
5963
|
+
exports.parseResponseStatus = parseResponseStatus;
|
|
5964
|
+
exports.parseResponseStatusMessage = parseResponseStatusMessage;
|
|
5965
|
+
exports.patchRequest = patchRequest;
|
|
5966
|
+
exports.postRequest = postRequest;
|
|
5967
|
+
exports.putRequest = putRequest;
|
|
5718
5968
|
exports.registerFormSchema = registerFormSchema;
|
|
5719
5969
|
exports.removeCssVars = removeCssVars;
|
|
5970
|
+
exports.removeCustomHeader = removeCustomHeader;
|
|
5971
|
+
exports.resetHttpConfig = resetHttpConfig;
|
|
5720
5972
|
exports.resolveThemeMode = resolveThemeMode;
|
|
5973
|
+
exports.safeJsonParse = safeJsonParse;
|
|
5721
5974
|
exports.saveThemeMode = saveThemeMode;
|
|
5975
|
+
exports.setApiBaseUrl = setApiBaseUrl;
|
|
5976
|
+
exports.setApiPrefix = setApiPrefix;
|
|
5977
|
+
exports.setCustomHeader = setCustomHeader;
|
|
5978
|
+
exports.setCustomHeaders = setCustomHeaders;
|
|
5979
|
+
exports.simpleMetaParseResponse = simpleMetaParseResponse;
|
|
5980
|
+
exports.simpleParseDualDataResponse = simpleParseDualDataResponse;
|
|
5981
|
+
exports.simpleParseResponse = simpleParseResponse;
|
|
5722
5982
|
exports.slugify = slugify;
|
|
5723
5983
|
exports.slugifyUnique = slugifyUnique;
|
|
5724
|
-
exports.startOfDay = startOfDay;
|
|
5725
5984
|
exports.truncate = truncate;
|
|
5726
5985
|
exports.truncateWords = truncateWords;
|
|
5727
5986
|
exports.unslugify = unslugify;
|
|
5987
|
+
exports.uploadFile = uploadFile;
|
|
5728
5988
|
exports.useBattery = useBattery_default;
|
|
5729
5989
|
exports.useClickAway = useClickAway_default;
|
|
5730
5990
|
exports.useContinuousRetry = useContinuousRetry_default;
|
|
@@ -5785,8 +6045,5 @@ exports.useToggle = useToggle_default;
|
|
|
5785
6045
|
exports.useVisibilityChange = useVisibilityChange_default;
|
|
5786
6046
|
exports.useWindowScroll = useWindowScroll_default;
|
|
5787
6047
|
exports.useWindowSize = useWindowSize_default;
|
|
5788
|
-
exports.withAbortSignal = withAbortSignal;
|
|
5789
|
-
exports.withFormData = withFormData;
|
|
5790
|
-
exports.withTimeout = withTimeout;
|
|
5791
6048
|
//# sourceMappingURL=index.js.map
|
|
5792
6049
|
//# sourceMappingURL=index.js.map
|