@xuda.io/xuda-worker-bundle 1.3.2704 → 1.3.2706
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 +13 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2048,6 +2048,17 @@ func.common.db = async function (SESSION_ID, serviceP, dataP, opt = {}, dsSessio
|
|
|
2048
2048
|
if (!SESSION_OBJ?.[SESSION_ID]?.rpi_http_methods?.includes(serviceP)) {
|
|
2049
2049
|
throw '';
|
|
2050
2050
|
}
|
|
2051
|
+
const is_local_draft_pouch_runtime =
|
|
2052
|
+
_session?.engine_mode === 'miniapp' &&
|
|
2053
|
+
_session?.is_draft_runtime &&
|
|
2054
|
+
Array.isArray(_session?.rpi_http_methods) &&
|
|
2055
|
+
_session.rpi_http_methods.includes('dbs_read');
|
|
2056
|
+
if (is_local_draft_pouch_runtime && ['dbs_read', 'dbs_update', 'dbs_create', 'dbs_delete'].includes(serviceP)) {
|
|
2057
|
+
return success_callback({
|
|
2058
|
+
code: 1,
|
|
2059
|
+
data: await func.db.pouch[serviceP](SESSION_ID, data),
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2051
2062
|
if (!(await func?.db?.pouch?.get_replication_stat(SESSION_ID))) throw '';
|
|
2052
2063
|
const db = await func.utils.connect_pouchdb(SESSION_ID);
|
|
2053
2064
|
switch (serviceP) {
|
|
@@ -3024,7 +3035,8 @@ func.runtime.render.build_tree = async function (options) {
|
|
|
3024
3035
|
const pathP = Array.isArray(options?.pathP) ? options.pathP.slice() : [];
|
|
3025
3036
|
const tree_path = pathP.length ? pathP.slice() : [0];
|
|
3026
3037
|
const attributes = func.runtime.render.safe_clone_tree_value(nodeP.attributes || {});
|
|
3027
|
-
|
|
3038
|
+
const has_child_nodes = Array.isArray(nodeP.children) && nodeP.children.length > 0;
|
|
3039
|
+
if (typeof nodeP.content !== 'undefined' && typeof attributes['xu-content'] === 'undefined' && !has_child_nodes && nodeP.content !== '') {
|
|
3028
3040
|
attributes['xu-content'] = func.runtime.render.safe_clone_tree_value(nodeP.content);
|
|
3029
3041
|
}
|
|
3030
3042
|
|