@xuda.io/xuda-dbs-plugin-xuda 1.0.2 → 1.0.4
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/index.mjs +15 -0
- package/package.json +2 -2
- package/setup.mjs +1 -1
package/index.mjs
CHANGED
@@ -1002,6 +1002,7 @@ export const Delete = async (e, db, table_obj) => {
|
|
1002
1002
|
return { code: -110, data: error };
|
1003
1003
|
}
|
1004
1004
|
};
|
1005
|
+
|
1005
1006
|
export const Restore = async (e, db, table_obj) => {
|
1006
1007
|
var docs_to_restore = [];
|
1007
1008
|
const data = await db.fetch({ keys: e.ids });
|
@@ -1023,3 +1024,17 @@ export const Restore = async (e, db, table_obj) => {
|
|
1023
1024
|
return { code: -110, data: error };
|
1024
1025
|
}
|
1025
1026
|
};
|
1027
|
+
|
1028
|
+
export const test_connection = async (node_modules_path, setup_doc) => {
|
1029
|
+
try {
|
1030
|
+
if (!setup_doc.db_connection_string) throw "db_connection_string missing";
|
1031
|
+
const nano = require(node_modules_path + "/nano")(setup_doc);
|
1032
|
+
if (!nano) {
|
1033
|
+
return { code: -450, data: "connection error" };
|
1034
|
+
}
|
1035
|
+
await nano.get("_design");
|
1036
|
+
return { code: 450, data: nano };
|
1037
|
+
} catch (err) {
|
1038
|
+
return { code: -450, data: err };
|
1039
|
+
}
|
1040
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@xuda.io/xuda-dbs-plugin-xuda",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.4",
|
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"
|
@@ -13,7 +13,7 @@
|
|
13
13
|
],
|
14
14
|
"author": "xuda.io",
|
15
15
|
"license": "Proprietary software licenses",
|
16
|
-
"svg_icon": "<svg xmlns=\"http://www.w3.org/2000/svg\"
|
16
|
+
"svg_icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" width=\"24px\" height=\"24px\" viewBox=\"0 0 256 256\" strokeWidth={1.5} stroke=\"currentColor\" className=\"w-6 h-6\"><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125\" /></svg>",
|
17
17
|
"dependencies": {
|
18
18
|
"nano": "^10.1.0"
|
19
19
|
}
|
package/setup.mjs
CHANGED
@@ -3,7 +3,7 @@ export function tabs(doc) {
|
|
3
3
|
accounts: {
|
4
4
|
svg_icon:
|
5
5
|
'<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-palette" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M12 21a9 9 0 1 1 0 -18a9 8 0 0 1 9 8a4.5 4 0 0 1 -4.5 4h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25" /> <circle cx="7.5" cy="10.5" r=".5" fill="currentColor" /> <circle cx="12" cy="7.5" r=".5" fill="currentColor" /> <circle cx="16.5" cy="10.5" r=".5" fill="currentColor" /> </svg>',
|
6
|
-
text: "
|
6
|
+
text: "Connections",
|
7
7
|
type: "multi",
|
8
8
|
|
9
9
|
fields: {
|