@bwg-ui/core 1.1.8 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/chunks/{BwgLargeUploader-DsaIHpYz.js → BwgLargeUploader-B5EtYKUz.js} +844 -810
  2. package/dist/chunks/{BwgLargeUploader-DsaIHpYz.js.map → BwgLargeUploader-B5EtYKUz.js.map} +1 -1
  3. package/dist/chunks/BwgLargeUploader-BPJcShgF.cjs +3 -0
  4. package/dist/chunks/{BwgLargeUploader-1yDku10l.cjs.map → BwgLargeUploader-BPJcShgF.cjs.map} +1 -1
  5. package/dist/chunks/{FileUtils-CmK-zHC5.cjs → FileUtils-BweAWoJt.cjs} +2 -2
  6. package/dist/chunks/{FileUtils-CmK-zHC5.cjs.map → FileUtils-BweAWoJt.cjs.map} +1 -1
  7. package/dist/chunks/{FileUtils-DsA-Sw37.js → FileUtils-CaU9Bzu2.js} +2 -2
  8. package/dist/chunks/{FileUtils-DsA-Sw37.js.map → FileUtils-CaU9Bzu2.js.map} +1 -1
  9. package/dist/chunks/{SSOHandler-B5rmYk8s.js → SSOHandler-C72Do3RD.js} +4 -4
  10. package/dist/chunks/{SSOHandler-B5rmYk8s.js.map → SSOHandler-C72Do3RD.js.map} +1 -1
  11. package/dist/chunks/{SSOHandler-DjL0sH7k.cjs → SSOHandler-ColywAGZ.cjs} +2 -2
  12. package/dist/chunks/{SSOHandler-DjL0sH7k.cjs.map → SSOHandler-ColywAGZ.cjs.map} +1 -1
  13. package/dist/chunks/{SearchBoxContext-CzDzVCVm.js → SearchBoxContext-CY4tAQcg.js} +2 -2
  14. package/dist/chunks/{SearchBoxContext-CzDzVCVm.js.map → SearchBoxContext-CY4tAQcg.js.map} +1 -1
  15. package/dist/chunks/{SearchBoxContext-mcPWk862.cjs → SearchBoxContext-DDBY44Wr.cjs} +2 -2
  16. package/dist/chunks/{SearchBoxContext-mcPWk862.cjs.map → SearchBoxContext-DDBY44Wr.cjs.map} +1 -1
  17. package/dist/chunks/{UtilsContext-DczQBfFi.cjs → UtilsContext-C4tlOndT.cjs} +2 -2
  18. package/dist/chunks/{UtilsContext-DczQBfFi.cjs.map → UtilsContext-C4tlOndT.cjs.map} +1 -1
  19. package/dist/chunks/{UtilsContext-BKUZmmKx.js → UtilsContext-JSHHfnWl.js} +4 -4
  20. package/dist/chunks/{UtilsContext-BKUZmmKx.js.map → UtilsContext-JSHHfnWl.js.map} +1 -1
  21. package/dist/chunks/{codeStore-rU4v3QIA.js → codeStore-IIp25egq.js} +2 -2
  22. package/dist/chunks/{codeStore-rU4v3QIA.js.map → codeStore-IIp25egq.js.map} +1 -1
  23. package/dist/chunks/{codeStore-BG8S_mdS.cjs → codeStore-KPL92rcv.cjs} +2 -2
  24. package/dist/chunks/{codeStore-BG8S_mdS.cjs.map → codeStore-KPL92rcv.cjs.map} +1 -1
  25. package/dist/chunks/envUtils-C9Gf5aek.js.map +1 -1
  26. package/dist/chunks/envUtils-CduTHoHu.cjs.map +1 -1
  27. package/dist/chunks/menuViewStore-DuS0VmkB.cjs +3 -0
  28. package/dist/chunks/menuViewStore-DuS0VmkB.cjs.map +1 -0
  29. package/dist/chunks/{menuViewStore-BwR3vgPM.js → menuViewStore-OKcSQq-s.js} +32 -28
  30. package/dist/chunks/menuViewStore-OKcSQq-s.js.map +1 -0
  31. package/dist/chunks/{popupStore-BGubYHZh.cjs → popupStore-BEoWGajT.cjs} +2 -2
  32. package/dist/chunks/{popupStore-BGubYHZh.cjs.map → popupStore-BEoWGajT.cjs.map} +1 -1
  33. package/dist/chunks/{popupStore-BJ_IYrdY.js → popupStore-D8RI04bU.js} +2 -2
  34. package/dist/chunks/{popupStore-BJ_IYrdY.js.map → popupStore-D8RI04bU.js.map} +1 -1
  35. package/dist/chunks/serviceConfig-9dHegQIK.cjs +3 -0
  36. package/dist/chunks/serviceConfig-9dHegQIK.cjs.map +1 -0
  37. package/dist/chunks/serviceConfig-Dhe7neaj.js +709 -0
  38. package/dist/chunks/serviceConfig-Dhe7neaj.js.map +1 -0
  39. package/dist/components/common/index.cjs +1 -1
  40. package/dist/components/common/index.js +1 -1
  41. package/dist/components/core/BwgUploader.d.ts +10 -0
  42. package/dist/components/core/BwgUploader.d.ts.map +1 -1
  43. package/dist/components/core/index.cjs +1 -1
  44. package/dist/components/core/index.js +1 -1
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.js +9 -9
  47. package/dist/provider/contexts/UtilsContext.d.ts +6 -6
  48. package/dist/provider/index.cjs +1 -1
  49. package/dist/provider/index.js +2 -2
  50. package/dist/stores/index.cjs +1 -1
  51. package/dist/stores/index.d.ts +3 -1
  52. package/dist/stores/index.d.ts.map +1 -1
  53. package/dist/stores/index.js +5 -5
  54. package/dist/stores/menuViewStore.d.ts +3 -1
  55. package/dist/stores/menuViewStore.d.ts.map +1 -1
  56. package/dist/utils/apiUtils.d.ts +20 -6
  57. package/dist/utils/apiUtils.d.ts.map +1 -1
  58. package/dist/utils/index.cjs +1 -1
  59. package/dist/utils/index.js +2 -2
  60. package/dist/utils/notificationUtils.d.ts +3 -2
  61. package/dist/utils/notificationUtils.d.ts.map +1 -1
  62. package/package.json +1 -1
  63. package/dist/chunks/BwgLargeUploader-1yDku10l.cjs +0 -3
  64. package/dist/chunks/menuViewStore-BJak0NMm.cjs +0 -3
  65. package/dist/chunks/menuViewStore-BJak0NMm.cjs.map +0 -1
  66. package/dist/chunks/menuViewStore-BwR3vgPM.js.map +0 -1
  67. package/dist/chunks/serviceConfig-Cc8jfw_Y.cjs +0 -3
  68. package/dist/chunks/serviceConfig-Cc8jfw_Y.cjs.map +0 -1
  69. package/dist/chunks/serviceConfig-lAlRNVIw.js +0 -670
  70. package/dist/chunks/serviceConfig-lAlRNVIw.js.map +0 -1
@@ -1,670 +0,0 @@
1
- import H from "axios";
2
- import c from "crypto-js";
3
- import { notification as C } from "antd";
4
- import { create as J } from "zustand";
5
- import { i as P, g as Z } from "./envUtils-C9Gf5aek.js";
6
- const D = (e) => typeof e != "string" ? !e : e.trim().length === 0, V = (e, t) => D(e) ? t : e || "", X = (e) => !D(e), Y = (e, t, r = "...") => e.length <= t ? e : e.substring(0, t) + r, M = (e) => D(e) ? e : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), Q = (e) => D(e) ? e : e.split(" ").map((t) => M(t)).join(" "), ee = (e) => e.replace(/-([a-z])/g, (t) => t[1].toUpperCase()), te = (e) => e.replace(/[A-Z]/g, (t) => `_${t.toLowerCase()}`), re = (e) => e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`), ne = (e) => {
7
- const r = e.replace(/\D/g, "").match(/^(\d{3})(\d{4})(\d{4})$/);
8
- return r ? `${r[1]}-${r[2]}-${r[3]}` : e;
9
- }, se = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e), ae = (e) => {
10
- try {
11
- return new URL(e), !0;
12
- } catch {
13
- return !1;
14
- }
15
- }, oe = (e) => e.replace(/\D/g, ""), ce = (e) => e.replace(/[^a-zA-Z0-9가-힣\s]/g, ""), ie = (e) => e.replace(/<[^>]*>/g, ""), ue = (e) => e.replace(/\n/g, "<br>"), le = (e) => e.replace(/<br\s*\/?>/gi, `
16
- `), de = (e, t) => {
17
- const r = e.match(t);
18
- return r || [];
19
- }, ge = (e, t) => e.repeat(t), me = (e, t, r = " ") => e.padStart(t, r), he = (e, t, r = " ") => e.padEnd(t, r), fe = (e, t, r = " ") => {
20
- const n = t - e.length;
21
- if (n <= 0) return e;
22
- const a = Math.floor(n / 2), s = n - a;
23
- return r.repeat(a) + e + r.repeat(s);
24
- }, b = (e, t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") => {
25
- let r = "";
26
- for (let n = 0; n < e; n++)
27
- r += t.charAt(Math.floor(Math.random() * t.length));
28
- return r;
29
- }, pe = (e) => e.split("").reverse().join(""), Se = (e, t) => (e.match(new RegExp(t, "g")) || []).length, ye = (e) => e.trim().split(/\s+/).length, B = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
30
- const t = Math.random() * 16 | 0;
31
- return (e === "x" ? t : t & 3 | 8).toString(16);
32
- }), R = (e = 32) => {
33
- const r = B().replace(/-/g, "");
34
- return e >= 32 ? r + b(e - 32, "0123456789abcdef") : r.substring(0, e);
35
- }, Ce = () => R(16), Ie = () => R(64), Ue = (e = 16) => b(e, "0123456789"), Ne = (e = 16) => b(e, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"), G = () => B(), j = () => G().replace(/-/g, ""), we = () => {
36
- const e = Date.now().toString(36), t = b(8, "0123456789abcdef");
37
- return e + t;
38
- }, ve = (e, t = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") => e.replace(
39
- /[X-Z]/g,
40
- () => t.charAt(Math.floor(Math.random() * t.length))
41
- ), xe = (e) => {
42
- const t = c.SHA256(e);
43
- return c.enc.Base64.stringify(t);
44
- }, L = () => "abcdefghij1234567890!@#$%^&*();;", K = () => "123456098765!@#$", Ee = (e) => {
45
- if (!e) return "";
46
- try {
47
- const t = c.enc.Utf8.parse(L()), r = c.enc.Utf8.parse(K());
48
- return c.AES.encrypt(e, t, {
49
- iv: r,
50
- padding: c.pad.Pkcs7,
51
- mode: c.mode.CBC
52
- }).toString();
53
- } catch (t) {
54
- return console.error("암호화 오류:", t), "";
55
- }
56
- }, De = (e) => {
57
- if (!e) return "";
58
- try {
59
- const t = c.enc.Utf8.parse(L()), r = c.enc.Utf8.parse(K());
60
- return c.AES.decrypt(e, t, {
61
- iv: r,
62
- padding: c.pad.Pkcs7,
63
- mode: c.mode.CBC
64
- }).toString(c.enc.Utf8);
65
- } catch (t) {
66
- return console.error("복호화 오류:", t), "";
67
- }
68
- }, be = (e, t) => {
69
- if (!e) return "";
70
- try {
71
- const r = t || L();
72
- return c.AES.encrypt(e, r).toString();
73
- } catch (r) {
74
- return console.error("간단한 암호화 오류:", r), "";
75
- }
76
- }, Te = (e, t) => {
77
- if (!e) return "";
78
- try {
79
- const r = t || L();
80
- return c.AES.decrypt(e, r).toString(c.enc.Utf8);
81
- } catch (r) {
82
- return console.error("간단한 복호화 오류:", r), "";
83
- }
84
- }, Ae = (e) => e ? c.MD5(e).toString() : "", Pe = (e) => e ? c.SHA256(e).toString() : "", Le = (e) => e ? c.enc.Base64.stringify(c.enc.Utf8.parse(e)) : "", Oe = (e) => {
85
- if (!e) return "";
86
- try {
87
- return c.enc.Base64.parse(e).toString(c.enc.Utf8);
88
- } catch (t) {
89
- return console.error("Base64 디코딩 오류:", t), "";
90
- }
91
- }, Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
92
- __proto__: null,
93
- base64Decode: Oe,
94
- base64Encode: Le,
95
- br2nl: le,
96
- bxmDecrypt: De,
97
- bxmEncrypt: Ee,
98
- capitalize: M,
99
- capitalizeWords: Q,
100
- center: fe,
101
- countChar: Se,
102
- countWords: ye,
103
- encryptSha256: xe,
104
- extractNumbers: oe,
105
- findPattern: de,
106
- formatPhoneNumber: ne,
107
- generateAlphanumericUID: Ne,
108
- generateCustomUID: ve,
109
- generateGUID: G,
110
- generateGUIDWithoutHyphens: j,
111
- generateLongUID: Ie,
112
- generateNumericUID: Ue,
113
- generateRandomString: b,
114
- generateShortUID: Ce,
115
- generateTimestampUID: we,
116
- generateUID: R,
117
- isEmpty: D,
118
- isNotEmpty: X,
119
- isSafeEmpty: V,
120
- isValidEmail: se,
121
- isValidUrl: ae,
122
- md5Hash: Ae,
123
- nl2br: ue,
124
- padLeft: me,
125
- padRight: he,
126
- removeHtmlTags: ie,
127
- removeSpecialChars: ce,
128
- repeat: ge,
129
- reverse: pe,
130
- sha256Hash: Pe,
131
- simpleDecrypt: Te,
132
- simpleEncrypt: be,
133
- toCamelCase: ee,
134
- toKebabCase: re,
135
- toSnakeCase: te,
136
- truncate: Y
137
- }, Symbol.toStringTag, { value: "Module" })), d = {
138
- duration: 4.5,
139
- // 4.5초
140
- placement: "topRight"
141
- };
142
- class w {
143
- constructor() {
144
- }
145
- static getInstance() {
146
- return w.instance || (w.instance = new w()), w.instance;
147
- }
148
- /**
149
- * BwgError 전용 에러 알림
150
- * @param props - 에러 메시지 설정
151
- */
152
- showBwgError(t) {
153
- const { message: r, description: n, duration: a = d.duration, placement: s = d.placement } = t;
154
- C.error({
155
- message: `${r}`,
156
- description: n || "오류가 발생했습니다. 다시 시도해주세요.",
157
- duration: a,
158
- placement: s,
159
- style: {
160
- borderLeft: "4px solid #ff4d4f",
161
- backgroundColor: "#fff2f0"
162
- }
163
- });
164
- }
165
- /**
166
- * 성공 알림
167
- */
168
- showSuccess(t, r, n) {
169
- C.success({
170
- message: `${t}`,
171
- description: r,
172
- duration: n || d.duration,
173
- placement: d.placement
174
- });
175
- }
176
- /**
177
- * 정보 알림
178
- */
179
- showInfo(t, r, n) {
180
- C.info({
181
- message: `${t}`,
182
- description: r,
183
- duration: n || d.duration,
184
- placement: d.placement
185
- });
186
- }
187
- /**
188
- * 경고 알림
189
- */
190
- showWarning(t, r, n) {
191
- C.warning({
192
- message: `${t}`,
193
- description: r,
194
- duration: n || d.duration,
195
- placement: d.placement
196
- });
197
- }
198
- /**
199
- * 일반 에러 알림
200
- */
201
- showError(t, r, n) {
202
- C.error({
203
- message: `${t}`,
204
- description: r,
205
- duration: n || d.duration,
206
- placement: d.placement
207
- });
208
- }
209
- /**
210
- * 모든 알림 닫기
211
- */
212
- destroy() {
213
- C.destroy();
214
- }
215
- /**
216
- * 특정 키의 알림 닫기
217
- */
218
- close(t) {
219
- C.destroy();
220
- }
221
- }
222
- const I = w.getInstance(), _e = (e) => {
223
- I.showBwgError(e);
224
- }, Ye = (e, t, r) => {
225
- I.showSuccess(e, t, r);
226
- }, Qe = (e, t, r) => {
227
- I.showInfo(e, t, r);
228
- }, et = (e, t, r) => {
229
- I.showWarning(e, t, r);
230
- }, tt = (e, t, r) => {
231
- I.showError(e, t, r);
232
- }, rt = () => {
233
- I.destroy();
234
- }, nt = (e) => {
235
- I.close(e);
236
- };
237
- import.meta.env.DEV;
238
- function ke(e, t) {
239
- let r;
240
- try {
241
- r = e();
242
- } catch {
243
- return;
244
- }
245
- return {
246
- getItem: (a) => {
247
- var s;
248
- const f = (l) => l === null ? null : JSON.parse(l, void 0), m = (s = r.getItem(a)) != null ? s : null;
249
- return m instanceof Promise ? m.then(f) : f(m);
250
- },
251
- setItem: (a, s) => r.setItem(a, JSON.stringify(s, void 0)),
252
- removeItem: (a) => r.removeItem(a)
253
- };
254
- }
255
- const _ = (e) => (t) => {
256
- try {
257
- const r = e(t);
258
- return r instanceof Promise ? r : {
259
- then(n) {
260
- return _(n)(r);
261
- },
262
- catch(n) {
263
- return this;
264
- }
265
- };
266
- } catch (r) {
267
- return {
268
- then(n) {
269
- return this;
270
- },
271
- catch(n) {
272
- return _(n)(r);
273
- }
274
- };
275
- }
276
- }, Re = (e, t) => (r, n, a) => {
277
- let s = {
278
- storage: ke(() => localStorage),
279
- partialize: (o) => o,
280
- version: 0,
281
- merge: (o, N) => ({
282
- ...N,
283
- ...o
284
- }),
285
- ...t
286
- }, f = !1;
287
- const m = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
288
- let u = s.storage;
289
- if (!u)
290
- return e(
291
- (...o) => {
292
- console.warn(
293
- `[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`
294
- ), r(...o);
295
- },
296
- n,
297
- a
298
- );
299
- const y = () => {
300
- const o = s.partialize({ ...n() });
301
- return u.setItem(s.name, {
302
- state: o,
303
- version: s.version
304
- });
305
- }, p = a.setState;
306
- a.setState = (o, N) => (p(o, N), y());
307
- const S = e(
308
- (...o) => (r(...o), y()),
309
- n,
310
- a
311
- );
312
- a.getInitialState = () => S;
313
- let U;
314
- const W = () => {
315
- var o, N;
316
- if (!u) return;
317
- f = !1, m.forEach((i) => {
318
- var h;
319
- return i((h = n()) != null ? h : S);
320
- });
321
- const A = ((N = s.onRehydrateStorage) == null ? void 0 : N.call(s, (o = n()) != null ? o : S)) || void 0;
322
- return _(u.getItem.bind(u))(s.name).then((i) => {
323
- if (i)
324
- if (typeof i.version == "number" && i.version !== s.version) {
325
- if (s.migrate) {
326
- const h = s.migrate(
327
- i.state,
328
- i.version
329
- );
330
- return h instanceof Promise ? h.then((O) => [!0, O]) : [!0, h];
331
- }
332
- console.error(
333
- "State loaded from storage couldn't be migrated since no migrate function was provided"
334
- );
335
- } else
336
- return [!1, i.state];
337
- return [!1, void 0];
338
- }).then((i) => {
339
- var h;
340
- const [O, z] = i;
341
- if (U = s.merge(
342
- z,
343
- (h = n()) != null ? h : S
344
- ), r(U, !0), O)
345
- return y();
346
- }).then(() => {
347
- A?.(U, void 0), U = n(), f = !0, l.forEach((i) => i(U));
348
- }).catch((i) => {
349
- A?.(void 0, i);
350
- });
351
- };
352
- return a.persist = {
353
- setOptions: (o) => {
354
- s = {
355
- ...s,
356
- ...o
357
- }, o.storage && (u = o.storage);
358
- },
359
- clearStorage: () => {
360
- u?.removeItem(s.name);
361
- },
362
- getOptions: () => s,
363
- rehydrate: () => W(),
364
- hasHydrated: () => f,
365
- onHydrate: (o) => (m.add(o), () => {
366
- m.delete(o);
367
- }),
368
- onFinishHydration: (o) => (l.add(o), () => {
369
- l.delete(o);
370
- })
371
- }, s.skipHydration || W(), U || S;
372
- }, $e = Re, g = J()(
373
- $e(
374
- (e, t) => ({
375
- user: null,
376
- isLoggedIn: !1,
377
- // 로그인
378
- login: (r) => {
379
- e({ user: r, isLoggedIn: !0 }), console.log("사용자 로그인:", r);
380
- },
381
- // 로그아웃
382
- logout: () => {
383
- e({ user: null, isLoggedIn: !1 }), console.log("사용자 로그아웃");
384
- },
385
- // 사용자 정보 업데이트
386
- updateUser: (r) => {
387
- const n = t().user;
388
- n && e({ user: { ...n, ...r } });
389
- }
390
- }),
391
- {
392
- name: "user-storage",
393
- // 로컬 스토리지 키
394
- partialize: (e) => ({
395
- user: e.user,
396
- isLoggedIn: e.isLoggedIn
397
- })
398
- // 저장할 상태만 선택
399
- }
400
- )
401
- ), st = () => g.getState().user?.crprCd || null, We = () => g.getState().user?.userId || null, He = () => g.getState().user?.userNm || null, at = () => g.getState().user?.userDvsn || null, ot = () => g.getState().user?.emplNo || null, Me = () => g.getState().user?.dprtCd || null, Be = () => g.getState().user?.dprtNm || null, $ = () => g.getState().user?.roleList || null, ct = (e) => {
402
- const t = $();
403
- return t ? t.includes(e) : !1;
404
- }, it = (e) => {
405
- const t = $();
406
- return t ? e.some((r) => t.includes(r)) : !1;
407
- }, ut = (e) => {
408
- const t = $();
409
- return t ? e.every((r) => t.includes(r)) : !1;
410
- }, lt = () => g.getState().isLoggedIn, F = () => g.getState().user, dt = () => F() !== null, gt = () => {
411
- const e = He(), t = We();
412
- return e || t || null;
413
- }, mt = () => {
414
- const e = Be(), t = Me();
415
- return e || (t ? String(t) : null);
416
- };
417
- let E = null;
418
- const ht = (e) => {
419
- E === null && (E = e);
420
- }, ft = () => E, pt = async () => (console.log("IP 검증 비활성화됨 (성능 최적화)"), E || "unknown"), k = {
421
- method: "POST",
422
- timeout: 3e4,
423
- // 30초
424
- withCredentials: !0,
425
- // 쿠키 포함
426
- showLoading: !0,
427
- showError: !0,
428
- retryCount: 3,
429
- retryDelay: 1e3
430
- }, v = H.create({
431
- timeout: k.timeout,
432
- withCredentials: k.withCredentials,
433
- headers: {
434
- "Content-Type": "application/json; charset=utf-8",
435
- Accept: "application/json; charset=utf-8"
436
- }
437
- });
438
- P && (console.log("🔧 API Client Configuration:"), console.log(" - Timeout:", v.defaults.timeout), console.log(" - With Credentials:", v.defaults.withCredentials), console.log(" - Environment:", Z()));
439
- v.interceptors.request.use(
440
- (e) => {
441
- let t = "UNKNOWN", r = "UNKNOWN";
442
- (/* @__PURE__ */ new Date()).getTime();
443
- try {
444
- e.data && e.data.header ? (t = e.data.header.trxCd || "UNKNOWN", r = e.data.header.guid || "UNKNOWN") : e.params && e.params.header && (t = e.params.header.trxCd || "UNKNOWN", r = e.params.header.guid || "UNKNOWN");
445
- } catch (a) {
446
- console.warn("trxCd/guid 추출 실패:", a);
447
- }
448
- e.trxCd = t, e.guid = r, e.requestStartTime = Date.now(), console.log(`🚀 API 요청 시작 [거래코드: ${t} / GUID: ${r}]`);
449
- const n = localStorage.getItem("accessToken");
450
- return n && (e.headers.Authorization = `Bearer ${n}`), e.headers["Content-Type"] = "application/json; charset=UTF-8", e.headers.Accept = "application/json; charset=UTF-8", e;
451
- },
452
- (e) => (console.error("❌ 요청 인터셉터 에러:", e), Promise.reject(e))
453
- );
454
- v.interceptors.response.use(
455
- (e) => {
456
- let t = "UNKNOWN", r = "UNKNOWN";
457
- const n = (/* @__PURE__ */ new Date()).getTime();
458
- try {
459
- e.config.trxCd && (t = e.config.trxCd), e.config.guid ? r = e.config.guid : e.data && e.data.header && e.data.header.trxCd ? (t = e.data.header.trxCd, r = e.data.header.guid || "UNKNOWN") : e.config.data && e.config.data.header ? (t = e.config.data.header.trxCd || "UNKNOWN", r = e.config.data.header.guid || "UNKNOWN") : e.config.params && e.config.params.header && (t = e.config.params.header.trxCd || "UNKNOWN", r = e.config.params.header.guid || "UNKNOWN");
460
- } catch (s) {
461
- console.warn("trxCd/guid 추출 실패:", s);
462
- }
463
- let a = 0;
464
- return e.config.requestStartTime && (a = n - e.config.requestStartTime), console.log(
465
- `✅ API 응답 성공 [거래코드: ${t} / GUID : ${r}] - (소요시간: ${a}ms)`
466
- ), e;
467
- },
468
- async (e) => {
469
- if (console.error("❌ API 응답 에러:", e), P && console.error("🚨 Error Details:", {
470
- message: e.message,
471
- status: e.response?.status,
472
- statusText: e.response?.statusText,
473
- data: e.response?.data,
474
- config: {
475
- url: e.config?.url,
476
- method: e.config?.method,
477
- baseURL: e.config?.baseURL
478
- }
479
- }), e.response?.status === 401) {
480
- const t = localStorage.getItem("refreshToken");
481
- if (t)
482
- try {
483
- const r = await H.post("/auth/refresh", {
484
- refreshToken: t
485
- });
486
- if (r.data.accessToken) {
487
- localStorage.setItem(
488
- "accessToken",
489
- r.data.accessToken
490
- );
491
- const n = e.config;
492
- if (n)
493
- return n.headers.Authorization = `Bearer ${r.data.accessToken}`, v(n);
494
- }
495
- } catch {
496
- localStorage.removeItem("accessToken"), localStorage.removeItem("refreshToken"), window.location.href = "/login";
497
- }
498
- }
499
- return Promise.reject(e);
500
- }
501
- );
502
- const Ge = () => j(), T = async (e, t, r) => {
503
- try {
504
- const n = {
505
- ...k,
506
- ...r
507
- }, a = {
508
- method: n.method,
509
- url: "/api/service",
510
- timeout: n.timeout,
511
- withCredentials: n.withCredentials
512
- };
513
- n.headers && (a.headers = n.headers);
514
- const s = E || "unknown", f = __APP_CD__, m = __SYS_CD__;
515
- console.log("@@ request param :: ", t);
516
- const l = {
517
- header: {
518
- trxCd: e,
519
- guid: Ge(),
520
- userInfo: F(),
521
- clientIp: s,
522
- // 클라이언트 IP 추가 (서버에서 재확인 권장)
523
- domainId: "DEFAULT",
524
- appCd: f,
525
- sysCd: m
526
- },
527
- // data: bxmEncrypt(JSON.stringify(data)),
528
- data: t
529
- };
530
- P && (console.log("__BWG_LOCAL__ 테스트 입니다. ", P), console.log("📤 Request Data:", l)), n.method === "GET" ? a.params = l || n.params : (a.data = l || n.data, n.params && (a.params = n.params));
531
- let u;
532
- for (let y = 0; y <= (n.retryCount || 0); y++)
533
- try {
534
- const p = await v(a);
535
- if (p.data.header?.resCd == 0) {
536
- for (const S in p.data)
537
- if (S !== "header")
538
- return p.data[S];
539
- } else
540
- return _e({
541
- message: "서비스 호출 실패",
542
- description: p.data.header?.resMsg || "요청 처리 중 오류가 발생했습니다.",
543
- duration: 5
544
- }), null;
545
- } catch (p) {
546
- if (u = p, je(u) && y < (n.retryCount || 0)) {
547
- await Ke(n.retryDelay || 1e3);
548
- continue;
549
- }
550
- break;
551
- }
552
- throw u;
553
- } catch (n) {
554
- throw console.error("callService 에러:", n), n;
555
- }
556
- }, je = (e) => !e.response || e.response.status >= 500 && e.response.status < 600, Ke = (e) => new Promise((t) => setTimeout(t, e)), St = (e, t, r) => T(e, t, { ...r, method: "GET" }), yt = (e, t, r) => T(e, t, { ...r, method: "POST" }), Ct = (e, t, r) => T(e, t, { ...r, method: "PUT" }), It = (e, t, r) => T(e, t, { ...r, method: "DELETE" }), Ut = (e, t, r) => T(e, t, { ...r, method: "PATCH" }), q = {
557
- // 권한 관련
558
- AUTH_BTNS: "SCMSIGN00202",
559
- // 버튼 권한 조회
560
- AUTH_MENU: "SCMSIGN00201",
561
- // 메뉴 권한 조회
562
- SRCH_CODE: "SCMSIGN00301",
563
- // 코드 조회
564
- // 팝업 관련
565
- SRCH_POPU: "SCMPOPU00101",
566
- // 팝업 조회
567
- // 즐겨찾기 관련
568
- AUTH_BMRK: "SCMBMRK00101"
569
- // 즐겨찾기 관리
570
- };
571
- let x = {};
572
- function Nt(e) {
573
- x = e, console.log("🔧 Provider 서비스코드 오버라이드 설정:", e);
574
- }
575
- function Fe(e) {
576
- if (x[e] && x[e].trim() !== "")
577
- return console.log(`🔧 Provider 설정 사용: ${e} = ${x[e]}`), x[e];
578
- const t = q[e];
579
- return console.log(`🔧 기본값 사용: ${e} = ${t}`), t;
580
- }
581
- function wt() {
582
- const e = {};
583
- for (const t of Object.keys(q))
584
- e[t] = Fe(t);
585
- return e;
586
- }
587
- export {
588
- mt as $,
589
- se as A,
590
- ae as B,
591
- Ae as C,
592
- ue as D,
593
- me as E,
594
- he as F,
595
- ie as G,
596
- ce as H,
597
- pe as I,
598
- Pe as J,
599
- Te as K,
600
- be as L,
601
- ee as M,
602
- re as N,
603
- te as O,
604
- Y as P,
605
- It as Q,
606
- St as R,
607
- Ut as S,
608
- yt as T,
609
- Ct as U,
610
- T as V,
611
- ft as W,
612
- Ge as X,
613
- ht as Y,
614
- pt as Z,
615
- st as _,
616
- Le as a,
617
- gt as a0,
618
- Me as a1,
619
- Be as a2,
620
- ot as a3,
621
- $ as a4,
622
- at as a5,
623
- We as a6,
624
- F as a7,
625
- He as a8,
626
- ut as a9,
627
- it as aa,
628
- ct as ab,
629
- dt as ac,
630
- lt as ad,
631
- nt as ae,
632
- rt as af,
633
- I as ag,
634
- tt as ah,
635
- Qe as ai,
636
- Ye as aj,
637
- et as ak,
638
- wt as al,
639
- Fe as am,
640
- Nt as an,
641
- g as ao,
642
- $e as ap,
643
- Xe as aq,
644
- Oe as b,
645
- le as c,
646
- De as d,
647
- Ee as e,
648
- M as f,
649
- Q as g,
650
- fe as h,
651
- Se as i,
652
- ye as j,
653
- xe as k,
654
- oe as l,
655
- de as m,
656
- ne as n,
657
- Ne as o,
658
- ve as p,
659
- G as q,
660
- j as r,
661
- Ie as s,
662
- Ue as t,
663
- b as u,
664
- Ce as v,
665
- we as w,
666
- R as x,
667
- D as y,
668
- V as z
669
- };
670
- //# sourceMappingURL=serviceConfig-lAlRNVIw.js.map