chatifai 1.0.6 → 1.0.7

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 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: [{ organization_id: String, note: { type: String, maxlength: 500 } }] },
53
+ notes: { type: String, maxlength: 500 },
54
54
  avatar: { type: String },
55
- user_role: { type: [{ organization_id: String, role: { type: String, enum: types_1.userRoles } }], required: true },
55
+ user_role: { type: String, enum: types_1.userRoles, required: true },
56
56
  created_at: { type: Number },
57
- updated_at: { type: [{ organization_id: String, timestamp: Number }] },
57
+ updated_at: { type: Number },
58
58
  });
59
59
  exports.AgentSchema = Schema({
60
60
  organization_id: { type: String },
package/dist/types.d.ts CHANGED
@@ -49,82 +49,37 @@ 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.ZodArray<z.ZodObject<{
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.ZodArray<z.ZodObject<{
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.ZodArray<z.ZodObject<{
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
- organization_id: string;
126
- role: "admin" | "member" | "client";
127
- }[] | undefined;
82
+ user_role?: "admin" | "member" | "client" | undefined;
128
83
  }>;
129
84
  export declare const zodAgentSchema: z.ZodObject<{
130
85
  _id: z.ZodOptional<z.ZodString>;
package/dist/types.js CHANGED
@@ -35,26 +35,11 @@ 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
- .array(zod_1.z.object({
54
- organization_id: zod_1.z.string(),
55
- timestamp: zod_1.z.number(),
56
- }))
57
- .optional(),
42
+ updated_at: zod_1.z.number().optional(),
58
43
  });
59
44
  exports.zodAgentSchema = zod_1.z.object({
60
45
  _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: [{ organization_id: String, note: { type: String, maxlength: 500 } }] },
45
+ notes: { type: String, maxlength: 500 },
46
46
  avatar: { type: String },
47
- user_role: { type: [{ organization_id: String, role: { type: String, enum: userRoles } }], required: true },
47
+ user_role: { type: String, enum: userRoles, required: true },
48
48
  created_at: { type: Number },
49
- updated_at: { type: [{ organization_id: String, timestamp: Number }] },
49
+ updated_at: { type: Number },
50
50
  });
51
51
 
52
52
  export const AgentSchema = Schema({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatifai",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
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
@@ -36,32 +36,11 @@ 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
46
  export const zodAgentSchema = z.object({