sales-frontend-utils 0.0.27 → 0.0.29
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/index.cjs +55 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +54 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -188,6 +188,24 @@ declare const isStorybookEnv: () => boolean;
|
|
|
188
188
|
* @returns
|
|
189
189
|
*/
|
|
190
190
|
declare const getBusinessWorkDivisionCode: () => string;
|
|
191
|
+
/**
|
|
192
|
+
* @description
|
|
193
|
+
* 환경에 맞는 비정형PI 호스트명을 반환합니다.
|
|
194
|
+
* client side에서 사용하는 함수입니다.
|
|
195
|
+
* @param serviceCode dea,dis,dcm
|
|
196
|
+
* @param hostname window.location.hostname
|
|
197
|
+
* @returns
|
|
198
|
+
*/
|
|
199
|
+
declare const getDudApiHostNameFromEnvironment: (hostname?: string) => string;
|
|
200
|
+
/**
|
|
201
|
+
* @description
|
|
202
|
+
* 환경에 맞는 Dsp 호스트명을 반환합니다.
|
|
203
|
+
* client side에서 사용하는 함수입니다.
|
|
204
|
+
* @param serviceCodeTo dea,dis 같은 api서버명
|
|
205
|
+
* @param hostname window.location.hostname
|
|
206
|
+
* @returns
|
|
207
|
+
*/
|
|
208
|
+
declare const getDspApiHostNameFromEnvironment: (serviceCodeTo: string, hostname?: string) => string;
|
|
191
209
|
|
|
192
210
|
/**
|
|
193
211
|
* Message 이벤트 헨들러를 관리하는 클래스입니다. (싱글턴)
|
|
@@ -298,4 +316,4 @@ declare const initASTX2: ({ initSuccess, initFailure, checkServerSuccess, checkS
|
|
|
298
316
|
*/
|
|
299
317
|
declare function getE2EDataIDs(ids: string[], onSuccess: (astx_data: any) => void, onFailure?: () => void): void;
|
|
300
318
|
|
|
301
|
-
export { type BrowserName, type ExecutionEnvironment, MessageEventManager, type OSName, addE2EObject, base64ToBlob, base64ToFile, blobToFile, checkUserAgentDspApp, convertTextToImg, debounce, deleteCookie, downloadBlob, drawImageResizeCentered, fileToBase64, getApiHostNameFromEnvironment, getBrowserName, getBrowserVersion, getBusinessWorkDivisionCode, getCdnHostNameFromEnvironment, getCookie, getCurrentBrowserName, getCurrentBrowserVersion, getCurrentOSName, getCurrentOSVersion, getDeviceModel, getDspExecutionEnvironment, getE2EDataIDs, getEnvironmentFromHostname, getExt, getFormFactorFromUserAgent, getOSName, getOSVersion, getOrCreateDeviceId, getSubdomain, hasAstx2, initASTX2, isClient, isDspApp, isFpPlannerApp, isPc, isPhone, isSalesPortal, isStorybookEnv, isTablet, isWebView, loadScript, objectUrlToBase64, objectUrlToBlob, setCookie, throttle };
|
|
319
|
+
export { type BrowserName, type ExecutionEnvironment, MessageEventManager, type OSName, addE2EObject, base64ToBlob, base64ToFile, blobToFile, checkUserAgentDspApp, convertTextToImg, debounce, deleteCookie, downloadBlob, drawImageResizeCentered, fileToBase64, getApiHostNameFromEnvironment, getBrowserName, getBrowserVersion, getBusinessWorkDivisionCode, getCdnHostNameFromEnvironment, getCookie, getCurrentBrowserName, getCurrentBrowserVersion, getCurrentOSName, getCurrentOSVersion, getDeviceModel, getDspApiHostNameFromEnvironment, getDspExecutionEnvironment, getDudApiHostNameFromEnvironment, getE2EDataIDs, getEnvironmentFromHostname, getExt, getFormFactorFromUserAgent, getOSName, getOSVersion, getOrCreateDeviceId, getSubdomain, hasAstx2, initASTX2, isClient, isDspApp, isFpPlannerApp, isPc, isPhone, isSalesPortal, isStorybookEnv, isTablet, isWebView, loadScript, objectUrlToBase64, objectUrlToBlob, setCookie, throttle };
|
package/dist/index.d.ts
CHANGED
|
@@ -188,6 +188,24 @@ declare const isStorybookEnv: () => boolean;
|
|
|
188
188
|
* @returns
|
|
189
189
|
*/
|
|
190
190
|
declare const getBusinessWorkDivisionCode: () => string;
|
|
191
|
+
/**
|
|
192
|
+
* @description
|
|
193
|
+
* 환경에 맞는 비정형PI 호스트명을 반환합니다.
|
|
194
|
+
* client side에서 사용하는 함수입니다.
|
|
195
|
+
* @param serviceCode dea,dis,dcm
|
|
196
|
+
* @param hostname window.location.hostname
|
|
197
|
+
* @returns
|
|
198
|
+
*/
|
|
199
|
+
declare const getDudApiHostNameFromEnvironment: (hostname?: string) => string;
|
|
200
|
+
/**
|
|
201
|
+
* @description
|
|
202
|
+
* 환경에 맞는 Dsp 호스트명을 반환합니다.
|
|
203
|
+
* client side에서 사용하는 함수입니다.
|
|
204
|
+
* @param serviceCodeTo dea,dis 같은 api서버명
|
|
205
|
+
* @param hostname window.location.hostname
|
|
206
|
+
* @returns
|
|
207
|
+
*/
|
|
208
|
+
declare const getDspApiHostNameFromEnvironment: (serviceCodeTo: string, hostname?: string) => string;
|
|
191
209
|
|
|
192
210
|
/**
|
|
193
211
|
* Message 이벤트 헨들러를 관리하는 클래스입니다. (싱글턴)
|
|
@@ -298,4 +316,4 @@ declare const initASTX2: ({ initSuccess, initFailure, checkServerSuccess, checkS
|
|
|
298
316
|
*/
|
|
299
317
|
declare function getE2EDataIDs(ids: string[], onSuccess: (astx_data: any) => void, onFailure?: () => void): void;
|
|
300
318
|
|
|
301
|
-
export { type BrowserName, type ExecutionEnvironment, MessageEventManager, type OSName, addE2EObject, base64ToBlob, base64ToFile, blobToFile, checkUserAgentDspApp, convertTextToImg, debounce, deleteCookie, downloadBlob, drawImageResizeCentered, fileToBase64, getApiHostNameFromEnvironment, getBrowserName, getBrowserVersion, getBusinessWorkDivisionCode, getCdnHostNameFromEnvironment, getCookie, getCurrentBrowserName, getCurrentBrowserVersion, getCurrentOSName, getCurrentOSVersion, getDeviceModel, getDspExecutionEnvironment, getE2EDataIDs, getEnvironmentFromHostname, getExt, getFormFactorFromUserAgent, getOSName, getOSVersion, getOrCreateDeviceId, getSubdomain, hasAstx2, initASTX2, isClient, isDspApp, isFpPlannerApp, isPc, isPhone, isSalesPortal, isStorybookEnv, isTablet, isWebView, loadScript, objectUrlToBase64, objectUrlToBlob, setCookie, throttle };
|
|
319
|
+
export { type BrowserName, type ExecutionEnvironment, MessageEventManager, type OSName, addE2EObject, base64ToBlob, base64ToFile, blobToFile, checkUserAgentDspApp, convertTextToImg, debounce, deleteCookie, downloadBlob, drawImageResizeCentered, fileToBase64, getApiHostNameFromEnvironment, getBrowserName, getBrowserVersion, getBusinessWorkDivisionCode, getCdnHostNameFromEnvironment, getCookie, getCurrentBrowserName, getCurrentBrowserVersion, getCurrentOSName, getCurrentOSVersion, getDeviceModel, getDspApiHostNameFromEnvironment, getDspExecutionEnvironment, getDudApiHostNameFromEnvironment, getE2EDataIDs, getEnvironmentFromHostname, getExt, getFormFactorFromUserAgent, getOSName, getOSVersion, getOrCreateDeviceId, getSubdomain, hasAstx2, initASTX2, isClient, isDspApp, isFpPlannerApp, isPc, isPhone, isSalesPortal, isStorybookEnv, isTablet, isWebView, loadScript, objectUrlToBase64, objectUrlToBlob, setCookie, throttle };
|
package/dist/index.js
CHANGED
|
@@ -106,6 +106,59 @@ var isStorybookEnv = () => {
|
|
|
106
106
|
var getBusinessWorkDivisionCode = () => {
|
|
107
107
|
return location.pathname.split("/")[1] ?? "";
|
|
108
108
|
};
|
|
109
|
+
var getServiceCode = () => {
|
|
110
|
+
if (typeof window.isStorybookEnv === "boolean") {
|
|
111
|
+
return "";
|
|
112
|
+
} else {
|
|
113
|
+
return `/${location.pathname.split("/")[1]}`;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var getDudApiHostNameFromEnvironment = (hostname) => {
|
|
117
|
+
const environment = getEnvironmentFromHostname(hostname || location.hostname);
|
|
118
|
+
switch (environment) {
|
|
119
|
+
/**
|
|
120
|
+
* local에서 호출시, rewrite동작을 위해 상대주소를 호출합니다.
|
|
121
|
+
* (cors이슈 해결을 위해 필수)
|
|
122
|
+
*/
|
|
123
|
+
case "local":
|
|
124
|
+
return `${getServiceCode()}/api/dud`;
|
|
125
|
+
/**
|
|
126
|
+
* local 이 아닌 환경에서는 전체주소를 호출합니다.
|
|
127
|
+
*/
|
|
128
|
+
case "dev":
|
|
129
|
+
return `https://dsp-dud-dev.hanwhalife.com:10101`;
|
|
130
|
+
case "stg":
|
|
131
|
+
return `https://dsp-dud-stg.hanwhalife.com:10102`;
|
|
132
|
+
case "prd":
|
|
133
|
+
return `https://dsp-dud.hanwhalife.com`;
|
|
134
|
+
default:
|
|
135
|
+
console.warn("DUD API environment is not defined");
|
|
136
|
+
return "";
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
var getDspApiHostNameFromEnvironment = (serviceCodeTo, hostname) => {
|
|
140
|
+
const environment = getEnvironmentFromHostname(hostname || location.hostname);
|
|
141
|
+
switch (environment) {
|
|
142
|
+
/**
|
|
143
|
+
* local에서 호출시, rewrite동작을 위해 상대주소를 호출합니다.
|
|
144
|
+
* (cors이슈 해결을 위해 필수)
|
|
145
|
+
*/
|
|
146
|
+
case "local":
|
|
147
|
+
return `${getServiceCode()}/api/${serviceCodeTo}`;
|
|
148
|
+
/**
|
|
149
|
+
* local 이 아닌 환경에서는 전체주소를 호출합니다.
|
|
150
|
+
*/
|
|
151
|
+
case "dev":
|
|
152
|
+
return `https://nxl-dsp-dev.hanwhalife.com/api/${serviceCodeTo}`;
|
|
153
|
+
case "stg":
|
|
154
|
+
return `https://nxl-dsp-stg.hanwhalife.com/api/${serviceCodeTo}`;
|
|
155
|
+
case "prd":
|
|
156
|
+
return `https://nxl-dsp.hanwhalife.com/api/${serviceCodeTo}`;
|
|
157
|
+
default:
|
|
158
|
+
console.warn("DSP API environment is not defined");
|
|
159
|
+
return "";
|
|
160
|
+
}
|
|
161
|
+
};
|
|
109
162
|
|
|
110
163
|
// src/utils/user-agent-utils.ts
|
|
111
164
|
var getDspExecutionEnvironment = () => {
|
|
@@ -736,6 +789,6 @@ function getE2EDataIDs(ids, onSuccess, onFailure = () => {
|
|
|
736
789
|
}
|
|
737
790
|
}
|
|
738
791
|
|
|
739
|
-
export { MessageEventManager, addE2EObject, base64ToBlob, base64ToFile, blobToFile, checkUserAgentDspApp, convertTextToImg, debounce, deleteCookie, downloadBlob, drawImageResizeCentered, fileToBase64, getApiHostNameFromEnvironment, getBrowserName, getBrowserVersion, getBusinessWorkDivisionCode, getCdnHostNameFromEnvironment, getCookie, getCurrentBrowserName, getCurrentBrowserVersion, getCurrentOSName, getCurrentOSVersion, getDeviceModel, getDspExecutionEnvironment, getE2EDataIDs, getEnvironmentFromHostname, getExt, getFormFactorFromUserAgent, getOSName, getOSVersion, getOrCreateDeviceId, getSubdomain, hasAstx2, initASTX2, isClient, isDspApp, isFpPlannerApp, isPc, isPhone, isSalesPortal, isStorybookEnv, isTablet, isWebView, loadScript, objectUrlToBase64, objectUrlToBlob, setCookie, throttle };
|
|
792
|
+
export { MessageEventManager, addE2EObject, base64ToBlob, base64ToFile, blobToFile, checkUserAgentDspApp, convertTextToImg, debounce, deleteCookie, downloadBlob, drawImageResizeCentered, fileToBase64, getApiHostNameFromEnvironment, getBrowserName, getBrowserVersion, getBusinessWorkDivisionCode, getCdnHostNameFromEnvironment, getCookie, getCurrentBrowserName, getCurrentBrowserVersion, getCurrentOSName, getCurrentOSVersion, getDeviceModel, getDspApiHostNameFromEnvironment, getDspExecutionEnvironment, getDudApiHostNameFromEnvironment, getE2EDataIDs, getEnvironmentFromHostname, getExt, getFormFactorFromUserAgent, getOSName, getOSVersion, getOrCreateDeviceId, getSubdomain, hasAstx2, initASTX2, isClient, isDspApp, isFpPlannerApp, isPc, isPhone, isSalesPortal, isStorybookEnv, isTablet, isWebView, loadScript, objectUrlToBase64, objectUrlToBlob, setCookie, throttle };
|
|
740
793
|
//# sourceMappingURL=index.js.map
|
|
741
794
|
//# sourceMappingURL=index.js.map
|