@xuda.io/ai_module 1.1.3699 → 1.1.3701

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 (2) hide show
  1. package/index.mjs +13 -8
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2741,10 +2741,7 @@ export const get_apps = async function (req, job_id, headers) {
2741
2741
  //////////////
2742
2742
 
2743
2743
  const app_id = await account_module.get_account_default_project_id(uid);
2744
- // const user_apps = await db_module.get_app_couch_view(app_id, 'studio_mini_apps', {
2745
- // include_docs: true,
2746
- // });
2747
-
2744
+ debugger;
2748
2745
  let user_apps = { docs: [] };
2749
2746
  if (filter_type !== 'pending') {
2750
2747
  user_apps = await db_module.find_app_couch_query(app_id, opt);
@@ -2779,12 +2776,20 @@ export const get_apps = async function (req, job_id, headers) {
2779
2776
 
2780
2777
  let docs = [];
2781
2778
  for (let doc of user_apps.docs) {
2782
- if (!doc?.studio_meta?.agent_image?.length && (!doc?.studio_meta?.thumbnail_request_ts || Date.now() - doc?.studio_meta?.thumbnail_request_ts > 120000)) {
2783
- if (headers) {
2784
- update_thumbnail('mini_app', doc, app_id, uid, job_id, headers);
2785
- }
2779
+ let reference_doc;
2780
+
2781
+ if (doc.shared_from_uid) {
2782
+ reference_doc = _.cloneDeep(doc);
2783
+ doc = await db_module.get_app_couch_doc_native(reference_doc.shared_from_app_id, reference_doc.share_item_id);
2784
+ doc.reference_doc = reference_doc;
2786
2785
  }
2787
2786
 
2787
+ // if (!doc?.studio_meta?.agent_image?.length && (!doc?.studio_meta?.thumbnail_request_ts || Date.now() - doc?.studio_meta?.thumbnail_request_ts > 120000)) {
2788
+ // if (headers) {
2789
+ // update_thumbnail('mini_app', doc, app_id, uid, job_id, headers);
2790
+ // }
2791
+ // }
2792
+
2788
2793
  doc.user_contact = await account_module.get_user_card(uid, doc.studio_meta.createdByUid);
2789
2794
 
2790
2795
  docs.push(doc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3699",
3
+ "version": "1.1.3701",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",