sales-frontend-bridge 0.0.37 → 0.0.38

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
@@ -2459,7 +2459,10 @@ function PromiseWithResolvers() {
2459
2459
  return { promise, resolve, reject };
2460
2460
  }
2461
2461
  function ensureArray(arg) {
2462
- return Array.isArray(arg) ? arg : [];
2462
+ return Array.isArray(arg) ? DeepCopy(arg) : [];
2463
+ }
2464
+ function DeepCopy(arg) {
2465
+ return JSON.parse(JSON.stringify(arg));
2463
2466
  }
2464
2467
 
2465
2468
  // src/oz/utils/bridge-util/oz-wrapper-util.ts
@@ -2795,11 +2798,18 @@ async function CreateOzParam(documentList, extraData = {}) {
2795
2798
  if (data.inputJson) {
2796
2799
  result.push(`${prefix}connection.inputjson=${JSON.stringify(data.inputJson)}`);
2797
2800
  }
2798
- data.args = ensureArray(data.args);
2799
- data.args.push(`docCd=${docCode}`);
2800
- data.args.forEach((arg, idx2) => result.push(`${prefix}connection.args${idx2 + 1}=${arg}`));
2801
- data.extraParam = ensureArray(data.extraParam);
2802
- data.extraParam.forEach((param) => result.push(`${prefix}${param}`));
2801
+ const args = [
2802
+ // 모든서식에 공통으로 필요한 docCd param 추가
2803
+ `docCd=${docCode}`,
2804
+ ...ensureArray(data.args)
2805
+ ];
2806
+ args.forEach((arg, idx2) => result.push(`${prefix}connection.args${idx2 + 1}=${arg}`));
2807
+ const extraParam = [
2808
+ // connection.args의 갯수만큼 pcount 보정
2809
+ `connection.pcount=${args.length}`,
2810
+ ...ensureArray(data.extraParam)
2811
+ ];
2812
+ extraParam.forEach((param) => result.push(`${prefix}${param}`));
2803
2813
  return result;
2804
2814
  });
2805
2815
  const params = [