sales-frontend-utils 0.0.26 → 0.0.28

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 CHANGED
@@ -108,6 +108,28 @@ var isStorybookEnv = () => {
108
108
  var getBusinessWorkDivisionCode = () => {
109
109
  return location.pathname.split("/")[1] ?? "";
110
110
  };
111
+ var getDudApiHostNameFromEnvironment = (serviceCode, hostname) => {
112
+ const environment = getEnvironmentFromHostname(hostname);
113
+ switch (environment) {
114
+ /**
115
+ * local에서 호출시, rewrite동작을 위해 상대주소를 호출합니다.
116
+ * (cors이슈 해결을 위해 필수)
117
+ */
118
+ case "local":
119
+ return `${serviceCode}/api/dud`;
120
+ /**
121
+ * local 이 아닌 환경에서는 전체주소를 호출합니다.
122
+ */
123
+ case "dev":
124
+ return `https://dsp-dud-dev.hanwhalife.com:10101`;
125
+ case "stg":
126
+ return `https://dsp-dud-stg.hanwhalife.com:10102`;
127
+ case "prd":
128
+ return `https://dsp-dud.hanwhalife.com`;
129
+ default:
130
+ return "";
131
+ }
132
+ };
111
133
 
112
134
  // src/utils/user-agent-utils.ts
113
135
  var getDspExecutionEnvironment = () => {
@@ -632,7 +654,7 @@ function downloadBlob(blob, filename) {
632
654
  const link = document.createElement("a");
633
655
  link.style.display = "none";
634
656
  link.href = url;
635
- link.download = filename;
657
+ link.download = `${filename}.${getExt(blob)}`;
636
658
  document.body.appendChild(link);
637
659
  link.click();
638
660
  document.body.removeChild(link);
@@ -762,6 +784,7 @@ exports.getCurrentOSName = getCurrentOSName;
762
784
  exports.getCurrentOSVersion = getCurrentOSVersion;
763
785
  exports.getDeviceModel = getDeviceModel;
764
786
  exports.getDspExecutionEnvironment = getDspExecutionEnvironment;
787
+ exports.getDudApiHostNameFromEnvironment = getDudApiHostNameFromEnvironment;
765
788
  exports.getE2EDataIDs = getE2EDataIDs;
766
789
  exports.getEnvironmentFromHostname = getEnvironmentFromHostname;
767
790
  exports.getExt = getExt;