chatifai 1.0.6 → 1.0.8
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.js +7 -5
- package/dist/types.d.ts +46 -85
- package/dist/types.js +17 -30
- package/index.ts +7 -5
- package/package.json +1 -1
- package/types.ts +17 -36
package/dist/index.js
CHANGED
|
@@ -50,11 +50,11 @@ exports.UserSchema = Schema({
|
|
|
50
50
|
first_name: { type: String },
|
|
51
51
|
last_name: { type: String },
|
|
52
52
|
active_until: { type: Number },
|
|
53
|
-
notes: { type:
|
|
53
|
+
notes: { type: String, maxlength: 500 },
|
|
54
54
|
avatar: { type: String },
|
|
55
|
-
user_role: { type:
|
|
55
|
+
user_role: { type: String, enum: types_1.userRoles, required: true },
|
|
56
56
|
created_at: { type: Number },
|
|
57
|
-
updated_at: { type:
|
|
57
|
+
updated_at: { type: Number },
|
|
58
58
|
});
|
|
59
59
|
exports.AgentSchema = Schema({
|
|
60
60
|
organization_id: { type: String },
|
|
@@ -72,11 +72,13 @@ exports.AgentSchema = Schema({
|
|
|
72
72
|
});
|
|
73
73
|
exports.ContextSchema = Schema({
|
|
74
74
|
organization_id: { type: String },
|
|
75
|
+
file_id: { type: String },
|
|
75
76
|
title: { type: String, required: true, minlength: 1, maxlength: 100 },
|
|
76
77
|
description: { type: String, minlength: 1, maxlength: 500 },
|
|
77
|
-
|
|
78
|
+
file_url: { type: String },
|
|
78
79
|
type: { type: String, minlength: 1, maxlength: 100 },
|
|
79
|
-
|
|
80
|
+
size: { type: Number },
|
|
81
|
+
tokens: { type: Number },
|
|
80
82
|
created_at: { type: Number },
|
|
81
83
|
updated_at: { type: Number },
|
|
82
84
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -49,82 +49,74 @@ export declare const zodUserSchema: z.ZodObject<{
|
|
|
49
49
|
first_name: z.ZodOptional<z.ZodString>;
|
|
50
50
|
last_name: z.ZodOptional<z.ZodString>;
|
|
51
51
|
active_until: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
notes: z.ZodOptional<z.
|
|
53
|
-
organization_id: z.ZodString;
|
|
54
|
-
note: z.ZodString;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
organization_id: string;
|
|
57
|
-
note: string;
|
|
58
|
-
}, {
|
|
59
|
-
organization_id: string;
|
|
60
|
-
note: string;
|
|
61
|
-
}>, "many">>;
|
|
52
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
62
53
|
avatar: z.ZodOptional<z.ZodString>;
|
|
63
|
-
user_role: z.ZodOptional<z.
|
|
64
|
-
organization_id: z.ZodString;
|
|
65
|
-
role: z.ZodEnum<["admin", "member", "client"]>;
|
|
66
|
-
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
organization_id: string;
|
|
68
|
-
role: "admin" | "member" | "client";
|
|
69
|
-
}, {
|
|
70
|
-
organization_id: string;
|
|
71
|
-
role: "admin" | "member" | "client";
|
|
72
|
-
}>, "many">>;
|
|
54
|
+
user_role: z.ZodOptional<z.ZodDefault<z.ZodEnum<["admin", "member", "client"]>>>;
|
|
73
55
|
created_at: z.ZodOptional<z.ZodNumber>;
|
|
74
|
-
updated_at: z.ZodOptional<z.
|
|
75
|
-
organization_id: z.ZodString;
|
|
76
|
-
timestamp: z.ZodNumber;
|
|
77
|
-
}, "strip", z.ZodTypeAny, {
|
|
78
|
-
organization_id: string;
|
|
79
|
-
timestamp: number;
|
|
80
|
-
}, {
|
|
81
|
-
organization_id: string;
|
|
82
|
-
timestamp: number;
|
|
83
|
-
}>, "many">>;
|
|
56
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
84
57
|
}, "strip", z.ZodTypeAny, {
|
|
85
58
|
clerk_user_id: string;
|
|
86
59
|
email: string;
|
|
87
60
|
_id?: string | undefined;
|
|
88
61
|
created_at?: number | undefined;
|
|
89
|
-
updated_at?:
|
|
90
|
-
organization_id: string;
|
|
91
|
-
timestamp: number;
|
|
92
|
-
}[] | undefined;
|
|
62
|
+
updated_at?: number | undefined;
|
|
93
63
|
organization_memberships?: string[] | undefined;
|
|
94
64
|
first_name?: string | undefined;
|
|
95
65
|
last_name?: string | undefined;
|
|
96
66
|
active_until?: number | undefined;
|
|
97
|
-
notes?:
|
|
98
|
-
organization_id: string;
|
|
99
|
-
note: string;
|
|
100
|
-
}[] | undefined;
|
|
67
|
+
notes?: string | undefined;
|
|
101
68
|
avatar?: string | undefined;
|
|
102
|
-
user_role?:
|
|
103
|
-
organization_id: string;
|
|
104
|
-
role: "admin" | "member" | "client";
|
|
105
|
-
}[] | undefined;
|
|
69
|
+
user_role?: "admin" | "member" | "client" | undefined;
|
|
106
70
|
}, {
|
|
107
71
|
clerk_user_id: string;
|
|
108
72
|
email: string;
|
|
109
73
|
_id?: string | undefined;
|
|
110
74
|
created_at?: number | undefined;
|
|
111
|
-
updated_at?:
|
|
112
|
-
organization_id: string;
|
|
113
|
-
timestamp: number;
|
|
114
|
-
}[] | undefined;
|
|
75
|
+
updated_at?: number | undefined;
|
|
115
76
|
organization_memberships?: string[] | undefined;
|
|
116
77
|
first_name?: string | undefined;
|
|
117
78
|
last_name?: string | undefined;
|
|
118
79
|
active_until?: number | undefined;
|
|
119
|
-
notes?:
|
|
120
|
-
organization_id: string;
|
|
121
|
-
note: string;
|
|
122
|
-
}[] | undefined;
|
|
80
|
+
notes?: string | undefined;
|
|
123
81
|
avatar?: string | undefined;
|
|
124
|
-
user_role?:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
82
|
+
user_role?: "admin" | "member" | "client" | undefined;
|
|
83
|
+
}>;
|
|
84
|
+
export declare const zodContextSchema: z.ZodObject<{
|
|
85
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
86
|
+
organization_id: z.ZodOptional<z.ZodString>;
|
|
87
|
+
file_id: z.ZodOptional<z.ZodString>;
|
|
88
|
+
title: z.ZodString;
|
|
89
|
+
description: z.ZodOptional<z.ZodString>;
|
|
90
|
+
file_url: z.ZodOptional<z.ZodString>;
|
|
91
|
+
type: z.ZodOptional<z.ZodString>;
|
|
92
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
tokens: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
title: string;
|
|
98
|
+
_id?: string | undefined;
|
|
99
|
+
type?: string | undefined;
|
|
100
|
+
created_at?: number | undefined;
|
|
101
|
+
updated_at?: number | undefined;
|
|
102
|
+
organization_id?: string | undefined;
|
|
103
|
+
file_id?: string | undefined;
|
|
104
|
+
description?: string | undefined;
|
|
105
|
+
file_url?: string | undefined;
|
|
106
|
+
size?: number | undefined;
|
|
107
|
+
tokens?: number | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
title: string;
|
|
110
|
+
_id?: string | undefined;
|
|
111
|
+
type?: string | undefined;
|
|
112
|
+
created_at?: number | undefined;
|
|
113
|
+
updated_at?: number | undefined;
|
|
114
|
+
organization_id?: string | undefined;
|
|
115
|
+
file_id?: string | undefined;
|
|
116
|
+
description?: string | undefined;
|
|
117
|
+
file_url?: string | undefined;
|
|
118
|
+
size?: number | undefined;
|
|
119
|
+
tokens?: number | undefined;
|
|
128
120
|
}>;
|
|
129
121
|
export declare const zodAgentSchema: z.ZodObject<{
|
|
130
122
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -169,37 +161,6 @@ export declare const zodAgentSchema: z.ZodObject<{
|
|
|
169
161
|
message_count_limit?: number | undefined;
|
|
170
162
|
is_editable?: boolean | undefined;
|
|
171
163
|
}>;
|
|
172
|
-
export declare const zodContextSchema: z.ZodObject<{
|
|
173
|
-
_id: z.ZodOptional<z.ZodString>;
|
|
174
|
-
organization_id: z.ZodOptional<z.ZodString>;
|
|
175
|
-
title: z.ZodString;
|
|
176
|
-
description: z.ZodOptional<z.ZodString>;
|
|
177
|
-
document_url: z.ZodOptional<z.ZodString>;
|
|
178
|
-
type: z.ZodOptional<z.ZodString>;
|
|
179
|
-
content: z.ZodOptional<z.ZodString>;
|
|
180
|
-
created_at: z.ZodOptional<z.ZodNumber>;
|
|
181
|
-
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
182
|
-
}, "strip", z.ZodTypeAny, {
|
|
183
|
-
title: string;
|
|
184
|
-
_id?: string | undefined;
|
|
185
|
-
type?: string | undefined;
|
|
186
|
-
created_at?: number | undefined;
|
|
187
|
-
updated_at?: number | undefined;
|
|
188
|
-
organization_id?: string | undefined;
|
|
189
|
-
description?: string | undefined;
|
|
190
|
-
document_url?: string | undefined;
|
|
191
|
-
content?: string | undefined;
|
|
192
|
-
}, {
|
|
193
|
-
title: string;
|
|
194
|
-
_id?: string | undefined;
|
|
195
|
-
type?: string | undefined;
|
|
196
|
-
created_at?: number | undefined;
|
|
197
|
-
updated_at?: number | undefined;
|
|
198
|
-
organization_id?: string | undefined;
|
|
199
|
-
description?: string | undefined;
|
|
200
|
-
document_url?: string | undefined;
|
|
201
|
-
content?: string | undefined;
|
|
202
|
-
}>;
|
|
203
164
|
export declare const zodQuerySchema: z.ZodObject<{
|
|
204
165
|
_id: z.ZodOptional<z.ZodString>;
|
|
205
166
|
organization_id: z.ZodOptional<z.ZodString>;
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zodQuerySchema = exports.
|
|
3
|
+
exports.zodQuerySchema = exports.zodAgentSchema = exports.zodContextSchema = exports.zodUserSchema = exports.zodOrganizationSchema = exports.userRoles = exports.modelsList = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.modelsList = [
|
|
6
6
|
'gemini-2.5-flash-lite',
|
|
@@ -35,26 +35,24 @@ exports.zodUserSchema = zod_1.z.object({
|
|
|
35
35
|
first_name: zod_1.z.string().optional(),
|
|
36
36
|
last_name: zod_1.z.string().optional(),
|
|
37
37
|
active_until: zod_1.z.number().optional(),
|
|
38
|
-
notes: zod_1.z
|
|
39
|
-
.array(zod_1.z.object({
|
|
40
|
-
organization_id: zod_1.z.string(),
|
|
41
|
-
note: zod_1.z.string().max(500),
|
|
42
|
-
}))
|
|
43
|
-
.optional(),
|
|
38
|
+
notes: zod_1.z.string().max(500).optional(),
|
|
44
39
|
avatar: zod_1.z.string().url().optional(),
|
|
45
|
-
user_role: zod_1.z
|
|
46
|
-
.array(zod_1.z.object({
|
|
47
|
-
organization_id: zod_1.z.string(),
|
|
48
|
-
role: zod_1.z.enum(exports.userRoles),
|
|
49
|
-
}))
|
|
50
|
-
.optional(),
|
|
40
|
+
user_role: zod_1.z.enum(exports.userRoles).default('member').optional(),
|
|
51
41
|
created_at: zod_1.z.number().optional(),
|
|
52
|
-
updated_at: zod_1.z
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
updated_at: zod_1.z.number().optional(),
|
|
43
|
+
});
|
|
44
|
+
exports.zodContextSchema = zod_1.z.object({
|
|
45
|
+
_id: zod_1.z.string().optional(),
|
|
46
|
+
organization_id: zod_1.z.string().optional(),
|
|
47
|
+
file_id: zod_1.z.string().optional(),
|
|
48
|
+
title: zod_1.z.string().min(1).max(100),
|
|
49
|
+
description: zod_1.z.string().min(1).max(500).optional(),
|
|
50
|
+
file_url: zod_1.z.string().optional(),
|
|
51
|
+
type: zod_1.z.string().min(1).max(100).optional(),
|
|
52
|
+
size: zod_1.z.number().optional(),
|
|
53
|
+
tokens: zod_1.z.number().optional(),
|
|
54
|
+
created_at: zod_1.z.number().optional(),
|
|
55
|
+
updated_at: zod_1.z.number().optional(),
|
|
58
56
|
});
|
|
59
57
|
exports.zodAgentSchema = zod_1.z.object({
|
|
60
58
|
_id: zod_1.z.string().optional(),
|
|
@@ -71,17 +69,6 @@ exports.zodAgentSchema = zod_1.z.object({
|
|
|
71
69
|
created_at: zod_1.z.number().optional(),
|
|
72
70
|
updated_at: zod_1.z.number().optional(),
|
|
73
71
|
});
|
|
74
|
-
exports.zodContextSchema = zod_1.z.object({
|
|
75
|
-
_id: zod_1.z.string().optional(),
|
|
76
|
-
organization_id: zod_1.z.string().optional(),
|
|
77
|
-
title: zod_1.z.string().min(1).max(100),
|
|
78
|
-
description: zod_1.z.string().min(1).max(500).optional(),
|
|
79
|
-
document_url: zod_1.z.string().optional(),
|
|
80
|
-
type: zod_1.z.string().min(1).max(100).optional(),
|
|
81
|
-
content: zod_1.z.string().min(1).optional(),
|
|
82
|
-
created_at: zod_1.z.number().optional(),
|
|
83
|
-
updated_at: zod_1.z.number().optional(),
|
|
84
|
-
});
|
|
85
72
|
exports.zodQuerySchema = zod_1.z.object({
|
|
86
73
|
_id: zod_1.z.string().optional(),
|
|
87
74
|
organization_id: zod_1.z.string().optional(),
|
package/index.ts
CHANGED
|
@@ -42,11 +42,11 @@ export const UserSchema = Schema({
|
|
|
42
42
|
first_name: { type: String },
|
|
43
43
|
last_name: { type: String },
|
|
44
44
|
active_until: { type: Number },
|
|
45
|
-
notes: { type:
|
|
45
|
+
notes: { type: String, maxlength: 500 },
|
|
46
46
|
avatar: { type: String },
|
|
47
|
-
user_role: { type:
|
|
47
|
+
user_role: { type: String, enum: userRoles, required: true },
|
|
48
48
|
created_at: { type: Number },
|
|
49
|
-
updated_at: { type:
|
|
49
|
+
updated_at: { type: Number },
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
export const AgentSchema = Schema({
|
|
@@ -66,11 +66,13 @@ export const AgentSchema = Schema({
|
|
|
66
66
|
|
|
67
67
|
export const ContextSchema = Schema({
|
|
68
68
|
organization_id: { type: String },
|
|
69
|
+
file_id: { type: String },
|
|
69
70
|
title: { type: String, required: true, minlength: 1, maxlength: 100 },
|
|
70
71
|
description: { type: String, minlength: 1, maxlength: 500 },
|
|
71
|
-
|
|
72
|
+
file_url: { type: String },
|
|
72
73
|
type: { type: String, minlength: 1, maxlength: 100 },
|
|
73
|
-
|
|
74
|
+
size: { type: Number },
|
|
75
|
+
tokens: { type: Number },
|
|
74
76
|
created_at: { type: Number },
|
|
75
77
|
updated_at: { type: Number },
|
|
76
78
|
});
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -36,58 +36,39 @@ export const zodUserSchema = z.object({
|
|
|
36
36
|
first_name: z.string().optional(),
|
|
37
37
|
last_name: z.string().optional(),
|
|
38
38
|
active_until: z.number().optional(),
|
|
39
|
-
notes: z
|
|
40
|
-
.array(
|
|
41
|
-
z.object({
|
|
42
|
-
organization_id: z.string(),
|
|
43
|
-
note: z.string().max(500),
|
|
44
|
-
})
|
|
45
|
-
)
|
|
46
|
-
.optional(),
|
|
39
|
+
notes: z.string().max(500).optional(),
|
|
47
40
|
avatar: z.string().url().optional(),
|
|
48
|
-
user_role: z
|
|
49
|
-
.array(
|
|
50
|
-
z.object({
|
|
51
|
-
organization_id: z.string(),
|
|
52
|
-
role: z.enum(userRoles),
|
|
53
|
-
})
|
|
54
|
-
)
|
|
55
|
-
.optional(),
|
|
41
|
+
user_role: z.enum(userRoles).default('member').optional(),
|
|
56
42
|
created_at: z.number().optional(),
|
|
57
|
-
updated_at: z
|
|
58
|
-
.array(
|
|
59
|
-
z.object({
|
|
60
|
-
organization_id: z.string(),
|
|
61
|
-
timestamp: z.number(),
|
|
62
|
-
})
|
|
63
|
-
)
|
|
64
|
-
.optional(),
|
|
43
|
+
updated_at: z.number().optional(),
|
|
65
44
|
});
|
|
66
45
|
|
|
67
|
-
export const
|
|
46
|
+
export const zodContextSchema = z.object({
|
|
68
47
|
_id: z.string().optional(),
|
|
69
48
|
organization_id: z.string().optional(),
|
|
49
|
+
file_id: z.string().optional(),
|
|
70
50
|
title: z.string().min(1).max(100),
|
|
71
51
|
description: z.string().min(1).max(500).optional(),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
elevenlabs_voice_id: z.string().min(1).max(100).optional(),
|
|
77
|
-
message_count_limit: z.number().min(1).optional(),
|
|
78
|
-
is_editable: z.boolean().default(true).optional(),
|
|
52
|
+
file_url: z.string().optional(),
|
|
53
|
+
type: z.string().min(1).max(100).optional(),
|
|
54
|
+
size: z.number().optional(),
|
|
55
|
+
tokens: z.number().optional(),
|
|
79
56
|
created_at: z.number().optional(),
|
|
80
57
|
updated_at: z.number().optional(),
|
|
81
58
|
});
|
|
82
59
|
|
|
83
|
-
export const
|
|
60
|
+
export const zodAgentSchema = z.object({
|
|
84
61
|
_id: z.string().optional(),
|
|
85
62
|
organization_id: z.string().optional(),
|
|
86
63
|
title: z.string().min(1).max(100),
|
|
87
64
|
description: z.string().min(1).max(500).optional(),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
65
|
+
instructions: z.string().min(1).max(1000).optional(),
|
|
66
|
+
model: z.enum(modelsList),
|
|
67
|
+
temperature: z.number().min(0).max(1).optional(),
|
|
68
|
+
max_tokens: z.number().min(1).max(4000).optional(),
|
|
69
|
+
elevenlabs_voice_id: z.string().min(1).max(100).optional(),
|
|
70
|
+
message_count_limit: z.number().min(1).optional(),
|
|
71
|
+
is_editable: z.boolean().default(true).optional(),
|
|
91
72
|
created_at: z.number().optional(),
|
|
92
73
|
updated_at: z.number().optional(),
|
|
93
74
|
});
|