sales-frontend-utils 0.0.18 → 0.0.19

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.d.cts CHANGED
@@ -256,11 +256,6 @@ declare function fileToBase64(file: File | Blob): Promise<string>;
256
256
  */
257
257
  declare function getExt(data: string | File | Blob): string | undefined;
258
258
 
259
- declare global {
260
- interface Window {
261
- $ASTX2: any;
262
- }
263
- }
264
259
  /**
265
260
  * element를 동적으로 추가하는 경우 사용.
266
261
  * @param el HTMLElement
package/dist/index.d.ts CHANGED
@@ -256,11 +256,6 @@ declare function fileToBase64(file: File | Blob): Promise<string>;
256
256
  */
257
257
  declare function getExt(data: string | File | Blob): string | undefined;
258
258
 
259
- declare global {
260
- interface Window {
261
- $ASTX2: any;
262
- }
263
- }
264
259
  /**
265
260
  * element를 동적으로 추가하는 경우 사용.
266
261
  * @param el HTMLElement
package/dist/index.js CHANGED
@@ -573,19 +573,16 @@ var astx2_custom_default = "/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision
573
573
 
574
574
  // src/utils/astx2-utils.ts
575
575
  function addE2EObject(el, e2e_type) {
576
- const globalThis = window;
577
- if (globalThis.$ASTX2) {
578
- globalThis.$ASTX2.addE2EObject(el, e2e_type);
579
- globalThis.$ASTX2.resetE2E();
576
+ if (window.$ASTX2) {
577
+ window.$ASTX2.addE2EObject(el, e2e_type);
578
+ window.$ASTX2.resetE2E();
580
579
  }
581
580
  }
582
581
  function hasAstx2() {
583
- const globalThis = window;
584
- return !!globalThis.$ASTX2;
582
+ return !!window.$ASTX2;
585
583
  }
586
584
  var loadScript = (callback) => {
587
- const globalThis = window;
588
- if (!globalThis.$ASTX2) {
585
+ if (!window.$ASTX2) {
589
586
  console.log("dynamic load");
590
587
  const script = document.createElement("script");
591
588
  script.innerHTML = `
@@ -608,27 +605,26 @@ var init = ({
608
605
  checkServerFailure = () => {
609
606
  }
610
607
  } = {}) => {
611
- const globalThis = window;
612
- globalThis.$ASTX2.init(
608
+ window.$ASTX2.init(
613
609
  () => {
614
- globalThis.$ASTX2.initE2E();
615
- globalThis.$ASTX2.checkServer(
610
+ window.$ASTX2.initE2E();
611
+ window.$ASTX2.checkServer(
616
612
  () => {
617
613
  checkServerSuccess();
618
614
  },
619
615
  () => {
620
616
  checkServerFailure();
621
- console.error(`ASTX.checkServer() onFailure: errno=${globalThis.$ASTX2.getLastError()}`);
617
+ console.error(`ASTX.checkServer() onFailure: errno=${window.$ASTX2.getLastError()}`);
622
618
  }
623
619
  );
624
620
  initSuccess();
625
621
  },
626
622
  () => {
627
623
  initFailure();
628
- if (globalThis.$ASTX2.getLastError() === 103) {
624
+ if (window.$ASTX2.getLastError() === 103) {
629
625
  console.error("AhnLab Safe Transaction \uD074\uB77C\uC774\uC5B8\uD2B8\uAC00 \uC124\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.");
630
626
  } else {
631
- console.error(`$ASTX2.init() onFailure: errno=${globalThis.$ASTX2.getLastError()}`);
627
+ console.error(`$ASTX2.init() onFailure: errno=${window.$ASTX2.getLastError()}`);
632
628
  }
633
629
  }
634
630
  );
@@ -643,8 +639,7 @@ var initASTX2 = ({
643
639
  checkServerFailure = () => {
644
640
  }
645
641
  } = {}) => {
646
- const globalThis = window;
647
- if (globalThis.$ASTX2) {
642
+ if (window.$ASTX2) {
648
643
  init({
649
644
  initSuccess,
650
645
  initFailure,
@@ -655,16 +650,15 @@ var initASTX2 = ({
655
650
  };
656
651
  function getE2EDataIDs(ids, onSuccess, onFailure = () => {
657
652
  }) {
658
- const globalThis = window;
659
- if (globalThis.$ASTX2) {
660
- globalThis.$ASTX2.getE2EDataIDs(
653
+ if (window.$ASTX2) {
654
+ window.$ASTX2.getE2EDataIDs(
661
655
  ids,
662
656
  async (astx_data) => {
663
657
  onSuccess(astx_data);
664
658
  },
665
659
  () => {
666
660
  onFailure();
667
- console.log(`ASTX.getE2EData() onFailure: errno=${globalThis.$ASTX2.getLastError()}`);
661
+ console.log(`ASTX.getE2EData() onFailure: errno=${window.$ASTX2.getLastError()}`);
668
662
  }
669
663
  );
670
664
  }