chatifai 1.0.28 → 1.0.30

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 CHANGED
@@ -99,14 +99,14 @@ export declare const UserSchema: Schema<any, import("mongoose").Model<any, any,
99
99
  createdAt: NativeDate;
100
100
  updatedAt: NativeDate;
101
101
  } & {
102
+ email: string;
102
103
  organization_memberships: string[];
103
104
  clerk_user_id: string;
104
- email: string;
105
105
  user_role: "admin" | "member" | "client";
106
- created_at?: number | null | undefined;
107
- updated_at?: number | null | undefined;
108
106
  first_name?: string | null | undefined;
109
107
  last_name?: string | null | undefined;
108
+ created_at?: number | null | undefined;
109
+ updated_at?: number | null | undefined;
110
110
  active_until?: number | null | undefined;
111
111
  notes?: string | null | undefined;
112
112
  avatar?: string | null | undefined;
@@ -114,14 +114,14 @@ export declare const UserSchema: Schema<any, import("mongoose").Model<any, any,
114
114
  createdAt: NativeDate;
115
115
  updatedAt: NativeDate;
116
116
  } & {
117
+ email: string;
117
118
  organization_memberships: string[];
118
119
  clerk_user_id: string;
119
- email: string;
120
120
  user_role: "admin" | "member" | "client";
121
- created_at?: number | null | undefined;
122
- updated_at?: number | null | undefined;
123
121
  first_name?: string | null | undefined;
124
122
  last_name?: string | null | undefined;
123
+ created_at?: number | null | undefined;
124
+ updated_at?: number | null | undefined;
125
125
  active_until?: number | null | undefined;
126
126
  notes?: string | null | undefined;
127
127
  avatar?: string | null | undefined;
@@ -129,14 +129,14 @@ export declare const UserSchema: Schema<any, import("mongoose").Model<any, any,
129
129
  createdAt: NativeDate;
130
130
  updatedAt: NativeDate;
131
131
  } & {
132
+ email: string;
132
133
  organization_memberships: string[];
133
134
  clerk_user_id: string;
134
- email: string;
135
135
  user_role: "admin" | "member" | "client";
136
- created_at?: number | null | undefined;
137
- updated_at?: number | null | undefined;
138
136
  first_name?: string | null | undefined;
139
137
  last_name?: string | null | undefined;
138
+ created_at?: number | null | undefined;
139
+ updated_at?: number | null | undefined;
140
140
  active_until?: number | null | undefined;
141
141
  notes?: string | null | undefined;
142
142
  avatar?: string | null | undefined;
@@ -235,9 +235,9 @@ export declare const ContextSchema: Schema<any, import("mongoose").Model<any, an
235
235
  size?: number | null | undefined;
236
236
  tokens?: number | null | undefined;
237
237
  uploaded_by?: {
238
- email?: string | null | undefined;
239
238
  first_name?: string | null | undefined;
240
239
  last_name?: string | null | undefined;
240
+ email?: string | null | undefined;
241
241
  } | null | undefined;
242
242
  bucket_name?: string | null | undefined;
243
243
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
@@ -260,9 +260,9 @@ export declare const ContextSchema: Schema<any, import("mongoose").Model<any, an
260
260
  size?: number | null | undefined;
261
261
  tokens?: number | null | undefined;
262
262
  uploaded_by?: {
263
- email?: string | null | undefined;
264
263
  first_name?: string | null | undefined;
265
264
  last_name?: string | null | undefined;
265
+ email?: string | null | undefined;
266
266
  } | null | undefined;
267
267
  bucket_name?: string | null | undefined;
268
268
  }>, {}> & import("mongoose").FlatRecord<{
@@ -285,9 +285,9 @@ export declare const ContextSchema: Schema<any, import("mongoose").Model<any, an
285
285
  size?: number | null | undefined;
286
286
  tokens?: number | null | undefined;
287
287
  uploaded_by?: {
288
- email?: string | null | undefined;
289
288
  first_name?: string | null | undefined;
290
289
  last_name?: string | null | undefined;
290
+ email?: string | null | undefined;
291
291
  } | null | undefined;
292
292
  bucket_name?: string | null | undefined;
293
293
  }> & {
@@ -417,8 +417,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
417
417
  status: "active" | "inactive" | "archived";
418
418
  query: string;
419
419
  contexts: import("mongoose").Types.DocumentArray<{
420
- entries?: {} | null | undefined;
421
420
  keys?: {} | null | undefined;
421
+ entries?: {} | null | undefined;
422
422
  values?: {} | null | undefined;
423
423
  prototype?: {
424
424
  toString: {} | null;
@@ -459,8 +459,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
459
459
  getOwnPropertyDescriptors?: {} | null | undefined;
460
460
  fromEntries?: {} | null | undefined;
461
461
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
462
- entries?: {} | null | undefined;
463
462
  keys?: {} | null | undefined;
463
+ entries?: {} | null | undefined;
464
464
  values?: {} | null | undefined;
465
465
  prototype?: {
466
466
  toString: {} | null;
@@ -501,8 +501,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
501
501
  getOwnPropertyDescriptors?: {} | null | undefined;
502
502
  fromEntries?: {} | null | undefined;
503
503
  }> & {
504
- entries?: {} | null | undefined;
505
504
  keys?: {} | null | undefined;
505
+ entries?: {} | null | undefined;
506
506
  values?: {} | null | undefined;
507
507
  prototype?: {
508
508
  toString: {} | null;
@@ -545,8 +545,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
545
545
  }>;
546
546
  full_document_search: boolean;
547
547
  users: import("mongoose").Types.DocumentArray<{
548
- entries?: {} | null | undefined;
549
548
  keys?: {} | null | undefined;
549
+ entries?: {} | null | undefined;
550
550
  values?: {} | null | undefined;
551
551
  prototype?: {
552
552
  toString: {} | null;
@@ -587,8 +587,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
587
587
  getOwnPropertyDescriptors?: {} | null | undefined;
588
588
  fromEntries?: {} | null | undefined;
589
589
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
590
- entries?: {} | null | undefined;
591
590
  keys?: {} | null | undefined;
591
+ entries?: {} | null | undefined;
592
592
  values?: {} | null | undefined;
593
593
  prototype?: {
594
594
  toString: {} | null;
@@ -629,8 +629,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
629
629
  getOwnPropertyDescriptors?: {} | null | undefined;
630
630
  fromEntries?: {} | null | undefined;
631
631
  }> & {
632
- entries?: {} | null | undefined;
633
632
  keys?: {} | null | undefined;
633
+ entries?: {} | null | undefined;
634
634
  values?: {} | null | undefined;
635
635
  prototype?: {
636
636
  toString: {} | null;
@@ -685,8 +685,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
685
685
  status: "active" | "inactive" | "archived";
686
686
  query: string;
687
687
  contexts: import("mongoose").Types.DocumentArray<{
688
- entries?: {} | null | undefined;
689
688
  keys?: {} | null | undefined;
689
+ entries?: {} | null | undefined;
690
690
  values?: {} | null | undefined;
691
691
  prototype?: {
692
692
  toString: {} | null;
@@ -727,8 +727,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
727
727
  getOwnPropertyDescriptors?: {} | null | undefined;
728
728
  fromEntries?: {} | null | undefined;
729
729
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
730
- entries?: {} | null | undefined;
731
730
  keys?: {} | null | undefined;
731
+ entries?: {} | null | undefined;
732
732
  values?: {} | null | undefined;
733
733
  prototype?: {
734
734
  toString: {} | null;
@@ -769,8 +769,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
769
769
  getOwnPropertyDescriptors?: {} | null | undefined;
770
770
  fromEntries?: {} | null | undefined;
771
771
  }> & {
772
- entries?: {} | null | undefined;
773
772
  keys?: {} | null | undefined;
773
+ entries?: {} | null | undefined;
774
774
  values?: {} | null | undefined;
775
775
  prototype?: {
776
776
  toString: {} | null;
@@ -813,8 +813,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
813
813
  }>;
814
814
  full_document_search: boolean;
815
815
  users: import("mongoose").Types.DocumentArray<{
816
- entries?: {} | null | undefined;
817
816
  keys?: {} | null | undefined;
817
+ entries?: {} | null | undefined;
818
818
  values?: {} | null | undefined;
819
819
  prototype?: {
820
820
  toString: {} | null;
@@ -855,8 +855,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
855
855
  getOwnPropertyDescriptors?: {} | null | undefined;
856
856
  fromEntries?: {} | null | undefined;
857
857
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
858
- entries?: {} | null | undefined;
859
858
  keys?: {} | null | undefined;
859
+ entries?: {} | null | undefined;
860
860
  values?: {} | null | undefined;
861
861
  prototype?: {
862
862
  toString: {} | null;
@@ -897,8 +897,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
897
897
  getOwnPropertyDescriptors?: {} | null | undefined;
898
898
  fromEntries?: {} | null | undefined;
899
899
  }> & {
900
- entries?: {} | null | undefined;
901
900
  keys?: {} | null | undefined;
901
+ entries?: {} | null | undefined;
902
902
  values?: {} | null | undefined;
903
903
  prototype?: {
904
904
  toString: {} | null;
@@ -953,8 +953,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
953
953
  status: "active" | "inactive" | "archived";
954
954
  query: string;
955
955
  contexts: import("mongoose").Types.DocumentArray<{
956
- entries?: {} | null | undefined;
957
956
  keys?: {} | null | undefined;
957
+ entries?: {} | null | undefined;
958
958
  values?: {} | null | undefined;
959
959
  prototype?: {
960
960
  toString: {} | null;
@@ -995,8 +995,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
995
995
  getOwnPropertyDescriptors?: {} | null | undefined;
996
996
  fromEntries?: {} | null | undefined;
997
997
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
998
- entries?: {} | null | undefined;
999
998
  keys?: {} | null | undefined;
999
+ entries?: {} | null | undefined;
1000
1000
  values?: {} | null | undefined;
1001
1001
  prototype?: {
1002
1002
  toString: {} | null;
@@ -1037,8 +1037,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
1037
1037
  getOwnPropertyDescriptors?: {} | null | undefined;
1038
1038
  fromEntries?: {} | null | undefined;
1039
1039
  }> & {
1040
- entries?: {} | null | undefined;
1041
1040
  keys?: {} | null | undefined;
1041
+ entries?: {} | null | undefined;
1042
1042
  values?: {} | null | undefined;
1043
1043
  prototype?: {
1044
1044
  toString: {} | null;
@@ -1081,8 +1081,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
1081
1081
  }>;
1082
1082
  full_document_search: boolean;
1083
1083
  users: import("mongoose").Types.DocumentArray<{
1084
- entries?: {} | null | undefined;
1085
1084
  keys?: {} | null | undefined;
1085
+ entries?: {} | null | undefined;
1086
1086
  values?: {} | null | undefined;
1087
1087
  prototype?: {
1088
1088
  toString: {} | null;
@@ -1123,8 +1123,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
1123
1123
  getOwnPropertyDescriptors?: {} | null | undefined;
1124
1124
  fromEntries?: {} | null | undefined;
1125
1125
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
1126
- entries?: {} | null | undefined;
1127
1126
  keys?: {} | null | undefined;
1127
+ entries?: {} | null | undefined;
1128
1128
  values?: {} | null | undefined;
1129
1129
  prototype?: {
1130
1130
  toString: {} | null;
@@ -1165,8 +1165,8 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
1165
1165
  getOwnPropertyDescriptors?: {} | null | undefined;
1166
1166
  fromEntries?: {} | null | undefined;
1167
1167
  }> & {
1168
- entries?: {} | null | undefined;
1169
1168
  keys?: {} | null | undefined;
1169
+ entries?: {} | null | undefined;
1170
1170
  values?: {} | null | undefined;
1171
1171
  prototype?: {
1172
1172
  toString: {} | null;
@@ -1269,8 +1269,8 @@ export declare const ThreadSchema: Schema<any, import("mongoose").Model<any, any
1269
1269
  createdAt: NativeDate;
1270
1270
  updatedAt: NativeDate;
1271
1271
  } & {
1272
- organization_id: string;
1273
1272
  user_id: string;
1273
+ organization_id: string;
1274
1274
  agent_id: string;
1275
1275
  messages_count: number;
1276
1276
  title?: string | null | undefined;
@@ -1282,8 +1282,8 @@ export declare const ThreadSchema: Schema<any, import("mongoose").Model<any, any
1282
1282
  createdAt: NativeDate;
1283
1283
  updatedAt: NativeDate;
1284
1284
  } & {
1285
- organization_id: string;
1286
1285
  user_id: string;
1286
+ organization_id: string;
1287
1287
  agent_id: string;
1288
1288
  messages_count: number;
1289
1289
  title?: string | null | undefined;
@@ -1295,8 +1295,8 @@ export declare const ThreadSchema: Schema<any, import("mongoose").Model<any, any
1295
1295
  createdAt: NativeDate;
1296
1296
  updatedAt: NativeDate;
1297
1297
  } & {
1298
- organization_id: string;
1299
1298
  user_id: string;
1299
+ organization_id: string;
1300
1300
  agent_id: string;
1301
1301
  messages_count: number;
1302
1302
  title?: string | null | undefined;
@@ -1328,9 +1328,10 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
1328
1328
  role: "user" | "agent" | "system";
1329
1329
  content: string;
1330
1330
  is_favorite: boolean;
1331
+ like: "liked" | "disliked" | "waiting_response";
1332
+ user_id?: string | null | undefined;
1331
1333
  created_at?: number | null | undefined;
1332
1334
  updated_at?: number | null | undefined;
1333
- user_id?: string | null | undefined;
1334
1335
  agent_id?: string | null | undefined;
1335
1336
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
1336
1337
  createdAt: NativeDate;
@@ -1341,9 +1342,10 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
1341
1342
  role: "user" | "agent" | "system";
1342
1343
  content: string;
1343
1344
  is_favorite: boolean;
1345
+ like: "liked" | "disliked" | "waiting_response";
1346
+ user_id?: string | null | undefined;
1344
1347
  created_at?: number | null | undefined;
1345
1348
  updated_at?: number | null | undefined;
1346
- user_id?: string | null | undefined;
1347
1349
  agent_id?: string | null | undefined;
1348
1350
  }>, {}> & import("mongoose").FlatRecord<{
1349
1351
  createdAt: NativeDate;
@@ -1354,9 +1356,10 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
1354
1356
  role: "user" | "agent" | "system";
1355
1357
  content: string;
1356
1358
  is_favorite: boolean;
1359
+ like: "liked" | "disliked" | "waiting_response";
1360
+ user_id?: string | null | undefined;
1357
1361
  created_at?: number | null | undefined;
1358
1362
  updated_at?: number | null | undefined;
1359
- user_id?: string | null | undefined;
1360
1363
  agent_id?: string | null | undefined;
1361
1364
  }> & {
1362
1365
  _id: import("mongoose").Types.ObjectId;
package/dist/index.js CHANGED
@@ -99,7 +99,11 @@ exports.ContextSchema = new mongoose_1.Schema({
99
99
  email: { type: String },
100
100
  },
101
101
  bucket_name: { type: String },
102
- processing_status: { type: String, enum: ['pending', 'processing', 'completed', 'failed'], default: 'pending' },
102
+ processing_status: {
103
+ type: String,
104
+ enum: ['pending', 'processing', 'completed', 'failed'],
105
+ default: 'pending',
106
+ },
103
107
  created_at: { type: Number },
104
108
  updated_at: { type: Number },
105
109
  }, {
@@ -208,6 +212,11 @@ exports.MessageSchema = new mongoose_1.Schema({
208
212
  agent_id: { type: String },
209
213
  content: { type: String, required: true },
210
214
  is_favorite: { type: Boolean, default: false },
215
+ like: {
216
+ type: String,
217
+ enum: ['liked', 'disliked', 'waiting_response'],
218
+ default: 'waiting_response',
219
+ },
211
220
  role: { type: String, enum: ['user', 'agent', 'system'], required: true },
212
221
  created_at: { type: Number },
213
222
  updated_at: { type: Number },
package/dist/types.d.ts CHANGED
@@ -1,6 +1,22 @@
1
1
  import { z } from 'zod';
2
2
  export declare const modelsList: readonly ["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-2.5-pro", "grok-4-fast-non-reasoning", "grok-4-fast-reasoning", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano"];
3
3
  export declare const userRoles: readonly ["admin", "member", "client"];
4
+ export declare const zodClerkMinimalUserSchema: z.ZodObject<{
5
+ user_id: z.ZodString;
6
+ first_name: z.ZodOptional<z.ZodString>;
7
+ last_name: z.ZodOptional<z.ZodString>;
8
+ email: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ user_id: string;
11
+ first_name?: string | undefined;
12
+ last_name?: string | undefined;
13
+ email?: string | undefined;
14
+ }, {
15
+ user_id: string;
16
+ first_name?: string | undefined;
17
+ last_name?: string | undefined;
18
+ email?: string | undefined;
19
+ }>;
4
20
  export declare const zodOrganizationSchema: z.ZodObject<{
5
21
  _id: z.ZodOptional<z.ZodString>;
6
22
  clerk_organization_id: z.ZodString;
@@ -55,27 +71,27 @@ export declare const zodUserSchema: z.ZodObject<{
55
71
  created_at: z.ZodOptional<z.ZodNumber>;
56
72
  updated_at: z.ZodOptional<z.ZodNumber>;
57
73
  }, "strip", z.ZodTypeAny, {
58
- clerk_user_id: string;
59
74
  email: string;
75
+ clerk_user_id: string;
76
+ first_name?: string | undefined;
77
+ last_name?: string | undefined;
60
78
  _id?: string | undefined;
61
79
  created_at?: number | undefined;
62
80
  updated_at?: number | undefined;
63
81
  organization_memberships?: string[] | undefined;
64
- first_name?: string | undefined;
65
- last_name?: string | undefined;
66
82
  active_until?: number | undefined;
67
83
  notes?: string | undefined;
68
84
  avatar?: string | undefined;
69
85
  user_role?: "admin" | "member" | "client" | undefined;
70
86
  }, {
71
- clerk_user_id: string;
72
87
  email: string;
88
+ clerk_user_id: string;
89
+ first_name?: string | undefined;
90
+ last_name?: string | undefined;
73
91
  _id?: string | undefined;
74
92
  created_at?: number | undefined;
75
93
  updated_at?: number | undefined;
76
94
  organization_memberships?: string[] | undefined;
77
- first_name?: string | undefined;
78
- last_name?: string | undefined;
79
95
  active_until?: number | undefined;
80
96
  notes?: string | undefined;
81
97
  avatar?: string | undefined;
@@ -102,20 +118,20 @@ export declare const zodContextSchema: z.ZodObject<{
102
118
  last_name: z.ZodOptional<z.ZodString>;
103
119
  email: z.ZodOptional<z.ZodString>;
104
120
  }, "strip", z.ZodTypeAny, {
105
- email?: string | undefined;
106
121
  first_name?: string | undefined;
107
122
  last_name?: string | undefined;
108
- }, {
109
123
  email?: string | undefined;
124
+ }, {
110
125
  first_name?: string | undefined;
111
126
  last_name?: string | undefined;
127
+ email?: string | undefined;
112
128
  }>>;
113
129
  bucket_name: z.ZodOptional<z.ZodString>;
114
130
  processing_status: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>;
115
131
  }, "strip", z.ZodTypeAny, {
116
132
  title: string;
117
- _id?: string | undefined;
118
133
  type?: string | undefined;
134
+ _id?: string | undefined;
119
135
  created_at?: number | undefined;
120
136
  updated_at?: number | undefined;
121
137
  organization_id?: string | undefined;
@@ -129,16 +145,16 @@ export declare const zodContextSchema: z.ZodObject<{
129
145
  tokens?: number | undefined;
130
146
  is_active?: boolean | undefined;
131
147
  uploaded_by?: {
132
- email?: string | undefined;
133
148
  first_name?: string | undefined;
134
149
  last_name?: string | undefined;
150
+ email?: string | undefined;
135
151
  } | undefined;
136
152
  bucket_name?: string | undefined;
137
153
  processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
138
154
  }, {
139
155
  title: string;
140
- _id?: string | undefined;
141
156
  type?: string | undefined;
157
+ _id?: string | undefined;
142
158
  created_at?: number | undefined;
143
159
  updated_at?: number | undefined;
144
160
  organization_id?: string | undefined;
@@ -152,9 +168,9 @@ export declare const zodContextSchema: z.ZodObject<{
152
168
  tokens?: number | undefined;
153
169
  is_active?: boolean | undefined;
154
170
  uploaded_by?: {
155
- email?: string | undefined;
156
171
  first_name?: string | undefined;
157
172
  last_name?: string | undefined;
173
+ email?: string | undefined;
158
174
  } | undefined;
159
175
  bucket_name?: string | undefined;
160
176
  processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
@@ -346,20 +362,20 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
346
362
  last_name: z.ZodOptional<z.ZodString>;
347
363
  email: z.ZodOptional<z.ZodString>;
348
364
  }, "strip", z.ZodTypeAny, {
349
- email?: string | undefined;
350
365
  first_name?: string | undefined;
351
366
  last_name?: string | undefined;
352
- }, {
353
367
  email?: string | undefined;
368
+ }, {
354
369
  first_name?: string | undefined;
355
370
  last_name?: string | undefined;
371
+ email?: string | undefined;
356
372
  }>>>;
357
373
  bucket_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
358
374
  processing_status: z.ZodOptional<z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>>;
359
375
  }, "strip", z.ZodTypeAny, {
376
+ type?: string | undefined;
360
377
  _id?: string | undefined;
361
378
  title?: string | undefined;
362
- type?: string | undefined;
363
379
  created_at?: number | undefined;
364
380
  updated_at?: number | undefined;
365
381
  organization_id?: string | undefined;
@@ -373,16 +389,16 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
373
389
  tokens?: number | undefined;
374
390
  is_active?: boolean | undefined;
375
391
  uploaded_by?: {
376
- email?: string | undefined;
377
392
  first_name?: string | undefined;
378
393
  last_name?: string | undefined;
394
+ email?: string | undefined;
379
395
  } | undefined;
380
396
  bucket_name?: string | undefined;
381
397
  processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
382
398
  }, {
399
+ type?: string | undefined;
383
400
  _id?: string | undefined;
384
401
  title?: string | undefined;
385
- type?: string | undefined;
386
402
  created_at?: number | undefined;
387
403
  updated_at?: number | undefined;
388
404
  organization_id?: string | undefined;
@@ -396,9 +412,9 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
396
412
  tokens?: number | undefined;
397
413
  is_active?: boolean | undefined;
398
414
  uploaded_by?: {
399
- email?: string | undefined;
400
415
  first_name?: string | undefined;
401
416
  last_name?: string | undefined;
417
+ email?: string | undefined;
402
418
  } | undefined;
403
419
  bucket_name?: string | undefined;
404
420
  processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
@@ -406,44 +422,20 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
406
422
  full_document_search: z.ZodOptional<z.ZodBoolean>;
407
423
  status: z.ZodDefault<z.ZodEnum<["active", "inactive", "archived"]>>;
408
424
  users: z.ZodOptional<z.ZodArray<z.ZodObject<{
409
- _id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
410
- organization_memberships: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
411
- clerk_user_id: z.ZodOptional<z.ZodString>;
425
+ user_id: z.ZodString;
426
+ first_name: z.ZodOptional<z.ZodString>;
427
+ last_name: z.ZodOptional<z.ZodString>;
412
428
  email: z.ZodOptional<z.ZodString>;
413
- first_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
414
- last_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
415
- active_until: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
416
- notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
417
- avatar: z.ZodOptional<z.ZodOptional<z.ZodString>>;
418
- user_role: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["admin", "member", "client"]>>>>;
419
- created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
420
- updated_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
421
429
  }, "strip", z.ZodTypeAny, {
422
- _id?: string | undefined;
423
- created_at?: number | undefined;
424
- updated_at?: number | undefined;
425
- organization_memberships?: string[] | undefined;
426
- clerk_user_id?: string | undefined;
427
- email?: string | undefined;
430
+ user_id: string;
428
431
  first_name?: string | undefined;
429
432
  last_name?: string | undefined;
430
- active_until?: number | undefined;
431
- notes?: string | undefined;
432
- avatar?: string | undefined;
433
- user_role?: "admin" | "member" | "client" | undefined;
434
- }, {
435
- _id?: string | undefined;
436
- created_at?: number | undefined;
437
- updated_at?: number | undefined;
438
- organization_memberships?: string[] | undefined;
439
- clerk_user_id?: string | undefined;
440
433
  email?: string | undefined;
434
+ }, {
435
+ user_id: string;
441
436
  first_name?: string | undefined;
442
437
  last_name?: string | undefined;
443
- active_until?: number | undefined;
444
- notes?: string | undefined;
445
- avatar?: string | undefined;
446
- user_role?: "admin" | "member" | "client" | undefined;
438
+ email?: string | undefined;
447
439
  }>, "many">>;
448
440
  click_count: z.ZodOptional<z.ZodNumber>;
449
441
  created_at: z.ZodOptional<z.ZodNumber>;
@@ -459,9 +451,9 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
459
451
  query_name?: string | undefined;
460
452
  query_hint?: string | undefined;
461
453
  contexts?: {
454
+ type?: string | undefined;
462
455
  _id?: string | undefined;
463
456
  title?: string | undefined;
464
- type?: string | undefined;
465
457
  created_at?: number | undefined;
466
458
  updated_at?: number | undefined;
467
459
  organization_id?: string | undefined;
@@ -475,33 +467,25 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
475
467
  tokens?: number | undefined;
476
468
  is_active?: boolean | undefined;
477
469
  uploaded_by?: {
478
- email?: string | undefined;
479
470
  first_name?: string | undefined;
480
471
  last_name?: string | undefined;
472
+ email?: string | undefined;
481
473
  } | undefined;
482
474
  bucket_name?: string | undefined;
483
475
  processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
484
476
  }[] | undefined;
485
477
  full_document_search?: boolean | undefined;
486
478
  users?: {
487
- _id?: string | undefined;
488
- created_at?: number | undefined;
489
- updated_at?: number | undefined;
490
- organization_memberships?: string[] | undefined;
491
- clerk_user_id?: string | undefined;
492
- email?: string | undefined;
479
+ user_id: string;
493
480
  first_name?: string | undefined;
494
481
  last_name?: string | undefined;
495
- active_until?: number | undefined;
496
- notes?: string | undefined;
497
- avatar?: string | undefined;
498
- user_role?: "admin" | "member" | "client" | undefined;
482
+ email?: string | undefined;
499
483
  }[] | undefined;
500
484
  click_count?: number | undefined;
501
485
  }, {
502
486
  query: string;
503
- _id?: string | undefined;
504
487
  status?: "active" | "inactive" | "archived" | undefined;
488
+ _id?: string | undefined;
505
489
  created_at?: number | undefined;
506
490
  updated_at?: number | undefined;
507
491
  organization_id?: string | undefined;
@@ -509,9 +493,9 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
509
493
  query_name?: string | undefined;
510
494
  query_hint?: string | undefined;
511
495
  contexts?: {
496
+ type?: string | undefined;
512
497
  _id?: string | undefined;
513
498
  title?: string | undefined;
514
- type?: string | undefined;
515
499
  created_at?: number | undefined;
516
500
  updated_at?: number | undefined;
517
501
  organization_id?: string | undefined;
@@ -525,27 +509,19 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
525
509
  tokens?: number | undefined;
526
510
  is_active?: boolean | undefined;
527
511
  uploaded_by?: {
528
- email?: string | undefined;
529
512
  first_name?: string | undefined;
530
513
  last_name?: string | undefined;
514
+ email?: string | undefined;
531
515
  } | undefined;
532
516
  bucket_name?: string | undefined;
533
517
  processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
534
518
  }[] | undefined;
535
519
  full_document_search?: boolean | undefined;
536
520
  users?: {
537
- _id?: string | undefined;
538
- created_at?: number | undefined;
539
- updated_at?: number | undefined;
540
- organization_memberships?: string[] | undefined;
541
- clerk_user_id?: string | undefined;
542
- email?: string | undefined;
521
+ user_id: string;
543
522
  first_name?: string | undefined;
544
523
  last_name?: string | undefined;
545
- active_until?: number | undefined;
546
- notes?: string | undefined;
547
- avatar?: string | undefined;
548
- user_role?: "admin" | "member" | "client" | undefined;
524
+ email?: string | undefined;
549
525
  }[] | undefined;
550
526
  click_count?: number | undefined;
551
527
  }>;
@@ -560,14 +536,14 @@ export declare const zodQuerySchema: z.ZodObject<{
560
536
  email: z.ZodOptional<z.ZodString>;
561
537
  }, "strip", z.ZodTypeAny, {
562
538
  user_id: string;
563
- email?: string | undefined;
564
539
  first_name?: string | undefined;
565
540
  last_name?: string | undefined;
541
+ email?: string | undefined;
566
542
  }, {
567
543
  user_id: string;
568
- email?: string | undefined;
569
544
  first_name?: string | undefined;
570
545
  last_name?: string | undefined;
546
+ email?: string | undefined;
571
547
  }>;
572
548
  query: z.ZodString;
573
549
  pre_defined_query_id: z.ZodOptional<z.ZodString>;
@@ -579,9 +555,9 @@ export declare const zodQuerySchema: z.ZodObject<{
579
555
  query: string;
580
556
  user: {
581
557
  user_id: string;
582
- email?: string | undefined;
583
558
  first_name?: string | undefined;
584
559
  last_name?: string | undefined;
560
+ email?: string | undefined;
585
561
  };
586
562
  timestamp: number;
587
563
  full_document_search?: boolean | undefined;
@@ -594,9 +570,9 @@ export declare const zodQuerySchema: z.ZodObject<{
594
570
  query: string;
595
571
  user: {
596
572
  user_id: string;
597
- email?: string | undefined;
598
573
  first_name?: string | undefined;
599
574
  last_name?: string | undefined;
575
+ email?: string | undefined;
600
576
  };
601
577
  timestamp: number;
602
578
  full_document_search?: boolean | undefined;
@@ -608,7 +584,22 @@ export declare const zodQuerySchema: z.ZodObject<{
608
584
  export declare const zodThreadSchema: z.ZodObject<{
609
585
  _id: z.ZodOptional<z.ZodString>;
610
586
  organization_id: z.ZodString;
611
- user_id: z.ZodString;
587
+ user_id: z.ZodObject<{
588
+ user_id: z.ZodString;
589
+ first_name: z.ZodOptional<z.ZodString>;
590
+ last_name: z.ZodOptional<z.ZodString>;
591
+ email: z.ZodOptional<z.ZodString>;
592
+ }, "strip", z.ZodTypeAny, {
593
+ user_id: string;
594
+ first_name?: string | undefined;
595
+ last_name?: string | undefined;
596
+ email?: string | undefined;
597
+ }, {
598
+ user_id: string;
599
+ first_name?: string | undefined;
600
+ last_name?: string | undefined;
601
+ email?: string | undefined;
602
+ }>;
612
603
  agent_id: z.ZodOptional<z.ZodString>;
613
604
  title: z.ZodOptional<z.ZodString>;
614
605
  description: z.ZodOptional<z.ZodString>;
@@ -617,8 +608,13 @@ export declare const zodThreadSchema: z.ZodObject<{
617
608
  query_id: z.ZodOptional<z.ZodString>;
618
609
  messages_count: z.ZodOptional<z.ZodNumber>;
619
610
  }, "strip", z.ZodTypeAny, {
611
+ user_id: {
612
+ user_id: string;
613
+ first_name?: string | undefined;
614
+ last_name?: string | undefined;
615
+ email?: string | undefined;
616
+ };
620
617
  organization_id: string;
621
- user_id: string;
622
618
  _id?: string | undefined;
623
619
  title?: string | undefined;
624
620
  created_at?: number | undefined;
@@ -628,8 +624,13 @@ export declare const zodThreadSchema: z.ZodObject<{
628
624
  query_id?: string | undefined;
629
625
  messages_count?: number | undefined;
630
626
  }, {
627
+ user_id: {
628
+ user_id: string;
629
+ first_name?: string | undefined;
630
+ last_name?: string | undefined;
631
+ email?: string | undefined;
632
+ };
631
633
  organization_id: string;
632
- user_id: string;
633
634
  _id?: string | undefined;
634
635
  title?: string | undefined;
635
636
  created_at?: number | undefined;
@@ -648,6 +649,7 @@ export declare const zodMessageSchema: z.ZodObject<{
648
649
  role: z.ZodEnum<["user", "agent", "system"]>;
649
650
  content: z.ZodString;
650
651
  is_favorite: z.ZodOptional<z.ZodBoolean>;
652
+ like: z.ZodOptional<z.ZodEnum<["liked", "disliked", "waiting_response"]>>;
651
653
  created_at: z.ZodOptional<z.ZodNumber>;
652
654
  updated_at: z.ZodOptional<z.ZodNumber>;
653
655
  }, "strip", z.ZodTypeAny, {
@@ -655,23 +657,25 @@ export declare const zodMessageSchema: z.ZodObject<{
655
657
  thread_id: string;
656
658
  role: "user" | "agent" | "system";
657
659
  content: string;
660
+ user_id?: string | undefined;
658
661
  _id?: string | undefined;
659
662
  created_at?: number | undefined;
660
663
  updated_at?: number | undefined;
661
- user_id?: string | undefined;
662
664
  agent_id?: string | undefined;
663
665
  is_favorite?: boolean | undefined;
666
+ like?: "liked" | "disliked" | "waiting_response" | undefined;
664
667
  }, {
665
668
  organization_id: string;
666
669
  thread_id: string;
667
670
  role: "user" | "agent" | "system";
668
671
  content: string;
672
+ user_id?: string | undefined;
669
673
  _id?: string | undefined;
670
674
  created_at?: number | undefined;
671
675
  updated_at?: number | undefined;
672
- user_id?: string | undefined;
673
676
  agent_id?: string | undefined;
674
677
  is_favorite?: boolean | undefined;
678
+ like?: "liked" | "disliked" | "waiting_response" | undefined;
675
679
  }>;
676
680
  export type EventAttributeType = {
677
681
  http_request: {
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueuesList = exports.FileType = exports.zodMessageSchema = exports.zodThreadSchema = exports.zodQuerySchema = exports.zodPreDefinedQuerySchema = exports.zodFullTextSchema = exports.zodChunkSchema = exports.zodAgentSchema = exports.zodContextSchema = exports.zodUserSchema = exports.zodOrganizationSchema = exports.userRoles = exports.modelsList = void 0;
3
+ exports.QueuesList = exports.FileType = exports.zodMessageSchema = exports.zodThreadSchema = exports.zodQuerySchema = exports.zodPreDefinedQuerySchema = exports.zodFullTextSchema = exports.zodChunkSchema = exports.zodAgentSchema = exports.zodContextSchema = exports.zodUserSchema = exports.zodOrganizationSchema = exports.zodClerkMinimalUserSchema = exports.userRoles = exports.modelsList = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.modelsList = [
6
6
  'gemini-2.5-flash-lite',
@@ -13,6 +13,12 @@ exports.modelsList = [
13
13
  'gpt-4.1-nano',
14
14
  ];
15
15
  exports.userRoles = ['admin', 'member', 'client'];
16
+ exports.zodClerkMinimalUserSchema = zod_1.z.object({
17
+ user_id: zod_1.z.string(),
18
+ first_name: zod_1.z.string().optional(),
19
+ last_name: zod_1.z.string().optional(),
20
+ email: zod_1.z.string().email().optional(),
21
+ });
16
22
  exports.zodOrganizationSchema = zod_1.z.object({
17
23
  _id: zod_1.z.string().optional(),
18
24
  clerk_organization_id: zod_1.z.string(),
@@ -129,7 +135,7 @@ exports.zodPreDefinedQuerySchema = zod_1.z.object({
129
135
  contexts: zod_1.z.array(exports.zodContextSchema.partial()).optional(),
130
136
  full_document_search: zod_1.z.boolean().optional(),
131
137
  status: zod_1.z.enum(['active', 'inactive', 'archived']).default('active'),
132
- users: zod_1.z.array(exports.zodUserSchema.partial()).optional(),
138
+ users: zod_1.z.array(exports.zodClerkMinimalUserSchema).optional(),
133
139
  click_count: zod_1.z.number().optional(),
134
140
  created_at: zod_1.z.number().optional(),
135
141
  updated_at: zod_1.z.number().optional(),
@@ -139,12 +145,7 @@ exports.zodQuerySchema = zod_1.z.object({
139
145
  thread_id: zod_1.z.string().optional(),
140
146
  context_ids: zod_1.z.array(zod_1.z.string()).optional(),
141
147
  organization_id: zod_1.z.string(),
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
- }),
148
+ user: exports.zodClerkMinimalUserSchema,
148
149
  query: zod_1.z.string().min(1),
149
150
  pre_defined_query_id: zod_1.z.string().optional(),
150
151
  custom_instructions: zod_1.z.string().optional(),
@@ -154,7 +155,7 @@ exports.zodQuerySchema = zod_1.z.object({
154
155
  exports.zodThreadSchema = zod_1.z.object({
155
156
  _id: zod_1.z.string().optional(),
156
157
  organization_id: zod_1.z.string(),
157
- user_id: zod_1.z.string(),
158
+ user_id: exports.zodClerkMinimalUserSchema,
158
159
  agent_id: zod_1.z.string().optional(),
159
160
  title: zod_1.z.string().min(1).max(200).optional(),
160
161
  description: zod_1.z.string().optional(),
@@ -172,6 +173,7 @@ exports.zodMessageSchema = zod_1.z.object({
172
173
  role: zod_1.z.enum(['user', 'agent', 'system']),
173
174
  content: zod_1.z.string(),
174
175
  is_favorite: zod_1.z.boolean().optional(),
176
+ like: zod_1.z.enum(['liked', 'disliked', 'waiting_response']).optional(),
175
177
  created_at: zod_1.z.number().optional(),
176
178
  updated_at: zod_1.z.number().optional(),
177
179
  });
package/index.ts CHANGED
@@ -97,7 +97,11 @@ export const ContextSchema = new Schema(
97
97
  email: { type: String },
98
98
  },
99
99
  bucket_name: { type: String },
100
- processing_status: { type: String, enum: ['pending', 'processing', 'completed', 'failed'] , default: 'pending' },
100
+ processing_status: {
101
+ type: String,
102
+ enum: ['pending', 'processing', 'completed', 'failed'],
103
+ default: 'pending',
104
+ },
101
105
  created_at: { type: Number },
102
106
  updated_at: { type: Number },
103
107
  },
@@ -226,6 +230,11 @@ export const MessageSchema = new Schema(
226
230
  agent_id: { type: String },
227
231
  content: { type: String, required: true },
228
232
  is_favorite: { type: Boolean, default: false },
233
+ like: {
234
+ type: String,
235
+ enum: ['liked', 'disliked', 'waiting_response'],
236
+ default: 'waiting_response',
237
+ },
229
238
  role: { type: String, enum: ['user', 'agent', 'system'], required: true },
230
239
  created_at: { type: Number },
231
240
  updated_at: { type: Number },
@@ -238,4 +247,4 @@ export const MessageSchema = new Schema(
238
247
  id: true,
239
248
  // encryptionType: 'csfle',
240
249
  }
241
- );
250
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatifai",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "SDK for interacting with the Chatifai API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -13,6 +13,13 @@ export const modelsList = [
13
13
 
14
14
  export const userRoles = ['admin', 'member', 'client'] as const;
15
15
 
16
+ export const zodClerkMinimalUserSchema = z.object({
17
+ user_id: z.string(),
18
+ first_name: z.string().optional(),
19
+ last_name: z.string().optional(),
20
+ email: z.string().email().optional(),
21
+ });
22
+
16
23
  export const zodOrganizationSchema = z.object({
17
24
  _id: z.string().optional(),
18
25
  clerk_organization_id: z.string(),
@@ -135,7 +142,7 @@ export const zodPreDefinedQuerySchema = z.object({
135
142
  contexts: z.array(zodContextSchema.partial()).optional(),
136
143
  full_document_search: z.boolean().optional(),
137
144
  status: z.enum(['active', 'inactive', 'archived']).default('active'),
138
- users: z.array(zodUserSchema.partial()).optional(),
145
+ users: z.array(zodClerkMinimalUserSchema).optional(),
139
146
  click_count: z.number().optional(),
140
147
  created_at: z.number().optional(),
141
148
  updated_at: z.number().optional(),
@@ -146,12 +153,7 @@ export const zodQuerySchema = z.object({
146
153
  thread_id: z.string().optional(), // If there is not thread id provided, a new thread will be created
147
154
  context_ids: z.array(z.string()).optional(), // Run on all organization files unless specific file ids are provided
148
155
  organization_id: z.string(), // Will be used to fetch the agent, contexts, chunks, etc.
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
- }),
156
+ user: zodClerkMinimalUserSchema,
155
157
  query: z.string().min(1),
156
158
  pre_defined_query_id: z.string().optional(),
157
159
  custom_instructions: z.string().optional(),
@@ -162,7 +164,7 @@ export const zodQuerySchema = z.object({
162
164
  export const zodThreadSchema = z.object({
163
165
  _id: z.string().optional(),
164
166
  organization_id: z.string(),
165
- user_id: z.string(),
167
+ user_id: zodClerkMinimalUserSchema,
166
168
  agent_id: z.string().optional(),
167
169
  title: z.string().min(1).max(200).optional(),
168
170
  description: z.string().optional(),
@@ -181,6 +183,7 @@ export const zodMessageSchema = z.object({
181
183
  role: z.enum(['user', 'agent', 'system']),
182
184
  content: z.string(),
183
185
  is_favorite: z.boolean().optional(),
186
+ like: z.enum(['liked', 'disliked', 'waiting_response']).optional(), // 1 for like, -1 for dislike
184
187
  created_at: z.number().optional(),
185
188
  updated_at: z.number().optional(),
186
189
  });