sales-frontend-utils 0.0.28 → 0.0.30
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 +42 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +41 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -188,6 +188,11 @@ declare const isStorybookEnv: () => boolean;
|
|
|
188
188
|
* @returns
|
|
189
189
|
*/
|
|
190
190
|
declare const getBusinessWorkDivisionCode: () => string;
|
|
191
|
+
/**
|
|
192
|
+
* @description storybook에서 동작을 고려하여 수정한 버전
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
declare const getServiceCode: () => string;
|
|
191
196
|
/**
|
|
192
197
|
* @description
|
|
193
198
|
* 환경에 맞는 비정형PI 호스트명을 반환합니다.
|
|
@@ -196,7 +201,16 @@ declare const getBusinessWorkDivisionCode: () => string;
|
|
|
196
201
|
* @param hostname window.location.hostname
|
|
197
202
|
* @returns
|
|
198
203
|
*/
|
|
199
|
-
declare const getDudApiHostNameFromEnvironment: (
|
|
204
|
+
declare const getDudApiHostNameFromEnvironment: (hostname?: string) => string;
|
|
205
|
+
/**
|
|
206
|
+
* @description
|
|
207
|
+
* 환경에 맞는 Dsp 호스트명을 반환합니다.
|
|
208
|
+
* client side에서 사용하는 함수입니다.
|
|
209
|
+
* @param serviceCodeTo dea,dis 같은 api서버명
|
|
210
|
+
* @param hostname window.location.hostname
|
|
211
|
+
* @returns
|
|
212
|
+
*/
|
|
213
|
+
declare const getDspApiHostNameFromEnvironment: (serviceCodeTo: string, hostname?: string) => string;
|
|
200
214
|
|
|
201
215
|
/**
|
|
202
216
|
* Message 이벤트 헨들러를 관리하는 클래스입니다. (싱글턴)
|
|
@@ -307,4 +321,4 @@ declare const initASTX2: ({ initSuccess, initFailure, checkServerSuccess, checkS
|
|
|
307
321
|
*/
|
|
308
322
|
declare function getE2EDataIDs(ids: string[], onSuccess: (astx_data: any) => void, onFailure?: () => void): void;
|
|
309
323
|
|
|
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 };
|
|
324
|
+
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, getServiceCode, 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,11 @@ declare const isStorybookEnv: () => boolean;
|
|
|
188
188
|
* @returns
|
|
189
189
|
*/
|
|
190
190
|
declare const getBusinessWorkDivisionCode: () => string;
|
|
191
|
+
/**
|
|
192
|
+
* @description storybook에서 동작을 고려하여 수정한 버전
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
declare const getServiceCode: () => string;
|
|
191
196
|
/**
|
|
192
197
|
* @description
|
|
193
198
|
* 환경에 맞는 비정형PI 호스트명을 반환합니다.
|
|
@@ -196,7 +201,16 @@ declare const getBusinessWorkDivisionCode: () => string;
|
|
|
196
201
|
* @param hostname window.location.hostname
|
|
197
202
|
* @returns
|
|
198
203
|
*/
|
|
199
|
-
declare const getDudApiHostNameFromEnvironment: (
|
|
204
|
+
declare const getDudApiHostNameFromEnvironment: (hostname?: string) => string;
|
|
205
|
+
/**
|
|
206
|
+
* @description
|
|
207
|
+
* 환경에 맞는 Dsp 호스트명을 반환합니다.
|
|
208
|
+
* client side에서 사용하는 함수입니다.
|
|
209
|
+
* @param serviceCodeTo dea,dis 같은 api서버명
|
|
210
|
+
* @param hostname window.location.hostname
|
|
211
|
+
* @returns
|
|
212
|
+
*/
|
|
213
|
+
declare const getDspApiHostNameFromEnvironment: (serviceCodeTo: string, hostname?: string) => string;
|
|
200
214
|
|
|
201
215
|
/**
|
|
202
216
|
* Message 이벤트 헨들러를 관리하는 클래스입니다. (싱글턴)
|
|
@@ -307,4 +321,4 @@ declare const initASTX2: ({ initSuccess, initFailure, checkServerSuccess, checkS
|
|
|
307
321
|
*/
|
|
308
322
|
declare function getE2EDataIDs(ids: string[], onSuccess: (astx_data: any) => void, onFailure?: () => void): void;
|
|
309
323
|
|
|
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 };
|
|
324
|
+
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, getServiceCode, 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,25 @@ 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
|
+
if (!isClient()) {
|
|
118
|
+
return "";
|
|
119
|
+
}
|
|
120
|
+
const environment = getEnvironmentFromHostname(hostname || location.hostname);
|
|
111
121
|
switch (environment) {
|
|
112
122
|
/**
|
|
113
123
|
* local에서 호출시, rewrite동작을 위해 상대주소를 호출합니다.
|
|
114
124
|
* (cors이슈 해결을 위해 필수)
|
|
115
125
|
*/
|
|
116
126
|
case "local":
|
|
117
|
-
return `${
|
|
127
|
+
return `${getServiceCode()}/api/dud`;
|
|
118
128
|
/**
|
|
119
129
|
* local 이 아닌 환경에서는 전체주소를 호출합니다.
|
|
120
130
|
*/
|
|
@@ -125,6 +135,33 @@ var getDudApiHostNameFromEnvironment = (serviceCode, hostname) => {
|
|
|
125
135
|
case "prd":
|
|
126
136
|
return `https://dsp-dud.hanwhalife.com`;
|
|
127
137
|
default:
|
|
138
|
+
console.warn("DUD API environment is not defined");
|
|
139
|
+
return "";
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
var getDspApiHostNameFromEnvironment = (serviceCodeTo, hostname) => {
|
|
143
|
+
if (!isClient()) {
|
|
144
|
+
return "";
|
|
145
|
+
}
|
|
146
|
+
const environment = getEnvironmentFromHostname(hostname || location.hostname);
|
|
147
|
+
switch (environment) {
|
|
148
|
+
/**
|
|
149
|
+
* local에서 호출시, rewrite동작을 위해 상대주소를 호출합니다.
|
|
150
|
+
* (cors이슈 해결을 위해 필수)
|
|
151
|
+
*/
|
|
152
|
+
case "local":
|
|
153
|
+
return `${getServiceCode()}/api/${serviceCodeTo}`;
|
|
154
|
+
/**
|
|
155
|
+
* local 이 아닌 환경에서는 전체주소를 호출합니다.
|
|
156
|
+
*/
|
|
157
|
+
case "dev":
|
|
158
|
+
return `https://nxl-dsp-dev.hanwhalife.com/api/${serviceCodeTo}`;
|
|
159
|
+
case "stg":
|
|
160
|
+
return `https://nxl-dsp-stg.hanwhalife.com/api/${serviceCodeTo}`;
|
|
161
|
+
case "prd":
|
|
162
|
+
return `https://nxl-dsp.hanwhalife.com/api/${serviceCodeTo}`;
|
|
163
|
+
default:
|
|
164
|
+
console.warn("DSP API environment is not defined");
|
|
128
165
|
return "";
|
|
129
166
|
}
|
|
130
167
|
};
|
|
@@ -758,6 +795,6 @@ function getE2EDataIDs(ids, onSuccess, onFailure = () => {
|
|
|
758
795
|
}
|
|
759
796
|
}
|
|
760
797
|
|
|
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 };
|
|
798
|
+
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, getServiceCode, getSubdomain, hasAstx2, initASTX2, isClient, isDspApp, isFpPlannerApp, isPc, isPhone, isSalesPortal, isStorybookEnv, isTablet, isWebView, loadScript, objectUrlToBase64, objectUrlToBlob, setCookie, throttle };
|
|
762
799
|
//# sourceMappingURL=index.js.map
|
|
763
800
|
//# sourceMappingURL=index.js.map
|