@ainetwork/adk-provider-memory-mongodb 0.4.0 → 0.5.0
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/dist/{chunk-GPOFS7ZT.js → chunk-2XJ6S2W5.js} +12 -7
- package/dist/chunk-2XJ6S2W5.js.map +1 -0
- package/dist/{chunk-5CCEN7NK.js → chunk-QULDFKGZ.js} +5 -1
- package/dist/chunk-QULDFKGZ.js.map +1 -0
- package/dist/chunk-RC275GLE.js +70 -0
- package/dist/chunk-RC275GLE.js.map +1 -0
- package/dist/{chunk-NGLXQZLX.js → chunk-SJ2FHHN6.js} +13 -10
- package/dist/chunk-SJ2FHHN6.js.map +1 -0
- package/dist/index.cjs +322 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +232 -59
- package/dist/index.js.map +1 -1
- package/dist/models/messages.model.cjs +4 -0
- package/dist/models/messages.model.cjs.map +1 -1
- package/dist/models/messages.model.d.cts +14 -1
- package/dist/models/messages.model.d.ts +14 -1
- package/dist/models/messages.model.js +1 -1
- package/dist/models/threads.model.cjs +11 -6
- package/dist/models/threads.model.cjs.map +1 -1
- package/dist/models/threads.model.d.cts +22 -9
- package/dist/models/threads.model.d.ts +22 -9
- package/dist/models/threads.model.js +1 -1
- package/dist/models/user-workflow.model.cjs +105 -0
- package/dist/models/user-workflow.model.cjs.map +1 -0
- package/dist/models/user-workflow.model.d.cts +92 -0
- package/dist/models/user-workflow.model.d.ts +92 -0
- package/dist/models/user-workflow.model.js +9 -0
- package/dist/models/{workflow.model.cjs → workflow-template.model.cjs} +18 -15
- package/dist/models/workflow-template.model.cjs.map +1 -0
- package/dist/models/workflow-template.model.d.cts +60 -0
- package/dist/models/workflow-template.model.d.ts +60 -0
- package/dist/models/workflow-template.model.js +9 -0
- package/dist/models/workflow-template.model.js.map +1 -0
- package/implements/base.memory.ts +130 -12
- package/implements/thread.memory.ts +48 -22
- package/implements/user-workflow.memory.ts +87 -0
- package/implements/workflow-template.memory.ts +69 -0
- package/models/messages.model.ts +7 -0
- package/models/threads.model.ts +16 -9
- package/models/user-workflow.model.ts +91 -0
- package/models/workflow-template.model.ts +58 -0
- package/package.json +3 -3
- package/dist/chunk-5CCEN7NK.js.map +0 -1
- package/dist/chunk-GPOFS7ZT.js.map +0 -1
- package/dist/chunk-NGLXQZLX.js.map +0 -1
- package/dist/models/workflow.model.cjs.map +0 -1
- package/dist/models/workflow.model.d.cts +0 -54
- package/dist/models/workflow.model.d.ts +0 -54
- package/dist/models/workflow.model.js +0 -9
- package/implements/workflow.memory.ts +0 -78
- package/models/workflow.model.ts +0 -46
- /package/dist/models/{workflow.model.js.map → user-workflow.model.js.map} +0 -0
|
@@ -79,8 +79,12 @@ var MessageObjectSchema = new import_mongoose.Schema(
|
|
|
79
79
|
type: import_mongoose.Schema.Types.Mixed,
|
|
80
80
|
default: {}
|
|
81
81
|
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
timestamps: true
|
|
82
85
|
}
|
|
83
86
|
);
|
|
87
|
+
MessageObjectSchema.index({ threadId: 1, messageId: 1 }, { unique: true });
|
|
84
88
|
var MessageModel = import_mongoose2.default.model("Message", MessageObjectSchema);
|
|
85
89
|
// Annotate the CommonJS export names for ESM import in node:
|
|
86
90
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../models/messages.model.ts"],"sourcesContent":["import { MessageRole } from \"@ainetwork/adk/types/memory\";\nimport { type Document, Schema } from \"mongoose\";\nimport mongoose from \"mongoose\";\n\n// MessageContentObject schema\nexport const MessageContentObjectSchema = new Schema(\n\t{\n\t\ttype: { type: String, required: true },\n\t\tparts: { type: [Schema.Types.Mixed], required: true },\n\t},\n\t{ _id: false },\n);\n\n// MessageObject schema - 개별 문서로 저장\nexport const MessageObjectSchema = new Schema(\n\t{\n\t\tmessageId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\tthreadId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\tuserId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\trole: {\n\t\t\ttype: String,\n\t\t\tenum: Object.values(MessageRole),\n\t\t\trequired: true,\n\t\t},\n\t\tcontent: {\n\t\t\ttype: MessageContentObjectSchema,\n\t\t\trequired: true,\n\t\t},\n\t\ttimestamp: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tmetadata: {\n\t\t\ttype: Schema.Types.Mixed,\n\t\t\tdefault: {},\n\t\t},\n\t},\n);\n\n// Message Document interface\nexport interface MessageDocument extends Document {\n\tmessageId: string;\n\tthreadId: string;\n\tuserId: string;\n\trole: MessageRole;\n\tcontent: {\n\t\ttype: string;\n\t\tparts: any[];\n\t};\n\ttimestamp: number;\n\tmetadata?: { [key: string]: unknown };\n}\n\nexport const MessageModel = mongoose.model<MessageDocument>(\"Message\", MessageObjectSchema);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA4B;AAC5B,sBAAsC;AACtC,IAAAA,mBAAqB;AAGd,IAAM,6BAA6B,IAAI;AAAA,EAC7C;AAAA,IACC,MAAM,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IACrC,OAAO,EAAE,MAAM,CAAC,uBAAO,MAAM,KAAK,GAAG,UAAU,KAAK;AAAA,EACrD;AAAA,EACA,EAAE,KAAK,MAAM;AACd;AAGO,IAAM,sBAAsB,IAAI;AAAA,EACtC;AAAA,IACC,WAAW;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,UAAU;AAAA,MACT,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACL,MAAM;AAAA,MACN,MAAM,OAAO,OAAO,yBAAW;AAAA,MAC/B,UAAU;AAAA,IACX;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,MAAM,uBAAO,MAAM;AAAA,MACnB,SAAS,CAAC;AAAA,IACX;AAAA,EACD;AACD;
|
|
1
|
+
{"version":3,"sources":["../../models/messages.model.ts"],"sourcesContent":["import { MessageRole } from \"@ainetwork/adk/types/memory\";\nimport { type Document, Schema } from \"mongoose\";\nimport mongoose from \"mongoose\";\n\n// MessageContentObject schema\nexport const MessageContentObjectSchema = new Schema(\n\t{\n\t\ttype: { type: String, required: true },\n\t\tparts: { type: [Schema.Types.Mixed], required: true },\n\t},\n\t{ _id: false },\n);\n\n// MessageObject schema - 개별 문서로 저장\nexport const MessageObjectSchema = new Schema(\n\t{\n\t\tmessageId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\tthreadId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\tuserId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\trole: {\n\t\t\ttype: String,\n\t\t\tenum: Object.values(MessageRole),\n\t\t\trequired: true,\n\t\t},\n\t\tcontent: {\n\t\t\ttype: MessageContentObjectSchema,\n\t\t\trequired: true,\n\t\t},\n\t\ttimestamp: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tmetadata: {\n\t\t\ttype: Schema.Types.Mixed,\n\t\t\tdefault: {},\n\t\t},\n\t},\n\t{\n\t\ttimestamps: true,\n\t},\n);\n\nMessageObjectSchema.index({ threadId: 1, messageId: 1 }, { unique: true });\n\n// Message Document interface\nexport interface MessageDocument extends Document {\n\tmessageId: string;\n\tthreadId: string;\n\tuserId: string;\n\trole: MessageRole;\n\tcontent: {\n\t\ttype: string;\n\t\tparts: any[];\n\t};\n\ttimestamp: number;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n\tmetadata?: { [key: string]: unknown };\n}\n\nexport const MessageModel = mongoose.model<MessageDocument>(\"Message\", MessageObjectSchema);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA4B;AAC5B,sBAAsC;AACtC,IAAAA,mBAAqB;AAGd,IAAM,6BAA6B,IAAI;AAAA,EAC7C;AAAA,IACC,MAAM,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IACrC,OAAO,EAAE,MAAM,CAAC,uBAAO,MAAM,KAAK,GAAG,UAAU,KAAK;AAAA,EACrD;AAAA,EACA,EAAE,KAAK,MAAM;AACd;AAGO,IAAM,sBAAsB,IAAI;AAAA,EACtC;AAAA,IACC,WAAW;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,UAAU;AAAA,MACT,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACL,MAAM;AAAA,MACN,MAAM,OAAO,OAAO,yBAAW;AAAA,MAC/B,UAAU;AAAA,IACX;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,MAAM,uBAAO,MAAM;AAAA,MACnB,SAAS,CAAC;AAAA,IACX;AAAA,EACD;AAAA,EACA;AAAA,IACC,YAAY;AAAA,EACb;AACD;AAEA,oBAAoB,MAAM,EAAE,UAAU,GAAG,WAAW,EAAE,GAAG,EAAE,QAAQ,KAAK,CAAC;AAkBlE,IAAM,eAAe,iBAAAC,QAAS,MAAuB,WAAW,mBAAmB;","names":["import_mongoose","mongoose"]}
|
|
@@ -17,7 +17,12 @@ declare const MessageContentObjectSchema: Schema<any, mongoose.Model<any, any, a
|
|
|
17
17
|
} & {
|
|
18
18
|
__v: number;
|
|
19
19
|
}>;
|
|
20
|
-
declare const MessageObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {},
|
|
20
|
+
declare const MessageObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
21
|
+
timestamps: true;
|
|
22
|
+
}, {
|
|
23
|
+
createdAt: NativeDate;
|
|
24
|
+
updatedAt: NativeDate;
|
|
25
|
+
} & {
|
|
21
26
|
threadId: string;
|
|
22
27
|
userId: string;
|
|
23
28
|
messageId: string;
|
|
@@ -29,6 +34,9 @@ declare const MessageObjectSchema: Schema<any, mongoose.Model<any, any, any, any
|
|
|
29
34
|
timestamp: number;
|
|
30
35
|
metadata: any;
|
|
31
36
|
}, Document<unknown, {}, mongoose.FlatRecord<{
|
|
37
|
+
createdAt: NativeDate;
|
|
38
|
+
updatedAt: NativeDate;
|
|
39
|
+
} & {
|
|
32
40
|
threadId: string;
|
|
33
41
|
userId: string;
|
|
34
42
|
messageId: string;
|
|
@@ -40,6 +48,9 @@ declare const MessageObjectSchema: Schema<any, mongoose.Model<any, any, any, any
|
|
|
40
48
|
timestamp: number;
|
|
41
49
|
metadata: any;
|
|
42
50
|
}>, {}> & mongoose.FlatRecord<{
|
|
51
|
+
createdAt: NativeDate;
|
|
52
|
+
updatedAt: NativeDate;
|
|
53
|
+
} & {
|
|
43
54
|
threadId: string;
|
|
44
55
|
userId: string;
|
|
45
56
|
messageId: string;
|
|
@@ -65,6 +76,8 @@ interface MessageDocument extends Document {
|
|
|
65
76
|
parts: any[];
|
|
66
77
|
};
|
|
67
78
|
timestamp: number;
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
updatedAt: Date;
|
|
68
81
|
metadata?: {
|
|
69
82
|
[key: string]: unknown;
|
|
70
83
|
};
|
|
@@ -17,7 +17,12 @@ declare const MessageContentObjectSchema: Schema<any, mongoose.Model<any, any, a
|
|
|
17
17
|
} & {
|
|
18
18
|
__v: number;
|
|
19
19
|
}>;
|
|
20
|
-
declare const MessageObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {},
|
|
20
|
+
declare const MessageObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
21
|
+
timestamps: true;
|
|
22
|
+
}, {
|
|
23
|
+
createdAt: NativeDate;
|
|
24
|
+
updatedAt: NativeDate;
|
|
25
|
+
} & {
|
|
21
26
|
threadId: string;
|
|
22
27
|
userId: string;
|
|
23
28
|
messageId: string;
|
|
@@ -29,6 +34,9 @@ declare const MessageObjectSchema: Schema<any, mongoose.Model<any, any, any, any
|
|
|
29
34
|
timestamp: number;
|
|
30
35
|
metadata: any;
|
|
31
36
|
}, Document<unknown, {}, mongoose.FlatRecord<{
|
|
37
|
+
createdAt: NativeDate;
|
|
38
|
+
updatedAt: NativeDate;
|
|
39
|
+
} & {
|
|
32
40
|
threadId: string;
|
|
33
41
|
userId: string;
|
|
34
42
|
messageId: string;
|
|
@@ -40,6 +48,9 @@ declare const MessageObjectSchema: Schema<any, mongoose.Model<any, any, any, any
|
|
|
40
48
|
timestamp: number;
|
|
41
49
|
metadata: any;
|
|
42
50
|
}>, {}> & mongoose.FlatRecord<{
|
|
51
|
+
createdAt: NativeDate;
|
|
52
|
+
updatedAt: NativeDate;
|
|
53
|
+
} & {
|
|
43
54
|
threadId: string;
|
|
44
55
|
userId: string;
|
|
45
56
|
messageId: string;
|
|
@@ -65,6 +76,8 @@ interface MessageDocument extends Document {
|
|
|
65
76
|
parts: any[];
|
|
66
77
|
};
|
|
67
78
|
timestamp: number;
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
updatedAt: Date;
|
|
68
81
|
metadata?: {
|
|
69
82
|
[key: string]: unknown;
|
|
70
83
|
};
|
|
@@ -58,14 +58,19 @@ var ThreadObjectSchema = new import_mongoose.Schema(
|
|
|
58
58
|
type: String,
|
|
59
59
|
required: false
|
|
60
60
|
},
|
|
61
|
-
|
|
62
|
-
type:
|
|
63
|
-
required:
|
|
61
|
+
isPinned: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
required: false,
|
|
64
|
+
default: false
|
|
64
65
|
},
|
|
65
|
-
|
|
66
|
-
type:
|
|
67
|
-
required:
|
|
66
|
+
workflowId: {
|
|
67
|
+
type: String,
|
|
68
|
+
required: false,
|
|
69
|
+
index: true
|
|
68
70
|
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
timestamps: true
|
|
69
74
|
}
|
|
70
75
|
);
|
|
71
76
|
var ThreadModel = import_mongoose2.default.model("Thread", ThreadObjectSchema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../models/threads.model.ts"],"sourcesContent":["import { ThreadType } from \"@ainetwork/adk/types/memory\";\nimport { type Document, Schema } from \"mongoose\";\nimport mongoose from \"mongoose\";\n\nexport const ThreadObjectSchema = new Schema(\n\t{\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tenum: Object.values(ThreadType),\n\t\t\trequired: true,\n\t\t},\n\t\tthreadId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\tuserId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t},\n\t\
|
|
1
|
+
{"version":3,"sources":["../../models/threads.model.ts"],"sourcesContent":["import { ThreadType } from \"@ainetwork/adk/types/memory\";\nimport { type Document, Schema } from \"mongoose\";\nimport mongoose from \"mongoose\";\n\nexport const ThreadObjectSchema = new Schema(\n\t{\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tenum: Object.values(ThreadType),\n\t\t\trequired: true,\n\t\t},\n\t\tthreadId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\tuserId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t},\n\t\tisPinned: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: false,\n\t\t},\n\t\tworkflowId: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tindex: true,\n\t\t},\n\t},\n\t{\n\t\ttimestamps: true,\n\t},\n);\n\nexport interface ThreadDocument extends Document {\n\ttype: ThreadType;\n\tthreadId: string;\n\tuserId: string;\n\ttitle: string;\n\tisPinned: boolean;\n\tworkflowId?: string;\n\tcreatedAt: Date;\n\tupdatedAt: Date;\n}\n\nexport const ThreadModel = mongoose.model<ThreadDocument>(\"Thread\", ThreadObjectSchema);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAC3B,sBAAsC;AACtC,IAAAA,mBAAqB;AAEd,IAAM,qBAAqB,IAAI;AAAA,EACrC;AAAA,IACC,MAAM;AAAA,MACL,MAAM;AAAA,MACN,MAAM,OAAO,OAAO,wBAAU;AAAA,MAC9B,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,IACV;AAAA,IACA,YAAY;AAAA,MACX,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EACA;AAAA,IACC,YAAY;AAAA,EACb;AACD;AAaO,IAAM,cAAc,iBAAAC,QAAS,MAAsB,UAAU,kBAAkB;","names":["import_mongoose","mongoose"]}
|
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import { ThreadType } from '@ainetwork/adk/types/memory';
|
|
2
2
|
import mongoose, { Schema, Document } from 'mongoose';
|
|
3
3
|
|
|
4
|
-
declare const ThreadObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {},
|
|
4
|
+
declare const ThreadObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
5
|
+
timestamps: true;
|
|
6
|
+
}, {
|
|
7
|
+
createdAt: NativeDate;
|
|
8
|
+
updatedAt: NativeDate;
|
|
9
|
+
} & {
|
|
5
10
|
type: ThreadType;
|
|
6
11
|
threadId: string;
|
|
7
12
|
userId: string;
|
|
8
|
-
created_at: number;
|
|
9
|
-
updated_at: number;
|
|
10
13
|
title?: string | null | undefined;
|
|
14
|
+
isPinned?: boolean | null | undefined;
|
|
15
|
+
workflowId?: string | null | undefined;
|
|
11
16
|
}, Document<unknown, {}, mongoose.FlatRecord<{
|
|
17
|
+
createdAt: NativeDate;
|
|
18
|
+
updatedAt: NativeDate;
|
|
19
|
+
} & {
|
|
12
20
|
type: ThreadType;
|
|
13
21
|
threadId: string;
|
|
14
22
|
userId: string;
|
|
15
|
-
created_at: number;
|
|
16
|
-
updated_at: number;
|
|
17
23
|
title?: string | null | undefined;
|
|
24
|
+
isPinned?: boolean | null | undefined;
|
|
25
|
+
workflowId?: string | null | undefined;
|
|
18
26
|
}>, {}> & mongoose.FlatRecord<{
|
|
27
|
+
createdAt: NativeDate;
|
|
28
|
+
updatedAt: NativeDate;
|
|
29
|
+
} & {
|
|
19
30
|
type: ThreadType;
|
|
20
31
|
threadId: string;
|
|
21
32
|
userId: string;
|
|
22
|
-
created_at: number;
|
|
23
|
-
updated_at: number;
|
|
24
33
|
title?: string | null | undefined;
|
|
34
|
+
isPinned?: boolean | null | undefined;
|
|
35
|
+
workflowId?: string | null | undefined;
|
|
25
36
|
}> & {
|
|
26
37
|
_id: mongoose.Types.ObjectId;
|
|
27
38
|
} & {
|
|
@@ -32,8 +43,10 @@ interface ThreadDocument extends Document {
|
|
|
32
43
|
threadId: string;
|
|
33
44
|
userId: string;
|
|
34
45
|
title: string;
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
isPinned: boolean;
|
|
47
|
+
workflowId?: string;
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
updatedAt: Date;
|
|
37
50
|
}
|
|
38
51
|
declare const ThreadModel: mongoose.Model<ThreadDocument, {}, {}, {}, Document<unknown, {}, ThreadDocument, {}> & ThreadDocument & Required<{
|
|
39
52
|
_id: unknown;
|
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import { ThreadType } from '@ainetwork/adk/types/memory';
|
|
2
2
|
import mongoose, { Schema, Document } from 'mongoose';
|
|
3
3
|
|
|
4
|
-
declare const ThreadObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {},
|
|
4
|
+
declare const ThreadObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
5
|
+
timestamps: true;
|
|
6
|
+
}, {
|
|
7
|
+
createdAt: NativeDate;
|
|
8
|
+
updatedAt: NativeDate;
|
|
9
|
+
} & {
|
|
5
10
|
type: ThreadType;
|
|
6
11
|
threadId: string;
|
|
7
12
|
userId: string;
|
|
8
|
-
created_at: number;
|
|
9
|
-
updated_at: number;
|
|
10
13
|
title?: string | null | undefined;
|
|
14
|
+
isPinned?: boolean | null | undefined;
|
|
15
|
+
workflowId?: string | null | undefined;
|
|
11
16
|
}, Document<unknown, {}, mongoose.FlatRecord<{
|
|
17
|
+
createdAt: NativeDate;
|
|
18
|
+
updatedAt: NativeDate;
|
|
19
|
+
} & {
|
|
12
20
|
type: ThreadType;
|
|
13
21
|
threadId: string;
|
|
14
22
|
userId: string;
|
|
15
|
-
created_at: number;
|
|
16
|
-
updated_at: number;
|
|
17
23
|
title?: string | null | undefined;
|
|
24
|
+
isPinned?: boolean | null | undefined;
|
|
25
|
+
workflowId?: string | null | undefined;
|
|
18
26
|
}>, {}> & mongoose.FlatRecord<{
|
|
27
|
+
createdAt: NativeDate;
|
|
28
|
+
updatedAt: NativeDate;
|
|
29
|
+
} & {
|
|
19
30
|
type: ThreadType;
|
|
20
31
|
threadId: string;
|
|
21
32
|
userId: string;
|
|
22
|
-
created_at: number;
|
|
23
|
-
updated_at: number;
|
|
24
33
|
title?: string | null | undefined;
|
|
34
|
+
isPinned?: boolean | null | undefined;
|
|
35
|
+
workflowId?: string | null | undefined;
|
|
25
36
|
}> & {
|
|
26
37
|
_id: mongoose.Types.ObjectId;
|
|
27
38
|
} & {
|
|
@@ -32,8 +43,10 @@ interface ThreadDocument extends Document {
|
|
|
32
43
|
threadId: string;
|
|
33
44
|
userId: string;
|
|
34
45
|
title: string;
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
isPinned: boolean;
|
|
47
|
+
workflowId?: string;
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
updatedAt: Date;
|
|
37
50
|
}
|
|
38
51
|
declare const ThreadModel: mongoose.Model<ThreadDocument, {}, {}, {}, Document<unknown, {}, ThreadDocument, {}> & ThreadDocument & Required<{
|
|
39
52
|
_id: unknown;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// models/user-workflow.model.ts
|
|
31
|
+
var user_workflow_model_exports = {};
|
|
32
|
+
__export(user_workflow_model_exports, {
|
|
33
|
+
UserWorkflowModel: () => UserWorkflowModel,
|
|
34
|
+
UserWorkflowObjectSchema: () => UserWorkflowObjectSchema
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(user_workflow_model_exports);
|
|
37
|
+
var import_mongoose = require("mongoose");
|
|
38
|
+
var import_mongoose2 = __toESM(require("mongoose"), 1);
|
|
39
|
+
var UserWorkflowObjectSchema = new import_mongoose.Schema(
|
|
40
|
+
{
|
|
41
|
+
workflowId: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: true,
|
|
44
|
+
unique: true
|
|
45
|
+
},
|
|
46
|
+
userId: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: true,
|
|
49
|
+
index: true
|
|
50
|
+
},
|
|
51
|
+
title: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: true
|
|
54
|
+
},
|
|
55
|
+
description: {
|
|
56
|
+
type: String
|
|
57
|
+
},
|
|
58
|
+
active: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
required: true,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
templateId: {
|
|
64
|
+
type: String
|
|
65
|
+
},
|
|
66
|
+
content: {
|
|
67
|
+
type: String,
|
|
68
|
+
required: true
|
|
69
|
+
},
|
|
70
|
+
variables: {
|
|
71
|
+
type: import_mongoose.Schema.Types.Mixed
|
|
72
|
+
},
|
|
73
|
+
variableValues: {
|
|
74
|
+
type: import_mongoose.Schema.Types.Mixed
|
|
75
|
+
},
|
|
76
|
+
schedule: {
|
|
77
|
+
type: String
|
|
78
|
+
},
|
|
79
|
+
timezone: {
|
|
80
|
+
type: String
|
|
81
|
+
},
|
|
82
|
+
lastRunAt: {
|
|
83
|
+
type: Number
|
|
84
|
+
},
|
|
85
|
+
nextRunAt: {
|
|
86
|
+
type: Number
|
|
87
|
+
},
|
|
88
|
+
lastThreadId: {
|
|
89
|
+
type: String
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
timestamps: true
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
var UserWorkflowModel = import_mongoose2.default.model(
|
|
97
|
+
"UserWorkflow",
|
|
98
|
+
UserWorkflowObjectSchema
|
|
99
|
+
);
|
|
100
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
+
0 && (module.exports = {
|
|
102
|
+
UserWorkflowModel,
|
|
103
|
+
UserWorkflowObjectSchema
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=user-workflow.model.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../models/user-workflow.model.ts"],"sourcesContent":["import { type Document, Schema } from \"mongoose\";\nimport mongoose from \"mongoose\";\n\nexport const UserWorkflowObjectSchema = new Schema(\n\t{\n\t\tworkflowId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tunique: true,\n\t\t},\n\t\tuserId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true,\n\t\t},\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t},\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t\tdefault: false,\n\t\t},\n\t\ttemplateId: {\n\t\t\ttype: String,\n\t\t},\n\t\tcontent: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tvariables: {\n\t\t\ttype: Schema.Types.Mixed,\n\t\t},\n\t\tvariableValues: {\n\t\t\ttype: Schema.Types.Mixed,\n\t\t},\n\t\tschedule: {\n\t\t\ttype: String,\n\t\t},\n\t\ttimezone: {\n\t\t\ttype: String,\n\t\t},\n\t\tlastRunAt: {\n\t\t\ttype: Number,\n\t\t},\n\t\tnextRunAt: {\n\t\t\ttype: Number,\n\t\t},\n\t\tlastThreadId: {\n\t\t\ttype: String,\n\t\t},\n\t},\n\t{\n\t\ttimestamps: true,\n\t}\n);\n\nexport interface UserWorkflowDocument extends Document {\n\tworkflowId: string;\n\tuserId: string;\n\ttitle: string;\n\tdescription?: string;\n\tactive: boolean;\n\ttemplateId?: string;\n\tcontent: string;\n\tvariables?: Record<\n\t\tstring,\n\t\t{\n\t\t\tid: string;\n\t\t\tlabel: string;\n\t\t\ttype: \"select\" | \"date_range\" | \"date_parts\" | \"text\" | \"number\";\n\t\t\toptions?: Array<string>;\n\t\t\tresolveAt?: \"creation\" | \"execution\";\n\t\t}\n\t>;\n\tvariableValues?: Record<string, string>;\n\tschedule?: string;\n\ttimezone?: string;\n\tlastRunAt?: number;\n\tnextRunAt?: number;\n\tlastThreadId?: string;\n}\n\nexport const UserWorkflowModel = mongoose.model<UserWorkflowDocument>(\n\t\"UserWorkflow\",\n\tUserWorkflowObjectSchema\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsC;AACtC,IAAAA,mBAAqB;AAEd,IAAM,2BAA2B,IAAI;AAAA,EAC3C;AAAA,IACC,YAAY;AAAA,MACX,MAAM;AAAA,MACN,UAAU;AAAA,MACV,QAAQ;AAAA,IACT;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,IACV;AAAA,IACA,YAAY;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACV,MAAM,uBAAO,MAAM;AAAA,IACpB;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM,uBAAO,MAAM;AAAA,IACpB;AAAA,IACA,UAAU;AAAA,MACT,MAAM;AAAA,IACP;AAAA,IACA,UAAU;AAAA,MACT,MAAM;AAAA,IACP;AAAA,IACA,WAAW;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,WAAW;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,cAAc;AAAA,MACb,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA;AAAA,IACC,YAAY;AAAA,EACb;AACD;AA4BO,IAAM,oBAAoB,iBAAAC,QAAS;AAAA,EACzC;AAAA,EACA;AACD;","names":["import_mongoose","mongoose"]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import mongoose, { Schema, Document } from 'mongoose';
|
|
2
|
+
|
|
3
|
+
declare const UserWorkflowObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
4
|
+
timestamps: true;
|
|
5
|
+
}, {
|
|
6
|
+
createdAt: NativeDate;
|
|
7
|
+
updatedAt: NativeDate;
|
|
8
|
+
} & {
|
|
9
|
+
userId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
workflowId: string;
|
|
12
|
+
content: string;
|
|
13
|
+
active: boolean;
|
|
14
|
+
description?: string | null | undefined;
|
|
15
|
+
templateId?: string | null | undefined;
|
|
16
|
+
variables?: any;
|
|
17
|
+
variableValues?: any;
|
|
18
|
+
schedule?: string | null | undefined;
|
|
19
|
+
timezone?: string | null | undefined;
|
|
20
|
+
lastRunAt?: number | null | undefined;
|
|
21
|
+
nextRunAt?: number | null | undefined;
|
|
22
|
+
lastThreadId?: string | null | undefined;
|
|
23
|
+
}, Document<unknown, {}, mongoose.FlatRecord<{
|
|
24
|
+
createdAt: NativeDate;
|
|
25
|
+
updatedAt: NativeDate;
|
|
26
|
+
} & {
|
|
27
|
+
userId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
workflowId: string;
|
|
30
|
+
content: string;
|
|
31
|
+
active: boolean;
|
|
32
|
+
description?: string | null | undefined;
|
|
33
|
+
templateId?: string | null | undefined;
|
|
34
|
+
variables?: any;
|
|
35
|
+
variableValues?: any;
|
|
36
|
+
schedule?: string | null | undefined;
|
|
37
|
+
timezone?: string | null | undefined;
|
|
38
|
+
lastRunAt?: number | null | undefined;
|
|
39
|
+
nextRunAt?: number | null | undefined;
|
|
40
|
+
lastThreadId?: string | null | undefined;
|
|
41
|
+
}>, {}> & mongoose.FlatRecord<{
|
|
42
|
+
createdAt: NativeDate;
|
|
43
|
+
updatedAt: NativeDate;
|
|
44
|
+
} & {
|
|
45
|
+
userId: string;
|
|
46
|
+
title: string;
|
|
47
|
+
workflowId: string;
|
|
48
|
+
content: string;
|
|
49
|
+
active: boolean;
|
|
50
|
+
description?: string | null | undefined;
|
|
51
|
+
templateId?: string | null | undefined;
|
|
52
|
+
variables?: any;
|
|
53
|
+
variableValues?: any;
|
|
54
|
+
schedule?: string | null | undefined;
|
|
55
|
+
timezone?: string | null | undefined;
|
|
56
|
+
lastRunAt?: number | null | undefined;
|
|
57
|
+
nextRunAt?: number | null | undefined;
|
|
58
|
+
lastThreadId?: string | null | undefined;
|
|
59
|
+
}> & {
|
|
60
|
+
_id: mongoose.Types.ObjectId;
|
|
61
|
+
} & {
|
|
62
|
+
__v: number;
|
|
63
|
+
}>;
|
|
64
|
+
interface UserWorkflowDocument extends Document {
|
|
65
|
+
workflowId: string;
|
|
66
|
+
userId: string;
|
|
67
|
+
title: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
active: boolean;
|
|
70
|
+
templateId?: string;
|
|
71
|
+
content: string;
|
|
72
|
+
variables?: Record<string, {
|
|
73
|
+
id: string;
|
|
74
|
+
label: string;
|
|
75
|
+
type: "select" | "date_range" | "date_parts" | "text" | "number";
|
|
76
|
+
options?: Array<string>;
|
|
77
|
+
resolveAt?: "creation" | "execution";
|
|
78
|
+
}>;
|
|
79
|
+
variableValues?: Record<string, string>;
|
|
80
|
+
schedule?: string;
|
|
81
|
+
timezone?: string;
|
|
82
|
+
lastRunAt?: number;
|
|
83
|
+
nextRunAt?: number;
|
|
84
|
+
lastThreadId?: string;
|
|
85
|
+
}
|
|
86
|
+
declare const UserWorkflowModel: mongoose.Model<UserWorkflowDocument, {}, {}, {}, Document<unknown, {}, UserWorkflowDocument, {}> & UserWorkflowDocument & Required<{
|
|
87
|
+
_id: unknown;
|
|
88
|
+
}> & {
|
|
89
|
+
__v: number;
|
|
90
|
+
}, any>;
|
|
91
|
+
|
|
92
|
+
export { type UserWorkflowDocument, UserWorkflowModel, UserWorkflowObjectSchema };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import mongoose, { Schema, Document } from 'mongoose';
|
|
2
|
+
|
|
3
|
+
declare const UserWorkflowObjectSchema: Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
4
|
+
timestamps: true;
|
|
5
|
+
}, {
|
|
6
|
+
createdAt: NativeDate;
|
|
7
|
+
updatedAt: NativeDate;
|
|
8
|
+
} & {
|
|
9
|
+
userId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
workflowId: string;
|
|
12
|
+
content: string;
|
|
13
|
+
active: boolean;
|
|
14
|
+
description?: string | null | undefined;
|
|
15
|
+
templateId?: string | null | undefined;
|
|
16
|
+
variables?: any;
|
|
17
|
+
variableValues?: any;
|
|
18
|
+
schedule?: string | null | undefined;
|
|
19
|
+
timezone?: string | null | undefined;
|
|
20
|
+
lastRunAt?: number | null | undefined;
|
|
21
|
+
nextRunAt?: number | null | undefined;
|
|
22
|
+
lastThreadId?: string | null | undefined;
|
|
23
|
+
}, Document<unknown, {}, mongoose.FlatRecord<{
|
|
24
|
+
createdAt: NativeDate;
|
|
25
|
+
updatedAt: NativeDate;
|
|
26
|
+
} & {
|
|
27
|
+
userId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
workflowId: string;
|
|
30
|
+
content: string;
|
|
31
|
+
active: boolean;
|
|
32
|
+
description?: string | null | undefined;
|
|
33
|
+
templateId?: string | null | undefined;
|
|
34
|
+
variables?: any;
|
|
35
|
+
variableValues?: any;
|
|
36
|
+
schedule?: string | null | undefined;
|
|
37
|
+
timezone?: string | null | undefined;
|
|
38
|
+
lastRunAt?: number | null | undefined;
|
|
39
|
+
nextRunAt?: number | null | undefined;
|
|
40
|
+
lastThreadId?: string | null | undefined;
|
|
41
|
+
}>, {}> & mongoose.FlatRecord<{
|
|
42
|
+
createdAt: NativeDate;
|
|
43
|
+
updatedAt: NativeDate;
|
|
44
|
+
} & {
|
|
45
|
+
userId: string;
|
|
46
|
+
title: string;
|
|
47
|
+
workflowId: string;
|
|
48
|
+
content: string;
|
|
49
|
+
active: boolean;
|
|
50
|
+
description?: string | null | undefined;
|
|
51
|
+
templateId?: string | null | undefined;
|
|
52
|
+
variables?: any;
|
|
53
|
+
variableValues?: any;
|
|
54
|
+
schedule?: string | null | undefined;
|
|
55
|
+
timezone?: string | null | undefined;
|
|
56
|
+
lastRunAt?: number | null | undefined;
|
|
57
|
+
nextRunAt?: number | null | undefined;
|
|
58
|
+
lastThreadId?: string | null | undefined;
|
|
59
|
+
}> & {
|
|
60
|
+
_id: mongoose.Types.ObjectId;
|
|
61
|
+
} & {
|
|
62
|
+
__v: number;
|
|
63
|
+
}>;
|
|
64
|
+
interface UserWorkflowDocument extends Document {
|
|
65
|
+
workflowId: string;
|
|
66
|
+
userId: string;
|
|
67
|
+
title: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
active: boolean;
|
|
70
|
+
templateId?: string;
|
|
71
|
+
content: string;
|
|
72
|
+
variables?: Record<string, {
|
|
73
|
+
id: string;
|
|
74
|
+
label: string;
|
|
75
|
+
type: "select" | "date_range" | "date_parts" | "text" | "number";
|
|
76
|
+
options?: Array<string>;
|
|
77
|
+
resolveAt?: "creation" | "execution";
|
|
78
|
+
}>;
|
|
79
|
+
variableValues?: Record<string, string>;
|
|
80
|
+
schedule?: string;
|
|
81
|
+
timezone?: string;
|
|
82
|
+
lastRunAt?: number;
|
|
83
|
+
nextRunAt?: number;
|
|
84
|
+
lastThreadId?: string;
|
|
85
|
+
}
|
|
86
|
+
declare const UserWorkflowModel: mongoose.Model<UserWorkflowDocument, {}, {}, {}, Document<unknown, {}, UserWorkflowDocument, {}> & UserWorkflowDocument & Required<{
|
|
87
|
+
_id: unknown;
|
|
88
|
+
}> & {
|
|
89
|
+
__v: number;
|
|
90
|
+
}, any>;
|
|
91
|
+
|
|
92
|
+
export { type UserWorkflowDocument, UserWorkflowModel, UserWorkflowObjectSchema };
|
|
@@ -27,25 +27,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// models/workflow.model.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
// models/workflow-template.model.ts
|
|
31
|
+
var workflow_template_model_exports = {};
|
|
32
|
+
__export(workflow_template_model_exports, {
|
|
33
|
+
WorkflowTemplateModel: () => WorkflowTemplateModel,
|
|
34
|
+
WorkflowTemplateObjectSchema: () => WorkflowTemplateObjectSchema
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(workflow_template_model_exports);
|
|
37
37
|
var import_mongoose = require("mongoose");
|
|
38
38
|
var import_mongoose2 = __toESM(require("mongoose"), 1);
|
|
39
|
-
var
|
|
39
|
+
var WorkflowTemplateObjectSchema = new import_mongoose.Schema(
|
|
40
40
|
{
|
|
41
|
-
|
|
41
|
+
templateId: {
|
|
42
42
|
type: String,
|
|
43
43
|
required: true,
|
|
44
44
|
unique: true
|
|
45
45
|
},
|
|
46
|
-
userId: {
|
|
47
|
-
type: String
|
|
48
|
-
},
|
|
49
46
|
title: {
|
|
50
47
|
type: String,
|
|
51
48
|
required: true
|
|
@@ -62,16 +59,22 @@ var WorkflowObjectSchema = new import_mongoose.Schema(
|
|
|
62
59
|
content: {
|
|
63
60
|
type: String,
|
|
64
61
|
required: true
|
|
62
|
+
},
|
|
63
|
+
variables: {
|
|
64
|
+
type: import_mongoose.Schema.Types.Mixed
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
timestamps: true
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
var
|
|
71
|
+
var WorkflowTemplateModel = import_mongoose2.default.model(
|
|
72
|
+
"WorkflowTemplate",
|
|
73
|
+
WorkflowTemplateObjectSchema
|
|
74
|
+
);
|
|
72
75
|
// Annotate the CommonJS export names for ESM import in node:
|
|
73
76
|
0 && (module.exports = {
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
WorkflowTemplateModel,
|
|
78
|
+
WorkflowTemplateObjectSchema
|
|
76
79
|
});
|
|
77
|
-
//# sourceMappingURL=workflow.model.cjs.map
|
|
80
|
+
//# sourceMappingURL=workflow-template.model.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../models/workflow-template.model.ts"],"sourcesContent":["import { type Document, Schema } from \"mongoose\";\nimport mongoose from \"mongoose\";\n\nexport const WorkflowTemplateObjectSchema = new Schema(\n\t{\n\t\ttemplateId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tunique: true,\n\t\t},\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t\tdefault: false,\n\t\t},\n\t\tcontent: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tvariables: {\n\t\t\ttype: Schema.Types.Mixed,\n\t\t},\n\t},\n\t{\n\t\ttimestamps: true,\n\t}\n);\n\nexport interface WorkflowTemplateDocument extends Document {\n\ttemplateId: string;\n\ttitle: string;\n\tdescription: string;\n\tactive: boolean;\n\tcontent: string;\n\tvariables?: Record<\n\t\tstring,\n\t\t{\n\t\t\tid: string;\n\t\t\tlabel: string;\n\t\t\ttype: \"select\" | \"date_range\" | \"date_parts\" | \"text\" | \"number\";\n\t\t\toptions?: Array<string>;\n\t\t\tresolveAt?: \"creation\" | \"execution\";\n\t\t}\n\t>;\n}\n\nexport const WorkflowTemplateModel = mongoose.model<WorkflowTemplateDocument>(\n\t\"WorkflowTemplate\",\n\tWorkflowTemplateObjectSchema\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsC;AACtC,IAAAA,mBAAqB;AAEd,IAAM,+BAA+B,IAAI;AAAA,EAC/C;AAAA,IACC,YAAY;AAAA,MACX,MAAM;AAAA,MACN,UAAU;AAAA,MACV,QAAQ;AAAA,IACT;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACV,MAAM,uBAAO,MAAM;AAAA,IACpB;AAAA,EACD;AAAA,EACA;AAAA,IACC,YAAY;AAAA,EACb;AACD;AAoBO,IAAM,wBAAwB,iBAAAC,QAAS;AAAA,EAC7C;AAAA,EACA;AACD;","names":["import_mongoose","mongoose"]}
|