@cossistant/types 0.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/api/common.d.ts +44 -0
- package/dist/api/common.d.ts.map +1 -0
- package/dist/api/common.js +72 -0
- package/dist/api/common.js.map +1 -0
- package/dist/api/contact.d.ts +138 -0
- package/dist/api/contact.d.ts.map +1 -0
- package/dist/api/contact.js +297 -0
- package/dist/api/contact.js.map +1 -0
- package/dist/api/conversation.d.ts +91 -0
- package/dist/api/conversation.d.ts.map +1 -0
- package/dist/api/conversation.js +81 -0
- package/dist/api/conversation.js.map +1 -0
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.js +11 -0
- package/dist/api/organization.d.ts +15 -0
- package/dist/api/organization.d.ts.map +1 -0
- package/dist/api/organization.js +20 -0
- package/dist/api/organization.js.map +1 -0
- package/dist/api/timeline-item.d.ts +270 -0
- package/dist/api/timeline-item.d.ts.map +1 -0
- package/dist/api/timeline-item.js +111 -0
- package/dist/api/timeline-item.js.map +1 -0
- package/dist/api/upload.d.ts +100 -0
- package/dist/api/upload.d.ts.map +1 -0
- package/dist/api/upload.js +119 -0
- package/dist/api/upload.js.map +1 -0
- package/dist/api/user.d.ts +27 -0
- package/dist/api/user.d.ts.map +1 -0
- package/dist/api/user.js +52 -0
- package/dist/api/user.js.map +1 -0
- package/dist/api/visitor.d.ts +125 -0
- package/dist/api/visitor.d.ts.map +1 -0
- package/dist/api/visitor.js +301 -0
- package/dist/api/visitor.js.map +1 -0
- package/dist/api/website.d.ts +192 -0
- package/dist/api/website.d.ts.map +1 -0
- package/dist/api/website.js +320 -0
- package/dist/api/website.js.map +1 -0
- package/dist/enums.d.ts +79 -0
- package/dist/enums.d.ts.map +1 -0
- package/dist/enums.js +69 -0
- package/dist/enums.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/presence.d.ts +7 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +8 -0
- package/dist/presence.js.map +1 -0
- package/dist/realtime-events.d.ts +136 -0
- package/dist/realtime-events.d.ts.map +1 -0
- package/dist/realtime-events.js +99 -0
- package/dist/realtime-events.js.map +1 -0
- package/dist/schemas.d.ts +44 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +46 -0
- package/dist/schemas.js.map +1 -0
- package/dist/trpc/contact.d.ts +68 -0
- package/dist/trpc/contact.d.ts.map +1 -0
- package/dist/trpc/contact.js +45 -0
- package/dist/trpc/contact.js.map +1 -0
- package/dist/trpc/conversation.d.ts +139 -0
- package/dist/trpc/conversation.d.ts.map +1 -0
- package/dist/trpc/conversation.js +80 -0
- package/dist/trpc/conversation.js.map +1 -0
- package/dist/trpc/visitor.d.ts +53 -0
- package/dist/trpc/visitor.d.ts.map +1 -0
- package/dist/trpc/visitor.js +34 -0
- package/dist/trpc/visitor.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/realtime-events.d.ts
|
|
4
|
+
declare const baseRealtimeEvent: z.ZodObject<{
|
|
5
|
+
websiteId: z.ZodString;
|
|
6
|
+
organizationId: z.ZodString;
|
|
7
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
8
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
/**
|
|
11
|
+
* Central event system for real-time communication
|
|
12
|
+
* All WebSocket and Redis Pub/Sub events are defined here
|
|
13
|
+
*/
|
|
14
|
+
declare const realtimeSchema: {
|
|
15
|
+
readonly userConnected: z.ZodObject<{
|
|
16
|
+
websiteId: z.ZodString;
|
|
17
|
+
organizationId: z.ZodString;
|
|
18
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
19
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
20
|
+
connectionId: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
readonly userDisconnected: z.ZodObject<{
|
|
23
|
+
websiteId: z.ZodString;
|
|
24
|
+
organizationId: z.ZodString;
|
|
25
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
26
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
27
|
+
connectionId: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
readonly visitorConnected: z.ZodObject<{
|
|
30
|
+
websiteId: z.ZodString;
|
|
31
|
+
organizationId: z.ZodString;
|
|
32
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
33
|
+
visitorId: z.ZodString;
|
|
34
|
+
connectionId: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
readonly visitorDisconnected: z.ZodObject<{
|
|
37
|
+
websiteId: z.ZodString;
|
|
38
|
+
organizationId: z.ZodString;
|
|
39
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
40
|
+
visitorId: z.ZodString;
|
|
41
|
+
connectionId: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
readonly userPresenceUpdate: z.ZodObject<{
|
|
44
|
+
websiteId: z.ZodString;
|
|
45
|
+
organizationId: z.ZodString;
|
|
46
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
47
|
+
userId: z.ZodString;
|
|
48
|
+
status: z.ZodEnum<{
|
|
49
|
+
online: "online";
|
|
50
|
+
away: "away";
|
|
51
|
+
offline: "offline";
|
|
52
|
+
}>;
|
|
53
|
+
lastSeen: z.ZodString;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
readonly conversationSeen: z.ZodObject<{
|
|
56
|
+
websiteId: z.ZodString;
|
|
57
|
+
organizationId: z.ZodString;
|
|
58
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
59
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
60
|
+
conversationId: z.ZodString;
|
|
61
|
+
aiAgentId: z.ZodNullable<z.ZodString>;
|
|
62
|
+
lastSeenAt: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
readonly conversationTyping: z.ZodObject<{
|
|
65
|
+
websiteId: z.ZodString;
|
|
66
|
+
organizationId: z.ZodString;
|
|
67
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
68
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
69
|
+
conversationId: z.ZodString;
|
|
70
|
+
aiAgentId: z.ZodNullable<z.ZodString>;
|
|
71
|
+
isTyping: z.ZodBoolean;
|
|
72
|
+
visitorPreview: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
readonly timelineItemCreated: z.ZodObject<{
|
|
75
|
+
websiteId: z.ZodString;
|
|
76
|
+
organizationId: z.ZodString;
|
|
77
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
78
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
79
|
+
conversationId: z.ZodString;
|
|
80
|
+
item: z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
conversationId: z.ZodString;
|
|
83
|
+
organizationId: z.ZodString;
|
|
84
|
+
visibility: z.ZodEnum<{
|
|
85
|
+
[x: string]: any;
|
|
86
|
+
}>;
|
|
87
|
+
type: z.ZodEnum<{
|
|
88
|
+
[x: string]: any;
|
|
89
|
+
}>;
|
|
90
|
+
text: z.ZodNullable<z.ZodString>;
|
|
91
|
+
parts: z.ZodArray<z.ZodUnknown>;
|
|
92
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
93
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
94
|
+
aiAgentId: z.ZodNullable<z.ZodString>;
|
|
95
|
+
createdAt: z.ZodString;
|
|
96
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
97
|
+
tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
readonly conversationCreated: z.ZodObject<{
|
|
101
|
+
websiteId: z.ZodString;
|
|
102
|
+
organizationId: z.ZodString;
|
|
103
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
104
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
105
|
+
conversationId: z.ZodString;
|
|
106
|
+
conversation: any;
|
|
107
|
+
header: any;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
readonly visitorIdentified: z.ZodObject<{
|
|
110
|
+
websiteId: z.ZodString;
|
|
111
|
+
organizationId: z.ZodString;
|
|
112
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
113
|
+
visitorId: z.ZodString;
|
|
114
|
+
visitor: any;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
};
|
|
117
|
+
type RealtimeEventType = keyof typeof realtimeSchema;
|
|
118
|
+
type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<(typeof realtimeSchema)[T]>;
|
|
119
|
+
type RealtimeEvent<T extends RealtimeEventType> = {
|
|
120
|
+
type: T;
|
|
121
|
+
payload: RealtimeEventPayload<T>;
|
|
122
|
+
};
|
|
123
|
+
type AnyRealtimeEvent = { [K in RealtimeEventType]: RealtimeEvent<K> }[RealtimeEventType];
|
|
124
|
+
type RealtimeEventData<T extends RealtimeEventType> = RealtimeEventPayload<T>;
|
|
125
|
+
/**
|
|
126
|
+
* Validates an event against its schema
|
|
127
|
+
*/
|
|
128
|
+
declare function validateRealtimeEvent<T extends RealtimeEventType>(type: T, data: unknown): RealtimeEventPayload<T>;
|
|
129
|
+
/**
|
|
130
|
+
* Type guard to check if a string is a valid event type
|
|
131
|
+
*/
|
|
132
|
+
declare function isValidEventType(type: unknown): type is RealtimeEventType;
|
|
133
|
+
declare function getEventPayload<T extends RealtimeEventType>(event: RealtimeEvent<T>): RealtimeEventPayload<T>;
|
|
134
|
+
//#endregion
|
|
135
|
+
export { AnyRealtimeEvent, RealtimeEvent, RealtimeEventData, RealtimeEventPayload, RealtimeEventType, baseRealtimeEvent, getEventPayload, isValidEventType, realtimeSchema, validateRealtimeEvent };
|
|
136
|
+
//# sourceMappingURL=realtime-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;cAMa,mBAAiB,CAAA,CAAA;;EAAjB,cAAA,aAKX;;;;;;;;AAL4B,cAWjB,cAXiB,EAAA;EAAA,SAAA,aAAA,aAAA,CAAA;IAWjB,SAAA,aAiEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEE,iBAAA,gBAAiC;KAEjC,+BAA+B,qBAAqB,CAAA,CAAE,cACzD,gBAAgB;KAGb,wBAAwB;QAC7B;WACG,qBAAqB;;KAGnB,gBAAA,WACL,oBAAoB,cAAc,KACvC;KAEU,4BAA4B,qBACvC,qBAAqB;;;;iBAKN,gCAAgC,yBACzC,mBAEJ,qBAAqB;;;;iBAQR,gBAAA,yBAAyC;iBAIzC,0BAA0B,0BAClC,cAAc,KACnB,qBAAqB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ConversationTimelineType, TimelineItemVisibility } from "./enums.js";
|
|
2
|
+
import { conversationSchema } from "./schemas.js";
|
|
3
|
+
import { visitorResponseSchema } from "./api/visitor.js";
|
|
4
|
+
import { conversationHeaderSchema } from "./trpc/conversation.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
//#region src/realtime-events.ts
|
|
8
|
+
const baseRealtimeEvent = z.object({
|
|
9
|
+
websiteId: z.string(),
|
|
10
|
+
organizationId: z.string(),
|
|
11
|
+
visitorId: z.string().nullable(),
|
|
12
|
+
userId: z.string().nullable()
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Central event system for real-time communication
|
|
16
|
+
* All WebSocket and Redis Pub/Sub events are defined here
|
|
17
|
+
*/
|
|
18
|
+
const realtimeSchema = {
|
|
19
|
+
userConnected: baseRealtimeEvent.extend({ connectionId: z.string() }),
|
|
20
|
+
userDisconnected: baseRealtimeEvent.extend({ connectionId: z.string() }),
|
|
21
|
+
visitorConnected: baseRealtimeEvent.extend({
|
|
22
|
+
visitorId: z.string(),
|
|
23
|
+
connectionId: z.string()
|
|
24
|
+
}),
|
|
25
|
+
visitorDisconnected: baseRealtimeEvent.extend({
|
|
26
|
+
visitorId: z.string(),
|
|
27
|
+
connectionId: z.string()
|
|
28
|
+
}),
|
|
29
|
+
userPresenceUpdate: baseRealtimeEvent.extend({
|
|
30
|
+
userId: z.string(),
|
|
31
|
+
status: z.enum([
|
|
32
|
+
"online",
|
|
33
|
+
"away",
|
|
34
|
+
"offline"
|
|
35
|
+
]),
|
|
36
|
+
lastSeen: z.string()
|
|
37
|
+
}),
|
|
38
|
+
conversationSeen: baseRealtimeEvent.extend({
|
|
39
|
+
conversationId: z.string(),
|
|
40
|
+
aiAgentId: z.string().nullable(),
|
|
41
|
+
lastSeenAt: z.string()
|
|
42
|
+
}),
|
|
43
|
+
conversationTyping: baseRealtimeEvent.extend({
|
|
44
|
+
conversationId: z.string(),
|
|
45
|
+
aiAgentId: z.string().nullable(),
|
|
46
|
+
isTyping: z.boolean(),
|
|
47
|
+
visitorPreview: z.string().max(2e3).nullable().optional()
|
|
48
|
+
}),
|
|
49
|
+
timelineItemCreated: baseRealtimeEvent.extend({
|
|
50
|
+
conversationId: z.string(),
|
|
51
|
+
item: z.object({
|
|
52
|
+
id: z.string(),
|
|
53
|
+
conversationId: z.string(),
|
|
54
|
+
organizationId: z.string(),
|
|
55
|
+
visibility: z.enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE]),
|
|
56
|
+
type: z.enum([
|
|
57
|
+
ConversationTimelineType.MESSAGE,
|
|
58
|
+
ConversationTimelineType.EVENT,
|
|
59
|
+
ConversationTimelineType.IDENTIFICATION
|
|
60
|
+
]),
|
|
61
|
+
text: z.string().nullable(),
|
|
62
|
+
parts: z.array(z.unknown()),
|
|
63
|
+
userId: z.string().nullable(),
|
|
64
|
+
visitorId: z.string().nullable(),
|
|
65
|
+
aiAgentId: z.string().nullable(),
|
|
66
|
+
createdAt: z.string(),
|
|
67
|
+
deletedAt: z.string().nullable(),
|
|
68
|
+
tool: z.string().nullable().optional()
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
conversationCreated: baseRealtimeEvent.extend({
|
|
72
|
+
conversationId: z.string(),
|
|
73
|
+
conversation: conversationSchema,
|
|
74
|
+
header: conversationHeaderSchema
|
|
75
|
+
}),
|
|
76
|
+
visitorIdentified: baseRealtimeEvent.extend({
|
|
77
|
+
visitorId: z.string(),
|
|
78
|
+
visitor: visitorResponseSchema
|
|
79
|
+
})
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Validates an event against its schema
|
|
83
|
+
*/
|
|
84
|
+
function validateRealtimeEvent(type, data) {
|
|
85
|
+
return realtimeSchema[type].parse(data);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Type guard to check if a string is a valid event type
|
|
89
|
+
*/
|
|
90
|
+
function isValidEventType(type) {
|
|
91
|
+
return typeof type === "string" && type in realtimeSchema;
|
|
92
|
+
}
|
|
93
|
+
function getEventPayload(event) {
|
|
94
|
+
return event.payload;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
export { baseRealtimeEvent, getEventPayload, isValidEventType, realtimeSchema, validateRealtimeEvent };
|
|
99
|
+
//# sourceMappingURL=realtime-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime-events.js","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { visitorResponseSchema } from \"./api/visitor\";\nimport { ConversationTimelineType, TimelineItemVisibility } from \"./enums\";\nimport { conversationSchema } from \"./schemas\";\nimport { conversationHeaderSchema } from \"./trpc/conversation\";\n\nexport const baseRealtimeEvent = z.object({\n\twebsiteId: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string().nullable(),\n\tuserId: z.string().nullable(),\n});\n\n/**\n * Central event system for real-time communication\n * All WebSocket and Redis Pub/Sub events are defined here\n */\nexport const realtimeSchema = {\n\tuserConnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tuserDisconnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorConnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorDisconnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tuserPresenceUpdate: baseRealtimeEvent.extend({\n\t\tuserId: z.string(),\n\t\tstatus: z.enum([\"online\", \"away\", \"offline\"]),\n\t\tlastSeen: z.string(),\n\t}),\n\tconversationSeen: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tlastSeenAt: z.string(),\n\t}),\n\tconversationTyping: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tisTyping: z.boolean(),\n\t\tvisitorPreview: z.string().max(2000).nullable().optional(),\n\t}),\n\ttimelineItemCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\titem: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\tvisibility: z.enum([\n\t\t\t\tTimelineItemVisibility.PUBLIC,\n\t\t\t\tTimelineItemVisibility.PRIVATE,\n\t\t\t]),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t\t]),\n\t\t\ttext: z.string().nullable(),\n\t\t\tparts: z.array(z.unknown()),\n\t\t\tuserId: z.string().nullable(),\n\t\t\tvisitorId: z.string().nullable(),\n\t\t\taiAgentId: z.string().nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t\ttool: z.string().nullable().optional(),\n\t\t}),\n\t}),\n\tconversationCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\tconversation: conversationSchema,\n\t\theader: conversationHeaderSchema,\n\t}),\n\tvisitorIdentified: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tvisitor: visitorResponseSchema,\n\t}),\n} as const;\n\nexport type RealtimeEventType = keyof typeof realtimeSchema;\n\nexport type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<\n\t(typeof realtimeSchema)[T]\n>;\n\nexport type RealtimeEvent<T extends RealtimeEventType> = {\n\ttype: T;\n\tpayload: RealtimeEventPayload<T>;\n};\n\nexport type AnyRealtimeEvent = {\n\t[K in RealtimeEventType]: RealtimeEvent<K>;\n}[RealtimeEventType];\n\nexport type RealtimeEventData<T extends RealtimeEventType> =\n\tRealtimeEventPayload<T>;\n\n/**\n * Validates an event against its schema\n */\nexport function validateRealtimeEvent<T extends RealtimeEventType>(\n\ttype: T,\n\tdata: unknown\n): RealtimeEventPayload<T> {\n\tconst schema = realtimeSchema[type];\n\treturn schema.parse(data) as RealtimeEventPayload<T>;\n}\n\n/**\n * Type guard to check if a string is a valid event type\n */\nexport function isValidEventType(type: unknown): type is RealtimeEventType {\n\treturn typeof type === \"string\" && type in realtimeSchema;\n}\n\nexport function getEventPayload<T extends RealtimeEventType>(\n\tevent: RealtimeEvent<T>\n): RealtimeEventPayload<T> {\n\treturn event.payload;\n}\n"],"mappings":";;;;;;;AAMA,MAAa,oBAAoB,EAAE,OAAO;CACzC,WAAW,EAAE,QAAQ;CACrB,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC;;;;;AAMF,MAAa,iBAAiB;CAC7B,eAAe,kBAAkB,OAAO,EACvC,cAAc,EAAE,QAAQ,EACxB,CAAC;CACF,kBAAkB,kBAAkB,OAAO,EAC1C,cAAc,EAAE,QAAQ,EACxB,CAAC;CACF,kBAAkB,kBAAkB,OAAO;EAC1C,WAAW,EAAE,QAAQ;EACrB,cAAc,EAAE,QAAQ;EACxB,CAAC;CACF,qBAAqB,kBAAkB,OAAO;EAC7C,WAAW,EAAE,QAAQ;EACrB,cAAc,EAAE,QAAQ;EACxB,CAAC;CACF,oBAAoB,kBAAkB,OAAO;EAC5C,QAAQ,EAAE,QAAQ;EAClB,QAAQ,EAAE,KAAK;GAAC;GAAU;GAAQ;GAAU,CAAC;EAC7C,UAAU,EAAE,QAAQ;EACpB,CAAC;CACF,kBAAkB,kBAAkB,OAAO;EAC1C,gBAAgB,EAAE,QAAQ;EAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;EAChC,YAAY,EAAE,QAAQ;EACtB,CAAC;CACF,oBAAoB,kBAAkB,OAAO;EAC5C,gBAAgB,EAAE,QAAQ;EAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;EAChC,UAAU,EAAE,SAAS;EACrB,gBAAgB,EAAE,QAAQ,CAAC,IAAI,IAAK,CAAC,UAAU,CAAC,UAAU;EAC1D,CAAC;CACF,qBAAqB,kBAAkB,OAAO;EAC7C,gBAAgB,EAAE,QAAQ;EAC1B,MAAM,EAAE,OAAO;GACd,IAAI,EAAE,QAAQ;GACd,gBAAgB,EAAE,QAAQ;GAC1B,gBAAgB,EAAE,QAAQ;GAC1B,YAAY,EAAE,KAAK,CAClB,uBAAuB,QACvB,uBAAuB,QACvB,CAAC;GACF,MAAM,EAAE,KAAK;IACZ,yBAAyB;IACzB,yBAAyB;IACzB,yBAAyB;IACzB,CAAC;GACF,MAAM,EAAE,QAAQ,CAAC,UAAU;GAC3B,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC;GAC3B,QAAQ,EAAE,QAAQ,CAAC,UAAU;GAC7B,WAAW,EAAE,QAAQ,CAAC,UAAU;GAChC,WAAW,EAAE,QAAQ,CAAC,UAAU;GAChC,WAAW,EAAE,QAAQ;GACrB,WAAW,EAAE,QAAQ,CAAC,UAAU;GAChC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;GACtC,CAAC;EACF,CAAC;CACF,qBAAqB,kBAAkB,OAAO;EAC7C,gBAAgB,EAAE,QAAQ;EAC1B,cAAc;EACd,QAAQ;EACR,CAAC;CACF,mBAAmB,kBAAkB,OAAO;EAC3C,WAAW,EAAE,QAAQ;EACrB,SAAS;EACT,CAAC;CACF;;;;AAuBD,SAAgB,sBACf,MACA,MAC0B;AAE1B,QADe,eAAe,MAChB,MAAM,KAAK;;;;;AAM1B,SAAgB,iBAAiB,MAA0C;AAC1E,QAAO,OAAO,SAAS,YAAY,QAAQ;;AAG5C,SAAgB,gBACf,OAC0B;AAC1B,QAAO,MAAM"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/schemas.d.ts
|
|
4
|
+
declare const viewSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
description: z.ZodNullable<z.ZodString>;
|
|
8
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
9
|
+
organizationId: z.ZodString;
|
|
10
|
+
websiteId: z.ZodString;
|
|
11
|
+
createdAt: z.ZodString;
|
|
12
|
+
updatedAt: z.ZodString;
|
|
13
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
type InboxView = z.infer<typeof viewSchema>;
|
|
16
|
+
declare const conversationSchema: z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
title: z.ZodOptional<z.ZodString>;
|
|
19
|
+
createdAt: z.ZodString;
|
|
20
|
+
updatedAt: z.ZodString;
|
|
21
|
+
visitorId: z.ZodString;
|
|
22
|
+
websiteId: z.ZodString;
|
|
23
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
}>>;
|
|
26
|
+
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
lastTimelineItem: any;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
type Conversation = z.infer<typeof conversationSchema>;
|
|
30
|
+
declare const conversationSeenSchema: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
conversationId: z.ZodString;
|
|
33
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
34
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
35
|
+
aiAgentId: z.ZodNullable<z.ZodString>;
|
|
36
|
+
lastSeenAt: z.ZodString;
|
|
37
|
+
createdAt: z.ZodString;
|
|
38
|
+
updatedAt: z.ZodString;
|
|
39
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
type ConversationSeen = z.infer<typeof conversationSeenSchema>;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Conversation, ConversationSeen, InboxView, conversationSchema, conversationSeenSchema, viewSchema };
|
|
44
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","names":[],"sources":["../src/schemas.ts"],"sourcesContent":[],"mappings":";;;cAIa,YAAU,CAAA,CAAA;;EAAV,IAAA,aAUX;;;;;;;;;KAEU,SAAA,GAAY,CAAA,CAAE,aAAa;cAE1B,oBAAkB,CAAA,CAAA;;;;EAdR,SAAA,aAAA;EAAA,SAAA,aAAA;EAYX,SAAA,aAAS;EAER,MAAA,cAAA,UAgBX,CAAA;;;;;;KAEU,YAAA,GAAe,CAAA,CAAE,aAAa;cAE7B,wBAAsB,CAAA,CAAA;;;;;;;EApBJ,SAAA,aAAA;EAAA,SAAA,aAAA;EAkBnB,SAAA,eAAY,YAAkB,CAAA;AAE1C,CAAA,eAAa,CAAA;KAYD,gBAAA,GAAmB,CAAA,CAAE,aAAa"}
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ConversationStatus } from "./enums.js";
|
|
2
|
+
import { timelineItemSchema } from "./api/timeline-item.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/schemas.ts
|
|
6
|
+
const viewSchema = z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
name: z.string(),
|
|
9
|
+
description: z.string().nullable(),
|
|
10
|
+
prompt: z.string().nullable(),
|
|
11
|
+
organizationId: z.string(),
|
|
12
|
+
websiteId: z.string(),
|
|
13
|
+
createdAt: z.string(),
|
|
14
|
+
updatedAt: z.string(),
|
|
15
|
+
deletedAt: z.string().nullable()
|
|
16
|
+
});
|
|
17
|
+
const conversationSchema = z.object({
|
|
18
|
+
id: z.string(),
|
|
19
|
+
title: z.string().optional(),
|
|
20
|
+
createdAt: z.string(),
|
|
21
|
+
updatedAt: z.string(),
|
|
22
|
+
visitorId: z.string(),
|
|
23
|
+
websiteId: z.string(),
|
|
24
|
+
status: z.enum([
|
|
25
|
+
ConversationStatus.OPEN,
|
|
26
|
+
ConversationStatus.RESOLVED,
|
|
27
|
+
ConversationStatus.SPAM
|
|
28
|
+
]).default(ConversationStatus.OPEN),
|
|
29
|
+
deletedAt: z.string().nullable().default(null),
|
|
30
|
+
lastTimelineItem: timelineItemSchema.optional()
|
|
31
|
+
});
|
|
32
|
+
const conversationSeenSchema = z.object({
|
|
33
|
+
id: z.string(),
|
|
34
|
+
conversationId: z.string(),
|
|
35
|
+
userId: z.string().nullable(),
|
|
36
|
+
visitorId: z.string().nullable(),
|
|
37
|
+
aiAgentId: z.string().nullable(),
|
|
38
|
+
lastSeenAt: z.string(),
|
|
39
|
+
createdAt: z.string(),
|
|
40
|
+
updatedAt: z.string(),
|
|
41
|
+
deletedAt: z.string().nullable()
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { conversationSchema, conversationSeenSchema, viewSchema };
|
|
46
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","names":[],"sources":["../src/schemas.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { timelineItemSchema } from \"./api/timeline-item\";\nimport { ConversationEventType, ConversationStatus } from \"./enums\";\n\nexport const viewSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tdescription: z.string().nullable(),\n\tprompt: z.string().nullable(),\n\torganizationId: z.string(),\n\twebsiteId: z.string(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n});\n\nexport type InboxView = z.infer<typeof viewSchema>;\n\nexport const conversationSchema = z.object({\n\tid: z.string(),\n\ttitle: z.string().optional(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tvisitorId: z.string(),\n\twebsiteId: z.string(),\n\tstatus: z\n\t\t.enum([\n\t\t\tConversationStatus.OPEN,\n\t\t\tConversationStatus.RESOLVED,\n\t\t\tConversationStatus.SPAM,\n\t\t])\n\t\t.default(ConversationStatus.OPEN),\n\tdeletedAt: z.string().nullable().default(null),\n\tlastTimelineItem: timelineItemSchema.optional(),\n});\n\nexport type Conversation = z.infer<typeof conversationSchema>;\n\nexport const conversationSeenSchema = z.object({\n\tid: z.string(),\n\tconversationId: z.string(),\n\tuserId: z.string().nullable(),\n\tvisitorId: z.string().nullable(),\n\taiAgentId: z.string().nullable(),\n\tlastSeenAt: z.string(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n});\n\nexport type ConversationSeen = z.infer<typeof conversationSeenSchema>;\n"],"mappings":";;;;;AAIA,MAAa,aAAa,EAAE,OAAO;CAClC,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ;CAChB,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,CAAC;AAIF,MAAa,qBAAqB,EAAE,OAAO;CAC1C,IAAI,EAAE,QAAQ;CACd,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,QAAQ,EACN,KAAK;EACL,mBAAmB;EACnB,mBAAmB;EACnB,mBAAmB;EACnB,CAAC,CACD,QAAQ,mBAAmB,KAAK;CAClC,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK;CAC9C,kBAAkB,mBAAmB,UAAU;CAC/C,CAAC;AAIF,MAAa,yBAAyB,EAAE,OAAO;CAC9C,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ;CAC1B,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,YAAY,EAAE,QAAQ;CACtB,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/trpc/contact.d.ts
|
|
4
|
+
declare const contactListItemSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodULID;
|
|
6
|
+
name: z.ZodNullable<z.ZodString>;
|
|
7
|
+
email: z.ZodNullable<z.ZodString>;
|
|
8
|
+
image: z.ZodNullable<z.ZodString>;
|
|
9
|
+
createdAt: z.ZodString;
|
|
10
|
+
updatedAt: z.ZodString;
|
|
11
|
+
visitorCount: z.ZodNumber;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
type ContactListItem = z.infer<typeof contactListItemSchema>;
|
|
14
|
+
declare const contactListVisitorStatusSchema: z.ZodEnum<{
|
|
15
|
+
all: "all";
|
|
16
|
+
withVisitors: "withVisitors";
|
|
17
|
+
withoutVisitors: "withoutVisitors";
|
|
18
|
+
}>;
|
|
19
|
+
type ContactListVisitorStatus = z.infer<typeof contactListVisitorStatusSchema>;
|
|
20
|
+
declare const listContactsResponseSchema: z.ZodObject<{
|
|
21
|
+
items: z.ZodArray<z.ZodObject<{
|
|
22
|
+
id: z.ZodULID;
|
|
23
|
+
name: z.ZodNullable<z.ZodString>;
|
|
24
|
+
email: z.ZodNullable<z.ZodString>;
|
|
25
|
+
image: z.ZodNullable<z.ZodString>;
|
|
26
|
+
createdAt: z.ZodString;
|
|
27
|
+
updatedAt: z.ZodString;
|
|
28
|
+
visitorCount: z.ZodNumber;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
page: z.ZodNumber;
|
|
31
|
+
pageSize: z.ZodNumber;
|
|
32
|
+
totalCount: z.ZodNumber;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
type ListContactsResponse = z.infer<typeof listContactsResponseSchema>;
|
|
35
|
+
declare const contactVisitorSummarySchema: z.ZodObject<{
|
|
36
|
+
id: z.ZodULID;
|
|
37
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
38
|
+
createdAt: z.ZodString;
|
|
39
|
+
browser: z.ZodNullable<z.ZodString>;
|
|
40
|
+
device: z.ZodNullable<z.ZodString>;
|
|
41
|
+
country: z.ZodNullable<z.ZodString>;
|
|
42
|
+
city: z.ZodNullable<z.ZodString>;
|
|
43
|
+
language: z.ZodNullable<z.ZodString>;
|
|
44
|
+
blockedAt: z.ZodNullable<z.ZodString>;
|
|
45
|
+
blockedByUserId: z.ZodNullable<z.ZodString>;
|
|
46
|
+
isBlocked: z.ZodBoolean;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
type ContactVisitorSummary = z.infer<typeof contactVisitorSummarySchema>;
|
|
49
|
+
declare const contactDetailResponseSchema: z.ZodObject<{
|
|
50
|
+
contact: any;
|
|
51
|
+
visitors: z.ZodArray<z.ZodObject<{
|
|
52
|
+
id: z.ZodULID;
|
|
53
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
54
|
+
createdAt: z.ZodString;
|
|
55
|
+
browser: z.ZodNullable<z.ZodString>;
|
|
56
|
+
device: z.ZodNullable<z.ZodString>;
|
|
57
|
+
country: z.ZodNullable<z.ZodString>;
|
|
58
|
+
city: z.ZodNullable<z.ZodString>;
|
|
59
|
+
language: z.ZodNullable<z.ZodString>;
|
|
60
|
+
blockedAt: z.ZodNullable<z.ZodString>;
|
|
61
|
+
blockedByUserId: z.ZodNullable<z.ZodString>;
|
|
62
|
+
isBlocked: z.ZodBoolean;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
type ContactDetailResponse = z.infer<typeof contactDetailResponseSchema>;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { ContactDetailResponse, ContactListItem, ContactListVisitorStatus, ContactVisitorSummary, ListContactsResponse, contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactVisitorSummarySchema, listContactsResponseSchema };
|
|
68
|
+
//# sourceMappingURL=contact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact.d.ts","names":[],"sources":["../../src/trpc/contact.ts"],"sourcesContent":[],"mappings":";;;cAGa,uBAAqB,CAAA,CAAA;;EAArB,IAAA,eAAA,YAQX,CAAA;;;;;;;KAEU,eAAA,GAAkB,CAAA,CAAE,aAAa;cAEhC,gCAA8B,CAAA,CAAA;;;;CAZT,CAAA;AAAA,KAkBtB,wBAAA,GAA2B,CAAA,CAAE,KAlBP,CAAA,OAmB1B,8BAnB0B,CAAA;AAUtB,cAYC,0BAZgC,EAYN,CAAA,CAAA,SAZP,CAAA;EAEnB,KAAA,YAAA,YAAA,CAAA;IAMD,EAAA,WAAA;IAIC,IAAA,eAAA,YAKX,CAAA;;;;;;;;;;;KAEU,oBAAA,GAAuB,CAAA,CAAE,aAAa;cAErC,6BAA2B,CAAA,CAAA;;;;;;EATD,OAAA,eAAA,YAAA,CAAA;EAAA,IAAA,eAAA,YAAA,CAAA;EAO3B,QAAA,eAAoB,YAAkB,CAAA;EAErC,SAAA,eAAA,YAYX,CAAA;;;;KAEU,qBAAA,GAAwB,CAAA,CAAE,aAAa;cAEtC,6BAA2B,CAAA,CAAA;;;;;;;;;;;;;;;;AAhBA,KAqB5B,qBAAA,GAAwB,CAAA,CAAE,KArBE,CAAA,OAqBW,2BArBX,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { contactResponseSchema } from "../api/contact.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/trpc/contact.ts
|
|
5
|
+
const contactListItemSchema = z.object({
|
|
6
|
+
id: z.ulid(),
|
|
7
|
+
name: z.string().nullable(),
|
|
8
|
+
email: z.string().nullable(),
|
|
9
|
+
image: z.string().nullable(),
|
|
10
|
+
createdAt: z.string(),
|
|
11
|
+
updatedAt: z.string(),
|
|
12
|
+
visitorCount: z.number().int().min(0)
|
|
13
|
+
});
|
|
14
|
+
const contactListVisitorStatusSchema = z.enum([
|
|
15
|
+
"all",
|
|
16
|
+
"withVisitors",
|
|
17
|
+
"withoutVisitors"
|
|
18
|
+
]);
|
|
19
|
+
const listContactsResponseSchema = z.object({
|
|
20
|
+
items: z.array(contactListItemSchema),
|
|
21
|
+
page: z.number().int().min(1),
|
|
22
|
+
pageSize: z.number().int().min(1),
|
|
23
|
+
totalCount: z.number().int().min(0)
|
|
24
|
+
});
|
|
25
|
+
const contactVisitorSummarySchema = z.object({
|
|
26
|
+
id: z.ulid(),
|
|
27
|
+
lastSeenAt: z.string().datetime().nullable(),
|
|
28
|
+
createdAt: z.string().datetime(),
|
|
29
|
+
browser: z.string().nullable(),
|
|
30
|
+
device: z.string().nullable(),
|
|
31
|
+
country: z.string().nullable(),
|
|
32
|
+
city: z.string().nullable(),
|
|
33
|
+
language: z.string().nullable(),
|
|
34
|
+
blockedAt: z.string().datetime().nullable(),
|
|
35
|
+
blockedByUserId: z.string().nullable(),
|
|
36
|
+
isBlocked: z.boolean()
|
|
37
|
+
});
|
|
38
|
+
const contactDetailResponseSchema = z.object({
|
|
39
|
+
contact: contactResponseSchema,
|
|
40
|
+
visitors: z.array(contactVisitorSummarySchema)
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactVisitorSummarySchema, listContactsResponseSchema };
|
|
45
|
+
//# sourceMappingURL=contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact.js","names":[],"sources":["../../src/trpc/contact.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { contactResponseSchema } from \"../api/contact\";\n\nexport const contactListItemSchema = z.object({\n\tid: z.ulid(),\n\tname: z.string().nullable(),\n\temail: z.string().nullable(),\n\timage: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tvisitorCount: z.number().int().min(0),\n});\n\nexport type ContactListItem = z.infer<typeof contactListItemSchema>;\n\nexport const contactListVisitorStatusSchema = z.enum([\n\t\"all\",\n\t\"withVisitors\",\n\t\"withoutVisitors\",\n]);\n\nexport type ContactListVisitorStatus = z.infer<\n\ttypeof contactListVisitorStatusSchema\n>;\n\nexport const listContactsResponseSchema = z.object({\n\titems: z.array(contactListItemSchema),\n\tpage: z.number().int().min(1),\n\tpageSize: z.number().int().min(1),\n\ttotalCount: z.number().int().min(0),\n});\n\nexport type ListContactsResponse = z.infer<typeof listContactsResponseSchema>;\n\nexport const contactVisitorSummarySchema = z.object({\n\tid: z.ulid(),\n\tlastSeenAt: z.string().datetime().nullable(),\n\tcreatedAt: z.string().datetime(),\n\tbrowser: z.string().nullable(),\n\tdevice: z.string().nullable(),\n\tcountry: z.string().nullable(),\n\tcity: z.string().nullable(),\n\tlanguage: z.string().nullable(),\n\tblockedAt: z.string().datetime().nullable(),\n\tblockedByUserId: z.string().nullable(),\n\tisBlocked: z.boolean(),\n});\n\nexport type ContactVisitorSummary = z.infer<typeof contactVisitorSummarySchema>;\n\nexport const contactDetailResponseSchema = z.object({\n\tcontact: contactResponseSchema,\n\tvisitors: z.array(contactVisitorSummarySchema),\n});\n\nexport type ContactDetailResponse = z.infer<typeof contactDetailResponseSchema>;\n"],"mappings":";;;;AAGA,MAAa,wBAAwB,EAAE,OAAO;CAC7C,IAAI,EAAE,MAAM;CACZ,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,cAAc,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;CACrC,CAAC;AAIF,MAAa,iCAAiC,EAAE,KAAK;CACpD;CACA;CACA;CACA,CAAC;AAMF,MAAa,6BAA6B,EAAE,OAAO;CAClD,OAAO,EAAE,MAAM,sBAAsB;CACrC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;CAC7B,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;CACjC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;CACnC,CAAC;AAIF,MAAa,8BAA8B,EAAE,OAAO;CACnD,IAAI,EAAE,MAAM;CACZ,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC5C,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC3C,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,WAAW,EAAE,SAAS;CACtB,CAAC;AAIF,MAAa,8BAA8B,EAAE,OAAO;CACnD,SAAS;CACT,UAAU,EAAE,MAAM,4BAA4B;CAC9C,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/trpc/conversation.d.ts
|
|
4
|
+
declare const conversationStatusSchema: z.ZodEnum<{
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
}>;
|
|
7
|
+
declare const conversationPrioritySchema: z.ZodEnum<{
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
}>;
|
|
10
|
+
declare const conversationSentimentSchema: z.ZodNullable<z.ZodEnum<{
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
}>>;
|
|
13
|
+
declare const conversationRecordSchema: z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
organizationId: z.ZodString;
|
|
16
|
+
visitorId: z.ZodString;
|
|
17
|
+
websiteId: z.ZodString;
|
|
18
|
+
status: z.ZodEnum<{
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>;
|
|
21
|
+
priority: z.ZodEnum<{
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
}>;
|
|
24
|
+
sentiment: z.ZodNullable<z.ZodEnum<{
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
}>>;
|
|
27
|
+
sentimentConfidence: z.ZodNullable<z.ZodNumber>;
|
|
28
|
+
channel: z.ZodString;
|
|
29
|
+
title: z.ZodNullable<z.ZodString>;
|
|
30
|
+
resolutionTime: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
32
|
+
firstResponseAt: z.ZodNullable<z.ZodString>;
|
|
33
|
+
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
34
|
+
lastMessageAt: z.ZodNullable<z.ZodString>;
|
|
35
|
+
lastMessageBy: z.ZodNullable<z.ZodString>;
|
|
36
|
+
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
37
|
+
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
38
|
+
createdAt: z.ZodString;
|
|
39
|
+
updatedAt: z.ZodString;
|
|
40
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
type ConversationRecordResponse = z.infer<typeof conversationRecordSchema>;
|
|
43
|
+
declare const conversationMutationResponseSchema: z.ZodObject<{
|
|
44
|
+
conversation: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
organizationId: z.ZodString;
|
|
47
|
+
visitorId: z.ZodString;
|
|
48
|
+
websiteId: z.ZodString;
|
|
49
|
+
status: z.ZodEnum<{
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
}>;
|
|
52
|
+
priority: z.ZodEnum<{
|
|
53
|
+
[x: string]: any;
|
|
54
|
+
}>;
|
|
55
|
+
sentiment: z.ZodNullable<z.ZodEnum<{
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
}>>;
|
|
58
|
+
sentimentConfidence: z.ZodNullable<z.ZodNumber>;
|
|
59
|
+
channel: z.ZodString;
|
|
60
|
+
title: z.ZodNullable<z.ZodString>;
|
|
61
|
+
resolutionTime: z.ZodNullable<z.ZodNumber>;
|
|
62
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
63
|
+
firstResponseAt: z.ZodNullable<z.ZodString>;
|
|
64
|
+
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
65
|
+
lastMessageAt: z.ZodNullable<z.ZodString>;
|
|
66
|
+
lastMessageBy: z.ZodNullable<z.ZodString>;
|
|
67
|
+
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
68
|
+
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
69
|
+
createdAt: z.ZodString;
|
|
70
|
+
updatedAt: z.ZodString;
|
|
71
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
declare const conversationHeaderSchema: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
status: z.ZodEnum<{
|
|
77
|
+
[x: string]: any;
|
|
78
|
+
}>;
|
|
79
|
+
priority: z.ZodEnum<{
|
|
80
|
+
[x: string]: any;
|
|
81
|
+
}>;
|
|
82
|
+
organizationId: z.ZodString;
|
|
83
|
+
visitorId: z.ZodString;
|
|
84
|
+
visitor: any;
|
|
85
|
+
websiteId: z.ZodString;
|
|
86
|
+
channel: z.ZodString;
|
|
87
|
+
title: z.ZodNullable<z.ZodString>;
|
|
88
|
+
resolutionTime: z.ZodNullable<z.ZodNumber>;
|
|
89
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
90
|
+
firstResponseAt: z.ZodNullable<z.ZodString>;
|
|
91
|
+
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
92
|
+
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
93
|
+
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
94
|
+
createdAt: z.ZodString;
|
|
95
|
+
updatedAt: z.ZodString;
|
|
96
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
97
|
+
lastMessageAt: z.ZodNullable<z.ZodString>;
|
|
98
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
99
|
+
lastTimelineItem: any;
|
|
100
|
+
viewIds: z.ZodArray<z.ZodString>;
|
|
101
|
+
seenData: z.ZodArray<any>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
declare const listConversationHeadersResponseSchema: z.ZodObject<{
|
|
104
|
+
items: z.ZodArray<z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
status: z.ZodEnum<{
|
|
107
|
+
[x: string]: any;
|
|
108
|
+
}>;
|
|
109
|
+
priority: z.ZodEnum<{
|
|
110
|
+
[x: string]: any;
|
|
111
|
+
}>;
|
|
112
|
+
organizationId: z.ZodString;
|
|
113
|
+
visitorId: z.ZodString;
|
|
114
|
+
visitor: any;
|
|
115
|
+
websiteId: z.ZodString;
|
|
116
|
+
channel: z.ZodString;
|
|
117
|
+
title: z.ZodNullable<z.ZodString>;
|
|
118
|
+
resolutionTime: z.ZodNullable<z.ZodNumber>;
|
|
119
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
120
|
+
firstResponseAt: z.ZodNullable<z.ZodString>;
|
|
121
|
+
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
122
|
+
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
123
|
+
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
124
|
+
createdAt: z.ZodString;
|
|
125
|
+
updatedAt: z.ZodString;
|
|
126
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
127
|
+
lastMessageAt: z.ZodNullable<z.ZodString>;
|
|
128
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
129
|
+
lastTimelineItem: any;
|
|
130
|
+
viewIds: z.ZodArray<z.ZodString>;
|
|
131
|
+
seenData: z.ZodArray<any>;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
type ConversationMutationResponse = z.infer<typeof conversationMutationResponseSchema>;
|
|
136
|
+
type ConversationHeader = z.infer<typeof conversationHeaderSchema>;
|
|
137
|
+
//#endregion
|
|
138
|
+
export { ConversationHeader, ConversationMutationResponse, ConversationRecordResponse, conversationHeaderSchema, conversationMutationResponseSchema, conversationPrioritySchema, conversationRecordSchema, conversationSentimentSchema, conversationStatusSchema, listConversationHeadersResponseSchema };
|
|
139
|
+
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","names":[],"sources":["../../src/trpc/conversation.ts"],"sourcesContent":[],"mappings":";;;cAUa,0BAAwB,CAAA,CAAA;;AAArC,CAAA,CAAA;AAMa,cAAA,0BAA0B,EAAA,CAAA,CAAA,OAAA,CAAA;EAO1B,CAAA,CAAA,EAAA,MAAA,CAAA,EAAA,GAAA;AAQb,CAAA,CAAA;cARa,6BAA2B,CAAA,CAAA,YAAA,CAAA,CAAA;;;cAQ3B,0BAAwB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwBzB,0BAAA,GAA6B,CAAA,CAAE,aACnC;cAGK,oCAAkC,CAAA,CAAA;EA5BV,YAAA,aAAA,CAAA;IAAA,EAAA,aAAA;IAwBzB,cAAA,aAA0B;IAIzB,SAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAIA,0BAAwB,CAAA,CAAA;;;;;;;;;;EAJU,OAAA,EAAA,GAAA;EAAA,SAAA,aAAA;EAIlC,OAAA,aAAA;;;;;;;;;;;;;;;;;cA0BA,uCAAqC,CAAA,CAAA;;;;;;;;;;;;;;;;;IA1Bb,eAAA,eAAA,YAAA,CAAA;IAAA,UAAA,eAAA,YAAA,CAAA;IA0BxB,gBAAA,eAAA,YAGX,CAAA;;;;;;;;;;;;;KAEU,4BAAA,GAA+B,CAAA,CAAE,aACrC;KAGI,kBAAA,GAAqB,CAAA,CAAE,aAAa"}
|