@cossistant/core 0.0.22 → 0.0.24

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.
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
8
11
  var __export = (all) => {
9
12
  let target = {};
10
13
  for (var name in all) __defProp(target, name, {
@@ -30,4 +33,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
33
  }) : target, mod));
31
34
 
32
35
  //#endregion
33
- export { __export, __reExport };
36
+ export { __commonJS, __export, __reExport, __toESM };
package/conversation.d.ts CHANGED
@@ -17,8 +17,8 @@ declare const createConversationRequestSchema: ZodObject<{
17
17
  private: "private";
18
18
  }>;
19
19
  type: ZodEnum<{
20
- message: "message";
21
20
  event: "event";
21
+ message: "message";
22
22
  identification: "identification";
23
23
  }>;
24
24
  text: ZodNullable<ZodString>;
@@ -29,7 +29,6 @@ declare const createConversationRequestSchema: ZodObject<{
29
29
  }, $strip>, ZodObject<{
30
30
  type: ZodLiteral<"event">;
31
31
  eventType: ZodEnum<{
32
- resolved: "resolved";
33
32
  assigned: "assigned";
34
33
  unassigned: "unassigned";
35
34
  participant_requested: "participant_requested";
@@ -39,6 +38,7 @@ declare const createConversationRequestSchema: ZodObject<{
39
38
  priority_changed: "priority_changed";
40
39
  tag_added: "tag_added";
41
40
  tag_removed: "tag_removed";
41
+ resolved: "resolved";
42
42
  reopened: "reopened";
43
43
  visitor_blocked: "visitor_blocked";
44
44
  visitor_unblocked: "visitor_unblocked";
@@ -90,8 +90,8 @@ declare const createConversationResponseSchema: ZodObject<{
90
90
  private: "private";
91
91
  }>;
92
92
  type: ZodEnum<{
93
- message: "message";
94
93
  event: "event";
94
+ message: "message";
95
95
  identification: "identification";
96
96
  }>;
97
97
  text: ZodNullable<ZodString>;
@@ -102,7 +102,6 @@ declare const createConversationResponseSchema: ZodObject<{
102
102
  }, $strip>, ZodObject<{
103
103
  type: ZodLiteral<"event">;
104
104
  eventType: ZodEnum<{
105
- resolved: "resolved";
106
105
  assigned: "assigned";
107
106
  unassigned: "unassigned";
108
107
  participant_requested: "participant_requested";
@@ -112,6 +111,7 @@ declare const createConversationResponseSchema: ZodObject<{
112
111
  priority_changed: "priority_changed";
113
112
  tag_added: "tag_added";
114
113
  tag_removed: "tag_removed";
114
+ resolved: "resolved";
115
115
  reopened: "reopened";
116
116
  visitor_blocked: "visitor_blocked";
117
117
  visitor_unblocked: "visitor_unblocked";
@@ -158,8 +158,8 @@ declare const createConversationResponseSchema: ZodObject<{
158
158
  visitorId: ZodString;
159
159
  websiteId: ZodString;
160
160
  status: ZodDefault<ZodEnum<{
161
- open: "open";
162
161
  resolved: "resolved";
162
+ open: "open";
163
163
  spam: "spam";
164
164
  }>>;
165
165
  deletedAt: ZodDefault<ZodNullable<ZodString>>;
@@ -172,8 +172,8 @@ declare const createConversationResponseSchema: ZodObject<{
172
172
  private: "private";
173
173
  }>;
174
174
  type: ZodEnum<{
175
- message: "message";
176
175
  event: "event";
176
+ message: "message";
177
177
  identification: "identification";
178
178
  }>;
179
179
  text: ZodNullable<ZodString>;
@@ -184,7 +184,6 @@ declare const createConversationResponseSchema: ZodObject<{
184
184
  }, $strip>, ZodObject<{
185
185
  type: ZodLiteral<"event">;
186
186
  eventType: ZodEnum<{
187
- resolved: "resolved";
188
187
  assigned: "assigned";
189
188
  unassigned: "unassigned";
190
189
  participant_requested: "participant_requested";
@@ -194,6 +193,7 @@ declare const createConversationResponseSchema: ZodObject<{
194
193
  priority_changed: "priority_changed";
195
194
  tag_added: "tag_added";
196
195
  tag_removed: "tag_removed";
196
+ resolved: "resolved";
197
197
  reopened: "reopened";
198
198
  visitor_blocked: "visitor_blocked";
199
199
  visitor_unblocked: "visitor_unblocked";
@@ -262,8 +262,8 @@ declare const listConversationsResponseSchema: ZodObject<{
262
262
  visitorId: ZodString;
263
263
  websiteId: ZodString;
264
264
  status: ZodDefault<ZodEnum<{
265
- open: "open";
266
265
  resolved: "resolved";
266
+ open: "open";
267
267
  spam: "spam";
268
268
  }>>;
269
269
  deletedAt: ZodDefault<ZodNullable<ZodString>>;
@@ -276,8 +276,8 @@ declare const listConversationsResponseSchema: ZodObject<{
276
276
  private: "private";
277
277
  }>;
278
278
  type: ZodEnum<{
279
- message: "message";
280
279
  event: "event";
280
+ message: "message";
281
281
  identification: "identification";
282
282
  }>;
283
283
  text: ZodNullable<ZodString>;
@@ -288,7 +288,6 @@ declare const listConversationsResponseSchema: ZodObject<{
288
288
  }, $strip>, ZodObject<{
289
289
  type: ZodLiteral<"event">;
290
290
  eventType: ZodEnum<{
291
- resolved: "resolved";
292
291
  assigned: "assigned";
293
292
  unassigned: "unassigned";
294
293
  participant_requested: "participant_requested";
@@ -298,6 +297,7 @@ declare const listConversationsResponseSchema: ZodObject<{
298
297
  priority_changed: "priority_changed";
299
298
  tag_added: "tag_added";
300
299
  tag_removed: "tag_removed";
300
+ resolved: "resolved";
301
301
  reopened: "reopened";
302
302
  visitor_blocked: "visitor_blocked";
303
303
  visitor_unblocked: "visitor_unblocked";
@@ -359,8 +359,8 @@ declare const getConversationResponseSchema: ZodObject<{
359
359
  visitorId: ZodString;
360
360
  websiteId: ZodString;
361
361
  status: ZodDefault<ZodEnum<{
362
- open: "open";
363
362
  resolved: "resolved";
363
+ open: "open";
364
364
  spam: "spam";
365
365
  }>>;
366
366
  deletedAt: ZodDefault<ZodNullable<ZodString>>;
@@ -373,8 +373,8 @@ declare const getConversationResponseSchema: ZodObject<{
373
373
  private: "private";
374
374
  }>;
375
375
  type: ZodEnum<{
376
- message: "message";
377
376
  event: "event";
377
+ message: "message";
378
378
  identification: "identification";
379
379
  }>;
380
380
  text: ZodNullable<ZodString>;
@@ -385,7 +385,6 @@ declare const getConversationResponseSchema: ZodObject<{
385
385
  }, $strip>, ZodObject<{
386
386
  type: ZodLiteral<"event">;
387
387
  eventType: ZodEnum<{
388
- resolved: "resolved";
389
388
  assigned: "assigned";
390
389
  unassigned: "unassigned";
391
390
  participant_requested: "participant_requested";
@@ -395,6 +394,7 @@ declare const getConversationResponseSchema: ZodObject<{
395
394
  priority_changed: "priority_changed";
396
395
  tag_added: "tag_added";
397
396
  tag_removed: "tag_removed";
397
+ resolved: "resolved";
398
398
  reopened: "reopened";
399
399
  visitor_blocked: "visitor_blocked";
400
400
  visitor_unblocked: "visitor_unblocked";
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","names":[],"sources":["../../types/src/api/conversation.ts"],"sourcesContent":[],"mappings":";;;;;;;cAIa,iCAA+B;;;;;;IAA/B,cAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsBD,6BAAA,GAAgC,cACpC;cAGK,kCAAgC;;;;;;;;;;MA1BD,OAAA,EAAA,SAAA;MAAA,KAAA,EAAA,OAAA;MAsBhC,cAAA,EAAA,gBAA6B;IAI5B,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KASD,8BAAA,GAAiC,cACrC;cAGK,gCAA8B;;;;;;;;;;;;;;;;CAbE,QAAA,CAAA;AAAA,KA0CjC,wBAAA,GAA2B,MA1CM,CAAA,OA2CrC,8BA3CqC,CAAA;AASjC,cAqCC,+BApCL,EAoCoC,SApCpC,CAAA;EAGK,aAAA,UAAA,UA2BV,CAAA;;;;;;;;;;;;;;MA3BwC,EAAA,aAAA,UAA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AAA,CAAA;IAAA,SAAA,aAAA,UAAA,CAAA;IAQ9B,SAAA,aAAuB,UAC3B,CAAA;IAGK,UAAA,WAAA;;;;EAAiC,CAAA,QAAA,CAAA,CAAA;CAAA,QAAA,CAAA;AAYlC,KA4GA,+BAAA,GAAkC,MA3GtC,CAAA,OA4GA,qCA7G6C,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cossistant/core",
3
3
  "type": "module",
4
- "version": "0.0.22",
4
+ "version": "0.0.24",
5
5
  "private": false,
6
6
  "author": "Cossistant Team",
7
7
  "description": "Core library for connecting to Cossistant API and managing data fetching",
@@ -0,0 +1,122 @@
1
+ import { ConversationEventType, ConversationTimelineType, TimelineItemVisibility } from "../enums.js";
2
+ import { _enum, array, boolean, literal, number, object, string, union } from "../../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/classic/schemas.js";
3
+ import { number as number$1 } from "../../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/classic/coerce.js";
4
+ import "../../../../node_modules/.bun/@hono_zod-openapi@1.1.4_5f6303fa86c4ce5a/node_modules/@hono/zod-openapi/dist/index.js";
5
+
6
+ //#region ../types/src/api/timeline-item.ts
7
+ const timelinePartImageSchema = object({
8
+ type: literal("image").openapi({ description: "Type of timeline part - always 'image' for image parts" }),
9
+ url: string().openapi({ description: "URL of the image" }),
10
+ mediaType: string().openapi({ description: "MIME type of the image" }),
11
+ fileName: string().optional().openapi({ description: "Original filename of the image" }),
12
+ size: number().optional().openapi({ description: "Size of the image in bytes" }),
13
+ width: number().optional().openapi({ description: "Width of the image in pixels" }),
14
+ height: number().optional().openapi({ description: "Height of the image in pixels" })
15
+ });
16
+ const timelinePartTextSchema = object({
17
+ type: literal("text").openapi({ description: "Type of timeline part - always 'text' for text parts" }),
18
+ text: string().openapi({ description: "The text content of this timeline part" })
19
+ });
20
+ const timelineFileSchema = object({
21
+ type: literal("file").openapi({ description: "Type of timeline part - always 'file' for file parts" }),
22
+ url: string().openapi({ description: "URL of the file" }),
23
+ mediaType: string().openapi({ description: "MIME type of the file" }),
24
+ fileName: string().optional().openapi({ description: "Original filename of the file" }),
25
+ size: number().optional().openapi({ description: "Size of the file in bytes" })
26
+ });
27
+ const timelinePartEventSchema = object({
28
+ type: literal("event").openapi({ description: "Type of timeline part - always 'event' for event parts" }),
29
+ eventType: _enum([
30
+ ConversationEventType.ASSIGNED,
31
+ ConversationEventType.UNASSIGNED,
32
+ ConversationEventType.PARTICIPANT_REQUESTED,
33
+ ConversationEventType.PARTICIPANT_JOINED,
34
+ ConversationEventType.PARTICIPANT_LEFT,
35
+ ConversationEventType.STATUS_CHANGED,
36
+ ConversationEventType.PRIORITY_CHANGED,
37
+ ConversationEventType.TAG_ADDED,
38
+ ConversationEventType.TAG_REMOVED,
39
+ ConversationEventType.RESOLVED,
40
+ ConversationEventType.REOPENED,
41
+ ConversationEventType.VISITOR_BLOCKED,
42
+ ConversationEventType.VISITOR_UNBLOCKED,
43
+ ConversationEventType.VISITOR_IDENTIFIED
44
+ ]).openapi({ description: "Type of event that occurred" }),
45
+ actorUserId: string().nullable().openapi({ description: "User that triggered the event, if applicable" }),
46
+ actorAiAgentId: string().nullable().openapi({ description: "AI agent that triggered the event, if applicable" }),
47
+ targetUserId: string().nullable().openapi({ description: "User targeted by the event, if applicable" }),
48
+ targetAiAgentId: string().nullable().openapi({ description: "AI agent targeted by the event, if applicable" }),
49
+ message: string().nullable().optional().openapi({ description: "Optional human readable message attached to the event" })
50
+ });
51
+ const timelinePartMetadataSchema = object({
52
+ type: literal("metadata").openapi({ description: "Type of timeline part - always 'metadata' for metadata parts" }),
53
+ source: _enum([
54
+ "email",
55
+ "widget",
56
+ "api"
57
+ ]).openapi({ description: "Source channel through which the message was created" })
58
+ });
59
+ const timelineItemPartsSchema = array(union([
60
+ timelinePartTextSchema,
61
+ timelinePartEventSchema,
62
+ timelinePartImageSchema,
63
+ timelineFileSchema,
64
+ timelinePartMetadataSchema
65
+ ])).openapi({ description: "Array of timeline parts that make up the timeline item content" });
66
+ const timelineItemSchema = object({
67
+ id: string().optional().openapi({ description: "Unique identifier for the timeline item" }),
68
+ conversationId: string().openapi({ description: "ID of the conversation this timeline item belongs to" }),
69
+ organizationId: string().openapi({ description: "ID of the organization this timeline item belongs to" }),
70
+ visibility: _enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE]).openapi({ description: "Visibility level of the timeline item" }),
71
+ type: _enum([
72
+ ConversationTimelineType.MESSAGE,
73
+ ConversationTimelineType.EVENT,
74
+ ConversationTimelineType.IDENTIFICATION
75
+ ]).openapi({ description: "Type of timeline item - message, event, or interactive identification tool" }),
76
+ text: string().nullable().openapi({ description: "Main text content of the timeline item" }),
77
+ tool: string().nullable().optional().openapi({ description: "Optional tool identifier associated with this timeline item" }),
78
+ parts: timelineItemPartsSchema,
79
+ userId: string().nullable().openapi({ description: "ID of the user who created this timeline item, if applicable" }),
80
+ aiAgentId: string().nullable().openapi({ description: "ID of the AI agent that created this timeline item, if applicable" }),
81
+ visitorId: string().nullable().openapi({ description: "ID of the visitor who created this timeline item, if applicable" }),
82
+ createdAt: string().openapi({ description: "ISO 8601 timestamp when the timeline item was created" }),
83
+ deletedAt: string().nullable().optional().openapi({ description: "ISO 8601 timestamp when the timeline item was deleted, if applicable" })
84
+ });
85
+ const getConversationTimelineItemsRequestSchema = object({
86
+ limit: number$1().min(1).max(100).default(50).openapi({
87
+ description: "Number of timeline items to fetch per page",
88
+ default: 50
89
+ }),
90
+ cursor: string().nullable().optional().openapi({ description: "Cursor for pagination (timestamp_id format from previous response)" })
91
+ }).openapi({ description: "Query parameters for fetching conversation timeline items" });
92
+ const getConversationTimelineItemsResponseSchema = object({
93
+ items: array(timelineItemSchema).openapi({ description: "Array of timeline items in chronological order" }),
94
+ nextCursor: string().nullable().openapi({ description: "Cursor for the next page, null if no more items are available" }),
95
+ hasNextPage: boolean().openapi({ description: "Whether there are more items available to fetch" })
96
+ }).openapi({ description: "Response containing paginated timeline items" });
97
+ const sendTimelineItemRequestSchema = object({
98
+ conversationId: string().openapi({ description: "ID of the conversation to send the timeline item to" }),
99
+ item: object({
100
+ id: string().optional().openapi({ description: "Optional client-generated ID for the timeline item" }),
101
+ type: _enum([ConversationTimelineType.MESSAGE, ConversationTimelineType.EVENT]).default(ConversationTimelineType.MESSAGE).openapi({
102
+ description: "Type of timeline item - defaults to MESSAGE",
103
+ default: ConversationTimelineType.MESSAGE
104
+ }),
105
+ text: string().openapi({ description: "Main text content of the timeline item" }),
106
+ parts: timelineItemPartsSchema.optional(),
107
+ visibility: _enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE]).default(TimelineItemVisibility.PUBLIC).openapi({
108
+ description: "Visibility level of the timeline item",
109
+ default: TimelineItemVisibility.PUBLIC
110
+ }),
111
+ tool: string().nullable().optional().openapi({ description: "Optional tool identifier when sending non-message timeline items" }),
112
+ userId: string().nullable().optional().openapi({ description: "ID of the user creating this timeline item" }),
113
+ aiAgentId: string().nullable().optional().openapi({ description: "ID of the AI agent creating this timeline item" }),
114
+ visitorId: string().nullable().optional().openapi({ description: "ID of the visitor creating this timeline item" }),
115
+ createdAt: string().optional().openapi({ description: "Optional timestamp for the timeline item" })
116
+ })
117
+ }).openapi({ description: "Request body for sending a timeline item to a conversation" });
118
+ const sendTimelineItemResponseSchema = object({ item: timelineItemSchema.openapi({ description: "The created timeline item" }) }).openapi({ description: "Response containing the created timeline item" });
119
+
120
+ //#endregion
121
+ export { timelineItemPartsSchema };
122
+ //# sourceMappingURL=timeline-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-item.js","names":["z.object","z.literal","z.string","z.number","z\n\t\t.enum","z.enum","z\n\t.array","z.union","z\n\t.object","z.coerce.number","z.array","z.boolean","z\n\t\t\t\t.enum"],"sources":["../../../../../../types/src/api/timeline-item.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\nimport {\n\tConversationEventType,\n\tConversationTimelineType,\n\tTimelineItemVisibility,\n} from \"../enums\";\n\nconst timelinePartImageSchema = z.object({\n\ttype: z.literal(\"image\").openapi({\n\t\tdescription: \"Type of timeline part - always 'image' for image parts\",\n\t}),\n\turl: z.string().openapi({\n\t\tdescription: \"URL of the image\",\n\t}),\n\tmediaType: z.string().openapi({\n\t\tdescription: \"MIME type of the image\",\n\t}),\n\tfileName: z.string().optional().openapi({\n\t\tdescription: \"Original filename of the image\",\n\t}),\n\tsize: z.number().optional().openapi({\n\t\tdescription: \"Size of the image in bytes\",\n\t}),\n\twidth: z.number().optional().openapi({\n\t\tdescription: \"Width of the image in pixels\",\n\t}),\n\theight: z.number().optional().openapi({\n\t\tdescription: \"Height of the image in pixels\",\n\t}),\n});\n\nconst timelinePartTextSchema = z.object({\n\ttype: z.literal(\"text\").openapi({\n\t\tdescription: \"Type of timeline part - always 'text' for text parts\",\n\t}),\n\ttext: z.string().openapi({\n\t\tdescription: \"The text content of this timeline part\",\n\t}),\n});\n\nconst timelineFileSchema = z.object({\n\ttype: z.literal(\"file\").openapi({\n\t\tdescription: \"Type of timeline part - always 'file' for file parts\",\n\t}),\n\turl: z.string().openapi({\n\t\tdescription: \"URL of the file\",\n\t}),\n\tmediaType: z.string().openapi({\n\t\tdescription: \"MIME type of the file\",\n\t}),\n\tfileName: z.string().optional().openapi({\n\t\tdescription: \"Original filename of the file\",\n\t}),\n\tsize: z.number().optional().openapi({\n\t\tdescription: \"Size of the file in bytes\",\n\t}),\n});\n\nconst timelinePartEventSchema = z.object({\n\ttype: z.literal(\"event\").openapi({\n\t\tdescription: \"Type of timeline part - always 'event' for event parts\",\n\t}),\n\teventType: z\n\t\t.enum([\n\t\t\tConversationEventType.ASSIGNED,\n\t\t\tConversationEventType.UNASSIGNED,\n\t\t\tConversationEventType.PARTICIPANT_REQUESTED,\n\t\t\tConversationEventType.PARTICIPANT_JOINED,\n\t\t\tConversationEventType.PARTICIPANT_LEFT,\n\t\t\tConversationEventType.STATUS_CHANGED,\n\t\t\tConversationEventType.PRIORITY_CHANGED,\n\t\t\tConversationEventType.TAG_ADDED,\n\t\t\tConversationEventType.TAG_REMOVED,\n\t\t\tConversationEventType.RESOLVED,\n\t\t\tConversationEventType.REOPENED,\n\t\t\tConversationEventType.VISITOR_BLOCKED,\n\t\t\tConversationEventType.VISITOR_UNBLOCKED,\n\t\t\tConversationEventType.VISITOR_IDENTIFIED,\n\t\t])\n\t\t.openapi({\n\t\t\tdescription: \"Type of event that occurred\",\n\t\t}),\n\tactorUserId: z.string().nullable().openapi({\n\t\tdescription: \"User that triggered the event, if applicable\",\n\t}),\n\tactorAiAgentId: z.string().nullable().openapi({\n\t\tdescription: \"AI agent that triggered the event, if applicable\",\n\t}),\n\ttargetUserId: z.string().nullable().openapi({\n\t\tdescription: \"User targeted by the event, if applicable\",\n\t}),\n\ttargetAiAgentId: z.string().nullable().openapi({\n\t\tdescription: \"AI agent targeted by the event, if applicable\",\n\t}),\n\tmessage: z.string().nullable().optional().openapi({\n\t\tdescription: \"Optional human readable message attached to the event\",\n\t}),\n});\n\nconst timelinePartMetadataSchema = z.object({\n\ttype: z.literal(\"metadata\").openapi({\n\t\tdescription: \"Type of timeline part - always 'metadata' for metadata parts\",\n\t}),\n\tsource: z.enum([\"email\", \"widget\", \"api\"]).openapi({\n\t\tdescription: \"Source channel through which the message was created\",\n\t}),\n});\n\nexport const timelineItemPartsSchema = z\n\t.array(\n\t\tz.union([\n\t\t\ttimelinePartTextSchema,\n\t\t\ttimelinePartEventSchema,\n\t\t\ttimelinePartImageSchema,\n\t\t\ttimelineFileSchema,\n\t\t\ttimelinePartMetadataSchema,\n\t\t])\n\t)\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Array of timeline parts that make up the timeline item content\",\n\t});\n\nexport const timelineItemSchema = z.object({\n\tid: z.string().optional().openapi({\n\t\tdescription: \"Unique identifier for the timeline item\",\n\t}),\n\tconversationId: z.string().openapi({\n\t\tdescription: \"ID of the conversation this timeline item belongs to\",\n\t}),\n\torganizationId: z.string().openapi({\n\t\tdescription: \"ID of the organization this timeline item belongs to\",\n\t}),\n\tvisibility: z\n\t\t.enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE])\n\t\t.openapi({\n\t\t\tdescription: \"Visibility level of the timeline item\",\n\t\t}),\n\ttype: z\n\t\t.enum([\n\t\t\tConversationTimelineType.MESSAGE,\n\t\t\tConversationTimelineType.EVENT,\n\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t])\n\t\t.openapi({\n\t\t\tdescription:\n\t\t\t\t\"Type of timeline item - message, event, or interactive identification tool\",\n\t\t}),\n\ttext: z.string().nullable().openapi({\n\t\tdescription: \"Main text content of the timeline item\",\n\t}),\n\ttool: z.string().nullable().optional().openapi({\n\t\tdescription: \"Optional tool identifier associated with this timeline item\",\n\t}),\n\tparts: timelineItemPartsSchema,\n\tuserId: z.string().nullable().openapi({\n\t\tdescription: \"ID of the user who created this timeline item, if applicable\",\n\t}),\n\taiAgentId: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"ID of the AI agent that created this timeline item, if applicable\",\n\t}),\n\tvisitorId: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"ID of the visitor who created this timeline item, if applicable\",\n\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"ISO 8601 timestamp when the timeline item was created\",\n\t}),\n\tdeletedAt: z.string().nullable().optional().openapi({\n\t\tdescription:\n\t\t\t\"ISO 8601 timestamp when the timeline item was deleted, if applicable\",\n\t}),\n});\n\nexport type timelineItemSchema = z.infer<typeof timelineItemSchema>;\n\nexport type TimelineItem = z.infer<typeof timelineItemSchema>;\nexport type TimelineItemParts = z.infer<typeof timelineItemPartsSchema>;\n\nexport type TimelinePartText = z.infer<typeof timelinePartTextSchema>;\nexport type TimelinePartImage = z.infer<typeof timelinePartImageSchema>;\nexport type TimelinePartFile = z.infer<typeof timelineFileSchema>;\nexport type TimelinePartEvent = z.infer<typeof timelinePartEventSchema>;\nexport type TimelinePartMetadata = z.infer<typeof timelinePartMetadataSchema>;\n\n// REST API Schemas\nexport const getConversationTimelineItemsRequestSchema = z\n\t.object({\n\t\tlimit: z.coerce.number().min(1).max(100).default(50).openapi({\n\t\t\tdescription: \"Number of timeline items to fetch per page\",\n\t\t\tdefault: 50,\n\t\t}),\n\t\tcursor: z.string().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Cursor for pagination (timestamp_id format from previous response)\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Query parameters for fetching conversation timeline items\",\n\t});\n\nexport type GetConversationTimelineItemsRequest = z.infer<\n\ttypeof getConversationTimelineItemsRequestSchema\n>;\n\nexport const getConversationTimelineItemsResponseSchema = z\n\t.object({\n\t\titems: z.array(timelineItemSchema).openapi({\n\t\t\tdescription: \"Array of timeline items in chronological order\",\n\t\t}),\n\t\tnextCursor: z.string().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Cursor for the next page, null if no more items are available\",\n\t\t}),\n\t\thasNextPage: z.boolean().openapi({\n\t\t\tdescription: \"Whether there are more items available to fetch\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Response containing paginated timeline items\",\n\t});\n\nexport type GetConversationTimelineItemsResponse = z.infer<\n\ttypeof getConversationTimelineItemsResponseSchema\n>;\n\n// Send Timeline Item (Message) Schemas\nexport const sendTimelineItemRequestSchema = z\n\t.object({\n\t\tconversationId: z.string().openapi({\n\t\t\tdescription: \"ID of the conversation to send the timeline item to\",\n\t\t}),\n\t\titem: z.object({\n\t\t\tid: z.string().optional().openapi({\n\t\t\t\tdescription: \"Optional client-generated ID for the timeline item\",\n\t\t\t}),\n\t\t\ttype: z\n\t\t\t\t.enum([\n\t\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\t])\n\t\t\t\t.default(ConversationTimelineType.MESSAGE)\n\t\t\t\t.openapi({\n\t\t\t\t\tdescription: \"Type of timeline item - defaults to MESSAGE\",\n\t\t\t\t\tdefault: ConversationTimelineType.MESSAGE,\n\t\t\t\t}),\n\t\t\ttext: z.string().openapi({\n\t\t\t\tdescription: \"Main text content of the timeline item\",\n\t\t\t}),\n\t\t\tparts: timelineItemPartsSchema.optional(),\n\t\t\tvisibility: z\n\t\t\t\t.enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE])\n\t\t\t\t.default(TimelineItemVisibility.PUBLIC)\n\t\t\t\t.openapi({\n\t\t\t\t\tdescription: \"Visibility level of the timeline item\",\n\t\t\t\t\tdefault: TimelineItemVisibility.PUBLIC,\n\t\t\t\t}),\n\t\t\ttool: z.string().nullable().optional().openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional tool identifier when sending non-message timeline items\",\n\t\t\t}),\n\t\t\tuserId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the user creating this timeline item\",\n\t\t\t}),\n\t\t\taiAgentId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the AI agent creating this timeline item\",\n\t\t\t}),\n\t\t\tvisitorId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the visitor creating this timeline item\",\n\t\t\t}),\n\t\t\tcreatedAt: z.string().optional().openapi({\n\t\t\t\tdescription: \"Optional timestamp for the timeline item\",\n\t\t\t}),\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request body for sending a timeline item to a conversation\",\n\t});\n\nexport type SendTimelineItemRequest = z.infer<\n\ttypeof sendTimelineItemRequestSchema\n>;\n\nexport const sendTimelineItemResponseSchema = z\n\t.object({\n\t\titem: timelineItemSchema.openapi({\n\t\t\tdescription: \"The created timeline item\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Response containing the created timeline item\",\n\t});\n\nexport type SendTimelineItemResponse = z.infer<\n\ttypeof sendTimelineItemResponseSchema\n>;\n"],"mappings":";;;;;;AAQA,MAAM,0BAA0BA,OAAS;CACxC,MAAMC,QAAU,QAAQ,CAAC,QAAQ,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;GAClC,CAAC;EACH,MAAMV,QAAU,CAAC,QAAQ,EACxB,aAAa,0CACb,CAAC;EACF,OAAO,wBAAwB,UAAU;EACzC,YAAYU,MACL,CAAC,uBAAuB,QAAQ,uBAAuB,QAAQ,CAAC,CACrE,QAAQ,uBAAuB,OAAO,CACtC,QAAQ;GACR,aAAa;GACb,SAAS,uBAAuB;GAChC,CAAC;EACH,MAAMV,QAAU,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAC9C,aACC,oEACD,CAAC;EACF,QAAQA,QAAU,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAChD,aAAa,8CACb,CAAC;EACF,WAAWA,QAAU,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EACnD,aAAa,kDACb,CAAC;EACF,WAAWA,QAAU,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EACnD,aAAa,iDACb,CAAC;EACF,WAAWA,QAAU,CAAC,UAAU,CAAC,QAAQ,EACxC,aAAa,4CACb,CAAC;EACF,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,8DACb,CAAC;AAMH,MAAa,iCAAiCM,OACrC,EACP,MAAM,mBAAmB,QAAQ,EAChC,aAAa,6BACb,CAAC,EACF,CAAC,CACD,QAAQ,EACR,aAAa,iDACb,CAAC"}
@@ -18,7 +18,23 @@ const ConversationTimelineType = {
18
18
  EVENT: "event",
19
19
  IDENTIFICATION: "identification"
20
20
  };
21
+ const ConversationEventType = {
22
+ ASSIGNED: "assigned",
23
+ UNASSIGNED: "unassigned",
24
+ PARTICIPANT_REQUESTED: "participant_requested",
25
+ PARTICIPANT_JOINED: "participant_joined",
26
+ PARTICIPANT_LEFT: "participant_left",
27
+ STATUS_CHANGED: "status_changed",
28
+ PRIORITY_CHANGED: "priority_changed",
29
+ TAG_ADDED: "tag_added",
30
+ TAG_REMOVED: "tag_removed",
31
+ RESOLVED: "resolved",
32
+ REOPENED: "reopened",
33
+ VISITOR_BLOCKED: "visitor_blocked",
34
+ VISITOR_UNBLOCKED: "visitor_unblocked",
35
+ VISITOR_IDENTIFIED: "visitor_identified"
36
+ };
21
37
 
22
38
  //#endregion
23
- export { ConversationStatus, ConversationTimelineType, SenderType, TimelineItemVisibility };
39
+ export { ConversationEventType, ConversationStatus, ConversationTimelineType, SenderType, TimelineItemVisibility };
24
40
  //# sourceMappingURL=enums.js.map
@@ -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} 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} 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;AAYD,MAAa,yBAAyB;CACrC,QAAQ;CACR,SAAS;CACT;AAED,MAAa,2BAA2B;CACvC,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB"}
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} 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} 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;AAYD,MAAa,yBAAyB;CACrC,QAAQ;CACR,SAAS;CACT;AAED,MAAa,2BAA2B;CACvC,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB;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;CACpB"}
@@ -83,8 +83,8 @@ declare const realtimeSchema: {
83
83
  private: "private";
84
84
  }>;
85
85
  type: ZodEnum<{
86
- message: "message";
87
86
  event: "event";
87
+ message: "message";
88
88
  identification: "identification";
89
89
  }>;
90
90
  text: ZodNullable<ZodString>;
@@ -111,8 +111,8 @@ declare const realtimeSchema: {
111
111
  visitorId: ZodString;
112
112
  websiteId: ZodString;
113
113
  status: ZodDefault<ZodEnum<{
114
- open: "open";
115
114
  resolved: "resolved";
115
+ open: "open";
116
116
  spam: "spam";
117
117
  }>>;
118
118
  deletedAt: ZodDefault<ZodNullable<ZodString>>;
@@ -125,8 +125,8 @@ declare const realtimeSchema: {
125
125
  private: "private";
126
126
  }>;
127
127
  type: ZodEnum<{
128
- message: "message";
129
128
  event: "event";
129
+ message: "message";
130
130
  identification: "identification";
131
131
  }>;
132
132
  text: ZodNullable<ZodString>;
@@ -137,7 +137,6 @@ declare const realtimeSchema: {
137
137
  }, $strip>, ZodObject<{
138
138
  type: ZodLiteral<"event">;
139
139
  eventType: ZodEnum<{
140
- resolved: "resolved";
141
140
  assigned: "assigned";
142
141
  unassigned: "unassigned";
143
142
  participant_requested: "participant_requested";
@@ -147,6 +146,7 @@ declare const realtimeSchema: {
147
146
  priority_changed: "priority_changed";
148
147
  tag_added: "tag_added";
149
148
  tag_removed: "tag_removed";
149
+ resolved: "resolved";
150
150
  reopened: "reopened";
151
151
  visitor_blocked: "visitor_blocked";
152
152
  visitor_unblocked: "visitor_unblocked";
@@ -189,8 +189,8 @@ declare const realtimeSchema: {
189
189
  header: ZodObject<{
190
190
  id: ZodString;
191
191
  status: ZodEnum<{
192
- open: "open";
193
192
  resolved: "resolved";
193
+ open: "open";
194
194
  spam: "spam";
195
195
  }>;
196
196
  priority: ZodEnum<{
@@ -229,7 +229,7 @@ declare const realtimeSchema: {
229
229
  deletedAt: ZodNullable<ZodString>;
230
230
  lastMessageAt: ZodNullable<ZodString>;
231
231
  lastSeenAt: ZodNullable<ZodString>;
232
- lastTimelineItem: ZodNullable<ZodObject<{
232
+ lastMessageTimelineItem: ZodNullable<ZodObject<{
233
233
  id: ZodOptional<ZodString>;
234
234
  conversationId: ZodString;
235
235
  organizationId: ZodString;
@@ -238,8 +238,8 @@ declare const realtimeSchema: {
238
238
  private: "private";
239
239
  }>;
240
240
  type: ZodEnum<{
241
- message: "message";
242
241
  event: "event";
242
+ message: "message";
243
243
  identification: "identification";
244
244
  }>;
245
245
  text: ZodNullable<ZodString>;
@@ -250,7 +250,75 @@ declare const realtimeSchema: {
250
250
  }, $strip>, ZodObject<{
251
251
  type: ZodLiteral<"event">;
252
252
  eventType: ZodEnum<{
253
+ assigned: "assigned";
254
+ unassigned: "unassigned";
255
+ participant_requested: "participant_requested";
256
+ participant_joined: "participant_joined";
257
+ participant_left: "participant_left";
258
+ status_changed: "status_changed";
259
+ priority_changed: "priority_changed";
260
+ tag_added: "tag_added";
261
+ tag_removed: "tag_removed";
253
262
  resolved: "resolved";
263
+ reopened: "reopened";
264
+ visitor_blocked: "visitor_blocked";
265
+ visitor_unblocked: "visitor_unblocked";
266
+ visitor_identified: "visitor_identified";
267
+ }>;
268
+ actorUserId: ZodNullable<ZodString>;
269
+ actorAiAgentId: ZodNullable<ZodString>;
270
+ targetUserId: ZodNullable<ZodString>;
271
+ targetAiAgentId: ZodNullable<ZodString>;
272
+ message: ZodOptional<ZodNullable<ZodString>>;
273
+ }, $strip>, ZodObject<{
274
+ type: ZodLiteral<"image">;
275
+ url: ZodString;
276
+ mediaType: ZodString;
277
+ fileName: ZodOptional<ZodString>;
278
+ size: ZodOptional<ZodNumber>;
279
+ width: ZodOptional<ZodNumber>;
280
+ height: ZodOptional<ZodNumber>;
281
+ }, $strip>, ZodObject<{
282
+ type: ZodLiteral<"file">;
283
+ url: ZodString;
284
+ mediaType: ZodString;
285
+ fileName: ZodOptional<ZodString>;
286
+ size: ZodOptional<ZodNumber>;
287
+ }, $strip>, ZodObject<{
288
+ type: ZodLiteral<"metadata">;
289
+ source: ZodEnum<{
290
+ email: "email";
291
+ widget: "widget";
292
+ api: "api";
293
+ }>;
294
+ }, $strip>]>>;
295
+ userId: ZodNullable<ZodString>;
296
+ aiAgentId: ZodNullable<ZodString>;
297
+ visitorId: ZodNullable<ZodString>;
298
+ createdAt: ZodString;
299
+ deletedAt: ZodOptional<ZodNullable<ZodString>>;
300
+ }, $strip>>;
301
+ lastTimelineItem: ZodNullable<ZodObject<{
302
+ id: ZodOptional<ZodString>;
303
+ conversationId: ZodString;
304
+ organizationId: ZodString;
305
+ visibility: ZodEnum<{
306
+ public: "public";
307
+ private: "private";
308
+ }>;
309
+ type: ZodEnum<{
310
+ event: "event";
311
+ message: "message";
312
+ identification: "identification";
313
+ }>;
314
+ text: ZodNullable<ZodString>;
315
+ tool: ZodOptional<ZodNullable<ZodString>>;
316
+ parts: ZodArray<ZodUnion<readonly [ZodObject<{
317
+ type: ZodLiteral<"text">;
318
+ text: ZodString;
319
+ }, $strip>, ZodObject<{
320
+ type: ZodLiteral<"event">;
321
+ eventType: ZodEnum<{
254
322
  assigned: "assigned";
255
323
  unassigned: "unassigned";
256
324
  participant_requested: "participant_requested";
@@ -260,6 +328,7 @@ declare const realtimeSchema: {
260
328
  priority_changed: "priority_changed";
261
329
  tag_added: "tag_added";
262
330
  tag_removed: "tag_removed";
331
+ resolved: "resolved";
263
332
  reopened: "reopened";
264
333
  visitor_blocked: "visitor_blocked";
265
334
  visitor_unblocked: "visitor_unblocked";
@@ -1 +1 @@
1
- {"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../../types/src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAiBa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmED,iBAAA,gBAAiC;KAEjC,+BAA+B,qBAAqB,eACvD,gBAAgB;KAGb,wBAAwB;QAC7B;WACG,qBAAqB"}
1
+ {"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../../types/src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAiBa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmED,iBAAA,gBAAiC;KAEjC,+BAA+B,qBAAqB,eACvD,gBAAgB;KAGb,wBAAwB;QAC7B;WACG,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"registries.d.ts","names":["core","$ZodType","$output","$input","$replace","Meta","S","output","input","M","P","K","R","MetadataType","$ZodRegistry","Schema","WeakMap","Map","JSONSchemaMeta","GlobalMeta","registry","T","globalRegistry"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/registries.d.cts"],"sourcesContent":["import type * as core from \"./core.cjs\";\nimport type { $ZodType } from \"./schemas.cjs\";\nexport declare const $output: unique symbol;\nexport type $output = typeof $output;\nexport declare const $input: unique symbol;\nexport type $input = typeof $input;\nexport type $replace<Meta, S extends $ZodType> = Meta extends $output ? core.output<S> : Meta extends $input ? core.input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends (...args: infer P) => infer R ? (...args: {\n [K in keyof P]: $replace<P[K], S>;\n}) => $replace<R, S> : Meta extends object ? {\n [K in keyof Meta]: $replace<Meta[K], S>;\n} : Meta;\ntype MetadataType = object | undefined;\nexport declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {\n _meta: Meta;\n _schema: Schema;\n _map: WeakMap<Schema, $replace<Meta, Schema>>;\n _idmap: Map<string, Schema>;\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;\n clear(): this;\n remove(schema: Schema): this;\n get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;\n has(schema: Schema): boolean;\n}\nexport interface JSONSchemaMeta {\n id?: string | undefined;\n title?: string | undefined;\n description?: string | undefined;\n deprecated?: boolean | undefined;\n [k: string]: unknown;\n}\nexport interface GlobalMeta extends JSONSchemaMeta {\n}\nexport declare function registry<T extends MetadataType = MetadataType, S extends $ZodType = $ZodType>(): $ZodRegistry<T, S>;\nexport declare const globalRegistry: $ZodRegistry<GlobalMeta>;\nexport {};\n"],"x_google_ignoreList":[0],"mappings":";;;;cAEqBE;KACTA,OAAAA,UAAiBA;AADRA,cAEAC,MAFsB,EAAA,OAAA,MAAA;AAC/BD,KAEAC,MAAAA,GAFO,OAESA,MAFCD;AACRC,KAETC,QAF8B,CAAA,IAAA,EAAA,UAELH,QAFK,CAAA,GAEOI,IAFP,SAEoBH,OAFpB,GAE8BF,MAF9B,CAE0CM,CAF1C,CAAA,GAE+CD,IAF/C,SAE4DF,MAF5D,GAEqEH,KAFrE,CAEgFM,CAFhF,CAAA,GAEqFD,IAFrF,SAAA,CAAA,KAAA,EAAA,CAAA,EAAA,GAEgHD,QAFhH,CAEyHK,CAFzH,EAE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ahJM,MAbgJN,CAAAA,EAAAA,IAAAA;EAAGH,GAAAA,CAAAA,UAcpJS,MAdoJT,CAAAA,CAAAA,MAAAA,EAcpIA,CAdoIA,CAAAA,EAchIF,QAdgIE,CAcvHD,IAduHC,EAcjHA,CAdiHA,CAAAA,GAAAA,SAAAA;EAAZF,GAAAA,CAAAA,MAAAA,EAe1IW,MAf0IX,CAAAA,EAAAA,OAAAA;;AAC1IM,UAgBCQ,cAAAA,CAhBDR;EAAaA,EAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAEC,KAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAIL,WAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAfF,UAAAA,CAAAA,EAAAA,OAAAA,GAAAA,SAAAA;EACLQ,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;AAATR,UAsBWe,UAAAA,SAAmBD,cAtB9Bd,CAAAA"}
1
+ {"version":3,"file":"registries.d.ts","names":["core","$ZodType","$output","$input","$replace","Meta","S","output","input","M","P","K","R","MetadataType","$ZodRegistry","Schema","WeakMap","Map","JSONSchemaMeta","GlobalMeta","registry","T","globalRegistry"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/registries.d.cts"],"sourcesContent":["import type * as core from \"./core.cjs\";\nimport type { $ZodType } from \"./schemas.cjs\";\nexport declare const $output: unique symbol;\nexport type $output = typeof $output;\nexport declare const $input: unique symbol;\nexport type $input = typeof $input;\nexport type $replace<Meta, S extends $ZodType> = Meta extends $output ? core.output<S> : Meta extends $input ? core.input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends (...args: infer P) => infer R ? (...args: {\n [K in keyof P]: $replace<P[K], S>;\n}) => $replace<R, S> : Meta extends object ? {\n [K in keyof Meta]: $replace<Meta[K], S>;\n} : Meta;\ntype MetadataType = object | undefined;\nexport declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {\n _meta: Meta;\n _schema: Schema;\n _map: WeakMap<Schema, $replace<Meta, Schema>>;\n _idmap: Map<string, Schema>;\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;\n clear(): this;\n remove(schema: Schema): this;\n get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;\n has(schema: Schema): boolean;\n}\nexport interface JSONSchemaMeta {\n id?: string | undefined;\n title?: string | undefined;\n description?: string | undefined;\n deprecated?: boolean | undefined;\n [k: string]: unknown;\n}\nexport interface GlobalMeta extends JSONSchemaMeta {\n}\nexport declare function registry<T extends MetadataType = MetadataType, S extends $ZodType = $ZodType>(): $ZodRegistry<T, S>;\nexport declare const globalRegistry: $ZodRegistry<GlobalMeta>;\nexport {};\n"],"x_google_ignoreList":[0],"mappings":";;;;cAEqBE;KACTA,OAAAA,UAAiBA;AADRA,cAEAC,MAFsB,EAAA,OAAA,MAAA;AAC/BD,KAEAC,MAAAA,GAFO,OAESA,MAFCD;AACRC,KAETC,QAF8B,CAAA,IAAA,EAAA,UAELH,QAFK,CAAA,GAEOI,IAFP,SAEoBH,OAFpB,GAE8BF,MAF9B,CAE0CM,CAF1C,CAAA,GAE+CD,IAF/C,SAE4DF,MAF5D,GAEqEH,KAFrE,CAEgFM,CAFhF,CAAA,GAEqFD,IAFrF,SAAA,CAAA,KAAA,EAAA,CAAA,EAAA,GAEgHD,QAFhH,CAEyHK,CAFzH,EAE4HH,CAF5H,CAAA,EAAA,GAEmID,IAFnI,UAAA,CAAA,GAAA,IAAA,EAAA,KAAA,EAAA,EAAA,GAAA,KAAA,EAAA,IAAA,CAAA,GAAA,IAAA,EAAA,QAC9BF,MAEIO,CAFE,GAEEN,QAFQD,CAECO,CAFDP,CAEGQ,CAFHR,CAAM,EAECG,CAFD,CAAA,EAClC,EAAA,GAEMF,QAFMA,CAEGQ,CAFK,EAEFN,CAFE,CAAA,GAEGD,IAFHA,SAAA,MAAA,GAAA,QA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AAAA,GAAAA,SAAAA;EAAEC,KAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAIL,WAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAfF,UAAAA,CAAAA,EAAAA,OAAAA,GAAAA,SAAAA;EACLQ,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;AAATR,UAsBWe,UAAAA,SAAmBD,cAtB9Bd,CAAAA"}
package/schemas3.d.ts CHANGED
@@ -12,8 +12,8 @@ declare const conversationSchema: ZodObject<{
12
12
  visitorId: ZodString;
13
13
  websiteId: ZodString;
14
14
  status: ZodDefault<ZodEnum<{
15
- open: "open";
16
15
  resolved: "resolved";
16
+ open: "open";
17
17
  spam: "spam";
18
18
  }>>;
19
19
  deletedAt: ZodDefault<ZodNullable<ZodString>>;
@@ -26,8 +26,8 @@ declare const conversationSchema: ZodObject<{
26
26
  private: "private";
27
27
  }>;
28
28
  type: ZodEnum<{
29
- message: "message";
30
29
  event: "event";
30
+ message: "message";
31
31
  identification: "identification";
32
32
  }>;
33
33
  text: ZodNullable<ZodString>;
@@ -38,7 +38,6 @@ declare const conversationSchema: ZodObject<{
38
38
  }, $strip>, ZodObject<{
39
39
  type: ZodLiteral<"event">;
40
40
  eventType: ZodEnum<{
41
- resolved: "resolved";
42
41
  assigned: "assigned";
43
42
  unassigned: "unassigned";
44
43
  participant_requested: "participant_requested";
@@ -48,6 +47,7 @@ declare const conversationSchema: ZodObject<{
48
47
  priority_changed: "priority_changed";
49
48
  tag_added: "tag_added";
50
49
  tag_removed: "tag_removed";
50
+ resolved: "resolved";
51
51
  reopened: "reopened";
52
52
  visitor_blocked: "visitor_blocked";
53
53
  visitor_unblocked: "visitor_unblocked";
@@ -1 +1 @@
1
- {"version":3,"file":"create-store.d.ts","names":[],"sources":["../../src/store/create-store.ts"],"sourcesContent":[],"mappings":";KAAY,gCAAgC;AAAhC,KAEA,gBAAA,GAFa,GAAA,GAAmB,IAAA;AAEhC,KAEA,YAFgB,CAAA,MAAA,CAAA,GAAA,CAAA,KAAA,EAEe,MAFf,EAAA,GAE0B,MAF1B;AAEhB,KAEA,KAFA,CAAA,MAAY,CAAA,GAAA;EAEZ,QAAK,EAAA,EACJ,MADI;EACJ,QAAA,CAAA,OAAA,EACM,YADN,CACmB,MADnB,CAAA,CAAA,EAAA,IAAA;EACmB,SAAA,CAAA,QAAA,EACX,aADW,CACG,MADH,CAAA,CAAA,EACa,gBADb;EAAb,KAAA,CAAA,EAAA,EAAA,GAAA,GAAA,IAAA,CAAA,EAAA,IAAA;CACgB;AAAd,iBAIL,WAJK,CAAA,MAAA,CAAA,CAAA,YAAA,EAI6B,MAJ7B,CAAA,EAIsC,KAJtC,CAI4C,MAJ5C,CAAA"}
1
+ {"version":3,"file":"create-store.d.ts","names":[],"sources":["../../src/store/create-store.ts"],"sourcesContent":[],"mappings":";KAAY,gCAAgC;AAAhC,KAEA,gBAAA,GAFa,GAAA,GAAA,IAAmB;AAEhC,KAEA,YAFgB,CAAA,MAAA,CAAA,GAAA,CAAA,KAAA,EAEe,MAFf,EAAA,GAE0B,MAF1B;AAEhB,KAEA,KAFA,CAAA,MAAY,CAAA,GAAA;EAEZ,QAAK,EAAA,EACJ,MADI;EACJ,QAAA,CAAA,OAAA,EACM,YADN,CACmB,MADnB,CAAA,CAAA,EAAA,IAAA;EACmB,SAAA,CAAA,QAAA,EACX,aADW,CACG,MADH,CAAA,CAAA,EACa,gBADb;EAAb,KAAA,CAAA,EAAA,EAAA,GAAA,GAAA,IAAA,CAAA,EAAA,IAAA;CACgB;AAAd,iBAIL,WAJK,CAAA,MAAA,CAAA,CAAA,YAAA,EAI6B,MAJ7B,CAAA,EAIsC,KAJtC,CAI4C,MAJ5C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-items-store.d.ts","names":[],"sources":["../../src/store/timeline-items-store.ts"],"sourcesContent":[],"mappings":";;;;;KAOK,wBAAA,GAA2B;KAEpB,8BAAA;EAFP,K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,kBAAA,GAAqB,KAKP,CALa,kBAKb,CAAA,GAAA;EACS,UAAA,CAAA,cAAA,EAAA,MAAA,EAAA,IAAA,EAH3B,8BAG2B,CAAA,EAAA,IAAA;EAA2B,kBAAA,CAAA,IAAA,EADpC,YACoC,CAAA,EAAA,IAAA;EAKtD,0BAAA,CAAA,KAAA,EAL2B,wBAK3B,CAAA,EALsD,YAKtD;EAAY,kBAAA,CAAA,cAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAAA,IAAA;EAKJ,oBAAA,CAAA,cAAwB,EAAA,MACzB,EAAA,YAAA,EACZ,MAAA,EAAA,IAAA,EAPK,YAOa,CAAA,EAAA,IAAA;EA2CL,iBAAA,CAAA,cAA4B,EAAA,MAAA,CAAA,EAAA,IAAA;CAC9B;AAAN,iBA9CQ,wBAAA,CA8CR,YAAA,CAAA,EA7CO,kBA6CP,CAAA,EA5CL,kBA4CK;AAEL,iBAHa,4BAAA,CAGb,KAAA,EAFK,KAEL,CAFW,kBAEX,CAAA,EAAA,cAAA,EAAA,MAAA,CAAA,EAAA,8BAAA,GAAA,SAAA"}
@@ -1,4 +1,5 @@
1
1
  import { createStore } from "./create-store.js";
2
+ import { timelineItemPartsSchema } from "../packages/types/src/api/timeline-item.js";
2
3
 
3
4
  //#region src/store/timeline-items-store.ts
4
5
  const INITIAL_STATE = { conversations: {} };
@@ -84,6 +85,7 @@ function finalizeTimelineItem(state, conversationId, optimisticId, item) {
84
85
  }
85
86
  function normalizeRealtimeTimelineItem(event) {
86
87
  const raw = event.payload.item;
88
+ const parsedParts = timelineItemPartsSchema.parse(raw.parts);
87
89
  return {
88
90
  id: raw.id,
89
91
  conversationId: raw.conversationId,
@@ -91,7 +93,7 @@ function normalizeRealtimeTimelineItem(event) {
91
93
  visibility: raw.visibility,
92
94
  type: raw.type,
93
95
  text: raw.text ?? null,
94
- parts: raw.parts,
96
+ parts: parsedParts,
95
97
  tool: raw.tool ?? null,
96
98
  userId: raw.userId,
97
99
  visitorId: raw.visitorId,
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-items-store.js","names":["INITIAL_STATE: TimelineItemsState","nextConversation: ConversationTimelineItemsState"],"sources":["../../src/store/timeline-items-store.ts"],"sourcesContent":["import type { RealtimeEvent } from \"@cossistant/types\";\nimport type {\n\tTimelineItem,\n\tTimelineItemParts,\n} from \"@cossistant/types/api/timeline-item\";\nimport { createStore, type Store } from \"./create-store\";\n\ntype TimelineItemCreatedEvent = RealtimeEvent<\"timelineItemCreated\">;\n\nexport type ConversationTimelineItemsState = {\n\titems: TimelineItem[];\n\thasNextPage: boolean;\n\tnextCursor?: string;\n};\n\nexport type TimelineItemsState = {\n\tconversations: Record<string, ConversationTimelineItemsState>;\n};\n\nconst INITIAL_STATE: TimelineItemsState = {\n\tconversations: {},\n};\n\nfunction sortTimelineItems(items: TimelineItem[]): TimelineItem[] {\n\treturn [...items].sort((a, b) => a.createdAt.localeCompare(b.createdAt));\n}\n\nfunction isSameTimelineItem(a: TimelineItem, b: TimelineItem): boolean {\n\treturn (\n\t\ta.id === b.id &&\n\t\ta.text === b.text &&\n\t\tnew Date(a.createdAt).getTime() === new Date(b.createdAt).getTime()\n\t);\n}\n\nfunction mergeTimelineItems(\n\texisting: TimelineItem[],\n\tincoming: TimelineItem[]\n): TimelineItem[] {\n\tif (incoming.length === 0) {\n\t\treturn existing;\n\t}\n\n\tconst byId = new Map<string, TimelineItem>();\n\tfor (const item of existing) {\n\t\tif (item.id) {\n\t\t\tbyId.set(item.id, item);\n\t\t}\n\t}\n\n\tlet changed = false;\n\tfor (const item of incoming) {\n\t\tif (!item.id) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst previous = byId.get(item.id);\n\t\tif (!(previous && isSameTimelineItem(previous, item))) {\n\t\t\tchanged = true;\n\t\t}\n\t\tbyId.set(item.id, item);\n\t}\n\n\tif (!changed && byId.size === existing.length) {\n\t\tlet orderStable = true;\n\t\tfor (const item of existing) {\n\t\t\tif (item.id && byId.get(item.id) !== item) {\n\t\t\t\torderStable = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (orderStable) {\n\t\t\treturn existing;\n\t\t}\n\t}\n\n\treturn sortTimelineItems(Array.from(byId.values()));\n}\n\nfunction applyPage(\n\tstate: TimelineItemsState,\n\tconversationId: string,\n\tpage: Pick<\n\t\tConversationTimelineItemsState,\n\t\t\"items\" | \"hasNextPage\" | \"nextCursor\"\n\t>\n): TimelineItemsState {\n\tconst existing = state.conversations[conversationId];\n\tconst mergedItems = mergeTimelineItems(existing?.items ?? [], page.items);\n\n\tif (\n\t\texisting &&\n\t\texisting.items === mergedItems &&\n\t\texisting.hasNextPage === page.hasNextPage &&\n\t\texisting.nextCursor === page.nextCursor\n\t) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t...state,\n\t\tconversations: {\n\t\t\t...state.conversations,\n\t\t\t[conversationId]: {\n\t\t\t\titems: mergedItems,\n\t\t\t\thasNextPage: page.hasNextPage,\n\t\t\t\tnextCursor: page.nextCursor,\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction applyTimelineItem(\n\tstate: TimelineItemsState,\n\titem: TimelineItem\n): TimelineItemsState {\n\tconst existing = state.conversations[item.conversationId];\n\tconst mergedItems = mergeTimelineItems(existing?.items ?? [], [item]);\n\n\tif (existing && existing.items === mergedItems) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t...state,\n\t\tconversations: {\n\t\t\t...state.conversations,\n\t\t\t[item.conversationId]: {\n\t\t\t\titems: mergedItems,\n\t\t\t\thasNextPage: existing?.hasNextPage ?? false,\n\t\t\t\tnextCursor: existing?.nextCursor,\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction removeTimelineItem(\n\tstate: TimelineItemsState,\n\tconversationId: string,\n\titemId: string\n): TimelineItemsState {\n\tconst existing = state.conversations[conversationId];\n\tif (!existing) {\n\t\treturn state;\n\t}\n\n\tconst index = existing.items.findIndex((item) => item.id === itemId);\n\tif (index === -1) {\n\t\treturn state;\n\t}\n\n\tconst nextItems = existing.items\n\t\t.slice(0, index)\n\t\t.concat(existing.items.slice(index + 1));\n\n\tconst nextConversation: ConversationTimelineItemsState = {\n\t\t...existing,\n\t\titems: nextItems,\n\t};\n\n\treturn {\n\t\t...state,\n\t\tconversations: {\n\t\t\t...state.conversations,\n\t\t\t[conversationId]: nextConversation,\n\t\t},\n\t};\n}\n\nfunction finalizeTimelineItem(\n\tstate: TimelineItemsState,\n\tconversationId: string,\n\toptimisticId: string,\n\titem: TimelineItem\n): TimelineItemsState {\n\tconst withoutOptimistic = removeTimelineItem(\n\t\tstate,\n\t\tconversationId,\n\t\toptimisticId\n\t);\n\treturn applyTimelineItem(withoutOptimistic, item);\n}\n\n// Normalize timeline item created event\nfunction normalizeRealtimeTimelineItem(\n\tevent: TimelineItemCreatedEvent\n): TimelineItem {\n\tconst raw = event.payload.item;\n\treturn {\n\t\tid: raw.id,\n\t\tconversationId: raw.conversationId,\n\t\torganizationId: raw.organizationId,\n\t\tvisibility: raw.visibility,\n\t\ttype: raw.type,\n\t\ttext: raw.text ?? null,\n\t\tparts: raw.parts as TimelineItemParts,\n\t\ttool: raw.tool ?? null,\n\t\tuserId: raw.userId,\n\t\tvisitorId: raw.visitorId,\n\t\taiAgentId: raw.aiAgentId,\n\t\tcreatedAt: raw.createdAt,\n\t\tdeletedAt: raw.deletedAt ?? null,\n\t};\n}\n\nexport type TimelineItemsStore = Store<TimelineItemsState> & {\n\tingestPage(\n\t\tconversationId: string,\n\t\tpage: ConversationTimelineItemsState\n\t): void;\n\tingestTimelineItem(item: TimelineItem): void;\n\tingestRealtimeTimelineItem(event: TimelineItemCreatedEvent): TimelineItem;\n\tremoveTimelineItem(conversationId: string, itemId: string): void;\n\tfinalizeTimelineItem(\n\t\tconversationId: string,\n\t\toptimisticId: string,\n\t\titem: TimelineItem\n\t): void;\n\tclearConversation(conversationId: string): void;\n};\n\nexport function createTimelineItemsStore(\n\tinitialState: TimelineItemsState = INITIAL_STATE\n): TimelineItemsStore {\n\tconst store = createStore<TimelineItemsState>(initialState);\n\n\treturn {\n\t\t...store,\n\t\tingestPage(conversationId, page) {\n\t\t\tstore.setState((state) => applyPage(state, conversationId, page));\n\t\t},\n\t\tingestTimelineItem(item) {\n\t\t\tstore.setState((state) => applyTimelineItem(state, item));\n\t\t},\n\t\tingestRealtimeTimelineItem(event) {\n\t\t\tconst item = normalizeRealtimeTimelineItem(event);\n\t\t\tstore.setState((state) => applyTimelineItem(state, item));\n\t\t\treturn item;\n\t\t},\n\t\tremoveTimelineItem(conversationId, itemId) {\n\t\t\tstore.setState((state) =>\n\t\t\t\tremoveTimelineItem(state, conversationId, itemId)\n\t\t\t);\n\t\t},\n\t\tfinalizeTimelineItem(conversationId, optimisticId, item) {\n\t\t\tstore.setState((state) =>\n\t\t\t\tfinalizeTimelineItem(state, conversationId, optimisticId, item)\n\t\t\t);\n\t\t},\n\t\tclearConversation(conversationId) {\n\t\t\tstore.setState((state) => {\n\t\t\t\tif (!state.conversations[conversationId]) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\n\t\t\t\tconst { [conversationId]: _removed, ...rest } = state.conversations;\n\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tconversations: rest,\n\t\t\t\t} satisfies TimelineItemsState;\n\t\t\t});\n\t\t},\n\t};\n}\n\nexport function getConversationTimelineItems(\n\tstore: Store<TimelineItemsState>,\n\tconversationId: string\n): ConversationTimelineItemsState | undefined {\n\treturn store.getState().conversations[conversationId];\n}\n"],"mappings":";;;AAmBA,MAAMA,gBAAoC,EACzC,eAAe,EAAE,EACjB;AAED,SAAS,kBAAkB,OAAuC;AACjE,QAAO,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,UAAU,cAAc,EAAE,UAAU,CAAC;;AAGzE,SAAS,mBAAmB,GAAiB,GAA0B;AACtE,QACC,EAAE,OAAO,EAAE,MACX,EAAE,SAAS,EAAE,QACb,IAAI,KAAK,EAAE,UAAU,C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OAAO;GACjC,MAAM,OAAO,8BAA8B,MAAM;AACjD,SAAM,UAAU,UAAU,kBAAkB,OAAO,KAAK,CAAC;AACzD,UAAO;;EAER,mBAAmB,gBAAgB,QAAQ;AAC1C,SAAM,UAAU,UACf,mBAAmB,OAAO,gBAAgB,OAAO,CACjD;;EAEF,qBAAqB,gBAAgB,cAAc,MAAM;AACxD,SAAM,UAAU,UACf,qBAAqB,OAAO,gBAAgB,cAAc,KAAK,CAC/D;;EAEF,kBAAkB,gBAAgB;AACjC,SAAM,UAAU,UAAU;AACzB,QAAI,CAAC,MAAM,cAAc,gBACxB,QAAO;IAGR,MAAM,GAAG,iBAAiB,SAAU,GAAG,SAAS,MAAM;AAEtD,WAAO;KACN,GAAG;KACH,eAAe;KACf;KACA;;EAEH;;AAGF,SAAgB,6BACf,OACA,gBAC6C;AAC7C,QAAO,MAAM,UAAU,CAAC,cAAc"}
1
+ {"version":3,"file":"timeline-items-store.js","names":["INITIAL_STATE: TimelineItemsState","nextConversation: ConversationTimelineItemsState"],"sources":["../../src/store/timeline-items-store.ts"],"sourcesContent":["import type { RealtimeEvent } from \"@cossistant/types\";\nimport {\n\ttype TimelineItem,\n\ttimelineItemPartsSchema,\n} from \"@cossistant/types/api/timeline-item\";\nimport { createStore, type Store } from \"./create-store\";\n\ntype TimelineItemCreatedEvent = RealtimeEvent<\"timelineItemCreated\">;\n\nexport type ConversationTimelineItemsState = {\n\titems: TimelineItem[];\n\thasNextPage: boolean;\n\tnextCursor?: string;\n};\n\nexport type TimelineItemsState = {\n\tconversations: Record<string, ConversationTimelineItemsState>;\n};\n\nconst INITIAL_STATE: TimelineItemsState = {\n\tconversations: {},\n};\n\nfunction sortTimelineItems(items: TimelineItem[]): TimelineItem[] {\n\treturn [...items].sort((a, b) => a.createdAt.localeCompare(b.createdAt));\n}\n\nfunction isSameTimelineItem(a: TimelineItem, b: TimelineItem): boolean {\n\treturn (\n\t\ta.id === b.id &&\n\t\ta.text === b.text &&\n\t\tnew Date(a.createdAt).getTime() === new Date(b.createdAt).getTime()\n\t);\n}\n\nfunction mergeTimelineItems(\n\texisting: TimelineItem[],\n\tincoming: TimelineItem[]\n): TimelineItem[] {\n\tif (incoming.length === 0) {\n\t\treturn existing;\n\t}\n\n\tconst byId = new Map<string, TimelineItem>();\n\tfor (const item of existing) {\n\t\tif (item.id) {\n\t\t\tbyId.set(item.id, item);\n\t\t}\n\t}\n\n\tlet changed = false;\n\tfor (const item of incoming) {\n\t\tif (!item.id) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst previous = byId.get(item.id);\n\t\tif (!(previous && isSameTimelineItem(previous, item))) {\n\t\t\tchanged = true;\n\t\t}\n\t\tbyId.set(item.id, item);\n\t}\n\n\tif (!changed && byId.size === existing.length) {\n\t\tlet orderStable = true;\n\t\tfor (const item of existing) {\n\t\t\tif (item.id && byId.get(item.id) !== item) {\n\t\t\t\torderStable = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (orderStable) {\n\t\t\treturn existing;\n\t\t}\n\t}\n\n\treturn sortTimelineItems(Array.from(byId.values()));\n}\n\nfunction applyPage(\n\tstate: TimelineItemsState,\n\tconversationId: string,\n\tpage: Pick<\n\t\tConversationTimelineItemsState,\n\t\t\"items\" | \"hasNextPage\" | \"nextCursor\"\n\t>\n): TimelineItemsState {\n\tconst existing = state.conversations[conversationId];\n\tconst mergedItems = mergeTimelineItems(existing?.items ?? [], page.items);\n\n\tif (\n\t\texisting &&\n\t\texisting.items === mergedItems &&\n\t\texisting.hasNextPage === page.hasNextPage &&\n\t\texisting.nextCursor === page.nextCursor\n\t) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t...state,\n\t\tconversations: {\n\t\t\t...state.conversations,\n\t\t\t[conversationId]: {\n\t\t\t\titems: mergedItems,\n\t\t\t\thasNextPage: page.hasNextPage,\n\t\t\t\tnextCursor: page.nextCursor,\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction applyTimelineItem(\n\tstate: TimelineItemsState,\n\titem: TimelineItem\n): TimelineItemsState {\n\tconst existing = state.conversations[item.conversationId];\n\tconst mergedItems = mergeTimelineItems(existing?.items ?? [], [item]);\n\n\tif (existing && existing.items === mergedItems) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t...state,\n\t\tconversations: {\n\t\t\t...state.conversations,\n\t\t\t[item.conversationId]: {\n\t\t\t\titems: mergedItems,\n\t\t\t\thasNextPage: existing?.hasNextPage ?? false,\n\t\t\t\tnextCursor: existing?.nextCursor,\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction removeTimelineItem(\n\tstate: TimelineItemsState,\n\tconversationId: string,\n\titemId: string\n): TimelineItemsState {\n\tconst existing = state.conversations[conversationId];\n\tif (!existing) {\n\t\treturn state;\n\t}\n\n\tconst index = existing.items.findIndex((item) => item.id === itemId);\n\tif (index === -1) {\n\t\treturn state;\n\t}\n\n\tconst nextItems = existing.items\n\t\t.slice(0, index)\n\t\t.concat(existing.items.slice(index + 1));\n\n\tconst nextConversation: ConversationTimelineItemsState = {\n\t\t...existing,\n\t\titems: nextItems,\n\t};\n\n\treturn {\n\t\t...state,\n\t\tconversations: {\n\t\t\t...state.conversations,\n\t\t\t[conversationId]: nextConversation,\n\t\t},\n\t};\n}\n\nfunction finalizeTimelineItem(\n\tstate: TimelineItemsState,\n\tconversationId: string,\n\toptimisticId: string,\n\titem: TimelineItem\n): TimelineItemsState {\n\tconst withoutOptimistic = removeTimelineItem(\n\t\tstate,\n\t\tconversationId,\n\t\toptimisticId\n\t);\n\treturn applyTimelineItem(withoutOptimistic, item);\n}\n\n// Normalize timeline item created event\nfunction normalizeRealtimeTimelineItem(\n\tevent: TimelineItemCreatedEvent\n): TimelineItem {\n\tconst raw = event.payload.item;\n\n\tconst parsedParts = timelineItemPartsSchema.parse(raw.parts);\n\n\treturn {\n\t\tid: raw.id,\n\t\tconversationId: raw.conversationId,\n\t\torganizationId: raw.organizationId,\n\t\tvisibility: raw.visibility,\n\t\ttype: raw.type,\n\t\ttext: raw.text ?? null,\n\t\tparts: parsedParts,\n\t\ttool: raw.tool ?? null,\n\t\tuserId: raw.userId,\n\t\tvisitorId: raw.visitorId,\n\t\taiAgentId: raw.aiAgentId,\n\t\tcreatedAt: raw.createdAt,\n\t\tdeletedAt: raw.deletedAt ?? null,\n\t};\n}\n\nexport type TimelineItemsStore = Store<TimelineItemsState> & {\n\tingestPage(\n\t\tconversationId: string,\n\t\tpage: ConversationTimelineItemsState\n\t): void;\n\tingestTimelineItem(item: TimelineItem): void;\n\tingestRealtimeTimelineItem(event: TimelineItemCreatedEvent): TimelineItem;\n\tremoveTimelineItem(conversationId: string, itemId: string): void;\n\tfinalizeTimelineItem(\n\t\tconversationId: string,\n\t\toptimisticId: string,\n\t\titem: TimelineItem\n\t): void;\n\tclearConversation(conversationId: string): void;\n};\n\nexport function createTimelineItemsStore(\n\tinitialState: TimelineItemsState = INITIAL_STATE\n): TimelineItemsStore {\n\tconst store = createStore<TimelineItemsState>(initialState);\n\n\treturn {\n\t\t...store,\n\t\tingestPage(conversationId, page) {\n\t\t\tstore.setState((state) => applyPage(state, conversationId, page));\n\t\t},\n\t\tingestTimelineItem(item) {\n\t\t\tstore.setState((state) => applyTimelineItem(state, item));\n\t\t},\n\t\tingestRealtimeTimelineItem(event) {\n\t\t\tconst item = normalizeRealtimeTimelineItem(event);\n\t\t\tstore.setState((state) => applyTimelineItem(state, item));\n\t\t\treturn item;\n\t\t},\n\t\tremoveTimelineItem(conversationId, itemId) {\n\t\t\tstore.setState((state) =>\n\t\t\t\tremoveTimelineItem(state, conversationId, itemId)\n\t\t\t);\n\t\t},\n\t\tfinalizeTimelineItem(conversationId, optimisticId, item) {\n\t\t\tstore.setState((state) =>\n\t\t\t\tfinalizeTimelineItem(state, conversationId, optimisticId, item)\n\t\t\t);\n\t\t},\n\t\tclearConversation(conversationId) {\n\t\t\tstore.setState((state) => {\n\t\t\t\tif (!state.conversations[conversationId]) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\n\t\t\t\tconst { [conversationId]: _removed, ...rest } = state.conversations;\n\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tconversations: rest,\n\t\t\t\t} satisfies TimelineItemsState;\n\t\t\t});\n\t\t},\n\t};\n}\n\nexport function getConversationTimelineItems(\n\tstore: Store<TimelineItemsState>,\n\tconversationId: string\n): ConversationTimelineItemsState | undefined {\n\treturn store.getState().conversations[conversationId];\n}\n"],"mappings":";;;;AAmBA,MAAMA,gBAAoC,EACzC,eAAe,EAAE,EACjB;AAED,SAAS,kBAAkB,OAAuC;AACjE,QAAO,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,UAAU,cAAc,EAAE,UAAU,CAAC;;AAGzE,SAAS,mBAAmB,GAAiB,GAA0B;AACtE,QACC,EAAE,OAAO,EAAE,MACX,EAAE,SAAS,EAAE,QACb,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,KAAK,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS;;AAIrE,SAAS,mBACR,UACA,UACiB;AACjB,KAAI,SAAS,WAAW,EACvB,QAAO;CAGR,MAAM,uBAAO,IAAI,KAA2B;AAC5C,MAAK,MAAM,QAAQ,SAClB,KAAI,KAAK,GACR,MAAK,IAAI,KAAK,IAAI,KAAK;CAIzB,IAAI,UAAU;AACd,MAAK,MAAM,QAAQ,UAAU;AAC5B,MAAI,CAAC,KAAK,GACT;EAED,MAAM,WAAW,KAAK,IAAI,KAAK,GAAG;AAClC,MAAI,EAAE,YAAY,mBAAmB,UAAU,KAAK,EACnD,WAAU;AAEX,OAAK,IAAI,KAAK,IAAI,KAAK;;AAGxB,KAAI,CAAC,WAAW,KAAK,SAAS,SAAS,QAAQ;EAC9C,IAAI,cAAc;AAClB,OAAK,MAAM,QAAQ,SAClB,KAAI,KAAK,MAAM,KAAK,IAAI,KAAK,GAAG,KAAK,MAAM;AAC1C,iBAAc;AACd;;AAIF,MAAI,YACH,QAAO;;AAIT,QAAO,kBAAkB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17
17
  type: ZodEnum<{
18
- message: "message";
19
18
  event: "event";
19
+ message: "message";
20
20
  identification: "identification";
21
21
  }>;
22
22
  text: ZodNullable<ZodString>;
@@ -27,7 +27,6 @@ declare const timelineItemSchema: ZodObject<{
27
27
  }, $strip>, ZodObject<{
28
28
  type: ZodLiteral<"event">;
29
29
  eventType: ZodEnum<{
30
- resolved: "resolved";
31
30
  assigned: "assigned";
32
31
  unassigned: "unassigned";
33
32
  participant_requested: "participant_requested";
@@ -37,6 +36,7 @@ declare const timelineItemSchema: ZodObject<{
37
36
  priority_changed: "priority_changed";
38
37
  tag_added: "tag_added";
39
38
  tag_removed: "tag_removed";
39
+ resolved: "resolved";
40
40
  reopened: "reopened";
41
41
  visitor_blocked: "visitor_blocked";
42
42
  visitor_unblocked: "visitor_unblocked";
@@ -92,8 +92,8 @@ declare const getConversationTimelineItemsResponseSchema: ZodObject<{
92
92
  private: "private";
93
93
  }>;
94
94
  type: ZodEnum<{
95
- message: "message";
96
95
  event: "event";
96
+ message: "message";
97
97
  identification: "identification";
98
98
  }>;
99
99
  text: ZodNullable<ZodString>;
@@ -104,7 +104,6 @@ declare const getConversationTimelineItemsResponseSchema: ZodObject<{
104
104
  }, $strip>, ZodObject<{
105
105
  type: ZodLiteral<"event">;
106
106
  eventType: ZodEnum<{
107
- resolved: "resolved";
108
107
  assigned: "assigned";
109
108
  unassigned: "unassigned";
110
109
  participant_requested: "participant_requested";
@@ -114,6 +113,7 @@ declare const getConversationTimelineItemsResponseSchema: ZodObject<{
114
113
  priority_changed: "priority_changed";
115
114
  tag_added: "tag_added";
116
115
  tag_removed: "tag_removed";
116
+ resolved: "resolved";
117
117
  reopened: "reopened";
118
118
  visitor_blocked: "visitor_blocked";
119
119
  visitor_unblocked: "visitor_unblocked";
@@ -161,8 +161,8 @@ declare const sendTimelineItemRequestSchema: ZodObject<{
161
161
  item: ZodObject<{
162
162
  id: ZodOptional<ZodString>;
163
163
  type: ZodDefault<ZodEnum<{
164
- message: "message";
165
164
  event: "event";
165
+ message: "message";
166
166
  }>>;
167
167
  text: ZodString;
168
168
  parts: ZodOptional<ZodArray<ZodUnion<readonly [ZodObject<{
@@ -171,7 +171,6 @@ declare const sendTimelineItemRequestSchema: ZodObject<{
171
171
  }, $strip>, ZodObject<{
172
172
  type: ZodLiteral<"event">;
173
173
  eventType: ZodEnum<{
174
- resolved: "resolved";
175
174
  assigned: "assigned";
176
175
  unassigned: "unassigned";
177
176
  participant_requested: "participant_requested";
@@ -181,6 +180,7 @@ declare const sendTimelineItemRequestSchema: ZodObject<{
181
180
  priority_changed: "priority_changed";
182
181
  tag_added: "tag_added";
183
182
  tag_removed: "tag_removed";
183
+ resolved: "resolved";
184
184
  reopened: "reopened";
185
185
  visitor_blocked: "visitor_blocked";
186
186
  visitor_unblocked: "visitor_unblocked";
@@ -235,8 +235,8 @@ declare const sendTimelineItemResponseSchema: ZodObject<{
235
235
  private: "private";
236
236
  }>;
237
237
  type: ZodEnum<{
238
- message: "message";
239
238
  event: "event";
239
+ message: "message";
240
240
  identification: "identification";
241
241
  }>;
242
242
  text: ZodNullable<ZodString>;
@@ -247,7 +247,6 @@ declare const sendTimelineItemResponseSchema: ZodObject<{
247
247
  }, $strip>, ZodObject<{
248
248
  type: ZodLiteral<"event">;
249
249
  eventType: ZodEnum<{
250
- resolved: "resolved";
251
250
  assigned: "assigned";
252
251
  unassigned: "unassigned";
253
252
  participant_requested: "participant_requested";
@@ -257,6 +256,7 @@ declare const sendTimelineItemResponseSchema: ZodObject<{
257
256
  priority_changed: "priority_changed";
258
257
  tag_added: "tag_added";
259
258
  tag_removed: "tag_removed";
259
+ resolved: "resolved";
260
260
  reopened: "reopened";
261
261
  visitor_blocked: "visitor_blocked";
262
262
  visitor_unblocked: "visitor_unblocked";