@xuda.io/xuda-worker-bundle-min 1.3.897 → 1.3.899
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.js +16 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7117,6 +7117,22 @@ func.utils.connect_pouchdb = async function (SESSION_ID) {
|
|
|
7117
7117
|
return new PouchDB("xuda_rt_" + app_id);
|
|
7118
7118
|
};
|
|
7119
7119
|
|
|
7120
|
+
func.utils.validate_pouchdb = async function (SESSION_ID) {
|
|
7121
|
+
const app_id = SESSION_OBJ[SESSION_ID].app_id;
|
|
7122
|
+
const db = new PouchDB("xuda_rt_" + app_id);
|
|
7123
|
+
db.info()
|
|
7124
|
+
.then((info) => {
|
|
7125
|
+
console.log("Database exists", info);
|
|
7126
|
+
})
|
|
7127
|
+
.catch((error) => {
|
|
7128
|
+
if (error.status === 404) {
|
|
7129
|
+
throw new Error("Database does not exist");
|
|
7130
|
+
} else {
|
|
7131
|
+
throw new Error("Error accessing database", error);
|
|
7132
|
+
}
|
|
7133
|
+
});
|
|
7134
|
+
};
|
|
7135
|
+
|
|
7120
7136
|
func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
|
|
7121
7137
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
7122
7138
|
|