shuttlepro-shared 1.5.26 → 1.5.28

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.
@@ -19,11 +19,6 @@ const CategorySchema = new Schema(
19
19
  oldId: { type: String, default: "" },
20
20
  webCategoryId: { type: Number, default: null },
21
21
  parentId: { type: Schema.Types.ObjectId, ref: "Category", default: null },
22
- websiteId: {
23
- type: Schema.Types.ObjectId,
24
- ref: "Website",
25
- default: null,
26
- },
27
22
  createdBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
28
23
  updatedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
29
24
  isDeleted: { type: Boolean, default: false },
@@ -141,6 +141,7 @@ const conversationSchema = new mongoose.Schema(
141
141
  },
142
142
  workflowQueueActive: { type: Boolean, default: false },
143
143
  workflowInitiatedAt: { type: Date, default: null },
144
+ aiBotActive: { type: Boolean, default: false },
144
145
  initialWorkflowMessageId: { type: String, default: "" },
145
146
  // Soft-merge for Gmail/SMTP email chats only (provider threads stay separate)
146
147
  mergedInto: {
@@ -203,5 +204,11 @@ conversationSchema.index({
203
204
  workflowQueueActive: 1,
204
205
  platformTimestamp: -1,
205
206
  });
207
+ conversationSchema.index({
208
+ workspaceId: 1,
209
+ isSpam: 1,
210
+ aiBotActive: 1,
211
+ platformTimestamp: -1,
212
+ });
206
213
 
207
214
  module.exports = mongoose.model("Conversation", conversationSchema);
package/models/Message.js CHANGED
@@ -42,8 +42,8 @@ const newMessageSchema = new mongoose.Schema(
42
42
  activityId: { type: String, default: "" },
43
43
 
44
44
  body: {},
45
+ llmTokenUsage: { type: Schema.Types.Mixed },
45
46
  },
46
47
  { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
47
48
  );
48
-
49
49
  module.exports = mongoose.model("Message", newMessageSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.5.26",
3
+ "version": "1.5.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,9 +13,10 @@ const updateEmbedding = async (productId, workspaceId) => {
13
13
  }
14
14
 
15
15
  try {
16
- await axiosInstance.post(
17
- `${EMBEDDING_SERVICE_URL}/embedding/${workspaceId}/${productId}`
18
- );
16
+ await axiosInstance.post(`${EMBEDDING_SERVICE_URL}/embedding/product`, {
17
+ workspaceId,
18
+ productId,
19
+ });
19
20
  console.log(`✅ Updated embedding for productId: ${productId}`);
20
21
  } catch (error) {
21
22
  console.error(