@cossistant/core 0.1.0 → 0.1.1
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/client.d.ts +14 -2
- package/client.d.ts.map +1 -1
- package/client.js +25 -4
- package/client.js.map +1 -1
- package/env.d.ts +1 -0
- package/index.d.ts +7 -4
- package/index.js +6 -3
- package/package.json +1 -1
- package/realtime-client.d.ts +85 -0
- package/realtime-client.d.ts.map +1 -0
- package/realtime-client.js +463 -0
- package/realtime-client.js.map +1 -0
- package/realtime-event-filter.d.ts +15 -0
- package/realtime-event-filter.d.ts.map +1 -0
- package/realtime-event-filter.js +40 -0
- package/realtime-event-filter.js.map +1 -0
- package/resolve-public-key.d.ts +31 -0
- package/resolve-public-key.d.ts.map +1 -0
- package/resolve-public-key.js +52 -0
- package/resolve-public-key.js.map +1 -0
- package/rest-client.d.ts.map +1 -1
- package/rest-client.js +3 -2
- package/rest-client.js.map +1 -1
- package/store/seen-store.d.ts +1 -1
- package/store/timeline-items-store.d.ts.map +1 -1
- package/store/timeline-items-store.js +1 -1
- package/store/typing-store.d.ts +1 -1
- package/types/src/api/contact.js +297 -0
- package/types/src/api/contact.js.map +1 -0
- package/types/src/api/timeline-item.js +1 -1
- package/types/src/api/visitor.js +301 -0
- package/types/src/api/visitor.js.map +1 -0
- package/types/src/enums.js +12 -1
- package/types/src/enums.js.map +1 -1
- package/types/src/realtime-events.d.ts +2 -1
- package/types/src/realtime-events.d.ts.map +1 -1
- package/types/src/realtime-events.js +349 -0
- package/types/src/realtime-events.js.map +1 -0
- package/types/src/schemas.js +49 -0
- package/types/src/schemas.js.map +1 -0
- package/types/src/trpc/conversation.js +124 -0
- package/types/src/trpc/conversation.js.map +1 -0
- package/utils.d.ts.map +1 -1
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { contactResponseSchema } from "./contact.js";
|
|
2
|
+
import { z } from "@hono/zod-openapi";
|
|
3
|
+
|
|
4
|
+
//#region ../types/src/api/visitor.ts
|
|
5
|
+
/**
|
|
6
|
+
* Visitor metadata are stored as key value pairs
|
|
7
|
+
* Values can be strings, numbers, booleans, or null
|
|
8
|
+
*/
|
|
9
|
+
const visitorMetadataSchema = z.record(z.string(), z.string().or(z.number()).or(z.boolean()).or(z.null()));
|
|
10
|
+
/**
|
|
11
|
+
* Contact information for identified visitors
|
|
12
|
+
*/
|
|
13
|
+
const publicContactResponseSchema = z.object({
|
|
14
|
+
id: z.ulid().openapi({
|
|
15
|
+
description: "The contact's unique identifier.",
|
|
16
|
+
example: "01JG000000000000000000000"
|
|
17
|
+
}),
|
|
18
|
+
name: z.string().nullable().openapi({
|
|
19
|
+
description: "The contact's name.",
|
|
20
|
+
example: "John Doe"
|
|
21
|
+
}),
|
|
22
|
+
email: z.string().nullable().openapi({
|
|
23
|
+
description: "The contact's email address.",
|
|
24
|
+
example: "john.doe@example.com"
|
|
25
|
+
}),
|
|
26
|
+
image: z.string().nullable().openapi({
|
|
27
|
+
description: "The contact's avatar/profile image URL.",
|
|
28
|
+
example: "https://example.com/avatar.png"
|
|
29
|
+
}),
|
|
30
|
+
metadataHash: z.string().optional().openapi({
|
|
31
|
+
description: "Hash of the contact's metadata. Used to detect if metadata has changed without comparing full objects.",
|
|
32
|
+
example: "a1b2c3d4"
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Visitor data update request schema
|
|
37
|
+
*/
|
|
38
|
+
const updateVisitorRequestSchema = z.object({
|
|
39
|
+
externalId: z.string().openapi({
|
|
40
|
+
description: "External identifier for the visitor (e.g. from your system).",
|
|
41
|
+
example: "user_12345"
|
|
42
|
+
}).optional(),
|
|
43
|
+
name: z.string().openapi({
|
|
44
|
+
description: "The visitor's name.",
|
|
45
|
+
example: "John Doe"
|
|
46
|
+
}).optional(),
|
|
47
|
+
email: z.string().email().openapi({
|
|
48
|
+
description: "The visitor's email address.",
|
|
49
|
+
example: "john.doe@example.com"
|
|
50
|
+
}).optional(),
|
|
51
|
+
browser: z.string().openapi({
|
|
52
|
+
description: "The visitor's browser.",
|
|
53
|
+
example: "Chrome"
|
|
54
|
+
}).optional(),
|
|
55
|
+
browserVersion: z.string().openapi({
|
|
56
|
+
description: "The visitor's browser version.",
|
|
57
|
+
example: "120.0.0"
|
|
58
|
+
}).optional(),
|
|
59
|
+
os: z.string().openapi({
|
|
60
|
+
description: "The visitor's operating system.",
|
|
61
|
+
example: "Windows"
|
|
62
|
+
}).optional(),
|
|
63
|
+
osVersion: z.string().openapi({
|
|
64
|
+
description: "The visitor's operating system version.",
|
|
65
|
+
example: "11"
|
|
66
|
+
}).optional(),
|
|
67
|
+
device: z.string().openapi({
|
|
68
|
+
description: "The visitor's device.",
|
|
69
|
+
example: "MacBook Pro"
|
|
70
|
+
}).optional(),
|
|
71
|
+
deviceType: z.enum([
|
|
72
|
+
"desktop",
|
|
73
|
+
"mobile",
|
|
74
|
+
"tablet",
|
|
75
|
+
"unknown"
|
|
76
|
+
]).openapi({
|
|
77
|
+
description: "The visitor's device type.",
|
|
78
|
+
example: "desktop"
|
|
79
|
+
}).optional(),
|
|
80
|
+
ip: z.string().openapi({
|
|
81
|
+
description: "The visitor's IP address.",
|
|
82
|
+
example: "192.168.1.1"
|
|
83
|
+
}).optional(),
|
|
84
|
+
city: z.string().openapi({
|
|
85
|
+
description: "The visitor's city.",
|
|
86
|
+
example: "San Francisco"
|
|
87
|
+
}).optional(),
|
|
88
|
+
region: z.string().openapi({
|
|
89
|
+
description: "The visitor's region/state.",
|
|
90
|
+
example: "California"
|
|
91
|
+
}).optional(),
|
|
92
|
+
country: z.string().openapi({
|
|
93
|
+
description: "The visitor's country.",
|
|
94
|
+
example: "United States"
|
|
95
|
+
}).optional(),
|
|
96
|
+
countryCode: z.string().max(2).openapi({
|
|
97
|
+
description: "The visitor's country code (ISO 3166-1 alpha-2).",
|
|
98
|
+
example: "US"
|
|
99
|
+
}).optional(),
|
|
100
|
+
latitude: z.number().openapi({
|
|
101
|
+
description: "The visitor's latitude.",
|
|
102
|
+
example: 37.7749
|
|
103
|
+
}).optional(),
|
|
104
|
+
longitude: z.number().openapi({
|
|
105
|
+
description: "The visitor's longitude.",
|
|
106
|
+
example: -122.4194
|
|
107
|
+
}).optional(),
|
|
108
|
+
language: z.string().openapi({
|
|
109
|
+
description: "The visitor's preferred language.",
|
|
110
|
+
example: "en-US"
|
|
111
|
+
}).optional(),
|
|
112
|
+
timezone: z.string().openapi({
|
|
113
|
+
description: "The visitor's timezone.",
|
|
114
|
+
example: "America/Los_Angeles"
|
|
115
|
+
}).optional(),
|
|
116
|
+
screenResolution: z.string().openapi({
|
|
117
|
+
description: "The visitor's screen resolution.",
|
|
118
|
+
example: "1920x1080"
|
|
119
|
+
}).optional(),
|
|
120
|
+
viewport: z.string().openapi({
|
|
121
|
+
description: "The visitor's viewport size.",
|
|
122
|
+
example: "1920x900"
|
|
123
|
+
}).optional(),
|
|
124
|
+
metadata: visitorMetadataSchema.openapi({
|
|
125
|
+
description: "Additional custom metadata for the visitor.",
|
|
126
|
+
example: {
|
|
127
|
+
plan: "premium",
|
|
128
|
+
role: "admin"
|
|
129
|
+
}
|
|
130
|
+
}).optional()
|
|
131
|
+
});
|
|
132
|
+
const updateVisitorMetadataRequestSchema = z.object({ metadata: visitorMetadataSchema.openapi({
|
|
133
|
+
description: "Metadata payload to merge into the visitor's profile.",
|
|
134
|
+
example: {
|
|
135
|
+
plan: "premium",
|
|
136
|
+
role: "admin"
|
|
137
|
+
}
|
|
138
|
+
}) });
|
|
139
|
+
const visitorProfileSchema = z.object({
|
|
140
|
+
id: z.ulid().openapi({
|
|
141
|
+
description: "The visitor's unique identifier (ULID).",
|
|
142
|
+
example: "01JG000000000000000000000"
|
|
143
|
+
}),
|
|
144
|
+
lastSeenAt: z.string().nullable().openapi({
|
|
145
|
+
description: "When the visitor was last seen.",
|
|
146
|
+
example: "2021-01-01T00:00:00.000Z"
|
|
147
|
+
}),
|
|
148
|
+
blockedAt: z.string().nullable().openapi({
|
|
149
|
+
description: "When the visitor was blocked, if applicable.",
|
|
150
|
+
example: "2024-01-01T12:00:00.000Z"
|
|
151
|
+
}),
|
|
152
|
+
blockedByUserId: z.string().nullable().openapi({
|
|
153
|
+
description: "Identifier of the team member who blocked the visitor.",
|
|
154
|
+
example: "01JG000000000000000000001"
|
|
155
|
+
}),
|
|
156
|
+
isBlocked: z.boolean().openapi({
|
|
157
|
+
description: "Whether the visitor is currently blocked.",
|
|
158
|
+
example: true
|
|
159
|
+
}),
|
|
160
|
+
contact: publicContactResponseSchema.nullable()
|
|
161
|
+
});
|
|
162
|
+
/**
|
|
163
|
+
* Visitor response schema
|
|
164
|
+
*/
|
|
165
|
+
const visitorResponseSchema = z.object({
|
|
166
|
+
id: z.ulid().openapi({
|
|
167
|
+
description: "The visitor's unique identifier (ULID).",
|
|
168
|
+
example: "01JG000000000000000000000"
|
|
169
|
+
}),
|
|
170
|
+
browser: z.string().nullable().openapi({
|
|
171
|
+
description: "The visitor's browser.",
|
|
172
|
+
example: "Chrome"
|
|
173
|
+
}),
|
|
174
|
+
browserVersion: z.string().nullable().openapi({
|
|
175
|
+
description: "The visitor's browser version.",
|
|
176
|
+
example: "120.0.0"
|
|
177
|
+
}),
|
|
178
|
+
os: z.string().nullable().openapi({
|
|
179
|
+
description: "The visitor's operating system.",
|
|
180
|
+
example: "Windows"
|
|
181
|
+
}),
|
|
182
|
+
osVersion: z.string().nullable().openapi({
|
|
183
|
+
description: "The visitor's operating system version.",
|
|
184
|
+
example: "11"
|
|
185
|
+
}),
|
|
186
|
+
device: z.string().nullable().openapi({
|
|
187
|
+
description: "The visitor's device.",
|
|
188
|
+
example: "MacBook Pro"
|
|
189
|
+
}),
|
|
190
|
+
deviceType: z.string().nullable().openapi({
|
|
191
|
+
description: "The visitor's device type.",
|
|
192
|
+
example: "desktop"
|
|
193
|
+
}),
|
|
194
|
+
ip: z.string().nullable().openapi({
|
|
195
|
+
description: "The visitor's IP address.",
|
|
196
|
+
example: "192.168.1.1"
|
|
197
|
+
}),
|
|
198
|
+
city: z.string().nullable().openapi({
|
|
199
|
+
description: "The visitor's city.",
|
|
200
|
+
example: "San Francisco"
|
|
201
|
+
}),
|
|
202
|
+
region: z.string().nullable().openapi({
|
|
203
|
+
description: "The visitor's region/state.",
|
|
204
|
+
example: "California"
|
|
205
|
+
}),
|
|
206
|
+
country: z.string().nullable().openapi({
|
|
207
|
+
description: "The visitor's country.",
|
|
208
|
+
example: "United States"
|
|
209
|
+
}),
|
|
210
|
+
countryCode: z.string().nullable().openapi({
|
|
211
|
+
description: "The visitor's country code (ISO 3166-1 alpha-2).",
|
|
212
|
+
example: "US"
|
|
213
|
+
}),
|
|
214
|
+
latitude: z.number().nullable().openapi({
|
|
215
|
+
description: "The visitor's latitude.",
|
|
216
|
+
example: 37.7749
|
|
217
|
+
}),
|
|
218
|
+
longitude: z.number().nullable().openapi({
|
|
219
|
+
description: "The visitor's longitude.",
|
|
220
|
+
example: -122.4194
|
|
221
|
+
}),
|
|
222
|
+
language: z.string().nullable().openapi({
|
|
223
|
+
description: "The visitor's preferred language.",
|
|
224
|
+
example: "en-US"
|
|
225
|
+
}),
|
|
226
|
+
timezone: z.string().nullable().openapi({
|
|
227
|
+
description: "The visitor's timezone.",
|
|
228
|
+
example: "America/Los_Angeles"
|
|
229
|
+
}),
|
|
230
|
+
screenResolution: z.string().nullable().openapi({
|
|
231
|
+
description: "The visitor's screen resolution.",
|
|
232
|
+
example: "1920x1080"
|
|
233
|
+
}),
|
|
234
|
+
viewport: z.string().nullable().openapi({
|
|
235
|
+
description: "The visitor's viewport size.",
|
|
236
|
+
example: "1920x900"
|
|
237
|
+
}),
|
|
238
|
+
createdAt: z.string().openapi({
|
|
239
|
+
description: "When the visitor was first seen.",
|
|
240
|
+
example: "2021-01-01T00:00:00.000Z"
|
|
241
|
+
}),
|
|
242
|
+
updatedAt: z.string().openapi({
|
|
243
|
+
description: "When the visitor record was last updated.",
|
|
244
|
+
example: "2021-01-01T00:00:00.000Z"
|
|
245
|
+
}),
|
|
246
|
+
lastSeenAt: z.string().nullable().openapi({
|
|
247
|
+
description: "When the visitor was last connected or active.",
|
|
248
|
+
example: "2021-01-01T00:00:00.000Z"
|
|
249
|
+
}),
|
|
250
|
+
websiteId: z.ulid().openapi({
|
|
251
|
+
description: "The website's unique identifier that the visitor belongs to.",
|
|
252
|
+
example: "01JG000000000000000000000"
|
|
253
|
+
}),
|
|
254
|
+
organizationId: z.ulid().openapi({
|
|
255
|
+
description: "The organization's unique identifier that the visitor belongs to.",
|
|
256
|
+
example: "01JG000000000000000000000"
|
|
257
|
+
}),
|
|
258
|
+
blockedAt: z.string().nullable().openapi({
|
|
259
|
+
description: "When the visitor was blocked, if applicable.",
|
|
260
|
+
example: "2024-01-01T12:00:00.000Z"
|
|
261
|
+
}),
|
|
262
|
+
blockedByUserId: z.string().nullable().openapi({
|
|
263
|
+
description: "Identifier of the team member who blocked the visitor.",
|
|
264
|
+
example: "01JG000000000000000000001"
|
|
265
|
+
}),
|
|
266
|
+
isBlocked: z.boolean().openapi({
|
|
267
|
+
description: "Whether the visitor is currently blocked.",
|
|
268
|
+
example: true
|
|
269
|
+
}),
|
|
270
|
+
contact: contactResponseSchema.nullable()
|
|
271
|
+
});
|
|
272
|
+
/**
|
|
273
|
+
* Visitor response schema
|
|
274
|
+
*/
|
|
275
|
+
const publicVisitorResponseSchema = z.object({
|
|
276
|
+
id: z.ulid().openapi({
|
|
277
|
+
description: "The visitor's unique identifier (ULID).",
|
|
278
|
+
example: "01JG000000000000000000000"
|
|
279
|
+
}),
|
|
280
|
+
isBlocked: z.boolean().openapi({
|
|
281
|
+
description: "Whether the visitor is currently blocked.",
|
|
282
|
+
example: false
|
|
283
|
+
}),
|
|
284
|
+
language: z.string().nullable().openapi({
|
|
285
|
+
description: "The visitor's preferred language.",
|
|
286
|
+
example: "en-US"
|
|
287
|
+
}),
|
|
288
|
+
contact: publicContactResponseSchema.nullable().openapi({
|
|
289
|
+
description: "Contact information if the visitor has been identified via .identify().",
|
|
290
|
+
example: {
|
|
291
|
+
id: "01JG000000000000000000000",
|
|
292
|
+
name: "John Doe",
|
|
293
|
+
email: "john.doe@example.com",
|
|
294
|
+
image: "https://example.com/avatar.png"
|
|
295
|
+
}
|
|
296
|
+
})
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
//#endregion
|
|
300
|
+
export { visitorProfileSchema, visitorResponseSchema };
|
|
301
|
+
//# sourceMappingURL=visitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor.js","names":[],"sources":["../../../../../types/src/api/visitor.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\nimport { contactResponseSchema } from \"./contact\";\n\n/**\n * Visitor metadata are stored as key value pairs\n * Values can be strings, numbers, booleans, or null\n */\nexport const visitorMetadataSchema = z.record(\n\tz.string(),\n\tz.string().or(z.number()).or(z.boolean()).or(z.null())\n);\n\n/**\n * Contact information for identified visitors\n */\nexport const publicContactResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The contact's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().nullable().openapi({\n\t\tdescription: \"The contact's name.\",\n\t\texample: \"John Doe\",\n\t}),\n\temail: z.string().nullable().openapi({\n\t\tdescription: \"The contact's email address.\",\n\t\texample: \"john.doe@example.com\",\n\t}),\n\timage: z.string().nullable().openapi({\n\t\tdescription: \"The contact's avatar/profile image URL.\",\n\t\texample: \"https://example.com/avatar.png\",\n\t}),\n\tmetadataHash: z.string().optional().openapi({\n\t\tdescription:\n\t\t\t\"Hash of the contact's metadata. Used to detect if metadata has changed without comparing full objects.\",\n\t\texample: \"a1b2c3d4\",\n\t}),\n});\n\nexport type PublicContact = z.infer<typeof publicContactResponseSchema>;\n\nexport type VisitorMetadata = z.infer<typeof visitorMetadataSchema>;\n\n/**\n * Visitor data update request schema\n */\nexport const updateVisitorRequestSchema = z.object({\n\texternalId: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription:\n\t\t\t\t\"External identifier for the visitor (e.g. from your system).\",\n\t\t\texample: \"user_12345\",\n\t\t})\n\t\t.optional(),\n\tname: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's name.\",\n\t\t\texample: \"John Doe\",\n\t\t})\n\t\t.optional(),\n\temail: z\n\t\t.string()\n\t\t.email()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's email address.\",\n\t\t\texample: \"john.doe@example.com\",\n\t\t})\n\t\t.optional(),\n\tbrowser: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's browser.\",\n\t\t\texample: \"Chrome\",\n\t\t})\n\t\t.optional(),\n\tbrowserVersion: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's browser version.\",\n\t\t\texample: \"120.0.0\",\n\t\t})\n\t\t.optional(),\n\tos: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's operating system.\",\n\t\t\texample: \"Windows\",\n\t\t})\n\t\t.optional(),\n\tosVersion: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's operating system version.\",\n\t\t\texample: \"11\",\n\t\t})\n\t\t.optional(),\n\tdevice: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's device.\",\n\t\t\texample: \"MacBook Pro\",\n\t\t})\n\t\t.optional(),\n\tdeviceType: z\n\t\t.enum([\"desktop\", \"mobile\", \"tablet\", \"unknown\"])\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's device type.\",\n\t\t\texample: \"desktop\",\n\t\t})\n\t\t.optional(),\n\tip: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's IP address.\",\n\t\t\texample: \"192.168.1.1\",\n\t\t})\n\t\t.optional(),\n\tcity: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's city.\",\n\t\t\texample: \"San Francisco\",\n\t\t})\n\t\t.optional(),\n\tregion: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's region/state.\",\n\t\t\texample: \"California\",\n\t\t})\n\t\t.optional(),\n\tcountry: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's country.\",\n\t\t\texample: \"United States\",\n\t\t})\n\t\t.optional(),\n\tcountryCode: z\n\t\t.string()\n\t\t.max(2)\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's country code (ISO 3166-1 alpha-2).\",\n\t\t\texample: \"US\",\n\t\t})\n\t\t.optional(),\n\tlatitude: z\n\t\t.number()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's latitude.\",\n\t\t\texample: 37.7749,\n\t\t})\n\t\t.optional(),\n\tlongitude: z\n\t\t.number()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's longitude.\",\n\t\t\texample: -122.4194,\n\t\t})\n\t\t.optional(),\n\tlanguage: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's preferred language.\",\n\t\t\texample: \"en-US\",\n\t\t})\n\t\t.optional(),\n\ttimezone: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's timezone.\",\n\t\t\texample: \"America/Los_Angeles\",\n\t\t})\n\t\t.optional(),\n\tscreenResolution: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's screen resolution.\",\n\t\t\texample: \"1920x1080\",\n\t\t})\n\t\t.optional(),\n\tviewport: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The visitor's viewport size.\",\n\t\t\texample: \"1920x900\",\n\t\t})\n\t\t.optional(),\n\tmetadata: visitorMetadataSchema\n\t\t.openapi({\n\t\t\tdescription: \"Additional custom metadata for the visitor.\",\n\t\t\texample: { plan: \"premium\", role: \"admin\" },\n\t\t})\n\t\t.optional(),\n});\n\nexport type UpdateVisitorRequest = z.infer<typeof updateVisitorRequestSchema>;\n\nexport const updateVisitorMetadataRequestSchema = z.object({\n\tmetadata: visitorMetadataSchema.openapi({\n\t\tdescription: \"Metadata payload to merge into the visitor's profile.\",\n\t\texample: { plan: \"premium\", role: \"admin\" },\n\t}),\n});\n\nexport type UpdateVisitorMetadataRequest = z.infer<\n\ttypeof updateVisitorMetadataRequestSchema\n>;\n\nexport const visitorProfileSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The visitor's unique identifier (ULID).\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tlastSeenAt: z.string().nullable().openapi({\n\t\tdescription: \"When the visitor was last seen.\",\n\t\texample: \"2021-01-01T00:00:00.000Z\",\n\t}),\n\tblockedAt: z.string().nullable().openapi({\n\t\tdescription: \"When the visitor was blocked, if applicable.\",\n\t\texample: \"2024-01-01T12:00:00.000Z\",\n\t}),\n\tblockedByUserId: z.string().nullable().openapi({\n\t\tdescription: \"Identifier of the team member who blocked the visitor.\",\n\t\texample: \"01JG000000000000000000001\",\n\t}),\n\tisBlocked: z.boolean().openapi({\n\t\tdescription: \"Whether the visitor is currently blocked.\",\n\t\texample: true,\n\t}),\n\tcontact: publicContactResponseSchema.nullable(),\n});\n\n/**\n * Visitor response schema\n */\nexport const visitorResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The visitor's unique identifier (ULID).\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tbrowser: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's browser.\",\n\t\texample: \"Chrome\",\n\t}),\n\tbrowserVersion: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's browser version.\",\n\t\texample: \"120.0.0\",\n\t}),\n\tos: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's operating system.\",\n\t\texample: \"Windows\",\n\t}),\n\tosVersion: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's operating system version.\",\n\t\texample: \"11\",\n\t}),\n\tdevice: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's device.\",\n\t\texample: \"MacBook Pro\",\n\t}),\n\tdeviceType: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's device type.\",\n\t\texample: \"desktop\",\n\t}),\n\tip: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's IP address.\",\n\t\texample: \"192.168.1.1\",\n\t}),\n\tcity: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's city.\",\n\t\texample: \"San Francisco\",\n\t}),\n\tregion: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's region/state.\",\n\t\texample: \"California\",\n\t}),\n\tcountry: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's country.\",\n\t\texample: \"United States\",\n\t}),\n\tcountryCode: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's country code (ISO 3166-1 alpha-2).\",\n\t\texample: \"US\",\n\t}),\n\tlatitude: z.number().nullable().openapi({\n\t\tdescription: \"The visitor's latitude.\",\n\t\texample: 37.7749,\n\t}),\n\tlongitude: z.number().nullable().openapi({\n\t\tdescription: \"The visitor's longitude.\",\n\t\texample: -122.4194,\n\t}),\n\tlanguage: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's preferred language.\",\n\t\texample: \"en-US\",\n\t}),\n\ttimezone: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's timezone.\",\n\t\texample: \"America/Los_Angeles\",\n\t}),\n\tscreenResolution: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's screen resolution.\",\n\t\texample: \"1920x1080\",\n\t}),\n\tviewport: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's viewport size.\",\n\t\texample: \"1920x900\",\n\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"When the visitor was first seen.\",\n\t\texample: \"2021-01-01T00:00:00.000Z\",\n\t}),\n\tupdatedAt: z.string().openapi({\n\t\tdescription: \"When the visitor record was last updated.\",\n\t\texample: \"2021-01-01T00:00:00.000Z\",\n\t}),\n\tlastSeenAt: z.string().nullable().openapi({\n\t\tdescription: \"When the visitor was last connected or active.\",\n\t\texample: \"2021-01-01T00:00:00.000Z\",\n\t}),\n\twebsiteId: z.ulid().openapi({\n\t\tdescription: \"The website's unique identifier that the visitor belongs to.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription:\n\t\t\t\"The organization's unique identifier that the visitor belongs to.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tblockedAt: z.string().nullable().openapi({\n\t\tdescription: \"When the visitor was blocked, if applicable.\",\n\t\texample: \"2024-01-01T12:00:00.000Z\",\n\t}),\n\tblockedByUserId: z.string().nullable().openapi({\n\t\tdescription: \"Identifier of the team member who blocked the visitor.\",\n\t\texample: \"01JG000000000000000000001\",\n\t}),\n\tisBlocked: z.boolean().openapi({\n\t\tdescription: \"Whether the visitor is currently blocked.\",\n\t\texample: true,\n\t}),\n\tcontact: contactResponseSchema.nullable(),\n});\n\nexport type Visitor = z.infer<typeof visitorResponseSchema>;\nexport type VisitorResponse = Visitor;\n\n/**\n * Visitor response schema\n */\nexport const publicVisitorResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The visitor's unique identifier (ULID).\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tisBlocked: z.boolean().openapi({\n\t\tdescription: \"Whether the visitor is currently blocked.\",\n\t\texample: false,\n\t}),\n\tlanguage: z.string().nullable().openapi({\n\t\tdescription: \"The visitor's preferred language.\",\n\t\texample: \"en-US\",\n\t}),\n\tcontact: publicContactResponseSchema.nullable().openapi({\n\t\tdescription:\n\t\t\t\"Contact information if the visitor has been identified via .identify().\",\n\t\texample: {\n\t\t\tid: \"01JG000000000000000000000\",\n\t\t\tname: \"John Doe\",\n\t\t\temail: \"john.doe@example.com\",\n\t\t\timage: \"https://example.com/avatar.png\",\n\t\t},\n\t}),\n});\n\nexport type PublicVisitor = z.infer<typeof publicVisitorResponseSchema>;\nexport type PublicVisitorResponse = PublicVisitor;\n"],"mappings":";;;;;;;;AAOA,MAAa,wBAAwB,EAAE,OACtC,EAAE,QAAQ,EACV,EAAE,QAAQ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,SAAS;EACT,CAAC;CACF,iBAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;EAC9C,aAAa;EACb,SAAS;EACT,CAAC;CACF,WAAW,EAAE,SAAS,CAAC,QAAQ;EAC9B,aAAa;EACb,SAAS;EACT,CAAC;CACF,SAAS,sBAAsB,UAAU;CACzC,CAAC;;;;AAQF,MAAa,8BAA8B,EAAE,OAAO;CACnD,IAAI,EAAE,MAAM,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,WAAW,EAAE,SAAS,CAAC,QAAQ;EAC9B,aAAa;EACb,SAAS;EACT,CAAC;CACF,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;EACvC,aAAa;EACb,SAAS;EACT,CAAC;CACF,SAAS,4BAA4B,UAAU,CAAC,QAAQ;EACvD,aACC;EACD,SAAS;GACR,IAAI;GACJ,MAAM;GACN,OAAO;GACP,OAAO;GACP;EACD,CAAC;CACF,CAAC"}
|
package/types/src/enums.js
CHANGED
|
@@ -9,6 +9,12 @@ const ConversationStatus = {
|
|
|
9
9
|
RESOLVED: "resolved",
|
|
10
10
|
SPAM: "spam"
|
|
11
11
|
};
|
|
12
|
+
const ConversationPriority = {
|
|
13
|
+
LOW: "low",
|
|
14
|
+
NORMAL: "normal",
|
|
15
|
+
HIGH: "high",
|
|
16
|
+
URGENT: "urgent"
|
|
17
|
+
};
|
|
12
18
|
const TimelineItemVisibility = {
|
|
13
19
|
PUBLIC: "public",
|
|
14
20
|
PRIVATE: "private"
|
|
@@ -38,7 +44,12 @@ const ConversationEventType = {
|
|
|
38
44
|
TITLE_GENERATED: "title_generated",
|
|
39
45
|
AI_ESCALATED: "ai_escalated"
|
|
40
46
|
};
|
|
47
|
+
const ConversationSentiment = {
|
|
48
|
+
POSITIVE: "positive",
|
|
49
|
+
NEGATIVE: "negative",
|
|
50
|
+
NEUTRAL: "neutral"
|
|
51
|
+
};
|
|
41
52
|
|
|
42
53
|
//#endregion
|
|
43
|
-
export { ConversationEventType, ConversationStatus, ConversationTimelineType, SenderType, TimelineItemVisibility };
|
|
54
|
+
export { ConversationEventType, ConversationPriority, ConversationSentiment, ConversationStatus, ConversationTimelineType, SenderType, TimelineItemVisibility };
|
|
44
55
|
//# sourceMappingURL=enums.js.map
|
package/types/src/enums.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","names":[],"sources":["../../../../types/src/enums.ts"],"sourcesContent":["export const SenderType = {\n\tVISITOR: \"visitor\",\n\tTEAM_MEMBER: \"team_member\",\n\tAI: \"ai\",\n} as const;\n\nexport type SenderType = (typeof SenderType)[keyof typeof SenderType];\n\nexport const ConversationStatus = {\n\tOPEN: \"open\",\n\tRESOLVED: \"resolved\",\n\tSPAM: \"spam\",\n} as const;\n\nexport type ConversationStatus =\n\t(typeof ConversationStatus)[keyof typeof ConversationStatus];\n\nexport const ConversationPriority = {\n\tLOW: \"low\",\n\tNORMAL: \"normal\",\n\tHIGH: \"high\",\n\tURGENT: \"urgent\",\n} as const;\n\nexport const TimelineItemVisibility = {\n\tPUBLIC: \"public\",\n\tPRIVATE: \"private\",\n} as const;\n\nexport const ConversationTimelineType = {\n\tMESSAGE: \"message\",\n\tEVENT: \"event\",\n\tIDENTIFICATION: \"identification\",\n\tTOOL: \"tool\",\n} as const;\n\nexport type ConversationTimelineType =\n\t(typeof ConversationTimelineType)[keyof typeof ConversationTimelineType];\n\nexport const ConversationEventType = {\n\tASSIGNED: \"assigned\",\n\tUNASSIGNED: \"unassigned\",\n\tPARTICIPANT_REQUESTED: \"participant_requested\",\n\tPARTICIPANT_JOINED: \"participant_joined\",\n\tPARTICIPANT_LEFT: \"participant_left\",\n\tSTATUS_CHANGED: \"status_changed\",\n\tPRIORITY_CHANGED: \"priority_changed\",\n\tTAG_ADDED: \"tag_added\",\n\tTAG_REMOVED: \"tag_removed\",\n\tRESOLVED: \"resolved\",\n\tREOPENED: \"reopened\",\n\tVISITOR_BLOCKED: \"visitor_blocked\",\n\tVISITOR_UNBLOCKED: \"visitor_unblocked\",\n\tVISITOR_IDENTIFIED: \"visitor_identified\",\n\t// Private AI events (team only, not visible to visitors)\n\tAI_ANALYZED: \"ai_analyzed\",\n\tTITLE_GENERATED: \"title_generated\",\n\tAI_ESCALATED: \"ai_escalated\",\n} as const;\n\nexport const ConversationParticipationStatus = {\n\tREQUESTED: \"requested\",\n\tACTIVE: \"active\",\n\tLEFT: \"left\",\n\tDECLINED: \"declined\",\n} as const;\n\nexport const ConversationSentiment = {\n\tPOSITIVE: \"positive\",\n\tNEGATIVE: \"negative\",\n\tNEUTRAL: \"neutral\",\n} as const;\n\nexport type ConversationSentiment =\n\t(typeof ConversationSentiment)[keyof typeof ConversationSentiment];\n\nexport type ConversationParticipationStatus =\n\t(typeof ConversationParticipationStatus)[keyof typeof ConversationParticipationStatus];\n\nexport type ConversationEventType =\n\t(typeof ConversationEventType)[keyof typeof ConversationEventType];\n\nexport type TimelineItemVisibility =\n\t(typeof TimelineItemVisibility)[keyof typeof TimelineItemVisibility];\n\nexport type ConversationPriority =\n\t(typeof ConversationPriority)[keyof typeof ConversationPriority];\n\nexport const WebsiteInstallationTarget = {\n\tNEXTJS: \"nextjs\",\n\tREACT: \"react\",\n} as const;\n\nexport const WebsiteStatus = {\n\tACTIVE: \"active\",\n\tINACTIVE: \"inactive\",\n} as const;\n\nexport type WebsiteStatus = (typeof WebsiteStatus)[keyof typeof WebsiteStatus];\n\nexport type WebsiteInstallationTarget =\n\t(typeof WebsiteInstallationTarget)[keyof typeof WebsiteInstallationTarget];\n\nexport const APIKeyType = {\n\tPRIVATE: \"private\",\n\tPUBLIC: \"public\",\n} as const;\n\nexport type APIKeyType = (typeof APIKeyType)[keyof typeof APIKeyType];\n"],"mappings":";AAAA,MAAa,aAAa;CACzB,SAAS;CACT,aAAa;CACb,IAAI;CACJ;AAID,MAAa,qBAAqB;CACjC,MAAM;CACN,UAAU;CACV,MAAM;CACN;
|
|
1
|
+
{"version":3,"file":"enums.js","names":[],"sources":["../../../../types/src/enums.ts"],"sourcesContent":["export const SenderType = {\n\tVISITOR: \"visitor\",\n\tTEAM_MEMBER: \"team_member\",\n\tAI: \"ai\",\n} as const;\n\nexport type SenderType = (typeof SenderType)[keyof typeof SenderType];\n\nexport const ConversationStatus = {\n\tOPEN: \"open\",\n\tRESOLVED: \"resolved\",\n\tSPAM: \"spam\",\n} as const;\n\nexport type ConversationStatus =\n\t(typeof ConversationStatus)[keyof typeof ConversationStatus];\n\nexport const ConversationPriority = {\n\tLOW: \"low\",\n\tNORMAL: \"normal\",\n\tHIGH: \"high\",\n\tURGENT: \"urgent\",\n} as const;\n\nexport const TimelineItemVisibility = {\n\tPUBLIC: \"public\",\n\tPRIVATE: \"private\",\n} as const;\n\nexport const ConversationTimelineType = {\n\tMESSAGE: \"message\",\n\tEVENT: \"event\",\n\tIDENTIFICATION: \"identification\",\n\tTOOL: \"tool\",\n} as const;\n\nexport type ConversationTimelineType =\n\t(typeof ConversationTimelineType)[keyof typeof ConversationTimelineType];\n\nexport const ConversationEventType = {\n\tASSIGNED: \"assigned\",\n\tUNASSIGNED: \"unassigned\",\n\tPARTICIPANT_REQUESTED: \"participant_requested\",\n\tPARTICIPANT_JOINED: \"participant_joined\",\n\tPARTICIPANT_LEFT: \"participant_left\",\n\tSTATUS_CHANGED: \"status_changed\",\n\tPRIORITY_CHANGED: \"priority_changed\",\n\tTAG_ADDED: \"tag_added\",\n\tTAG_REMOVED: \"tag_removed\",\n\tRESOLVED: \"resolved\",\n\tREOPENED: \"reopened\",\n\tVISITOR_BLOCKED: \"visitor_blocked\",\n\tVISITOR_UNBLOCKED: \"visitor_unblocked\",\n\tVISITOR_IDENTIFIED: \"visitor_identified\",\n\t// Private AI events (team only, not visible to visitors)\n\tAI_ANALYZED: \"ai_analyzed\",\n\tTITLE_GENERATED: \"title_generated\",\n\tAI_ESCALATED: \"ai_escalated\",\n} as const;\n\nexport const ConversationParticipationStatus = {\n\tREQUESTED: \"requested\",\n\tACTIVE: \"active\",\n\tLEFT: \"left\",\n\tDECLINED: \"declined\",\n} as const;\n\nexport const ConversationSentiment = {\n\tPOSITIVE: \"positive\",\n\tNEGATIVE: \"negative\",\n\tNEUTRAL: \"neutral\",\n} as const;\n\nexport type ConversationSentiment =\n\t(typeof ConversationSentiment)[keyof typeof ConversationSentiment];\n\nexport type ConversationParticipationStatus =\n\t(typeof ConversationParticipationStatus)[keyof typeof ConversationParticipationStatus];\n\nexport type ConversationEventType =\n\t(typeof ConversationEventType)[keyof typeof ConversationEventType];\n\nexport type TimelineItemVisibility =\n\t(typeof TimelineItemVisibility)[keyof typeof TimelineItemVisibility];\n\nexport type ConversationPriority =\n\t(typeof ConversationPriority)[keyof typeof ConversationPriority];\n\nexport const WebsiteInstallationTarget = {\n\tNEXTJS: \"nextjs\",\n\tREACT: \"react\",\n} as const;\n\nexport const WebsiteStatus = {\n\tACTIVE: \"active\",\n\tINACTIVE: \"inactive\",\n} as const;\n\nexport type WebsiteStatus = (typeof WebsiteStatus)[keyof typeof WebsiteStatus];\n\nexport type WebsiteInstallationTarget =\n\t(typeof WebsiteInstallationTarget)[keyof typeof WebsiteInstallationTarget];\n\nexport const APIKeyType = {\n\tPRIVATE: \"private\",\n\tPUBLIC: \"public\",\n} as const;\n\nexport type APIKeyType = (typeof APIKeyType)[keyof typeof APIKeyType];\n"],"mappings":";AAAA,MAAa,aAAa;CACzB,SAAS;CACT,aAAa;CACb,IAAI;CACJ;AAID,MAAa,qBAAqB;CACjC,MAAM;CACN,UAAU;CACV,MAAM;CACN;AAKD,MAAa,uBAAuB;CACnC,KAAK;CACL,QAAQ;CACR,MAAM;CACN,QAAQ;CACR;AAED,MAAa,yBAAyB;CACrC,QAAQ;CACR,SAAS;CACT;AAED,MAAa,2BAA2B;CACvC,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB,MAAM;CACN;AAKD,MAAa,wBAAwB;CACpC,UAAU;CACV,YAAY;CACZ,uBAAuB;CACvB,oBAAoB;CACpB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,WAAW;CACX,aAAa;CACb,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CAEpB,aAAa;CACb,iBAAiB;CACjB,cAAc;CACd;AASD,MAAa,wBAAwB;CACpC,UAAU;CACV,UAAU;CACV,SAAS;CACT"}
|
|
@@ -1245,6 +1245,7 @@ type RealtimeEvent<T extends RealtimeEventType> = {
|
|
|
1245
1245
|
type: T;
|
|
1246
1246
|
payload: RealtimeEventPayload<T>;
|
|
1247
1247
|
};
|
|
1248
|
+
type AnyRealtimeEvent = { [K in RealtimeEventType]: RealtimeEvent<K> }[RealtimeEventType];
|
|
1248
1249
|
//#endregion
|
|
1249
|
-
export { RealtimeEvent };
|
|
1250
|
+
export { AnyRealtimeEvent, RealtimeEvent };
|
|
1250
1251
|
//# sourceMappingURL=realtime-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../../../../types/src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAsBa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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