@xuda.io/xuda-dbs-plugin-xuda 1.0.154 → 1.0.156

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