@xuda.io/ai_module 1.1.4165 → 1.1.4166
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 +9 -7
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2649,16 +2649,16 @@ export const unarchive_ai_agent = async function (req) {
|
|
|
2649
2649
|
};
|
|
2650
2650
|
export const archive_ai_agent = async function (req) {
|
|
2651
2651
|
let { agent_id, uid } = req;
|
|
2652
|
-
|
|
2652
|
+
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
2653
2653
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
2654
2654
|
try {
|
|
2655
2655
|
const team_module = await import(`${module_path}/team_module/index.mjs`);
|
|
2656
2656
|
await team_module.validate_share_exist(uid, 'ai_agent', agent_id);
|
|
2657
2657
|
|
|
2658
|
-
let agent_doc = await db_module.get_app_couch_doc_native(app_id, agent_id);
|
|
2658
|
+
let agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, agent_id);
|
|
2659
2659
|
agent_doc.stat = 5;
|
|
2660
2660
|
agent_doc.ts = Date.now();
|
|
2661
|
-
const save_ret = await db_module.save_app_couch_doc(app_id, agent_doc);
|
|
2661
|
+
const save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, agent_doc);
|
|
2662
2662
|
|
|
2663
2663
|
return save_ret;
|
|
2664
2664
|
} catch (err) {
|
|
@@ -2669,15 +2669,16 @@ export const archive_ai_agent = async function (req) {
|
|
|
2669
2669
|
export const archive_mini_app = async function (req) {
|
|
2670
2670
|
let { prog_id, uid } = req;
|
|
2671
2671
|
|
|
2672
|
+
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
2672
2673
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
2673
2674
|
try {
|
|
2674
2675
|
const team_module = await import(`${module_path}/team_module/index.mjs`);
|
|
2675
2676
|
await team_module.validate_share_exist(uid, 'miniapp', prog_id);
|
|
2676
2677
|
|
|
2677
|
-
let prog_doc = await db_module.get_app_couch_doc_native(app_id, prog_id);
|
|
2678
|
+
let prog_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, prog_id);
|
|
2678
2679
|
prog_doc.stat = 5;
|
|
2679
2680
|
prog_doc.ts = Date.now();
|
|
2680
|
-
const save_ret = await db_module.save_app_couch_doc(app_id, prog_doc);
|
|
2681
|
+
const save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, prog_doc);
|
|
2681
2682
|
|
|
2682
2683
|
return save_ret;
|
|
2683
2684
|
} catch (err) {
|
|
@@ -2688,9 +2689,10 @@ export const archive_mini_app = async function (req) {
|
|
|
2688
2689
|
export const unarchive_mini_app = async function (req) {
|
|
2689
2690
|
let { prog_id, uid } = req;
|
|
2690
2691
|
|
|
2692
|
+
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
2691
2693
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
2692
2694
|
try {
|
|
2693
|
-
let prog_doc = await db_module.get_app_couch_doc_native(app_id, prog_id);
|
|
2695
|
+
let prog_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, prog_id);
|
|
2694
2696
|
|
|
2695
2697
|
if (prog_doc.stat !== 5) {
|
|
2696
2698
|
throw new Error('mini app is not archived');
|
|
@@ -2698,7 +2700,7 @@ export const unarchive_mini_app = async function (req) {
|
|
|
2698
2700
|
|
|
2699
2701
|
prog_doc.stat = 3;
|
|
2700
2702
|
prog_doc.ts = Date.now();
|
|
2701
|
-
const save_ret = await db_module.save_app_couch_doc(app_id, prog_doc);
|
|
2703
|
+
const save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, prog_doc);
|
|
2702
2704
|
|
|
2703
2705
|
return save_ret;
|
|
2704
2706
|
} catch (err) {
|