sales-frontend-oz 0.0.59 → 0.0.61

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
@@ -298,27 +298,6 @@ function ensureArray(arg) {
298
298
  function DeepCopy(arg) {
299
299
  return JSON.parse(JSON.stringify(arg));
300
300
  }
301
-
302
- // src/oz/utils/common-util.ts
303
- async function sleep(ms = 10) {
304
- return;
305
- }
306
- function categorizeByPageRange(data, pageCounts) {
307
- let currentPage = 1;
308
- let pageIndex = 0;
309
- const result = DeepCopy(data);
310
- result.forEach((group) => {
311
- group.startPage = currentPage;
312
- group.doc.forEach((doc) => {
313
- const pageCount = pageCounts[pageIndex++];
314
- doc.startPage = currentPage;
315
- doc.endPage = currentPage + pageCount - 1;
316
- currentPage += pageCount;
317
- });
318
- group.endPage = group.doc[group.doc.length - 1].endPage;
319
- });
320
- return result;
321
- }
322
301
  async function fetchDocument(args) {
323
302
  const { data: result } = await salesFrontendBridge.Bridge.native.downloadDocument(args);
324
303
  return result.data.map((i) => ({ ...i, startPage: 0, endPage: 0 }));
@@ -523,14 +502,12 @@ async function CreateOzParam({ documentList, extraData = {}, commonArgs = [], co
523
502
  async function setCheckEform(reportCount) {
524
503
  const count = reportCount ?? await getReportCountMemo();
525
504
  for (let i = 0; i < count; i++) {
526
- await sleep();
527
505
  await salesFrontendBridge.Bridge.nativeOz.setGlobal({ key: "checkeForm", value: "Y", docIndex: i });
528
506
  }
529
507
  }
530
508
  async function triggerClickOnAllDocuments(reportCount) {
531
509
  const count = reportCount ?? await getReportCountMemo();
532
510
  for (let i = 0; i < count; i++) {
533
- await sleep();
534
511
  const command = `INPUT_TRIGGER_CLICK_AT=${i}`;
535
512
  await salesFrontendBridge.Bridge.nativeOz.getInformation({ command });
536
513
  }
@@ -538,7 +515,6 @@ async function triggerClickOnAllDocuments(reportCount) {
538
515
  async function triggerCropImageOnAllDocuments(reportCount) {
539
516
  const count = reportCount ?? await getReportCountMemo();
540
517
  for (let i = 0; i < count; i++) {
541
- await sleep();
542
518
  await salesFrontendBridge.Bridge.nativeOz.triggerExternalEventByDocIndex({ param1: "cropimage" /* CropImage */, docIndex: Number(i) });
543
519
  }
544
520
  }
@@ -546,7 +522,6 @@ async function getTotalPageOnAllDocuments(reportCount) {
546
522
  const count = reportCount ?? await getReportCountMemo();
547
523
  const totalPages = [];
548
524
  for (let i = 0; i < count; i++) {
549
- await sleep();
550
525
  const command = `TOTAL_PAGE_OF_REPORT_FILE_AT=${i}`;
551
526
  const { data } = await salesFrontendBridge.Bridge.nativeOz.getInformation({ command });
552
527
  totalPages.push(Number(data));
@@ -573,7 +548,6 @@ async function getDraftDataHandler(rawOzRequest, documentIndexMap) {
573
548
  }
574
549
  async function triggerDraftDataByIndexList(indexList) {
575
550
  for (let i = 0; i < indexList.length; i++) {
576
- await sleep();
577
551
  await salesFrontendBridge.Bridge.nativeOz.triggerExternalEventByDocIndex({ param1: "getDraftData" /* GetDraftData */, docIndex: indexList[i] });
578
552
  }
579
553
  }
@@ -585,7 +559,6 @@ async function setFocusOnValidation(enable, reportCount) {
585
559
  return;
586
560
  }
587
561
  for (let i = 0; i < count; i++) {
588
- await sleep();
589
562
  await salesFrontendBridge.Bridge.nativeOz.setGlobal({ key: "chkFlag", value: expectedValue, docIndex: i });
590
563
  }
591
564
  return;
@@ -631,7 +604,6 @@ async function SavePdf({ policyNumber, fileName, startPage, endPage }) {
631
604
  async function checkDocumentsValidityByIndex(indexList) {
632
605
  const VALID = "";
633
606
  for (let i = 0; i < indexList.length; i++) {
634
- await sleep();
635
607
  const command = `INVALID_INFO_JSON_AT=${indexList[i]}`;
636
608
  const { data } = await salesFrontendBridge.Bridge.nativeOz.getInformation({ command });
637
609
  if (data !== VALID) {
@@ -643,7 +615,6 @@ async function checkDocumentsValidityByIndex(indexList) {
643
615
  async function validateAllPages(pageCount) {
644
616
  const count = pageCount ?? await getTotalPageMemo();
645
617
  for (let i = 1; i <= count; i++) {
646
- await sleep();
647
618
  const isValid = await checkValidPageMemo(i);
648
619
  if (!isValid) {
649
620
  return false;
@@ -684,6 +655,24 @@ var checkValidPageMemo = (() => {
684
655
  };
685
656
  return checkValidPage;
686
657
  })();
658
+
659
+ // src/oz/utils/common-util.ts
660
+ function categorizeByPageRange(data, pageCounts) {
661
+ let currentPage = 1;
662
+ let pageIndex = 0;
663
+ const result = DeepCopy(data);
664
+ result.forEach((group) => {
665
+ group.startPage = currentPage;
666
+ group.doc.forEach((doc) => {
667
+ const pageCount = pageCounts[pageIndex++];
668
+ doc.startPage = currentPage;
669
+ doc.endPage = currentPage + pageCount - 1;
670
+ currentPage += pageCount;
671
+ });
672
+ group.endPage = group.doc[group.doc.length - 1].endPage;
673
+ });
674
+ return result;
675
+ }
687
676
  var valueChangeDebounceMap = /* @__PURE__ */ new Map();
688
677
  function getDebouncedValueChangeHandler(docIndex, onValueChanged) {
689
678
  const DEBOUNCE_DELAY = 1e3 * 0.5;
@@ -733,7 +722,6 @@ exports.getTotalPageMemo = getTotalPageMemo;
733
722
  exports.getTotalPageOnAllDocuments = getTotalPageOnAllDocuments;
734
723
  exports.postFiletoDud = postFiletoDud;
735
724
  exports.setCheckEform = setCheckEform;
736
- exports.sleep = sleep;
737
725
  exports.triggerClickOnAllDocuments = triggerClickOnAllDocuments;
738
726
  exports.triggerCropImageOnAllDocuments = triggerCropImageOnAllDocuments;
739
727
  exports.triggerDraftDataByIndexList = triggerDraftDataByIndexList;