@xuda.io/xuda-dbs-plugin-xuda 1.0.153 → 1.0.155

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 (3) hide show
  1. package/package.json +1 -1
  2. package/server.js +7 -2
  3. package/studio.mjs +9 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-dbs-plugin-xuda",
3
- "version": "1.0.153",
3
+ "version": "1.0.155",
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/server.js CHANGED
@@ -957,14 +957,18 @@ exports.create = async (params, setup_doc, resolve, reject) => {
957
957
  return doc;
958
958
  };
959
959
 
960
+ const get_uuid = function (app_id) {
961
+ return "dbs_" + app_id.substr(0, 3) + "_" + crypto.randomUUID();
962
+ };
960
963
  const batch = async function () {
961
964
  var docs = [];
962
965
  try {
963
966
  for await (var val of e.table_data) {
964
967
  var doc = {
968
+ _id: get_uuid(e.app_id),
965
969
  docType: "database",
966
-
967
970
  user: e.uid,
971
+ app_id: e.app_id,
968
972
  stat: 3,
969
973
  udfData: {
970
974
  udffileid: e.table_id,
@@ -997,9 +1001,10 @@ exports.create = async (params, setup_doc, resolve, reject) => {
997
1001
  };
998
1002
  const single = async function () {
999
1003
  var doc = {
1004
+ _id: get_uuid(e.app_id),
1000
1005
  docType: "database",
1001
-
1002
1006
  user: e.uid,
1007
+ app_id: e.app_id,
1003
1008
  stat: 3,
1004
1009
  udfData: {
1005
1010
  udffileid: e.table_id,
package/studio.mjs CHANGED
@@ -1004,16 +1004,20 @@ export const create = async (params, resolve, reject) => {
1004
1004
 
1005
1005
  return doc;
1006
1006
  };
1007
-
1007
+ const get_uuid = function (app_id) {
1008
+ return "dbs_" + app_id.substr(0, 3) + "_" + crypto.randomUUID();
1009
+ };
1008
1010
  const batch = async function () {
1009
1011
  var docs = [];
1010
1012
  try {
1011
1013
  for await (var val of e.table_data) {
1012
1014
  var doc = {
1013
- _id: crypto.randomUUID(),
1015
+ _id: get_uuid(e.app_id),
1014
1016
  docType: "database",
1015
1017
  user: e.uid,
1018
+ app_id: e.app_id,
1016
1019
  stat: 3,
1020
+ source: "dbs",
1017
1021
  udfData: {
1018
1022
  udffileid: e.table_id,
1019
1023
  data: await create_data_obj(val),
@@ -1045,10 +1049,12 @@ export const create = async (params, resolve, reject) => {
1045
1049
  };
1046
1050
  const single = async function () {
1047
1051
  var doc = {
1048
- _id: crypto.randomUUID(),
1052
+ _id: get_uuid(e.app_id),
1049
1053
  docType: "database",
1050
1054
  user: e.uid,
1055
+ app_id: e.app_id,
1051
1056
  stat: 3,
1057
+ source: "dbs",
1052
1058
  udfData: {
1053
1059
  udffileid: e.table_id,
1054
1060
  data: await create_data_obj(e.table_data),