chatifai 1.0.26 → 1.0.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.
- package/dist/index.d.ts +9 -3
- package/dist/index.js +3 -1
- package/dist/types.d.ts +40 -3
- package/dist/types.js +10 -1
- package/index.ts +3 -1
- package/package.json +1 -1
- package/types.ts +14 -6
package/dist/index.d.ts
CHANGED
|
@@ -543,6 +543,7 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
543
543
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
544
544
|
fromEntries?: {} | null | undefined;
|
|
545
545
|
}>;
|
|
546
|
+
full_document_search: boolean;
|
|
546
547
|
users: import("mongoose").Types.DocumentArray<{
|
|
547
548
|
entries?: {} | null | undefined;
|
|
548
549
|
keys?: {} | null | undefined;
|
|
@@ -670,13 +671,13 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
670
671
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
671
672
|
fromEntries?: {} | null | undefined;
|
|
672
673
|
}>;
|
|
674
|
+
click_count: number;
|
|
673
675
|
created_at?: number | null | undefined;
|
|
674
676
|
updated_at?: number | null | undefined;
|
|
675
677
|
organization_id?: string | null | undefined;
|
|
676
678
|
instructions?: string | null | undefined;
|
|
677
679
|
query_name?: string | null | undefined;
|
|
678
680
|
query_hint?: string | null | undefined;
|
|
679
|
-
click_count?: number | null | undefined;
|
|
680
681
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
681
682
|
createdAt: NativeDate;
|
|
682
683
|
updatedAt: NativeDate;
|
|
@@ -810,6 +811,7 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
810
811
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
811
812
|
fromEntries?: {} | null | undefined;
|
|
812
813
|
}>;
|
|
814
|
+
full_document_search: boolean;
|
|
813
815
|
users: import("mongoose").Types.DocumentArray<{
|
|
814
816
|
entries?: {} | null | undefined;
|
|
815
817
|
keys?: {} | null | undefined;
|
|
@@ -937,13 +939,13 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
937
939
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
938
940
|
fromEntries?: {} | null | undefined;
|
|
939
941
|
}>;
|
|
942
|
+
click_count: number;
|
|
940
943
|
created_at?: number | null | undefined;
|
|
941
944
|
updated_at?: number | null | undefined;
|
|
942
945
|
organization_id?: string | null | undefined;
|
|
943
946
|
instructions?: string | null | undefined;
|
|
944
947
|
query_name?: string | null | undefined;
|
|
945
948
|
query_hint?: string | null | undefined;
|
|
946
|
-
click_count?: number | null | undefined;
|
|
947
949
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
948
950
|
createdAt: NativeDate;
|
|
949
951
|
updatedAt: NativeDate;
|
|
@@ -1077,6 +1079,7 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
1077
1079
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
1078
1080
|
fromEntries?: {} | null | undefined;
|
|
1079
1081
|
}>;
|
|
1082
|
+
full_document_search: boolean;
|
|
1080
1083
|
users: import("mongoose").Types.DocumentArray<{
|
|
1081
1084
|
entries?: {} | null | undefined;
|
|
1082
1085
|
keys?: {} | null | undefined;
|
|
@@ -1204,13 +1207,13 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
1204
1207
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
1205
1208
|
fromEntries?: {} | null | undefined;
|
|
1206
1209
|
}>;
|
|
1210
|
+
click_count: number;
|
|
1207
1211
|
created_at?: number | null | undefined;
|
|
1208
1212
|
updated_at?: number | null | undefined;
|
|
1209
1213
|
organization_id?: string | null | undefined;
|
|
1210
1214
|
instructions?: string | null | undefined;
|
|
1211
1215
|
query_name?: string | null | undefined;
|
|
1212
1216
|
query_hint?: string | null | undefined;
|
|
1213
|
-
click_count?: number | null | undefined;
|
|
1214
1217
|
}> & {
|
|
1215
1218
|
_id: import("mongoose").Types.ObjectId;
|
|
1216
1219
|
} & {
|
|
@@ -1324,6 +1327,7 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
|
|
|
1324
1327
|
thread_id: string;
|
|
1325
1328
|
role: "user" | "agent" | "system";
|
|
1326
1329
|
content: string;
|
|
1330
|
+
is_favorite: boolean;
|
|
1327
1331
|
created_at?: number | null | undefined;
|
|
1328
1332
|
updated_at?: number | null | undefined;
|
|
1329
1333
|
user_id?: string | null | undefined;
|
|
@@ -1336,6 +1340,7 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
|
|
|
1336
1340
|
thread_id: string;
|
|
1337
1341
|
role: "user" | "agent" | "system";
|
|
1338
1342
|
content: string;
|
|
1343
|
+
is_favorite: boolean;
|
|
1339
1344
|
created_at?: number | null | undefined;
|
|
1340
1345
|
updated_at?: number | null | undefined;
|
|
1341
1346
|
user_id?: string | null | undefined;
|
|
@@ -1348,6 +1353,7 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
|
|
|
1348
1353
|
thread_id: string;
|
|
1349
1354
|
role: "user" | "agent" | "system";
|
|
1350
1355
|
content: string;
|
|
1356
|
+
is_favorite: boolean;
|
|
1351
1357
|
created_at?: number | null | undefined;
|
|
1352
1358
|
updated_at?: number | null | undefined;
|
|
1353
1359
|
user_id?: string | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -158,8 +158,9 @@ exports.PreDefinedQuerySchema = new mongoose_1.Schema({
|
|
|
158
158
|
default: 'active',
|
|
159
159
|
required: true,
|
|
160
160
|
},
|
|
161
|
+
full_document_search: { type: Boolean, default: false },
|
|
161
162
|
users: { type: [Object] },
|
|
162
|
-
click_count: { type: Number },
|
|
163
|
+
click_count: { type: Number, default: 0 },
|
|
163
164
|
created_at: { type: Number },
|
|
164
165
|
updated_at: { type: Number },
|
|
165
166
|
}, {
|
|
@@ -206,6 +207,7 @@ exports.MessageSchema = new mongoose_1.Schema({
|
|
|
206
207
|
user_id: { type: String },
|
|
207
208
|
agent_id: { type: String },
|
|
208
209
|
content: { type: String, required: true },
|
|
210
|
+
is_favorite: { type: Boolean, default: false },
|
|
209
211
|
role: { type: String, enum: ['user', 'agent', 'system'], required: true },
|
|
210
212
|
created_at: { type: Number },
|
|
211
213
|
updated_at: { type: Number },
|
package/dist/types.d.ts
CHANGED
|
@@ -403,6 +403,7 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
|
|
|
403
403
|
bucket_name?: string | undefined;
|
|
404
404
|
processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
|
|
405
405
|
}>, "many">>;
|
|
406
|
+
full_document_search: z.ZodOptional<z.ZodBoolean>;
|
|
406
407
|
status: z.ZodDefault<z.ZodEnum<["active", "inactive", "archived"]>>;
|
|
407
408
|
users: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
408
409
|
_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -481,6 +482,7 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
|
|
|
481
482
|
bucket_name?: string | undefined;
|
|
482
483
|
processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
|
|
483
484
|
}[] | undefined;
|
|
485
|
+
full_document_search?: boolean | undefined;
|
|
484
486
|
users?: {
|
|
485
487
|
_id?: string | undefined;
|
|
486
488
|
created_at?: number | undefined;
|
|
@@ -530,6 +532,7 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
|
|
|
530
532
|
bucket_name?: string | undefined;
|
|
531
533
|
processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
|
|
532
534
|
}[] | undefined;
|
|
535
|
+
full_document_search?: boolean | undefined;
|
|
533
536
|
users?: {
|
|
534
537
|
_id?: string | undefined;
|
|
535
538
|
created_at?: number | undefined;
|
|
@@ -550,26 +553,57 @@ export declare const zodQuerySchema: z.ZodObject<{
|
|
|
550
553
|
thread_id: z.ZodOptional<z.ZodString>;
|
|
551
554
|
context_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
552
555
|
organization_id: z.ZodString;
|
|
553
|
-
|
|
556
|
+
user: z.ZodObject<{
|
|
557
|
+
user_id: z.ZodString;
|
|
558
|
+
first_name: z.ZodOptional<z.ZodString>;
|
|
559
|
+
last_name: z.ZodOptional<z.ZodString>;
|
|
560
|
+
email: z.ZodOptional<z.ZodString>;
|
|
561
|
+
}, "strip", z.ZodTypeAny, {
|
|
562
|
+
user_id: string;
|
|
563
|
+
email?: string | undefined;
|
|
564
|
+
first_name?: string | undefined;
|
|
565
|
+
last_name?: string | undefined;
|
|
566
|
+
}, {
|
|
567
|
+
user_id: string;
|
|
568
|
+
email?: string | undefined;
|
|
569
|
+
first_name?: string | undefined;
|
|
570
|
+
last_name?: string | undefined;
|
|
571
|
+
}>;
|
|
554
572
|
query: z.ZodString;
|
|
555
573
|
pre_defined_query_id: z.ZodOptional<z.ZodString>;
|
|
574
|
+
custom_instructions: z.ZodOptional<z.ZodString>;
|
|
575
|
+
full_document_search: z.ZodOptional<z.ZodBoolean>;
|
|
556
576
|
timestamp: z.ZodNumber;
|
|
557
577
|
}, "strip", z.ZodTypeAny, {
|
|
558
578
|
organization_id: string;
|
|
559
579
|
query: string;
|
|
560
|
-
|
|
580
|
+
user: {
|
|
581
|
+
user_id: string;
|
|
582
|
+
email?: string | undefined;
|
|
583
|
+
first_name?: string | undefined;
|
|
584
|
+
last_name?: string | undefined;
|
|
585
|
+
};
|
|
561
586
|
timestamp: number;
|
|
587
|
+
full_document_search?: boolean | undefined;
|
|
562
588
|
thread_id?: string | undefined;
|
|
563
589
|
context_ids?: string[] | undefined;
|
|
564
590
|
pre_defined_query_id?: string | undefined;
|
|
591
|
+
custom_instructions?: string | undefined;
|
|
565
592
|
}, {
|
|
566
593
|
organization_id: string;
|
|
567
594
|
query: string;
|
|
568
|
-
|
|
595
|
+
user: {
|
|
596
|
+
user_id: string;
|
|
597
|
+
email?: string | undefined;
|
|
598
|
+
first_name?: string | undefined;
|
|
599
|
+
last_name?: string | undefined;
|
|
600
|
+
};
|
|
569
601
|
timestamp: number;
|
|
602
|
+
full_document_search?: boolean | undefined;
|
|
570
603
|
thread_id?: string | undefined;
|
|
571
604
|
context_ids?: string[] | undefined;
|
|
572
605
|
pre_defined_query_id?: string | undefined;
|
|
606
|
+
custom_instructions?: string | undefined;
|
|
573
607
|
}>;
|
|
574
608
|
export declare const zodThreadSchema: z.ZodObject<{
|
|
575
609
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -613,6 +647,7 @@ export declare const zodMessageSchema: z.ZodObject<{
|
|
|
613
647
|
agent_id: z.ZodOptional<z.ZodString>;
|
|
614
648
|
role: z.ZodEnum<["user", "agent", "system"]>;
|
|
615
649
|
content: z.ZodString;
|
|
650
|
+
is_favorite: z.ZodOptional<z.ZodBoolean>;
|
|
616
651
|
created_at: z.ZodOptional<z.ZodNumber>;
|
|
617
652
|
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
618
653
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -625,6 +660,7 @@ export declare const zodMessageSchema: z.ZodObject<{
|
|
|
625
660
|
updated_at?: number | undefined;
|
|
626
661
|
user_id?: string | undefined;
|
|
627
662
|
agent_id?: string | undefined;
|
|
663
|
+
is_favorite?: boolean | undefined;
|
|
628
664
|
}, {
|
|
629
665
|
organization_id: string;
|
|
630
666
|
thread_id: string;
|
|
@@ -635,6 +671,7 @@ export declare const zodMessageSchema: z.ZodObject<{
|
|
|
635
671
|
updated_at?: number | undefined;
|
|
636
672
|
user_id?: string | undefined;
|
|
637
673
|
agent_id?: string | undefined;
|
|
674
|
+
is_favorite?: boolean | undefined;
|
|
638
675
|
}>;
|
|
639
676
|
export type EventAttributeType = {
|
|
640
677
|
http_request: {
|
package/dist/types.js
CHANGED
|
@@ -127,6 +127,7 @@ exports.zodPreDefinedQuerySchema = zod_1.z.object({
|
|
|
127
127
|
query: zod_1.z.string().min(1),
|
|
128
128
|
instructions: zod_1.z.string().optional(),
|
|
129
129
|
contexts: zod_1.z.array(exports.zodContextSchema.partial()).optional(),
|
|
130
|
+
full_document_search: zod_1.z.boolean().optional(),
|
|
130
131
|
status: zod_1.z.enum(['active', 'inactive', 'archived']).default('active'),
|
|
131
132
|
users: zod_1.z.array(exports.zodUserSchema.partial()).optional(),
|
|
132
133
|
click_count: zod_1.z.number().optional(),
|
|
@@ -138,9 +139,16 @@ exports.zodQuerySchema = zod_1.z.object({
|
|
|
138
139
|
thread_id: zod_1.z.string().optional(),
|
|
139
140
|
context_ids: zod_1.z.array(zod_1.z.string()).optional(),
|
|
140
141
|
organization_id: zod_1.z.string(),
|
|
141
|
-
|
|
142
|
+
user: zod_1.z.object({
|
|
143
|
+
user_id: zod_1.z.string(),
|
|
144
|
+
first_name: zod_1.z.string().optional(),
|
|
145
|
+
last_name: zod_1.z.string().optional(),
|
|
146
|
+
email: zod_1.z.string().email().optional(),
|
|
147
|
+
}),
|
|
142
148
|
query: zod_1.z.string().min(1),
|
|
143
149
|
pre_defined_query_id: zod_1.z.string().optional(),
|
|
150
|
+
custom_instructions: zod_1.z.string().optional(),
|
|
151
|
+
full_document_search: zod_1.z.boolean().optional(),
|
|
144
152
|
timestamp: zod_1.z.number(),
|
|
145
153
|
});
|
|
146
154
|
exports.zodThreadSchema = zod_1.z.object({
|
|
@@ -163,6 +171,7 @@ exports.zodMessageSchema = zod_1.z.object({
|
|
|
163
171
|
agent_id: zod_1.z.string().optional(),
|
|
164
172
|
role: zod_1.z.enum(['user', 'agent', 'system']),
|
|
165
173
|
content: zod_1.z.string(),
|
|
174
|
+
is_favorite: zod_1.z.boolean().optional(),
|
|
166
175
|
created_at: zod_1.z.number().optional(),
|
|
167
176
|
updated_at: zod_1.z.number().optional(),
|
|
168
177
|
});
|
package/index.ts
CHANGED
|
@@ -164,8 +164,9 @@ export const PreDefinedQuerySchema = new Schema(
|
|
|
164
164
|
default: 'active',
|
|
165
165
|
required: true,
|
|
166
166
|
},
|
|
167
|
+
full_document_search: { type: Boolean, default: false },
|
|
167
168
|
users: { type: [Object] },
|
|
168
|
-
click_count: { type: Number },
|
|
169
|
+
click_count: { type: Number, default: 0 },
|
|
169
170
|
created_at: { type: Number },
|
|
170
171
|
updated_at: { type: Number },
|
|
171
172
|
},
|
|
@@ -224,6 +225,7 @@ export const MessageSchema = new Schema(
|
|
|
224
225
|
user_id: { type: String },
|
|
225
226
|
agent_id: { type: String },
|
|
226
227
|
content: { type: String, required: true },
|
|
228
|
+
is_favorite: { type: Boolean, default: false },
|
|
227
229
|
role: { type: String, enum: ['user', 'agent', 'system'], required: true },
|
|
228
230
|
created_at: { type: Number },
|
|
229
231
|
updated_at: { type: Number },
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { custom, z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export const modelsList = [
|
|
4
4
|
'gemini-2.5-flash-lite',
|
|
@@ -88,7 +88,6 @@ export const zodAgentSchema = z.object({
|
|
|
88
88
|
updated_at: z.number().optional(),
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
|
|
92
91
|
export const zodChunkSchema = z.object({
|
|
93
92
|
_id: z.string().optional(),
|
|
94
93
|
chunk_id: z.string().optional(),
|
|
@@ -134,6 +133,7 @@ export const zodPreDefinedQuerySchema = z.object({
|
|
|
134
133
|
query: z.string().min(1),
|
|
135
134
|
instructions: z.string().optional(),
|
|
136
135
|
contexts: z.array(zodContextSchema.partial()).optional(),
|
|
136
|
+
full_document_search: z.boolean().optional(),
|
|
137
137
|
status: z.enum(['active', 'inactive', 'archived']).default('active'),
|
|
138
138
|
users: z.array(zodUserSchema.partial()).optional(),
|
|
139
139
|
click_count: z.number().optional(),
|
|
@@ -146,11 +146,18 @@ export const zodQuerySchema = z.object({
|
|
|
146
146
|
thread_id: z.string().optional(), // If there is not thread id provided, a new thread will be created
|
|
147
147
|
context_ids: z.array(z.string()).optional(), // Run on all organization files unless specific file ids are provided
|
|
148
148
|
organization_id: z.string(), // Will be used to fetch the agent, contexts, chunks, etc.
|
|
149
|
-
|
|
149
|
+
user: z.object({
|
|
150
|
+
user_id: z.string(),
|
|
151
|
+
first_name: z.string().optional(),
|
|
152
|
+
last_name: z.string().optional(),
|
|
153
|
+
email: z.string().email().optional(),
|
|
154
|
+
}),
|
|
150
155
|
query: z.string().min(1),
|
|
151
156
|
pre_defined_query_id: z.string().optional(),
|
|
157
|
+
custom_instructions: z.string().optional(),
|
|
158
|
+
full_document_search: z.boolean().optional(),
|
|
152
159
|
timestamp: z.number(),
|
|
153
|
-
})
|
|
160
|
+
});
|
|
154
161
|
|
|
155
162
|
export const zodThreadSchema = z.object({
|
|
156
163
|
_id: z.string().optional(),
|
|
@@ -173,6 +180,7 @@ export const zodMessageSchema = z.object({
|
|
|
173
180
|
agent_id: z.string().optional(),
|
|
174
181
|
role: z.enum(['user', 'agent', 'system']),
|
|
175
182
|
content: z.string(),
|
|
183
|
+
is_favorite: z.boolean().optional(),
|
|
176
184
|
created_at: z.number().optional(),
|
|
177
185
|
updated_at: z.number().optional(),
|
|
178
186
|
});
|
|
@@ -192,7 +200,7 @@ export type QueueMessageBodyType<T> = {
|
|
|
192
200
|
organization_id: string;
|
|
193
201
|
data: T;
|
|
194
202
|
timestamp: number;
|
|
195
|
-
}
|
|
203
|
+
};
|
|
196
204
|
|
|
197
205
|
export type OrganizationType = z.infer<typeof zodOrganizationSchema>;
|
|
198
206
|
export type UserType = z.infer<typeof zodUserSchema>;
|
|
@@ -217,4 +225,4 @@ export enum FileType {
|
|
|
217
225
|
|
|
218
226
|
export enum QueuesList {
|
|
219
227
|
CONTEXT_PROCESS = 'context_process_queue',
|
|
220
|
-
}
|
|
228
|
+
}
|