sales-frontend-utils 0.0.28 → 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 +35 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +35 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -196,7 +196,16 @@ declare const getBusinessWorkDivisionCode: () => string;
|
|
|
196
196
|
* @param hostname window.location.hostname
|
|
197
197
|
* @returns
|
|
198
198
|
*/
|
|
199
|
-
declare const getDudApiHostNameFromEnvironment: (
|
|
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;
|
|
200
209
|
|
|
201
210
|
/**
|
|
202
211
|
* Message 이벤트 헨들러를 관리하는 클래스입니다. (싱글턴)
|
|
@@ -307,4 +316,4 @@ declare const initASTX2: ({ initSuccess, initFailure, checkServerSuccess, checkS
|
|
|
307
316
|
*/
|
|
308
317
|
declare function getE2EDataIDs(ids: string[], onSuccess: (astx_data: any) => void, onFailure?: () => void): void;
|
|
309
318
|
|
|
310
|
-
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, 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 };
|
|
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
|
@@ -196,7 +196,16 @@ declare const getBusinessWorkDivisionCode: () => string;
|
|
|
196
196
|
* @param hostname window.location.hostname
|
|
197
197
|
* @returns
|
|
198
198
|
*/
|
|
199
|
-
declare const getDudApiHostNameFromEnvironment: (
|
|
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;
|
|
200
209
|
|
|
201
210
|
/**
|
|
202
211
|
* Message 이벤트 헨들러를 관리하는 클래스입니다. (싱글턴)
|
|
@@ -307,4 +316,4 @@ declare const initASTX2: ({ initSuccess, initFailure, checkServerSuccess, checkS
|
|
|
307
316
|
*/
|
|
308
317
|
declare function getE2EDataIDs(ids: string[], onSuccess: (astx_data: any) => void, onFailure?: () => void): void;
|
|
309
318
|
|
|
310
|
-
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, 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 };
|
|
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,15 +106,22 @@ var isStorybookEnv = () => {
|
|
|
106
106
|
var getBusinessWorkDivisionCode = () => {
|
|
107
107
|
return location.pathname.split("/")[1] ?? "";
|
|
108
108
|
};
|
|
109
|
-
var
|
|
110
|
-
|
|
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);
|
|
111
118
|
switch (environment) {
|
|
112
119
|
/**
|
|
113
120
|
* local에서 호출시, rewrite동작을 위해 상대주소를 호출합니다.
|
|
114
121
|
* (cors이슈 해결을 위해 필수)
|
|
115
122
|
*/
|
|
116
123
|
case "local":
|
|
117
|
-
return `${
|
|
124
|
+
return `${getServiceCode()}/api/dud`;
|
|
118
125
|
/**
|
|
119
126
|
* local 이 아닌 환경에서는 전체주소를 호출합니다.
|
|
120
127
|
*/
|
|
@@ -125,6 +132,30 @@ var getDudApiHostNameFromEnvironment = (serviceCode, hostname) => {
|
|
|
125
132
|
case "prd":
|
|
126
133
|
return `https://dsp-dud.hanwhalife.com`;
|
|
127
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");
|
|
128
159
|
return "";
|
|
129
160
|
}
|
|
130
161
|
};
|
|
@@ -758,6 +789,6 @@ function getE2EDataIDs(ids, onSuccess, onFailure = () => {
|
|
|
758
789
|
}
|
|
759
790
|
}
|
|
760
791
|
|
|
761
|
-
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, 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 };
|
|
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 };
|
|
762
793
|
//# sourceMappingURL=index.js.map
|
|
763
794
|
//# sourceMappingURL=index.js.map
|