x-block-lib 0.6.45 → 0.6.46

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.
Files changed (2) hide show
  1. package/dist/index.js +55 -49
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3903,13 +3903,19 @@ r.forBlock.call_func_v1 = function(e) {
3903
3903
  const c = n(o.space.name + "/" + o.func.name);
3904
3904
  let l = "";
3905
3905
  o.func.outputs.forEach(({ id: h }) => {
3906
- l += `${t}var __output_${h}__ = result[${n(h)}];
3906
+ l += `${t}var __output_${h}__ = __result__[${n(h)}];
3907
3907
  `;
3908
3908
  });
3909
3909
  const _ = r.statementToCode(o, "CALLBACK");
3910
3910
  return `{
3911
3911
  ${a}
3912
- var result = __callFuncV1__(${i}, ${s}, __inputs__, __getEnvV1__(), ${c});
3912
+ ${t}var __result__ = __callFuncV1__(
3913
+ ${t}${t}${i},
3914
+ ${t}${t}${s},
3915
+ ${t}${t}__inputs__,
3916
+ ${t}${t}__getEnvV1__(),
3917
+ ${t}${t}${c}
3918
+ ${t});
3913
3919
  ${l}${_}}
3914
3920
  `;
3915
3921
  };
@@ -4095,10 +4101,10 @@ r.forBlock.call_func_internal_v1 = function(e) {
4095
4101
  const _ = r.statementToCode(o, "CALLBACK");
4096
4102
  return `{
4097
4103
  ${a}
4098
- var __result__ = __callFuncInternalV1__(${i}, ${s}, __inputs__);
4099
- if (!__result__.success) {
4100
- throw 'call func<${c}> failed, reason: ' + __result__.message;
4101
- }
4104
+ ${t}var __result__ = __callFuncInternalV1__(${i}, ${s}, __inputs__);
4105
+ ${t}if (!__result__.success) {
4106
+ ${t}${t}throw 'call func<${c}> failed, reason: ' + __result__.message;
4107
+ ${t}}
4102
4108
  ${l}${_}}
4103
4109
  `;
4104
4110
  };
@@ -4321,22 +4327,21 @@ const $f = {
4321
4327
  },
4322
4328
  rebuildBlocks_: function() {
4323
4329
  this.isInsertionMarker() || Ge(this, [
4324
- ["SUCCESS", "__success__", "PARAM_SUCCESS", !0],
4325
- ["MESSAGE", "__message__", "PARAM_MESSAGE", !0],
4326
- ["DATA", "__data__", "PARAM_DATA", !0]
4330
+ ["SUCCESS", "__result__.success", "PARAM_SUCCESS", !0],
4331
+ ["MESSAGE", "__result__.message", "PARAM_MESSAGE", !0],
4332
+ ["DATA", "__result__.data", "PARAM_DATA", !0]
4327
4333
  ]);
4328
4334
  }
4329
4335
  };
4330
4336
  k.add_data_v1 = $f;
4331
4337
  r.forBlock.add_data_v1 = function(e) {
4332
- const t = r.INDENT, n = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", o = r.statementToCode(e, "HANDLE");
4338
+ const t = r.INDENT, n = "typeof(__tx__) !== 'undefined' ? __tx__ : null", o = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", i = r.statementToCode(e, "HANDLE");
4333
4339
  return `{
4334
- ${t}var tx = typeof(__tx__) !== 'undefined' ? __tx__ : null;
4335
- ${t}var res = __addDataV1__(tx, ${n});
4336
- ${t}var __success__ = res.success;
4337
- ${t}var __message__ = res.message;
4338
- ${t}var __data__ = res.data;
4339
- ${o}}
4340
+ ${t}var __result__ = __addDataV1__(
4341
+ ${t}${t}${n},
4342
+ ${t}${t}${o}
4343
+ ${t});
4344
+ ${i}}
4340
4345
  `;
4341
4346
  };
4342
4347
  function kn() {
@@ -4635,20 +4640,21 @@ const zf = {
4635
4640
  },
4636
4641
  rebuildBlocks_: function() {
4637
4642
  this.isInsertionMarker() || Ge(this, [
4638
- ["SUCCESS", "__success__", "PARAM_SUCCESS", !0],
4639
- ["MESSAGE", "__message__", "PARAM_MESSAGE", !0]
4643
+ ["SUCCESS", "__result__.success", "PARAM_SUCCESS", !0],
4644
+ ["MESSAGE", "__result__.message", "PARAM_MESSAGE", !0]
4640
4645
  ]);
4641
4646
  }
4642
4647
  };
4643
4648
  k.delete_data_v1 = zf;
4644
4649
  r.forBlock.delete_data_v1 = function(e) {
4645
- const t = r.INDENT, n = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", o = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null", i = r.statementToCode(e, "HANDLE");
4650
+ const t = r.INDENT, n = "typeof(__tx__) !== 'undefined' ? __tx__ : null", o = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", i = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null", s = r.statementToCode(e, "HANDLE");
4646
4651
  return `{
4647
- ${t}var tx = typeof(__tx__) !== 'undefined' ? __tx__ : null;
4648
- ${t}var res = __deleteDataV1__(tx, ${n}, ${o});
4649
- ${t}var __success__ = res.success;
4650
- ${t}var __message__ = res.message;
4651
- ${i}}
4652
+ ${t}var __result__ = __deleteDataV1__(
4653
+ ${t}${t}${n},
4654
+ ${t}${t}${o},
4655
+ ${t}${t}${i}
4656
+ ${t});
4657
+ ${s}}
4652
4658
  `;
4653
4659
  };
4654
4660
  C([
@@ -4694,27 +4700,27 @@ const Jf = {
4694
4700
  },
4695
4701
  rebuildBlocks_: function() {
4696
4702
  this.isInsertionMarker() || Ge(this, [
4697
- ["SUCCESS", "__success__", "PARAM_SUCCESS", !0],
4698
- ["MESSAGE", "__message__", "PARAM_MESSAGE", !0],
4699
- ["MAIN_DATA", "__mainData__", "PARAM_MAIN_DATA", !0],
4700
- ["EXTRA_DATA", "__extraData__", "PARAM_EXTRA_DATA", !0]
4703
+ ["SUCCESS", "__result__.success", "PARAM_SUCCESS", !0],
4704
+ ["MESSAGE", "__result__.message", "PARAM_MESSAGE", !0],
4705
+ ["MAIN_DATA", "__result__.mainData", "PARAM_MAIN_DATA", !0],
4706
+ ["EXTRA_DATA", "__result__.extraData", "PARAM_EXTRA_DATA", !0]
4701
4707
  ]);
4702
4708
  }
4703
4709
  };
4704
4710
  k.query_data_v1 = Jf;
4705
4711
  r.forBlock.query_data_v1 = function(e) {
4706
- const t = r.INDENT, n = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", o = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null";
4707
- let i = "null";
4708
- e.getInput("EXTRA") && (i = r.valueToCode(e, "EXTRA", u.ATOMIC) || "null");
4709
- const s = r.statementToCode(e, "HANDLE");
4712
+ const t = r.INDENT, n = "typeof(__tx__) !== 'undefined' ? __tx__ : null", o = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", i = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null";
4713
+ let s = "null";
4714
+ e.getInput("EXTRA") && (s = r.valueToCode(e, "EXTRA", u.ATOMIC) || "null");
4715
+ const a = r.statementToCode(e, "HANDLE");
4710
4716
  return `{
4711
- ${t}var tx = typeof(__tx__) !== 'undefined' ? __tx__ : null;
4712
- ${t}var res = __queryDataV1__(tx, ${n}, ${o}, ${i});
4713
- ${t}var __success__ = res.success;
4714
- ${t}var __message__ = res.message;
4715
- ${t}var __mainData__ = res.mainData;
4716
- ${t}var __extraData__ = res.extraData;
4717
- ${s}}
4717
+ ${t}var __result__ = __queryDataV1__(
4718
+ ${t}${t}${n},
4719
+ ${t}${t}${o},
4720
+ ${t}${t}${i},
4721
+ ${t}${t}${s}
4722
+ ${t});
4723
+ ${a}}
4718
4724
  `;
4719
4725
  };
4720
4726
  C([
@@ -5316,22 +5322,22 @@ const im = {
5316
5322
  },
5317
5323
  rebuildBlocks_: function() {
5318
5324
  this.isInsertionMarker() || Ge(this, [
5319
- ["SUCCESS", "__success__", "PARAM_SUCCESS", !0],
5320
- ["MESSAGE", "__message__", "PARAM_MESSAGE", !0],
5321
- ["DATA", "__data__", "PARAM_DATA", !0]
5325
+ ["SUCCESS", "__result__.success", "PARAM_SUCCESS", !0],
5326
+ ["MESSAGE", "__result__.message", "PARAM_MESSAGE", !0],
5327
+ ["DATA", "__result__.data", "PARAM_DATA", !0]
5322
5328
  ]);
5323
5329
  }
5324
5330
  };
5325
5331
  k.update_data_v1 = im;
5326
5332
  r.forBlock.update_data_v1 = function(e) {
5327
- const t = r.INDENT, n = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", o = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null", i = r.statementToCode(e, "HANDLE");
5333
+ const t = r.INDENT, n = "typeof(__tx__) !== 'undefined' ? __tx__ : null", o = r.valueToCode(e, "TABLE", u.ATOMIC) || "null", i = r.valueToCode(e, "CONDITION", u.ATOMIC) || "null", s = r.statementToCode(e, "HANDLE");
5328
5334
  return `{
5329
- ${t}var tx = typeof(__tx__) !== 'undefined' ? __tx__ : null;
5330
- ${t}var res = __updateDataV1__(tx, ${n}, ${o});
5331
- ${t}var __success__ = res.success;
5332
- ${t}var __message__ = res.message;
5333
- ${t}var __data__ = res.data;
5334
- ${i}}
5335
+ ${t}var __result__ = __updateDataV1__(
5336
+ ${t}${t}${n},
5337
+ ${t}${t}${o},
5338
+ ${t}${t}${i}
5339
+ ${t});
5340
+ ${s}}
5335
5341
  `;
5336
5342
  };
5337
5343
  const sm = G.xml, am = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.6.45",
4
+ "version": "0.6.46",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",