@avakado.ai/schemas 1.1.7 → 1.1.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avakado.ai/schemas",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Canonical Mongo schemas, models, enums and index declarations shared by the Avakado services.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"mongoose": "^8.19.2"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
|
-
"test": "node
|
|
29
|
+
"test": "node ../../scripts/check-imports.mjs ."
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
package/src/models/Action.js
CHANGED
|
@@ -13,6 +13,7 @@ const taskNodeCoreSchema = new Schema({
|
|
|
13
13
|
schema: Schema.Types.Mixed,
|
|
14
14
|
mapper: Schema.Types.Mixed,
|
|
15
15
|
preset: Schema.Types.Mixed,
|
|
16
|
+
compiledMapper: String,
|
|
16
17
|
},
|
|
17
18
|
output: {
|
|
18
19
|
schema: Schema.Types.Mixed,
|
|
@@ -39,11 +40,11 @@ export const Task_Tree = new Schema({
|
|
|
39
40
|
const ActionSchema = new Schema({
|
|
40
41
|
name: String,
|
|
41
42
|
business: { type: Schema.Types.ObjectId, ref: 'Businesses' },
|
|
42
|
-
async: { type: Boolean, default: true },
|
|
43
|
+
// async: { type: Boolean, default: true },
|
|
43
44
|
description: String,
|
|
44
45
|
needsApproval: Boolean, // Knowledge fetching doesn't need approval
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
inputSchema: Schema.Types.Mixed,
|
|
47
|
+
outputSchema: Schema.Types.Mixed,
|
|
47
48
|
functionString: String,
|
|
48
49
|
errorFunction: String,
|
|
49
50
|
UI: Schema.Types.Mixed,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Schema } from "mongoose";
|
|
2
2
|
import { defineModel, requireDep } from "../runtime.js";
|
|
3
3
|
import { CONVERSATION_PRIORITY, CONVERSATION_STATUS } from "../enums/index.js";
|
|
4
|
-
import { Trigger } from "./Triggers.js";
|
|
5
|
-
|
|
6
4
|
const ConversationSchema = new Schema({
|
|
7
5
|
agent: { type: Schema.Types.ObjectId, ref: 'Agent' }, // the AI agent
|
|
8
6
|
business: { type: Schema.Types.ObjectId, ref: 'Businesses' },
|
|
@@ -79,16 +77,16 @@ ConversationSchema.methods.updateStatus = async function (status) {
|
|
|
79
77
|
});
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
if (businessId) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
80
|
+
// if (businessId) {
|
|
81
|
+
// const trigger = await Trigger.findOne({ business: businessId, name: "conversationStatusUpdated", type: status });
|
|
82
|
+
// for (const workflow of trigger?.workflows ?? []) {
|
|
83
|
+
// await sendKafkaMessage({
|
|
84
|
+
// topic: 'workflow-execution-trigger',
|
|
85
|
+
// message: { key: workflow.toString(), value: JSON.stringify({ conversationId }) },
|
|
86
|
+
// acks: -1
|
|
87
|
+
// });
|
|
88
|
+
// }
|
|
89
|
+
// }
|
|
92
90
|
|
|
93
91
|
return saved;
|
|
94
92
|
};
|
|
@@ -2,12 +2,11 @@ import { Schema } from "mongoose";
|
|
|
2
2
|
import { defineModel } from "../runtime.js";
|
|
3
3
|
|
|
4
4
|
const TriggerTemplateSchema = new Schema({
|
|
5
|
-
name: { type: String, required: true, unique: true }, // convers
|
|
5
|
+
name: { type: String, required: true, unique: true, index: true }, // convers
|
|
6
6
|
description: String,
|
|
7
7
|
type: String,
|
|
8
8
|
payload: Schema.Types.Mixed,
|
|
9
9
|
}, {
|
|
10
10
|
timestamps: true,
|
|
11
11
|
});
|
|
12
|
-
TriggerTemplateSchema.index({ name: 1 });
|
|
13
12
|
export const TriggerTemplate = defineModel("TriggerTemplate", TriggerTemplateSchema, "TriggerTemplate");
|