@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,301 @@
|
|
|
1
|
+
import { contactResponseSchema } from "./contact.js";
|
|
2
|
+
import { z } from "@hono/zod-openapi";
|
|
3
|
+
|
|
4
|
+
//#region 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 { publicContactResponseSchema, publicVisitorResponseSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema };
|
|
301
|
+
//# sourceMappingURL=visitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor.js","names":[],"sources":["../../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,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CACtD;;;;AAKD,MAAa,8BAA8B,EAAE,OAAO;CACnD,IAAI,EAAE,MAAM,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;EACnC,aAAa;EACb,SAAS;EACT,CAAC;CACF,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;EACpC,aAAa;EACb,SAAS;EACT,CAAC;CACF,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;EACpC,aAAa;E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AAQ;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"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
|
|
3
|
+
//#region src/api/website.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Website creation request schema
|
|
7
|
+
*/
|
|
8
|
+
declare const createWebsiteRequestSchema: z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
domain: z.ZodString;
|
|
11
|
+
organizationId: z.ZodULID;
|
|
12
|
+
installationTarget: z.ZodEnum<any>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
type CreateWebsiteRequest = z.infer<typeof createWebsiteRequestSchema>;
|
|
15
|
+
declare const websiteApiKeySchema: z.ZodObject<{
|
|
16
|
+
id: z.ZodULID;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
key: z.ZodNullable<z.ZodString>;
|
|
19
|
+
keyType: z.ZodEnum<{
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
}>;
|
|
22
|
+
isTest: z.ZodBoolean;
|
|
23
|
+
isActive: z.ZodBoolean;
|
|
24
|
+
createdAt: z.ZodString;
|
|
25
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
26
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
type WebsiteApiKey = z.infer<typeof websiteApiKeySchema>;
|
|
29
|
+
declare const websiteSummarySchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodULID;
|
|
31
|
+
slug: z.ZodString;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
domain: z.ZodString;
|
|
34
|
+
contactEmail: z.ZodNullable<z.ZodString>;
|
|
35
|
+
logoUrl: z.ZodNullable<z.ZodString>;
|
|
36
|
+
organizationId: z.ZodULID;
|
|
37
|
+
whitelistedDomains: z.ZodArray<z.ZodURL>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
type WebsiteSummary = z.infer<typeof websiteSummarySchema>;
|
|
40
|
+
declare const websiteDeveloperSettingsResponseSchema: z.ZodObject<{
|
|
41
|
+
website: z.ZodObject<{
|
|
42
|
+
id: z.ZodULID;
|
|
43
|
+
slug: z.ZodString;
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
domain: z.ZodString;
|
|
46
|
+
contactEmail: z.ZodNullable<z.ZodString>;
|
|
47
|
+
logoUrl: z.ZodNullable<z.ZodString>;
|
|
48
|
+
organizationId: z.ZodULID;
|
|
49
|
+
whitelistedDomains: z.ZodArray<z.ZodURL>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
apiKeys: z.ZodArray<z.ZodObject<{
|
|
52
|
+
id: z.ZodULID;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
key: z.ZodNullable<z.ZodString>;
|
|
55
|
+
keyType: z.ZodEnum<{
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
}>;
|
|
58
|
+
isTest: z.ZodBoolean;
|
|
59
|
+
isActive: z.ZodBoolean;
|
|
60
|
+
createdAt: z.ZodString;
|
|
61
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
62
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
type WebsiteDeveloperSettingsResponse = z.infer<typeof websiteDeveloperSettingsResponseSchema>;
|
|
66
|
+
declare const createWebsiteApiKeyRequestSchema: z.ZodObject<{
|
|
67
|
+
organizationId: z.ZodULID;
|
|
68
|
+
websiteId: z.ZodULID;
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
keyType: z.ZodEnum<{
|
|
71
|
+
[x: string]: any;
|
|
72
|
+
}>;
|
|
73
|
+
isTest: z.ZodBoolean;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
type CreateWebsiteApiKeyRequest = z.infer<typeof createWebsiteApiKeyRequestSchema>;
|
|
76
|
+
declare const revokeWebsiteApiKeyRequestSchema: z.ZodObject<{
|
|
77
|
+
organizationId: z.ZodULID;
|
|
78
|
+
websiteId: z.ZodULID;
|
|
79
|
+
apiKeyId: z.ZodULID;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
type RevokeWebsiteApiKeyRequest = z.infer<typeof revokeWebsiteApiKeyRequestSchema>;
|
|
82
|
+
declare const updateWebsiteRequestSchema: z.ZodObject<{
|
|
83
|
+
organizationId: z.ZodULID;
|
|
84
|
+
websiteId: z.ZodULID;
|
|
85
|
+
data: z.ZodObject<{
|
|
86
|
+
name: z.ZodOptional<z.ZodString>;
|
|
87
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
88
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
89
|
+
contactEmail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
+
logoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
whitelistedDomains: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
93
|
+
installationTarget: z.ZodOptional<z.ZodEnum<any>>;
|
|
94
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
[x: string]: any;
|
|
96
|
+
}>>;
|
|
97
|
+
teamId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
type UpdateWebsiteRequest = z.infer<typeof updateWebsiteRequestSchema>;
|
|
101
|
+
/**
|
|
102
|
+
* Website creation response schema
|
|
103
|
+
*/
|
|
104
|
+
declare const createWebsiteResponseSchema: z.ZodObject<{
|
|
105
|
+
id: z.ZodULID;
|
|
106
|
+
name: z.ZodString;
|
|
107
|
+
slug: z.ZodString;
|
|
108
|
+
whitelistedDomains: z.ZodArray<z.ZodURL>;
|
|
109
|
+
organizationId: z.ZodULID;
|
|
110
|
+
apiKeys: z.ZodArray<z.ZodObject<{
|
|
111
|
+
id: z.ZodULID;
|
|
112
|
+
name: z.ZodString;
|
|
113
|
+
key: z.ZodNullable<z.ZodString>;
|
|
114
|
+
keyType: z.ZodEnum<{
|
|
115
|
+
[x: string]: any;
|
|
116
|
+
}>;
|
|
117
|
+
isTest: z.ZodBoolean;
|
|
118
|
+
isActive: z.ZodBoolean;
|
|
119
|
+
createdAt: z.ZodString;
|
|
120
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
121
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
type CreateWebsiteResponse = z.infer<typeof createWebsiteResponseSchema>;
|
|
125
|
+
/**
|
|
126
|
+
* Website domain validation request schema
|
|
127
|
+
*/
|
|
128
|
+
declare const checkWebsiteDomainRequestSchema: z.ZodObject<{
|
|
129
|
+
domain: z.ZodString;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
type CheckWebsiteDomainRequest = z.infer<typeof checkWebsiteDomainRequestSchema>;
|
|
132
|
+
declare const availableHumanAgentSchema: z.ZodObject<{
|
|
133
|
+
id: z.ZodULID;
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
image: z.ZodNullable<z.ZodString>;
|
|
136
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
declare const AvailableAIAgentSchema: z.ZodObject<{
|
|
139
|
+
id: z.ZodULID;
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
image: z.ZodNullable<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
/**
|
|
144
|
+
* Website information response schema
|
|
145
|
+
*/
|
|
146
|
+
declare const publicWebsiteResponseSchema: z.ZodObject<{
|
|
147
|
+
id: z.ZodULID;
|
|
148
|
+
name: z.ZodString;
|
|
149
|
+
domain: z.ZodString;
|
|
150
|
+
description: z.ZodNullable<z.ZodString>;
|
|
151
|
+
logoUrl: z.ZodNullable<z.ZodString>;
|
|
152
|
+
organizationId: z.ZodULID;
|
|
153
|
+
status: z.ZodString;
|
|
154
|
+
lastOnlineAt: z.ZodNullable<z.ZodString>;
|
|
155
|
+
availableHumanAgents: z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodULID;
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
image: z.ZodNullable<z.ZodString>;
|
|
159
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
availableAIAgents: z.ZodArray<z.ZodObject<{
|
|
162
|
+
id: z.ZodULID;
|
|
163
|
+
name: z.ZodString;
|
|
164
|
+
image: z.ZodNullable<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
visitor: any;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
type PublicWebsiteResponse = z.infer<typeof publicWebsiteResponseSchema>;
|
|
169
|
+
type AvailableHumanAgent = z.infer<typeof availableHumanAgentSchema>;
|
|
170
|
+
type AvailableAIAgent = z.infer<typeof AvailableAIAgentSchema>;
|
|
171
|
+
/**
|
|
172
|
+
* List websites by organization request schema
|
|
173
|
+
*/
|
|
174
|
+
declare const listByOrganizationRequestSchema: z.ZodObject<{
|
|
175
|
+
organizationId: z.ZodULID;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
type ListByOrganizationRequest = z.infer<typeof listByOrganizationRequestSchema>;
|
|
178
|
+
/**
|
|
179
|
+
* Website list item schema - simplified website info for listing
|
|
180
|
+
*/
|
|
181
|
+
declare const websiteListItemSchema: z.ZodObject<{
|
|
182
|
+
id: z.ZodULID;
|
|
183
|
+
name: z.ZodString;
|
|
184
|
+
slug: z.ZodString;
|
|
185
|
+
logoUrl: z.ZodNullable<z.ZodString>;
|
|
186
|
+
domain: z.ZodString;
|
|
187
|
+
organizationId: z.ZodULID;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
type WebsiteListItem = z.infer<typeof websiteListItemSchema>;
|
|
190
|
+
//#endregion
|
|
191
|
+
export { AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, CheckWebsiteDomainRequest, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, ListByOrganizationRequest, PublicWebsiteResponse, RevokeWebsiteApiKeyRequest, UpdateWebsiteRequest, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteListItem, WebsiteSummary, availableHumanAgentSchema, checkWebsiteDomainRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, listByOrganizationRequestSchema, publicWebsiteResponseSchema, revokeWebsiteApiKeyRequestSchema, updateWebsiteRequestSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
|
|
192
|
+
//# sourceMappingURL=website.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website.d.ts","names":[],"sources":["../../src/api/website.ts"],"sourcesContent":[],"mappings":";;;;;;AAOA;cAAa,4BAA0B,CAAA,CAAA;;;;;CAAA,eAAA,CAAA;AAAA,KA8B3B,oBAAA,GAAuB,CAAA,CAAE,KA9BE,CAAA,OA8BW,0BA9BX,CAAA;AA8B3B,cASC,mBATqC,EASlB,CAAA,CAAA,SATkB,CAAA;EASrC,EAAA,WAAA;;;;;;;;;;;;KA6CD,aAAA,GAAgB,CAAA,CAAE,aAAa;cAE9B,sBAAoB,CAAA,CAAA;EA/CD,EAAA,WAAA;EAAA,IAAA,aAAA;EA6CpB,IAAA,aAAa;EAEZ,MAAA,aAAA;;;;;;KAuCD,cAAA,GAAiB,CAAA,CAAE,aAAa;cAE/B,wCAAsC,CAAA,CAAA;;;;;;IAzClB,YAAA,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