@xuda.io/ai_module 1.1.5415 → 1.1.5417
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 +33 -32
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6137,48 +6137,49 @@ export const modify_profile_avatar = async function (req, job_id, headers) {
|
|
|
6137
6137
|
|
|
6138
6138
|
export const get_ai_workspace_pending_counts = async function (req, job_id, headers) {
|
|
6139
6139
|
const { uid } = req;
|
|
6140
|
-
|
|
6140
|
+
const account_profile_info = await get_active_account_profile_info(uid);
|
|
6141
6141
|
try {
|
|
6142
|
-
const workspace_pending_counts_ret = await db_module.get_couch_view('xuda_team', 'pending_workspace_requests_count', {
|
|
6143
|
-
startkey: [uid, ''],
|
|
6144
|
-
endkey: [uid, 'zzzz'],
|
|
6145
|
-
reduce: true,
|
|
6146
|
-
group_level: 999,
|
|
6147
|
-
});
|
|
6148
|
-
|
|
6149
6142
|
let data = {};
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6143
|
+
if (account_profile_info.is_main) {
|
|
6144
|
+
const workspace_pending_counts_ret = await db_module.get_couch_view('xuda_team', 'pending_workspace_requests_count', {
|
|
6145
|
+
startkey: [uid, ''],
|
|
6146
|
+
endkey: [uid, 'zzzz'],
|
|
6147
|
+
reduce: true,
|
|
6148
|
+
group_level: 999,
|
|
6149
|
+
});
|
|
6155
6150
|
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6151
|
+
for (const item of workspace_pending_counts_ret.data.rows) {
|
|
6152
|
+
switch (item.key[1]) {
|
|
6153
|
+
case 'chat':
|
|
6154
|
+
data['ai_chats'] = item.value;
|
|
6155
|
+
break;
|
|
6159
6156
|
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6157
|
+
case 'ai_agent':
|
|
6158
|
+
data['ai_agents'] = item.value;
|
|
6159
|
+
break;
|
|
6163
6160
|
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
break;
|
|
6161
|
+
case 'miniapp':
|
|
6162
|
+
data['apps'] = item.value;
|
|
6163
|
+
break;
|
|
6168
6164
|
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6165
|
+
case 'contact_connection':
|
|
6166
|
+
case 'contact':
|
|
6167
|
+
data['contacts'] = item.value;
|
|
6168
|
+
break;
|
|
6172
6169
|
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6170
|
+
case 'account_profile':
|
|
6171
|
+
data['account_profiles'] = item.value;
|
|
6172
|
+
break;
|
|
6176
6173
|
|
|
6177
|
-
|
|
6178
|
-
|
|
6174
|
+
case 'user_drive':
|
|
6175
|
+
data['user_drive'] = item.value;
|
|
6176
|
+
break;
|
|
6177
|
+
|
|
6178
|
+
default:
|
|
6179
|
+
break;
|
|
6180
|
+
}
|
|
6179
6181
|
}
|
|
6180
6182
|
}
|
|
6181
|
-
|
|
6182
6183
|
return { code: 111, data };
|
|
6183
6184
|
} catch (err) {
|
|
6184
6185
|
return { code: -111, data: err.message };
|