@xuda.io/xuda-dbs-plugin-xuda 1.0.114 → 1.0.116

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/package.json +1 -1
  2. package/studio.mjs +7 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-dbs-plugin-xuda",
3
- "version": "1.0.114",
3
+ "version": "1.0.116",
4
4
  "description": "Xuda Database Socket for Xuda's proprietary structure powered by CouchDB",
5
5
  "scripts": {
6
6
  "pub": "npm version patch --force && npm publish --access public"
package/studio.mjs CHANGED
@@ -1,4 +1,6 @@
1
- const check_unique = async function (e, docP, table_obj, db) {
1
+ var _this = {};
2
+
3
+ export const check_unique = async function (e, docP, table_obj, db) {
2
4
  var len = docP.udfIndex.length;
3
5
  if (!len) {
4
6
  return { code: -11, data: "table must have primary index" };
@@ -51,7 +53,6 @@ const check_unique = async function (e, docP, table_obj, db) {
51
53
  valSegment
52
54
  ).props.fieldType;
53
55
  let _val = await get_cast_val(
54
- e,
55
56
  "check_unique",
56
57
  valSegment,
57
58
  _fieldType,
@@ -133,7 +134,6 @@ const get_index_json = async function (docInP, table_obj) {
133
134
  }
134
135
 
135
136
  let _val = await get_cast_val(
136
- e,
137
137
  "get_index_json",
138
138
  field_obj.id,
139
139
  field_obj.props.fieldType,
@@ -180,7 +180,7 @@ const get_cast_val = async function (e, source, attributeP, typeP, valP) {
180
180
  console.warn(source, msg);
181
181
  };
182
182
 
183
- if (e.xu_cast) {
183
+ if (_this.xu_cast) {
184
184
  return e.xu_cast(typeP, valP, success, fail);
185
185
  }
186
186
  return xu_cast(typeP, valP, success, fail);
@@ -1157,7 +1157,6 @@ const query_db = async function (e, db, table_obj) {
1157
1157
  );
1158
1158
 
1159
1159
  let field_value = await get_cast_val(
1160
- e,
1161
1160
  "dbs_update",
1162
1161
  e.field_id,
1163
1162
  _tableFieldsObj.props.fieldType,
@@ -1260,7 +1259,6 @@ export const create = async (params, resolve, reject) => {
1260
1259
  var doc = {};
1261
1260
  for await (const val of table_obj.tableFields) {
1262
1261
  doc[val.data.field_id] = await get_cast_val(
1263
- e,
1264
1262
  "dbs_create",
1265
1263
  val.data.field_id,
1266
1264
  val.props.fieldType,
@@ -1386,7 +1384,6 @@ export const update = async (params, resolve, reject) => {
1386
1384
  }
1387
1385
 
1388
1386
  doc.udfData.data[e.field_id] = await get_cast_val(
1389
- e,
1390
1387
  "dbs_update",
1391
1388
  e.field_id,
1392
1389
  _tableFieldsObj.props.fieldType,
@@ -1409,7 +1406,6 @@ export const update = async (params, resolve, reject) => {
1409
1406
  }
1410
1407
 
1411
1408
  doc.udfData.data[key] = await get_cast_val(
1412
- e,
1413
1409
  "dbs_update",
1414
1410
  key,
1415
1411
  _tableFieldsObj.props.fieldType,
@@ -1530,3 +1526,6 @@ export const create_design = async (params, resolve, reject) => {
1530
1526
  return resolve(err);
1531
1527
  }
1532
1528
  };
1529
+ export const init_module = async (params) => {
1530
+ _this.xu_cast = params.xu_cast;
1531
+ };