sales-frontend-api 0.0.35 → 0.0.36

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/client.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var salesFrontendUtils = require('sales-frontend-utils');
4
4
  var axios = require('axios');
5
- var zustand = require('zustand');
5
+ var salesFrontendDebug = require('sales-frontend-debug');
6
6
 
7
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
@@ -49,114 +49,6 @@ var cookieClient = {
49
49
  cookieClient.setCookie(name, "", { ...options, expires: -1 });
50
50
  }
51
51
  };
52
- var useDebugStore = zustand.create()((set) => ({
53
- requests: [],
54
- responses: [],
55
- errors: [],
56
- isHold: false,
57
- heldRequests: [],
58
- heldResponses: [],
59
- heldErrors: [],
60
- addRequest: (request) => set((state) => ({ requests: [...state.requests, request] })),
61
- addResponse: (response) => set((state) => ({ responses: [...state.responses, response] })),
62
- addError: (error) => set((state) => ({ errors: [...state.errors, error] })),
63
- clear: () => set({ requests: [], responses: [], errors: [], heldRequests: [], heldResponses: [], heldErrors: [] }),
64
- toggleHold: () => set((state) => ({ isHold: !state.isHold })),
65
- holdRequest: (request) => set((state) => ({ heldRequests: [...state.heldRequests, request] })),
66
- holdResponse: (response) => set((state) => ({ heldResponses: [...state.heldResponses, response] })),
67
- holdError: (error) => set((state) => ({ heldErrors: [...state.heldErrors, error] })),
68
- playAllRequests: () => set((state) => {
69
- state.heldRequests.forEach((r) => r.resolver(r.request));
70
- return {
71
- requests: [...state.requests, ...state.heldRequests.map((r) => r.request)],
72
- heldRequests: []
73
- };
74
- }),
75
- playAllResponses: () => set((state) => {
76
- state.heldResponses.forEach((r) => r.resolver(r.response));
77
- state.heldErrors.forEach((r) => r.resolver(r.error));
78
- return {
79
- responses: [...state.responses, ...state.heldResponses.map((r) => r.response)],
80
- errors: [...state.errors, ...state.heldErrors.map((r) => r.error)],
81
- heldResponses: [],
82
- heldErrors: []
83
- };
84
- })
85
- }));
86
-
87
- // src/http-client/debug/interceptor-function.ts
88
- function addRequestLog(config) {
89
- const env = salesFrontendUtils.getEnvironmentFromHostname(location.hostname);
90
- if (env !== "prd") {
91
- const { addRequest, isHold, holdRequest } = useDebugStore.getState();
92
- const startTime = Date.now();
93
- const requestInfo = {
94
- url: config.url || "",
95
- method: config.method || "",
96
- headers: config.headers,
97
- params: config.params,
98
- data: config.data,
99
- startTime
100
- };
101
- if (isHold) {
102
- return new Promise((resolver) => {
103
- holdRequest({ request: requestInfo, resolver });
104
- });
105
- } else {
106
- addRequest(requestInfo);
107
- }
108
- }
109
- }
110
- function addResponseLog(response) {
111
- const env = salesFrontendUtils.getEnvironmentFromHostname(location.hostname);
112
- if (env !== "prd") {
113
- const { addResponse, isHold, holdResponse } = useDebugStore.getState();
114
- const { config } = response;
115
- const responseInfo = {
116
- url: config.url || "",
117
- method: config.method || "",
118
- status: response.status,
119
- statusText: response.statusText,
120
- headers: response.headers,
121
- data: response.data
122
- };
123
- if (isHold) {
124
- return new Promise((resolver) => {
125
- holdResponse({ response: responseInfo, resolver });
126
- });
127
- } else {
128
- addResponse(responseInfo);
129
- }
130
- }
131
- }
132
- function addErrorLog(error) {
133
- const env = salesFrontendUtils.getEnvironmentFromHostname(location.hostname);
134
- if (env !== "prd") {
135
- const { addError, isHold, holdError } = useDebugStore.getState();
136
- const { config } = error;
137
- const errorInfo = {
138
- url: config?.url || "",
139
- method: config?.method || "",
140
- message: error.message,
141
- config: error.config,
142
- response: error.response ? {
143
- url: error.response.config?.url || "",
144
- method: error.response.config?.method || "",
145
- status: error.response.status,
146
- statusText: error.response.statusText,
147
- headers: error.response.headers,
148
- data: error.response.data
149
- } : void 0
150
- };
151
- if (isHold) {
152
- return new Promise((resolver) => {
153
- holdError({ error: errorInfo, resolver });
154
- });
155
- } else {
156
- addError(errorInfo);
157
- }
158
- }
159
- }
160
52
 
161
53
  // src/http-client/header/header.types.ts
162
54
  var customHeaderNames = [
@@ -250,7 +142,11 @@ var HttpClientAxios = class {
250
142
  });
251
143
  this.api.interceptors.request.use(
252
144
  async (config2) => {
253
- await addRequestLog(config2);
145
+ await salesFrontendDebug.addRequestLog(config2);
146
+ const debugRefreshQueueOff = config2.headers?.["Debug-Refresh-Queue-Off"] === "true";
147
+ if (debugRefreshQueueOff) {
148
+ isRefreshed = true;
149
+ }
254
150
  const authClient = new AuthClient();
255
151
  const accessToken = await authClient.getAT();
256
152
  console.log("accessToken", accessToken);
@@ -289,16 +185,17 @@ var HttpClientAxios = class {
289
185
  );
290
186
  this.api.interceptors.response.use(
291
187
  async (response) => {
292
- await addResponseLog(response);
188
+ await salesFrontendDebug.addResponseLog(response);
293
189
  if (response.data.isSuccess === false) {
294
190
  return Promise.reject(response);
295
191
  }
296
192
  return response;
297
193
  },
298
194
  async (error) => {
299
- await addErrorLog(error);
195
+ await salesFrontendDebug.addErrorLog(error);
300
196
  const originalRequest = error.config;
301
- if (error.response?.status === 401) {
197
+ const debugRefreshQueueOff = config.headers?.["Debug-Refresh-Queue-Off"] === "true";
198
+ if (error.response?.status === 401 && !debugRefreshQueueOff) {
302
199
  isRefreshed = false;
303
200
  const client = new AuthClient();
304
201
  client.refreshToken().then(() => {
@@ -373,10 +270,6 @@ var AuthClient = class {
373
270
 
374
271
  exports.AuthClient = AuthClient;
375
272
  exports.HttpClientAxios = HttpClientAxios;
376
- exports.addErrorLog = addErrorLog;
377
- exports.addRequestLog = addRequestLog;
378
- exports.addResponseLog = addResponseLog;
379
273
  exports.cookieClient = cookieClient;
380
- exports.useDebugStore = useDebugStore;
381
274
  //# sourceMappingURL=client.cjs.map
382
275
  //# sourceMappingURL=client.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/http-client/cookie/cookie-client.ts","../src/http-client/debug/debug-store.ts","../src/http-client/debug/interceptor-function.ts","../src/http-client/header/header.types.ts","../src/http-client/header/header-manager.ts","../src/http-client/axios/http-client-axios.ts","../src/http-client/auth/auth-client.ts"],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AE,CAAA;AACzC,MAAA,MAAM,GAAM,GAAA,MAAM,UAAW,CAAA,GAAA,CAAI,IAAI,4BAA4B,CAAA;AAEjE,MAAA,OAAO,KAAK,IAAK,CAAA,WAAA;AAAA;AACnB;AAEJ","file":"client.cjs","sourcesContent":["/**\n * 클라이언트용 쿠키 함수\n */\nexport const cookieClient = {\n getCookie(name: string): string {\n if (typeof document === 'undefined') {\n return '';\n }\n const match = document.cookie.match(new RegExp(`(^|; *)${name}=([^;]*)`));\n\n return match ? decodeURIComponent(match[2] || '') : '';\n },\n\n setCookie(\n name: string,\n value: string,\n options: {\n expires?: number | Date; // number of days\n path?: string;\n domain?: string;\n secure?: boolean;\n } = {}\n ): void {\n if (typeof document === 'undefined') {\n return;\n }\n\n let cookieString = `${name}=${encodeURIComponent(value)}`;\n\n if (options.expires) {\n let expiresDate: Date;\n if (typeof options.expires === 'number') {\n expiresDate = new Date();\n expiresDate.setDate(expiresDate.getDate() + options.expires);\n } else {\n expiresDate = options.expires;\n }\n cookieString += `; expires=${expiresDate.toUTCString()}`;\n }\n\n cookieString += `; path=${options.path || '/'}`;\n\n if (options.domain) {\n cookieString += `; domain=${options.domain}`;\n }\n\n if (options.secure) {\n cookieString += '; secure';\n }\n\n document.cookie = cookieString;\n },\n deleteCookie(name: string, options: { path?: string; domain?: string } = {}): void {\n cookieClient.setCookie(name, '', { ...options, expires: -1 });\n }\n};\n","import { create } from 'zustand';\n\nimport { DebugStore } from './debug.types';\n\nexport const useDebugStore = create<DebugStore>()((set) => ({\n requests: [],\n responses: [],\n errors: [],\n isHold: false,\n heldRequests: [],\n heldResponses: [],\n heldErrors: [],\n addRequest: (request) => set((state) => ({ requests: [...state.requests, request] })),\n addResponse: (response) => set((state) => ({ responses: [...state.responses, response] })),\n addError: (error) => set((state) => ({ errors: [...state.errors, error] })),\n clear: () => set({ requests: [], responses: [], errors: [], heldRequests: [], heldResponses: [], heldErrors: [] }),\n toggleHold: () => set((state) => ({ isHold: !state.isHold })),\n holdRequest: (request) => set((state) => ({ heldRequests: [...state.heldRequests, request] })),\n holdResponse: (response) => set((state) => ({ heldResponses: [...state.heldResponses, response] })),\n holdError: (error) => set((state) => ({ heldErrors: [...state.heldErrors, error] })),\n playAllRequests: () =>\n set((state) => {\n state.heldRequests.forEach((r) => r.resolver(r.request));\n\n return {\n requests: [...state.requests, ...state.heldRequests.map((r) => r.request)],\n heldRequests: []\n };\n }),\n playAllResponses: () =>\n set((state) => {\n state.heldResponses.forEach((r) => r.resolver(r.response));\n state.heldErrors.forEach((r) => r.resolver(r.error));\n\n return {\n responses: [...state.responses, ...state.heldResponses.map((r) => r.response)],\n errors: [...state.errors, ...state.heldErrors.map((r) => r.error)],\n heldResponses: [],\n heldErrors: []\n };\n })\n}));\n","import { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from 'axios';\nimport { getEnvironmentFromHostname } from 'sales-frontend-utils';\n\nimport { useDebugStore } from '.';\n\n/** debug-tool 에서 사용될 로그 저장 */\nexport function addRequestLog(config: InternalAxiosRequestConfig) {\n const env = getEnvironmentFromHostname(location.hostname);\n\n /**\n * 운영환경이 아닐때만 저장\n */\n if (env !== 'prd') {\n const { addRequest, isHold, holdRequest } = useDebugStore.getState();\n const startTime = Date.now();\n const requestInfo = {\n url: config.url || '',\n method: config.method || '',\n headers: config.headers,\n params: config.params,\n data: config.data,\n startTime\n };\n\n if (isHold) {\n return new Promise((resolver) => {\n holdRequest({ request: requestInfo, resolver });\n });\n } else {\n addRequest(requestInfo);\n }\n }\n}\n\n/** debug-tool 에서 사용될 로그 저장 */\nexport function addResponseLog(response: AxiosResponse) {\n const env = getEnvironmentFromHostname(location.hostname);\n\n /**\n * 운영환경이 아닐때만 저장\n */\n if (env !== 'prd') {\n const { addResponse, isHold, holdResponse } = useDebugStore.getState();\n const { config } = response;\n const responseInfo = {\n url: config.url || '',\n method: config.method || '',\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n data: response.data\n };\n\n if (isHold) {\n return new Promise((resolver) => {\n holdResponse({ response: responseInfo, resolver });\n });\n } else {\n addResponse(responseInfo);\n }\n }\n}\n\nexport function addErrorLog(error: AxiosError) {\n const env = getEnvironmentFromHostname(location.hostname);\n\n /**\n * 운영환경이 아닐때만 저장\n */\n if (env !== 'prd') {\n const { addError, isHold, holdError } = useDebugStore.getState();\n const { config } = error;\n const errorInfo = {\n url: config?.url || '',\n method: config?.method || '',\n message: error.message,\n config: error.config,\n response: error.response\n ? {\n url: error.response.config?.url || '',\n method: error.response.config?.method || '',\n status: error.response.status,\n statusText: error.response.statusText,\n headers: error.response.headers,\n data: error.response.data\n }\n : undefined\n };\n\n if (isHold) {\n return new Promise((resolver) => {\n holdError({ error: errorInfo, resolver });\n });\n } else {\n addError(errorInfo);\n }\n }\n}\n","/**\n * @see https://loop.cloud.microsoft/p/eyJ3Ijp7InUiOiJodHRwczovL2hhbndoYWxpZmVtMzY1LnNoYXJlcG9pbnQuY29tLz9uYXY9Y3owbE1rWW1aRDFpSVVVd1FXdDJSbGhSV0VWUE1tUkNYMWhUZW5KWVVFdFBSVXByYWs1b1NrSlBjRk4wYm5wNmNsWmpMVUZ5YjI1UlJWOVdSREpUV25aeWVUUTJTV2swUlZrbVpqMHdNVk5OVGtkR1JsTkJXVE0xVVZaQ1ZrRkVRa1ZaVEVoRVNUSTBXRXhVVlZoV0ptTTlKbVpzZFdsa1BURSUzRCIsInIiOmZhbHNlfSwicCI6eyJ1IjoiaHR0cHM6Ly9oYW53aGFsaWZlbTM2NS5zaGFyZXBvaW50LmNvbS9jb250ZW50c3RvcmFnZS9DU1BfYmMyNDQwMTMtZDA1NS00MzVjLWI2NzQtMWZkNzRiM2FkNzNjLyVFQiVBQyVCOCVFQyU4NCU5QyUyMCVFQiU5RCVCQyVFQyU5RCVCNCVFQiVCOCU4QyVFQiU5RiVBQyVFQiVBNiVBQy9Mb29wQXBwRGF0YS8wOS0yLiUyMEJyaWRnZSUyMFNwZWMlMjAxLmxvb3A%2FbmF2PWN6MGxNa1pqYjI1MFpXNTBjM1J2Y21GblpTVXlSa05UVUY5aVl6STBOREF4TXkxa01EVTFMVFF6TldNdFlqWTNOQzB4Wm1RM05HSXpZV1EzTTJNbVpEMWlJVVV3UVd0MlJsaFJXRVZQTW1SQ1gxaFRlbkpZVUV0UFJVcHJhazVvU2tKUGNGTjBibnA2Y2xaakxVRnliMjVSUlY5V1JESlRXblp5ZVRRMlNXazBSVmttWmowd01WTk5Ua2RHUmxGRlYxTlFOelpMUWtsTFdrWkpXVUUzU1ZkWldGTklWa0ZUSm1NOUpUSkdKbVpzZFdsa1BURSUzRCIsInIiOmZhbHNlfSwiaSI6eyJpIjoiNTdkZmVhM2QtZDA2Yi00YWRlLWIxZjEtYjE4NDA4MmNlN2VjIn19\n */\nexport const customHeaderNames = [\n 'Accept-Language',\n 'DeviceId',\n 'LoginType',\n 'PlatformName',\n 'PlatformVersion',\n 'AppVersion',\n 'DeviceModel',\n 'FormFactor',\n 'LoginChannel'\n];\n\nexport const AT = 'AT';\nexport type GetterSync = (keyName: string) => string;\nexport type SetterSync = (keyName: string, value: string) => void;\n\nexport type GetterAsync = (keyName: string) => Promise<string> | string;\nexport type SetterAsync = (keyName: string, value: string) => Promise<void> | void;\n","import { AT, customHeaderNames, GetterSync, SetterSync } from './header.types';\n\nexport class HeaderManager {\n private getter: GetterSync;\n private setter: SetterSync;\n\n constructor(getter: GetterSync, setter: SetterSync) {\n this.getter = getter;\n this.setter = setter;\n }\n\n /**\n * 커스텀 헤더를 동기적으로 설정합니다.\n */\n setCustomHeaders(): void {\n customHeaderNames.forEach((headerName) => {\n const customHeaderKey = `X-Channel-${headerName}`;\n const headerValue = this.getter(customHeaderKey);\n if (headerValue) {\n this.setter(customHeaderKey, headerValue);\n }\n });\n }\n\n /**\n * 인증 토큰을 동기적으로 설정합니다.\n */\n setAuthToken(): void {\n const token = this.getter(AT);\n if (token) {\n this.setter('Authorization', `Bearer ${token}`);\n }\n }\n\n /**\n * 모든 헤더를 동기적으로 설정합니다.\n */\n setAllHeaders(): void {\n this.setCustomHeaders();\n this.setAuthToken();\n }\n}\n","import axios from 'axios';\nimport { getEnvironmentFromHostname } from 'sales-frontend-utils';\n\nimport { AuthClient } from '../auth/auth-client';\nimport { cookieClient } from '../cookie/cookie-client';\nimport { addErrorLog, addRequestLog, addResponseLog } from '../debug/interceptor-function';\nimport { HeaderManager } from '../header/header-manager';\n\nimport type { AxiosQueueType } from './types';\nimport type { AxiosError, AxiosResponse, AxiosInstance, AxiosRequestConfig, AxiosRequestHeaders } from 'axios';\nlet isRefreshed = true;\nconst axiosQueue: AxiosQueueType[] = [];\n\n/**\n * 쿠키에서 값을 가져오고, 없으면 기본값을 쿠키에 설정 후 반환하는 헬퍼 함수\n * @param key 쿠키 키\n * @param defaultValue 쿠키 값이 없을 때 사용할 기본값\n * @returns 쿠키 값 또는 기본값\n */\nconst getOrSetCookie = (key: string, defaultValue: string): string => {\n let value = cookieClient.getCookie(key);\n if (!value) {\n value = defaultValue;\n cookieClient.setCookie(key, value, { path: '/' });\n }\n\n return value;\n};\n\n/**\n * 전자청약\n * CSR용 http-client 입니다.\n * cookie , redirect , tokem 처리 방식은 CSR 환경에 맞게 구현됩니다.\n */\nexport class HttpClientAxios {\n config: AxiosRequestConfig;\n headerManager: HeaderManager;\n\n /**\n * axios의 request interceptor 동작시, 헤더에 주입될 헤더의 key,value\n */\n headers: Record<string, string> = {};\n\n /**\n * api연동을 수행할 실제 객체(axios, fetch 등의 다른 라이브러리로 교체가능한 영역)\n * 현재 버전에서는 axios를 사용하여 구현됨.\n */\n api: AxiosInstance;\n constructor(config: AxiosRequestConfig = {}) {\n this.config = config;\n\n /**\n * 헤더매니저 셋팅\n */\n const getter: HeaderManager['getter'] = (key) => {\n return cookieClient.getCookie(key);\n };\n const setter: HeaderManager['setter'] = (key, value) => {\n if (config?.headers) {\n config.headers[key] = value;\n }\n };\n this.headerManager = new HeaderManager(getter, setter);\n\n /**\n * api수행객체 최초 생성,\n * 공통으로 적용할 설정값이 있는경우 셋팅\n */\n this.api = axios.create({\n withCredentials: true,\n ...config\n });\n\n /**\n * 인터셉터 요청 처리\n */\n this.api.interceptors.request.use(\n async (config) => {\n /** 디버깅용 로그 */\n await addRequestLog(config);\n /**\n * AT토큰 주입\n */\n const authClient = new AuthClient();\n const accessToken = await authClient.getAT();\n console.log('accessToken', accessToken);\n if (accessToken) {\n config.headers['Authorization'] = `Bearer ${accessToken}`;\n }\n\n if (getEnvironmentFromHostname(location.hostname) === 'local') {\n console.log('localhost header setting!');\n /**\n * 주소가 localhost인 경우 테스트용 헤더 삽입\n */\n config.headers['x-channel-appversion'] = getOrSetCookie('x-channel-appversion', '3.1');\n config.headers['x-channel-deviceid'] = getOrSetCookie('x-channel-deviceid', 'deviceid');\n config.headers['x-channel-devicemodel'] = getOrSetCookie('x-channel-devicemodel', 'iPHONE13');\n config.headers['x-channel-formfactor'] = getOrSetCookie('x-channel-formfactor', 'Phone');\n config.headers['x-channel-loginchannel'] = getOrSetCookie('x-channel-loginchannel', 'DSP');\n config.headers['x-channel-logintype'] = getOrSetCookie('x-channel-logintype', 'ONPA_PIN');\n config.headers['x-channel-platformname'] = getOrSetCookie('x-channel-platformname', 'IOS');\n config.headers['x-channel-platformversion'] = getOrSetCookie('x-channel-platformversion', '15.4.1');\n config.headers['x-channel-screenid'] = getOrSetCookie('x-channel-screenid', 'ScreenId');\n }\n\n /**\n * 커스텀헤더 주입\n */\n this.headerManager.setCustomHeaders();\n /**\n *\n * this.headers설정된 값을 config headers에 주입\n */\n const headerEntries = Object.entries(this.headers);\n headerEntries.forEach(([key, value]) => {\n if (config?.headers) {\n config.headers[key] = value;\n }\n });\n\n /**\n * isRefreshed가 false이면(= 에러발생하여 token재발행중을 의미)\n * 새로운 요청들을 처리하지 않고,큐에 저장\n * 401에러 Queue처리 Request interceptor 등록\n */\n if (!isRefreshed) {\n return new Promise((resolve, reject) => {\n axiosQueue.push({ resolve, reject, config });\n }).then(() => config);\n }\n\n return config;\n },\n (error) => {\n return Promise.reject(error);\n }\n );\n\n /**\n * 인터셉터 응답 처리\n */\n this.api.interceptors.response.use(\n async (response: AxiosResponse) => {\n /** 디버깅용 로그 */\n await addResponseLog(response);\n if (response.data.isSuccess === false) {\n /**\n * 200 응답이라도 , isSuccess === false인 경우 에러로 reject\n */\n return Promise.reject(response);\n }\n\n return response;\n },\n async (error: AxiosError) => {\n /** 디버깅용 로그 */\n await addErrorLog(error);\n\n const originalRequest = error.config;\n\n /**\n * 401에러 Queue처리\n */\n if (error.response?.status === 401) {\n isRefreshed = false;\n const client = new AuthClient();\n client\n .refreshToken()\n .then(() => {\n /**\n * 토큰 갱신 성공, 플래그를 true로 설정\n */\n isRefreshed = true;\n\n /**\n * 큐에 쌓여있던 모든 요청 재시도\n */\n while (axiosQueue.length > 0) {\n const p = axiosQueue.shift(); // axiosQueue에서 첫 번째 요소를 제거하고 반환합니다.\n if (p) {\n /**\n * api 인스턴스를 통해 요청을 재시도합니다. 따라서 재요청들은 다시 인터셉터를 타게 됩니다.\n * 신규토큰을 주입받고 정상처리\n * @todo 재시도후 reject시에는 로그인페이지로 보내는 브릿지 함수를 호출하도록 처리가 필요해보임.\n */\n this.api(p.config)\n .then((response) => p.resolve(response))\n .catch((err) => p.reject(err));\n }\n }\n })\n .catch((error) => {\n /**\n * 토큰 재발행중 에러 발생한 경우 처리\n * @todo 로그인페이지 이동(?)\n */\n return Promise.reject(error);\n });\n\n return new Promise((resolve, reject) => {\n if (originalRequest) {\n axiosQueue.push({ resolve, reject, config: originalRequest });\n }\n });\n } else {\n return Promise.reject(error);\n }\n }\n );\n }\n\n setHeaders(headers: Record<string, string>) {\n this.headers = {\n ...this.headers,\n ...headers\n };\n }\n}\n","// import { bridge } from '@/app/responsive/bridge/tmp-bridge';\n// import { CsrHttpClientAxios } from '../axios/csr-http-client-axios';\n\nimport { getEnvironmentFromHostname, isDspWebview } from 'sales-frontend-utils';\n\nimport { HttpClientAxios } from '../axios/http-client-axios';\nimport { cookieClient } from '../cookie/cookie-client';\n\nexport class AuthClient {\n /**\n * App인지 확인\n * @returns boolean\n */\n isApp() {\n return isDspWebview();\n }\n\n /**\n *\n * @returns Promise<string | undefined>\n * 주소가 localhost인 경우 cookie에서 'AT' 를 읽어온다.\n */\n async getAT(): Promise<string | undefined> {\n /**\n * 주소가 localhost인 경우 cookie에서 'AT' 를 읽어온다.\n */\n if (getEnvironmentFromHostname(location.hostname) === 'local') {\n console.log('localhost token setting!');\n\n return cookieClient.getCookie('accessToken');\n }\n\n if (this.isApp()) {\n /**\n * @todo : 브릿지 함수 호출 스펙에 맞게 수정필요\n */\n // return await bridge.callToNative('', '', 'getAT', {});\n return '';\n } else {\n /**\n * pc인 경우는, middleware.ts 에서 요청헤더에 주입\n */\n }\n }\n\n /**\n * RT를 이용하여 신규 AT/RT발행\n * 기존토큰은 무효화처리\n * 쿠키에 저장.\n * @returns Promise<string> 액세스토큰\n */\n async refreshToken(): Promise<string> {\n if (this.isApp()) {\n /**\n * @todo : 브릿지 함수 호출 스펙에 맞게 수정필요\n */\n // @ts-ignore\n return await bridge.callToNative('', '', 'refreshToken', {});\n } else {\n /**\n * @todo : 내부api호출\n */\n const httpclient = new HttpClientAxios({});\n const res = await httpclient.api.get('/internal/api/auth/refresh');\n\n return res?.data.accessToken;\n }\n }\n}\n//\n"]}
1
+ {"version":3,"sources":["../src/http-client/cookie/cookie-client.ts","../src/http-client/header/header.types.ts","../src/http-client/header/header-manager.ts","../src/http-client/axios/http-client-axios.ts","../src/http-client/auth/auth-client.ts"],"names":["axios","config","addRequestLog","getEnvironmentFromHostname","addResponseLog","addErrorLog","error","isDspWebview"],"mappings":";;;;;;;;;;;;;;;AAGO,IAAM,YAAe,GAAA;AAAA,EAC1B,UAAU,IAAsB,EAAA;AAC9B,IAAI,IAAA,OAAO,aAAa,WAAa,EAAA;AACnC,MAAO,OAAA,EAAA;AAAA;AAET,IAAM,MAAA,KAAA,GAAQ,SAAS,MAAO,CAAA,KAAA,CAAM,IAAI,MAAO,CAAA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AQ,OAAO,KAAK,CAAA;AAAA;AAC7B;AACF,KACF;AAAA;AACF,EAEA,WAAW,OAAiC,EAAA;AAC1C,IAAA,IAAA,CAAK,OAAU,GAAA;AAAA,MACb,GAAG,IAAK,CAAA,OAAA;AAAA,MACR,GAAG;AAAA,KACL;AAAA;AAEJ;;;ACxNO,IAAM,aAAN,MAAiB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,KAAQ,GAAA;AACN,IAAA,OAAOC,+BAAa,EAAA;AAAA;AACtB;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,KAAqC,GAAA;AAIzC,IAAA,IAAIJ,6CAA2B,CAAA,QAAA,CAAS,QAAQ,CAAA,KAAM,OAAS,EAAA;AAC7D,MAAA,OAAA,CAAQ,IAAI,0BAA0B,CAAA;AAEtC,MAAO,OAAA,YAAA,CAAa,UAAU,aAAa,CAAA;AAAA;AAG7C,IAAI,IAAA,IAAA,CAAK,OAAS,EAAA;AAKhB,MAAO,OAAA,EAAA;AAAA;AAKT;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,YAAgC,GAAA;AACpC,IAAI,IAAA,IAAA,CAAK,OAAS,EAAA;AAKhB,MAAA,OAAO,MAAM,MAAO,CAAA,YAAA,CAAa,IAAI,EAAI,EAAA,cAAA,EAAgB,EAAE,CAAA;AAAA,KACtD,MAAA;AAIL,MAAA,MAAM,UAAa,GAAA,IAAI,eAAgB,CAAA,EAAE,CAAA;AACzC,MAAA,MAAM,GAAM,GAAA,MAAM,UAAW,CAAA,GAAA,CAAI,IAAI,4BAA4B,CAAA;AAEjE,MAAA,OAAO,KAAK,IAAK,CAAA,WAAA;AAAA;AACnB;AAEJ","file":"client.cjs","sourcesContent":["/**\n * 클라이언트용 쿠키 함수\n */\nexport const cookieClient = {\n getCookie(name: string): string {\n if (typeof document === 'undefined') {\n return '';\n }\n const match = document.cookie.match(new RegExp(`(^|; *)${name}=([^;]*)`));\n\n return match ? decodeURIComponent(match[2] || '') : '';\n },\n\n setCookie(\n name: string,\n value: string,\n options: {\n expires?: number | Date; // number of days\n path?: string;\n domain?: string;\n secure?: boolean;\n } = {}\n ): void {\n if (typeof document === 'undefined') {\n return;\n }\n\n let cookieString = `${name}=${encodeURIComponent(value)}`;\n\n if (options.expires) {\n let expiresDate: Date;\n if (typeof options.expires === 'number') {\n expiresDate = new Date();\n expiresDate.setDate(expiresDate.getDate() + options.expires);\n } else {\n expiresDate = options.expires;\n }\n cookieString += `; expires=${expiresDate.toUTCString()}`;\n }\n\n cookieString += `; path=${options.path || '/'}`;\n\n if (options.domain) {\n cookieString += `; domain=${options.domain}`;\n }\n\n if (options.secure) {\n cookieString += '; secure';\n }\n\n document.cookie = cookieString;\n },\n deleteCookie(name: string, options: { path?: string; domain?: string } = {}): void {\n cookieClient.setCookie(name, '', { ...options, expires: -1 });\n }\n};\n","/**\n * @see https://loop.cloud.microsoft/p/eyJ3Ijp7InUiOiJodHRwczovL2hhbndoYWxpZmVtMzY1LnNoYXJlcG9pbnQuY29tLz9uYXY9Y3owbE1rWW1aRDFpSVVVd1FXdDJSbGhSV0VWUE1tUkNYMWhUZW5KWVVFdFBSVXByYWs1b1NrSlBjRk4wYm5wNmNsWmpMVUZ5YjI1UlJWOVdSREpUV25aeWVUUTJTV2swUlZrbVpqMHdNVk5OVGtkR1JsTkJXVE0xVVZaQ1ZrRkVRa1ZaVEVoRVNUSTBXRXhVVlZoV0ptTTlKbVpzZFdsa1BURSUzRCIsInIiOmZhbHNlfSwicCI6eyJ1IjoiaHR0cHM6Ly9oYW53aGFsaWZlbTM2NS5zaGFyZXBvaW50LmNvbS9jb250ZW50c3RvcmFnZS9DU1BfYmMyNDQwMTMtZDA1NS00MzVjLWI2NzQtMWZkNzRiM2FkNzNjLyVFQiVBQyVCOCVFQyU4NCU5QyUyMCVFQiU5RCVCQyVFQyU5RCVCNCVFQiVCOCU4QyVFQiU5RiVBQyVFQiVBNiVBQy9Mb29wQXBwRGF0YS8wOS0yLiUyMEJyaWRnZSUyMFNwZWMlMjAxLmxvb3A%2FbmF2PWN6MGxNa1pqYjI1MFpXNTBjM1J2Y21GblpTVXlSa05UVUY5aVl6STBOREF4TXkxa01EVTFMVFF6TldNdFlqWTNOQzB4Wm1RM05HSXpZV1EzTTJNbVpEMWlJVVV3UVd0MlJsaFJXRVZQTW1SQ1gxaFRlbkpZVUV0UFJVcHJhazVvU2tKUGNGTjBibnA2Y2xaakxVRnliMjVSUlY5V1JESlRXblp5ZVRRMlNXazBSVmttWmowd01WTk5Ua2RHUmxGRlYxTlFOelpMUWtsTFdrWkpXVUUzU1ZkWldGTklWa0ZUSm1NOUpUSkdKbVpzZFdsa1BURSUzRCIsInIiOmZhbHNlfSwiaSI6eyJpIjoiNTdkZmVhM2QtZDA2Yi00YWRlLWIxZjEtYjE4NDA4MmNlN2VjIn19\n */\nexport const customHeaderNames = [\n 'Accept-Language',\n 'DeviceId',\n 'LoginType',\n 'PlatformName',\n 'PlatformVersion',\n 'AppVersion',\n 'DeviceModel',\n 'FormFactor',\n 'LoginChannel'\n];\n\nexport const AT = 'AT';\nexport type GetterSync = (keyName: string) => string;\nexport type SetterSync = (keyName: string, value: string) => void;\n\nexport type GetterAsync = (keyName: string) => Promise<string> | string;\nexport type SetterAsync = (keyName: string, value: string) => Promise<void> | void;\n","import { AT, customHeaderNames, GetterSync, SetterSync } from './header.types';\n\nexport class HeaderManager {\n private getter: GetterSync;\n private setter: SetterSync;\n\n constructor(getter: GetterSync, setter: SetterSync) {\n this.getter = getter;\n this.setter = setter;\n }\n\n /**\n * 커스텀 헤더를 동기적으로 설정합니다.\n */\n setCustomHeaders(): void {\n customHeaderNames.forEach((headerName) => {\n const customHeaderKey = `X-Channel-${headerName}`;\n const headerValue = this.getter(customHeaderKey);\n if (headerValue) {\n this.setter(customHeaderKey, headerValue);\n }\n });\n }\n\n /**\n * 인증 토큰을 동기적으로 설정합니다.\n */\n setAuthToken(): void {\n const token = this.getter(AT);\n if (token) {\n this.setter('Authorization', `Bearer ${token}`);\n }\n }\n\n /**\n * 모든 헤더를 동기적으로 설정합니다.\n */\n setAllHeaders(): void {\n this.setCustomHeaders();\n this.setAuthToken();\n }\n}\n","import axios from 'axios';\nimport { addErrorLog, addRequestLog, addResponseLog } from 'sales-frontend-debug';\nimport { getEnvironmentFromHostname } from 'sales-frontend-utils';\n\nimport { AuthClient } from '../auth/auth-client';\nimport { cookieClient } from '../cookie/cookie-client';\nimport { HeaderManager } from '../header/header-manager';\n\nimport type { AxiosQueueType } from './types';\nimport type { AxiosError, AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';\nlet isRefreshed = true;\nconst axiosQueue: AxiosQueueType[] = [];\n\n/**\n * 쿠키에서 값을 가져오고, 없으면 기본값을 쿠키에 설정 후 반환하는 헬퍼 함수\n * @param key 쿠키 키\n * @param defaultValue 쿠키 값이 없을 때 사용할 기본값\n * @returns 쿠키 값 또는 기본값\n */\nconst getOrSetCookie = (key: string, defaultValue: string): string => {\n let value = cookieClient.getCookie(key);\n if (!value) {\n value = defaultValue;\n cookieClient.setCookie(key, value, { path: '/' });\n }\n\n return value;\n};\n\n/**\n * 전자청약\n * CSR용 http-client 입니다.\n * cookie , redirect , tokem 처리 방식은 CSR 환경에 맞게 구현됩니다.\n */\nexport class HttpClientAxios {\n config: AxiosRequestConfig;\n headerManager: HeaderManager;\n\n /**\n * axios의 request interceptor 동작시, 헤더에 주입될 헤더의 key,value\n */\n headers: Record<string, string> = {};\n\n /**\n * api연동을 수행할 실제 객체(axios, fetch 등의 다른 라이브러리로 교체가능한 영역)\n * 현재 버전에서는 axios를 사용하여 구현됨.\n */\n api: AxiosInstance;\n constructor(config: AxiosRequestConfig = {}) {\n this.config = config;\n\n /**\n * 헤더매니저 셋팅\n */\n const getter: HeaderManager['getter'] = (key) => {\n return cookieClient.getCookie(key);\n };\n const setter: HeaderManager['setter'] = (key, value) => {\n if (config?.headers) {\n config.headers[key] = value;\n }\n };\n this.headerManager = new HeaderManager(getter, setter);\n\n /**\n * api수행객체 최초 생성,\n * 공통으로 적용할 설정값이 있는경우 셋팅\n */\n this.api = axios.create({\n withCredentials: true,\n ...config\n });\n\n /**\n * 인터셉터 요청 처리\n */\n this.api.interceptors.request.use(\n async (config) => {\n /** 디버깅용 로그 */\n await addRequestLog(config);\n\n const debugRefreshQueueOff = config.headers?.['Debug-Refresh-Queue-Off'] === 'true';\n if (debugRefreshQueueOff) {\n isRefreshed = true;\n }\n\n /**\n * AT토큰 주입\n */\n const authClient = new AuthClient();\n const accessToken = await authClient.getAT();\n console.log('accessToken', accessToken);\n if (accessToken) {\n config.headers['Authorization'] = `Bearer ${accessToken}`;\n }\n\n if (getEnvironmentFromHostname(location.hostname) === 'local') {\n console.log('localhost header setting!');\n /**\n * 주소가 localhost인 경우 테스트용 헤더 삽입\n */\n config.headers['x-channel-appversion'] = getOrSetCookie('x-channel-appversion', '3.1');\n config.headers['x-channel-deviceid'] = getOrSetCookie('x-channel-deviceid', 'deviceid');\n config.headers['x-channel-devicemodel'] = getOrSetCookie('x-channel-devicemodel', 'iPHONE13');\n config.headers['x-channel-formfactor'] = getOrSetCookie('x-channel-formfactor', 'Phone');\n config.headers['x-channel-loginchannel'] = getOrSetCookie('x-channel-loginchannel', 'DSP');\n config.headers['x-channel-logintype'] = getOrSetCookie('x-channel-logintype', 'ONPA_PIN');\n config.headers['x-channel-platformname'] = getOrSetCookie('x-channel-platformname', 'IOS');\n config.headers['x-channel-platformversion'] = getOrSetCookie('x-channel-platformversion', '15.4.1');\n config.headers['x-channel-screenid'] = getOrSetCookie('x-channel-screenid', 'ScreenId');\n }\n\n /**\n * 커스텀헤더 주입\n */\n this.headerManager.setCustomHeaders();\n /**\n *\n * this.headers설정된 값을 config headers에 주입\n */\n const headerEntries = Object.entries(this.headers);\n headerEntries.forEach(([key, value]) => {\n if (config?.headers) {\n config.headers[key] = value;\n }\n });\n\n /**\n * isRefreshed가 false이면(= 에러발생하여 token재발행중을 의미)\n * 새로운 요청들을 처리하지 않고,큐에 저장\n * 401에러 Queue처리 Request interceptor 등록\n */\n if (!isRefreshed) {\n return new Promise((resolve, reject) => {\n axiosQueue.push({ resolve, reject, config });\n }).then(() => config);\n }\n\n return config;\n },\n (error) => {\n return Promise.reject(error);\n }\n );\n\n /**\n * 인터셉터 응답 처리\n */\n this.api.interceptors.response.use(\n async (response: AxiosResponse) => {\n /** 디버깅용 로그 */\n await addResponseLog(response);\n if (response.data.isSuccess === false) {\n /**\n * 200 응답이라도 , isSuccess === false인 경우 에러로 reject\n */\n return Promise.reject(response);\n }\n\n return response;\n },\n async (error: AxiosError) => {\n /** 디버깅용 로그 */\n await addErrorLog(error);\n\n const originalRequest = error.config;\n const debugRefreshQueueOff = config.headers?.['Debug-Refresh-Queue-Off'] === 'true';\n /**\n * 401에러 Queue처리\n */\n if (error.response?.status === 401 && !debugRefreshQueueOff) {\n isRefreshed = false;\n const client = new AuthClient();\n client\n .refreshToken()\n .then(() => {\n /**\n * 토큰 갱신 성공, 플래그를 true로 설정\n */\n isRefreshed = true;\n\n /**\n * 큐에 쌓여있던 모든 요청 재시도\n */\n while (axiosQueue.length > 0) {\n const p = axiosQueue.shift(); // axiosQueue에서 첫 번째 요소를 제거하고 반환합니다.\n if (p) {\n /**\n * api 인스턴스를 통해 요청을 재시도합니다. 따라서 재요청들은 다시 인터셉터를 타게 됩니다.\n * 신규토큰을 주입받고 정상처리\n * @todo 재시도후 reject시에는 로그인페이지로 보내는 브릿지 함수를 호출하도록 처리가 필요해보임.\n */\n this.api(p.config)\n .then((response) => p.resolve(response))\n .catch((err) => p.reject(err));\n }\n }\n })\n .catch((error) => {\n /**\n * 토큰 재발행중 에러 발생한 경우 처리\n * @todo 로그인페이지 이동(?)\n */\n return Promise.reject(error);\n });\n\n return new Promise((resolve, reject) => {\n if (originalRequest) {\n axiosQueue.push({ resolve, reject, config: originalRequest });\n }\n });\n } else {\n return Promise.reject(error);\n }\n }\n );\n }\n\n setHeaders(headers: Record<string, string>) {\n this.headers = {\n ...this.headers,\n ...headers\n };\n }\n}\n","// import { bridge } from '@/app/responsive/bridge/tmp-bridge';\n// import { CsrHttpClientAxios } from '../axios/csr-http-client-axios';\n\nimport { getEnvironmentFromHostname, isDspWebview } from 'sales-frontend-utils';\n\nimport { HttpClientAxios } from '../axios/http-client-axios';\nimport { cookieClient } from '../cookie/cookie-client';\n\nexport class AuthClient {\n /**\n * App인지 확인\n * @returns boolean\n */\n isApp() {\n return isDspWebview();\n }\n\n /**\n *\n * @returns Promise<string | undefined>\n * 주소가 localhost인 경우 cookie에서 'AT' 를 읽어온다.\n */\n async getAT(): Promise<string | undefined> {\n /**\n * 주소가 localhost인 경우 cookie에서 'AT' 를 읽어온다.\n */\n if (getEnvironmentFromHostname(location.hostname) === 'local') {\n console.log('localhost token setting!');\n\n return cookieClient.getCookie('accessToken');\n }\n\n if (this.isApp()) {\n /**\n * @todo : 브릿지 함수 호출 스펙에 맞게 수정필요\n */\n // return await bridge.callToNative('', '', 'getAT', {});\n return '';\n } else {\n /**\n * pc인 경우는, middleware.ts 에서 요청헤더에 주입\n */\n }\n }\n\n /**\n * RT를 이용하여 신규 AT/RT발행\n * 기존토큰은 무효화처리\n * 쿠키에 저장.\n * @returns Promise<string> 액세스토큰\n */\n async refreshToken(): Promise<string> {\n if (this.isApp()) {\n /**\n * @todo : 브릿지 함수 호출 스펙에 맞게 수정필요\n */\n // @ts-ignore\n return await bridge.callToNative('', '', 'refreshToken', {});\n } else {\n /**\n * @todo : 내부api호출\n */\n const httpclient = new HttpClientAxios({});\n const res = await httpclient.api.get('/internal/api/auth/refresh');\n\n return res?.data.accessToken;\n }\n }\n}\n//\n"]}
package/dist/client.d.cts CHANGED
@@ -1,6 +1,5 @@
1
- import { InternalAxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
1
+ import { InternalAxiosRequestConfig } from 'axios';
2
2
  export { H as HttpClientAxios } from './http-client-axios-Cz6Oo35g.cjs';
3
- import * as zustand from 'zustand';
4
3
  import './header.types-duHbFvO0.cjs';
5
4
 
6
5
  declare class AuthClient {
@@ -30,72 +29,6 @@ interface AxiosQueueType {
30
29
  config: InternalAxiosRequestConfig;
31
30
  }
32
31
 
33
- interface RequestInfo {
34
- url: string;
35
- method: string;
36
- headers: any;
37
- params: any;
38
- data: any;
39
- startTime: number;
40
- }
41
- interface ResponseInfo {
42
- url: string;
43
- method: string;
44
- status: number;
45
- statusText: string;
46
- headers: any;
47
- data: any;
48
- }
49
- interface ErrorInfo {
50
- url: string;
51
- method: string;
52
- message: string;
53
- config: any;
54
- response?: ResponseInfo;
55
- }
56
- interface HeldRequest {
57
- request: RequestInfo;
58
- resolver: (value: any) => void;
59
- }
60
- interface HeldResponse {
61
- response: ResponseInfo;
62
- resolver: (value: any) => void;
63
- }
64
- interface HeldError {
65
- error: ErrorInfo;
66
- resolver: (value: any) => void;
67
- }
68
- interface DebugState {
69
- requests: RequestInfo[];
70
- responses: ResponseInfo[];
71
- errors: ErrorInfo[];
72
- isHold: boolean;
73
- heldRequests: HeldRequest[];
74
- heldResponses: HeldResponse[];
75
- heldErrors: HeldError[];
76
- }
77
- interface DebugActions {
78
- addRequest: (request: RequestInfo) => void;
79
- addResponse: (response: ResponseInfo) => void;
80
- addError: (error: ErrorInfo) => void;
81
- clear: () => void;
82
- toggleHold: () => void;
83
- holdRequest: (request: HeldRequest) => void;
84
- holdResponse: (response: HeldResponse) => void;
85
- holdError: (error: HeldError) => void;
86
- playAllRequests: () => void;
87
- playAllResponses: () => void;
88
- }
89
- type DebugStore = DebugState & DebugActions;
90
-
91
- declare const useDebugStore: zustand.UseBoundStore<zustand.StoreApi<DebugStore>>;
92
-
93
- /** debug-tool 에서 사용될 로그 저장 */
94
- declare function addRequestLog(config: InternalAxiosRequestConfig): Promise<unknown> | undefined;
95
- /** debug-tool 에서 사용될 로그 저장 */
96
- declare function addResponseLog(response: AxiosResponse): Promise<unknown> | undefined;
97
- declare function addErrorLog(error: AxiosError): Promise<unknown> | undefined;
98
-
99
32
  /**
100
33
  * 클라이언트용 쿠키 함수
101
34
  */
@@ -113,4 +46,4 @@ declare const cookieClient: {
113
46
  }): void;
114
47
  };
115
48
 
116
- export { AuthClient, type AxiosQueueType, type DebugActions, type DebugState, type DebugStore, type ErrorInfo, type HeldError, type HeldRequest, type HeldResponse, type RequestInfo, type ResponseInfo, addErrorLog, addRequestLog, addResponseLog, cookieClient, useDebugStore };
49
+ export { AuthClient, type AxiosQueueType, cookieClient };
package/dist/client.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { InternalAxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
1
+ import { InternalAxiosRequestConfig } from 'axios';
2
2
  export { H as HttpClientAxios } from './http-client-axios-D4Ub9Xlb.js';
3
- import * as zustand from 'zustand';
4
3
  import './header.types-duHbFvO0.js';
5
4
 
6
5
  declare class AuthClient {
@@ -30,72 +29,6 @@ interface AxiosQueueType {
30
29
  config: InternalAxiosRequestConfig;
31
30
  }
32
31
 
33
- interface RequestInfo {
34
- url: string;
35
- method: string;
36
- headers: any;
37
- params: any;
38
- data: any;
39
- startTime: number;
40
- }
41
- interface ResponseInfo {
42
- url: string;
43
- method: string;
44
- status: number;
45
- statusText: string;
46
- headers: any;
47
- data: any;
48
- }
49
- interface ErrorInfo {
50
- url: string;
51
- method: string;
52
- message: string;
53
- config: any;
54
- response?: ResponseInfo;
55
- }
56
- interface HeldRequest {
57
- request: RequestInfo;
58
- resolver: (value: any) => void;
59
- }
60
- interface HeldResponse {
61
- response: ResponseInfo;
62
- resolver: (value: any) => void;
63
- }
64
- interface HeldError {
65
- error: ErrorInfo;
66
- resolver: (value: any) => void;
67
- }
68
- interface DebugState {
69
- requests: RequestInfo[];
70
- responses: ResponseInfo[];
71
- errors: ErrorInfo[];
72
- isHold: boolean;
73
- heldRequests: HeldRequest[];
74
- heldResponses: HeldResponse[];
75
- heldErrors: HeldError[];
76
- }
77
- interface DebugActions {
78
- addRequest: (request: RequestInfo) => void;
79
- addResponse: (response: ResponseInfo) => void;
80
- addError: (error: ErrorInfo) => void;
81
- clear: () => void;
82
- toggleHold: () => void;
83
- holdRequest: (request: HeldRequest) => void;
84
- holdResponse: (response: HeldResponse) => void;
85
- holdError: (error: HeldError) => void;
86
- playAllRequests: () => void;
87
- playAllResponses: () => void;
88
- }
89
- type DebugStore = DebugState & DebugActions;
90
-
91
- declare const useDebugStore: zustand.UseBoundStore<zustand.StoreApi<DebugStore>>;
92
-
93
- /** debug-tool 에서 사용될 로그 저장 */
94
- declare function addRequestLog(config: InternalAxiosRequestConfig): Promise<unknown> | undefined;
95
- /** debug-tool 에서 사용될 로그 저장 */
96
- declare function addResponseLog(response: AxiosResponse): Promise<unknown> | undefined;
97
- declare function addErrorLog(error: AxiosError): Promise<unknown> | undefined;
98
-
99
32
  /**
100
33
  * 클라이언트용 쿠키 함수
101
34
  */
@@ -113,4 +46,4 @@ declare const cookieClient: {
113
46
  }): void;
114
47
  };
115
48
 
116
- export { AuthClient, type AxiosQueueType, type DebugActions, type DebugState, type DebugStore, type ErrorInfo, type HeldError, type HeldRequest, type HeldResponse, type RequestInfo, type ResponseInfo, addErrorLog, addRequestLog, addResponseLog, cookieClient, useDebugStore };
49
+ export { AuthClient, type AxiosQueueType, cookieClient };
package/dist/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getEnvironmentFromHostname, isDspWebview } from 'sales-frontend-utils';
2
2
  import axios from 'axios';
3
- import { create } from 'zustand';
3
+ import { addRequestLog, addResponseLog, addErrorLog } from 'sales-frontend-debug';
4
4
 
5
5
  var __defProp = Object.defineProperty;
6
6
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -43,114 +43,6 @@ var cookieClient = {
43
43
  cookieClient.setCookie(name, "", { ...options, expires: -1 });
44
44
  }
45
45
  };
46
- var useDebugStore = create()((set) => ({
47
- requests: [],
48
- responses: [],
49
- errors: [],
50
- isHold: false,
51
- heldRequests: [],
52
- heldResponses: [],
53
- heldErrors: [],
54
- addRequest: (request) => set((state) => ({ requests: [...state.requests, request] })),
55
- addResponse: (response) => set((state) => ({ responses: [...state.responses, response] })),
56
- addError: (error) => set((state) => ({ errors: [...state.errors, error] })),
57
- clear: () => set({ requests: [], responses: [], errors: [], heldRequests: [], heldResponses: [], heldErrors: [] }),
58
- toggleHold: () => set((state) => ({ isHold: !state.isHold })),
59
- holdRequest: (request) => set((state) => ({ heldRequests: [...state.heldRequests, request] })),
60
- holdResponse: (response) => set((state) => ({ heldResponses: [...state.heldResponses, response] })),
61
- holdError: (error) => set((state) => ({ heldErrors: [...state.heldErrors, error] })),
62
- playAllRequests: () => set((state) => {
63
- state.heldRequests.forEach((r) => r.resolver(r.request));
64
- return {
65
- requests: [...state.requests, ...state.heldRequests.map((r) => r.request)],
66
- heldRequests: []
67
- };
68
- }),
69
- playAllResponses: () => set((state) => {
70
- state.heldResponses.forEach((r) => r.resolver(r.response));
71
- state.heldErrors.forEach((r) => r.resolver(r.error));
72
- return {
73
- responses: [...state.responses, ...state.heldResponses.map((r) => r.response)],
74
- errors: [...state.errors, ...state.heldErrors.map((r) => r.error)],
75
- heldResponses: [],
76
- heldErrors: []
77
- };
78
- })
79
- }));
80
-
81
- // src/http-client/debug/interceptor-function.ts
82
- function addRequestLog(config) {
83
- const env = getEnvironmentFromHostname(location.hostname);
84
- if (env !== "prd") {
85
- const { addRequest, isHold, holdRequest } = useDebugStore.getState();
86
- const startTime = Date.now();
87
- const requestInfo = {
88
- url: config.url || "",
89
- method: config.method || "",
90
- headers: config.headers,
91
- params: config.params,
92
- data: config.data,
93
- startTime
94
- };
95
- if (isHold) {
96
- return new Promise((resolver) => {
97
- holdRequest({ request: requestInfo, resolver });
98
- });
99
- } else {
100
- addRequest(requestInfo);
101
- }
102
- }
103
- }
104
- function addResponseLog(response) {
105
- const env = getEnvironmentFromHostname(location.hostname);
106
- if (env !== "prd") {
107
- const { addResponse, isHold, holdResponse } = useDebugStore.getState();
108
- const { config } = response;
109
- const responseInfo = {
110
- url: config.url || "",
111
- method: config.method || "",
112
- status: response.status,
113
- statusText: response.statusText,
114
- headers: response.headers,
115
- data: response.data
116
- };
117
- if (isHold) {
118
- return new Promise((resolver) => {
119
- holdResponse({ response: responseInfo, resolver });
120
- });
121
- } else {
122
- addResponse(responseInfo);
123
- }
124
- }
125
- }
126
- function addErrorLog(error) {
127
- const env = getEnvironmentFromHostname(location.hostname);
128
- if (env !== "prd") {
129
- const { addError, isHold, holdError } = useDebugStore.getState();
130
- const { config } = error;
131
- const errorInfo = {
132
- url: config?.url || "",
133
- method: config?.method || "",
134
- message: error.message,
135
- config: error.config,
136
- response: error.response ? {
137
- url: error.response.config?.url || "",
138
- method: error.response.config?.method || "",
139
- status: error.response.status,
140
- statusText: error.response.statusText,
141
- headers: error.response.headers,
142
- data: error.response.data
143
- } : void 0
144
- };
145
- if (isHold) {
146
- return new Promise((resolver) => {
147
- holdError({ error: errorInfo, resolver });
148
- });
149
- } else {
150
- addError(errorInfo);
151
- }
152
- }
153
- }
154
46
 
155
47
  // src/http-client/header/header.types.ts
156
48
  var customHeaderNames = [
@@ -245,6 +137,10 @@ var HttpClientAxios = class {
245
137
  this.api.interceptors.request.use(
246
138
  async (config2) => {
247
139
  await addRequestLog(config2);
140
+ const debugRefreshQueueOff = config2.headers?.["Debug-Refresh-Queue-Off"] === "true";
141
+ if (debugRefreshQueueOff) {
142
+ isRefreshed = true;
143
+ }
248
144
  const authClient = new AuthClient();
249
145
  const accessToken = await authClient.getAT();
250
146
  console.log("accessToken", accessToken);
@@ -292,7 +188,8 @@ var HttpClientAxios = class {
292
188
  async (error) => {
293
189
  await addErrorLog(error);
294
190
  const originalRequest = error.config;
295
- if (error.response?.status === 401) {
191
+ const debugRefreshQueueOff = config.headers?.["Debug-Refresh-Queue-Off"] === "true";
192
+ if (error.response?.status === 401 && !debugRefreshQueueOff) {
296
193
  isRefreshed = false;
297
194
  const client = new AuthClient();
298
195
  client.refreshToken().then(() => {
@@ -365,6 +262,6 @@ var AuthClient = class {
365
262
  }
366
263
  };
367
264
 
368
- export { AuthClient, HttpClientAxios, addErrorLog, addRequestLog, addResponseLog, cookieClient, useDebugStore };
265
+ export { AuthClient, HttpClientAxios, cookieClient };
369
266
  //# sourceMappingURL=client.js.map
370
267
  //# sourceMappingURL=client.js.map