@cossistant/types 0.0.28 → 0.0.29
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/api/ai-agent.d.ts +202 -4
- package/api/ai-agent.d.ts.map +1 -1
- package/api/ai-agent.js +249 -7
- package/api/ai-agent.js.map +1 -1
- package/api/common.d.ts.map +1 -1
- package/api/contact.d.ts.map +1 -1
- package/api/index.d.ts +3 -2
- package/api/index.js +3 -2
- package/api/knowledge.d.ts +6 -0
- package/api/knowledge.d.ts.map +1 -1
- package/api/knowledge.js +12 -0
- package/api/knowledge.js.map +1 -1
- package/api/link-source.d.ts +262 -0
- package/api/link-source.d.ts.map +1 -0
- package/api/link-source.js +453 -0
- package/api/link-source.js.map +1 -0
- package/api/timeline-item.d.ts.map +1 -1
- package/enums.d.ts +3 -0
- package/enums.d.ts.map +1 -1
- package/enums.js +4 -1
- package/enums.js.map +1 -1
- package/index.d.ts +3 -2
- package/index.d.ts.map +1 -1
- package/index.js +3 -2
- package/package.json +1 -1
- package/realtime-events.d.ts +124 -0
- package/realtime-events.d.ts.map +1 -1
- package/realtime-events.js +86 -0
- package/realtime-events.js.map +1 -1
- package/trpc/conversation.d.ts +24 -0
- package/trpc/conversation.d.ts.map +1 -1
- package/trpc/conversation.js +12 -0
- package/trpc/conversation.js.map +1 -1
- package/trpc/visitor.d.ts +6 -0
- package/trpc/visitor.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { APIKeyType, ConversationEventType, ConversationParticipationStatus, ConversationPriority, ConversationSentiment, ConversationStatus, ConversationTimelineType, SenderType, TimelineItemVisibility, WebsiteInstallationTarget, WebsiteStatus } from "./enums.js";
|
|
2
|
-
import { AI_MODELS, aiAgentResponseSchema, createAiAgentRequestSchema, getAiAgentRequestSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema } from "./api/ai-agent.js";
|
|
2
|
+
import { AI_AGENT_GOALS, AI_MODELS, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, createAiAgentRequestSchema, deleteAiAgentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema } from "./api/ai-agent.js";
|
|
3
3
|
import { emailSchema, optionalUserIdSchema, paginationResponseSchema, paginationSchema, userIdSchema } from "./api/common.js";
|
|
4
4
|
import { contactMetadataSchema, contactOrganizationResponseSchema, contactResponseSchema, createContactOrganizationRequestSchema, createContactRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema } from "./api/contact.js";
|
|
5
5
|
import { getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, timelineItemPartsSchema, timelineItemSchema } from "./api/timeline-item.js";
|
|
6
6
|
import { conversationSchema } from "./schemas.js";
|
|
7
7
|
import { createConversationRequestSchema, createConversationResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema } from "./api/conversation.js";
|
|
8
8
|
import { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema } from "./api/knowledge.js";
|
|
9
|
+
import { cancelLinkSourceRequestSchema, crawlProgressPageSchema, createLinkSourceRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, getCrawlStatusRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, ignorePageRequestSchema, linkSourceResponseSchema, linkSourceStatusSchema, listKnowledgeByLinkSourceRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, scanSubpagesRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema } from "./api/link-source.js";
|
|
9
10
|
import { MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, getDefaultMemberNotificationPreference, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema } from "./api/notification.js";
|
|
10
11
|
import { organizationResponseSchema } from "./api/organization.js";
|
|
11
12
|
import { generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema } from "./api/upload.js";
|
|
@@ -18,4 +19,4 @@ import { baseRealtimeEvent, getEventPayload, isValidEventType, realtimeSchema, v
|
|
|
18
19
|
import { contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactVisitorSummarySchema, listContactsResponseSchema } from "./trpc/contact.js";
|
|
19
20
|
import { blockVisitorResponseSchema, listVisitorPresenceResponseSchema, visitorPresenceEntrySchema } from "./trpc/visitor.js";
|
|
20
21
|
|
|
21
|
-
export { AI_MODELS, APIKeyType, AvailableAIAgentSchema, ConversationEventType, ConversationParticipationStatus, ConversationPriority, ConversationSentiment, ConversationStatus, ConversationTimelineType, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, PRESENCE_AWAY_WINDOW_MS, PRESENCE_ONLINE_WINDOW_MS, PRESENCE_PING_INTERVAL_MS, SenderType, TimelineItemVisibility, WebsiteInstallationTarget, WebsiteStatus, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, baseRealtimeEvent, blockVisitorResponseSchema, checkWebsiteDomainRequestSchema, contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganizationResponseSchema, contactResponseSchema, contactVisitorSummarySchema, conversationHeaderSchema, conversationMutationResponseSchema, conversationPrioritySchema, conversationRecordSchema, conversationSchema, conversationSentimentSchema, conversationStatusSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteKnowledgeRequestSchema, emailSchema, faqKnowledgePayloadSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getDefaultMemberNotificationPreference, getEventPayload, getKnowledgeRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, isValidEventType, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listByOrganizationRequestSchema, listContactsResponseSchema, listConversationHeadersResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listVisitorPresenceResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, realtimeSchema, revokeWebsiteApiKeyRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, timelineItemPartsSchema, timelineItemSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, validateRealtimeEvent, visitorMetadataSchema, visitorPresenceEntrySchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
|
|
22
|
+
export { AI_AGENT_GOALS, AI_MODELS, APIKeyType, AvailableAIAgentSchema, ConversationEventType, ConversationParticipationStatus, ConversationPriority, ConversationSentiment, ConversationStatus, ConversationTimelineType, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, PRESENCE_AWAY_WINDOW_MS, PRESENCE_ONLINE_WINDOW_MS, PRESENCE_PING_INTERVAL_MS, SenderType, TimelineItemVisibility, WebsiteInstallationTarget, WebsiteStatus, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, baseRealtimeEvent, blockVisitorResponseSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganizationResponseSchema, contactResponseSchema, contactVisitorSummarySchema, conversationHeaderSchema, conversationMutationResponseSchema, conversationPrioritySchema, conversationRecordSchema, conversationSchema, conversationSentimentSchema, conversationStatusSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getEventPayload, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, isValidEventType, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listContactsResponseSchema, listConversationHeadersResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, listVisitorPresenceResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, realtimeSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, timelineItemPartsSchema, timelineItemSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, validateRealtimeEvent, visitorMetadataSchema, visitorPresenceEntrySchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
|
package/package.json
CHANGED
package/realtime-events.d.ts
CHANGED
|
@@ -228,6 +228,12 @@ declare const realtimeSchema: {
|
|
|
228
228
|
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
229
229
|
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
230
230
|
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
231
|
+
escalatedAt: z.ZodNullable<z.ZodString>;
|
|
232
|
+
escalatedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
233
|
+
escalationReason: z.ZodNullable<z.ZodString>;
|
|
234
|
+
escalationHandledAt: z.ZodNullable<z.ZodString>;
|
|
235
|
+
escalationHandledByUserId: z.ZodNullable<z.ZodString>;
|
|
236
|
+
aiPausedUntil: z.ZodNullable<z.ZodString>;
|
|
231
237
|
createdAt: z.ZodString;
|
|
232
238
|
updatedAt: z.ZodString;
|
|
233
239
|
deletedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -471,6 +477,124 @@ declare const realtimeSchema: {
|
|
|
471
477
|
deletedAt: z.ZodNullable<z.ZodString>;
|
|
472
478
|
}, z.core.$strip>;
|
|
473
479
|
}, z.core.$strip>;
|
|
480
|
+
readonly conversationUpdated: z.ZodObject<{
|
|
481
|
+
websiteId: z.ZodString;
|
|
482
|
+
organizationId: z.ZodString;
|
|
483
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
484
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
485
|
+
conversationId: z.ZodString;
|
|
486
|
+
updates: z.ZodObject<{
|
|
487
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
488
|
+
sentiment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
489
|
+
positive: "positive";
|
|
490
|
+
negative: "negative";
|
|
491
|
+
neutral: "neutral";
|
|
492
|
+
}>>>;
|
|
493
|
+
sentimentConfidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
494
|
+
escalatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
495
|
+
escalationReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
496
|
+
}, z.core.$strip>;
|
|
497
|
+
aiAgentId: z.ZodNullable<z.ZodString>;
|
|
498
|
+
}, z.core.$strip>;
|
|
499
|
+
readonly crawlStarted: z.ZodObject<{
|
|
500
|
+
websiteId: z.ZodString;
|
|
501
|
+
organizationId: z.ZodString;
|
|
502
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
503
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
504
|
+
linkSourceId: z.ZodString;
|
|
505
|
+
url: z.ZodString;
|
|
506
|
+
discoveredPages: z.ZodArray<z.ZodObject<{
|
|
507
|
+
url: z.ZodString;
|
|
508
|
+
title: z.ZodNullable<z.ZodString>;
|
|
509
|
+
depth: z.ZodNumber;
|
|
510
|
+
}, z.core.$strip>>;
|
|
511
|
+
totalPagesCount: z.ZodNumber;
|
|
512
|
+
}, z.core.$strip>;
|
|
513
|
+
readonly crawlProgress: z.ZodObject<{
|
|
514
|
+
websiteId: z.ZodString;
|
|
515
|
+
organizationId: z.ZodString;
|
|
516
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
517
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
518
|
+
linkSourceId: z.ZodString;
|
|
519
|
+
url: z.ZodString;
|
|
520
|
+
page: z.ZodObject<{
|
|
521
|
+
url: z.ZodString;
|
|
522
|
+
title: z.ZodNullable<z.ZodString>;
|
|
523
|
+
status: z.ZodEnum<{
|
|
524
|
+
pending: "pending";
|
|
525
|
+
crawling: "crawling";
|
|
526
|
+
completed: "completed";
|
|
527
|
+
failed: "failed";
|
|
528
|
+
}>;
|
|
529
|
+
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
530
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
531
|
+
}, z.core.$strip>;
|
|
532
|
+
completedCount: z.ZodNumber;
|
|
533
|
+
totalCount: z.ZodNumber;
|
|
534
|
+
}, z.core.$strip>;
|
|
535
|
+
readonly crawlCompleted: z.ZodObject<{
|
|
536
|
+
websiteId: z.ZodString;
|
|
537
|
+
organizationId: z.ZodString;
|
|
538
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
539
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
540
|
+
linkSourceId: z.ZodString;
|
|
541
|
+
url: z.ZodString;
|
|
542
|
+
crawledPagesCount: z.ZodNumber;
|
|
543
|
+
totalSizeBytes: z.ZodNumber;
|
|
544
|
+
failedPagesCount: z.ZodNumber;
|
|
545
|
+
}, z.core.$strip>;
|
|
546
|
+
readonly crawlFailed: z.ZodObject<{
|
|
547
|
+
websiteId: z.ZodString;
|
|
548
|
+
organizationId: z.ZodString;
|
|
549
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
550
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
551
|
+
linkSourceId: z.ZodString;
|
|
552
|
+
url: z.ZodString;
|
|
553
|
+
error: z.ZodString;
|
|
554
|
+
}, z.core.$strip>;
|
|
555
|
+
readonly linkSourceUpdated: z.ZodObject<{
|
|
556
|
+
websiteId: z.ZodString;
|
|
557
|
+
organizationId: z.ZodString;
|
|
558
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
559
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
560
|
+
linkSourceId: z.ZodString;
|
|
561
|
+
status: z.ZodEnum<{
|
|
562
|
+
pending: "pending";
|
|
563
|
+
mapping: "mapping";
|
|
564
|
+
crawling: "crawling";
|
|
565
|
+
completed: "completed";
|
|
566
|
+
failed: "failed";
|
|
567
|
+
}>;
|
|
568
|
+
discoveredPagesCount: z.ZodOptional<z.ZodNumber>;
|
|
569
|
+
crawledPagesCount: z.ZodOptional<z.ZodNumber>;
|
|
570
|
+
totalSizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
571
|
+
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
572
|
+
}, z.core.$strip>;
|
|
573
|
+
readonly crawlPagesDiscovered: z.ZodObject<{
|
|
574
|
+
websiteId: z.ZodString;
|
|
575
|
+
organizationId: z.ZodString;
|
|
576
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
577
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
578
|
+
linkSourceId: z.ZodString;
|
|
579
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
580
|
+
url: z.ZodString;
|
|
581
|
+
path: z.ZodString;
|
|
582
|
+
depth: z.ZodNumber;
|
|
583
|
+
}, z.core.$strip>>;
|
|
584
|
+
}, z.core.$strip>;
|
|
585
|
+
readonly crawlPageCompleted: z.ZodObject<{
|
|
586
|
+
websiteId: z.ZodString;
|
|
587
|
+
organizationId: z.ZodString;
|
|
588
|
+
visitorId: z.ZodNullable<z.ZodString>;
|
|
589
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
590
|
+
linkSourceId: z.ZodString;
|
|
591
|
+
page: z.ZodObject<{
|
|
592
|
+
url: z.ZodString;
|
|
593
|
+
title: z.ZodNullable<z.ZodString>;
|
|
594
|
+
sizeBytes: z.ZodNumber;
|
|
595
|
+
knowledgeId: z.ZodString;
|
|
596
|
+
}, z.core.$strip>;
|
|
597
|
+
}, z.core.$strip>;
|
|
474
598
|
};
|
|
475
599
|
type RealtimeEventType = keyof typeof realtimeSchema;
|
|
476
600
|
type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<(typeof realtimeSchema)[T]>;
|
package/realtime-events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;cAUa,mBAAiB,CAAA,CAAA;;EAAjB,cAAA,aAKX;;;;;;;;AAL4B,cAWjB,cAXiB,EAAA;EAAA,SAAA,aAAA,aAAA,CAAA;IAWjB,SAAA,
|
|
1
|
+
{"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;cAUa,mBAAiB,CAAA,CAAA;;EAAjB,cAAA,aAKX;;;;;;;;AAL4B,cAWjB,cAXiB,EAAA;EAAA,SAAA,aAAA,aAAA,CAAA;IAWjB,SAAA,aAsLH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEE,iBAAA,gBAAiC;KAEjC,+BAA+B,qBAAqB,CAAA,CAAE,cACzD,gBAAgB;KAGb,wBAAwB;QAC7B;WACG,qBAAqB;;KAGnB,gBAAA,WACL,oBAAoB,cAAc,KACvC;KAEU,4BAA4B,qBACvC,qBAAqB;;;;iBAKN,gCAAgC,yBACzC,mBAEJ,qBAAqB;;;;iBAQR,gBAAA,yBAAyC;iBAIzC,0BAA0B,0BAClC,cAAc,KACnB,qBAAqB"}
|
package/realtime-events.js
CHANGED
|
@@ -110,6 +110,92 @@ const realtimeSchema = {
|
|
|
110
110
|
updatedAt: z.string(),
|
|
111
111
|
deletedAt: z.string().nullable()
|
|
112
112
|
})
|
|
113
|
+
}),
|
|
114
|
+
conversationUpdated: baseRealtimeEvent.extend({
|
|
115
|
+
conversationId: z.string(),
|
|
116
|
+
updates: z.object({
|
|
117
|
+
title: z.string().nullable().optional(),
|
|
118
|
+
sentiment: z.enum([
|
|
119
|
+
"positive",
|
|
120
|
+
"negative",
|
|
121
|
+
"neutral"
|
|
122
|
+
]).nullable().optional(),
|
|
123
|
+
sentimentConfidence: z.number().nullable().optional(),
|
|
124
|
+
escalatedAt: z.string().nullable().optional(),
|
|
125
|
+
escalationReason: z.string().nullable().optional()
|
|
126
|
+
}),
|
|
127
|
+
aiAgentId: z.string().nullable()
|
|
128
|
+
}),
|
|
129
|
+
crawlStarted: baseRealtimeEvent.extend({
|
|
130
|
+
linkSourceId: z.string(),
|
|
131
|
+
url: z.string(),
|
|
132
|
+
discoveredPages: z.array(z.object({
|
|
133
|
+
url: z.string(),
|
|
134
|
+
title: z.string().nullable(),
|
|
135
|
+
depth: z.number()
|
|
136
|
+
})),
|
|
137
|
+
totalPagesCount: z.number()
|
|
138
|
+
}),
|
|
139
|
+
crawlProgress: baseRealtimeEvent.extend({
|
|
140
|
+
linkSourceId: z.string(),
|
|
141
|
+
url: z.string(),
|
|
142
|
+
page: z.object({
|
|
143
|
+
url: z.string(),
|
|
144
|
+
title: z.string().nullable(),
|
|
145
|
+
status: z.enum([
|
|
146
|
+
"pending",
|
|
147
|
+
"crawling",
|
|
148
|
+
"completed",
|
|
149
|
+
"failed"
|
|
150
|
+
]),
|
|
151
|
+
sizeBytes: z.number().optional(),
|
|
152
|
+
error: z.string().nullable().optional()
|
|
153
|
+
}),
|
|
154
|
+
completedCount: z.number(),
|
|
155
|
+
totalCount: z.number()
|
|
156
|
+
}),
|
|
157
|
+
crawlCompleted: baseRealtimeEvent.extend({
|
|
158
|
+
linkSourceId: z.string(),
|
|
159
|
+
url: z.string(),
|
|
160
|
+
crawledPagesCount: z.number(),
|
|
161
|
+
totalSizeBytes: z.number(),
|
|
162
|
+
failedPagesCount: z.number()
|
|
163
|
+
}),
|
|
164
|
+
crawlFailed: baseRealtimeEvent.extend({
|
|
165
|
+
linkSourceId: z.string(),
|
|
166
|
+
url: z.string(),
|
|
167
|
+
error: z.string()
|
|
168
|
+
}),
|
|
169
|
+
linkSourceUpdated: baseRealtimeEvent.extend({
|
|
170
|
+
linkSourceId: z.string(),
|
|
171
|
+
status: z.enum([
|
|
172
|
+
"pending",
|
|
173
|
+
"mapping",
|
|
174
|
+
"crawling",
|
|
175
|
+
"completed",
|
|
176
|
+
"failed"
|
|
177
|
+
]),
|
|
178
|
+
discoveredPagesCount: z.number().optional(),
|
|
179
|
+
crawledPagesCount: z.number().optional(),
|
|
180
|
+
totalSizeBytes: z.number().optional(),
|
|
181
|
+
errorMessage: z.string().nullable().optional()
|
|
182
|
+
}),
|
|
183
|
+
crawlPagesDiscovered: baseRealtimeEvent.extend({
|
|
184
|
+
linkSourceId: z.string(),
|
|
185
|
+
pages: z.array(z.object({
|
|
186
|
+
url: z.string(),
|
|
187
|
+
path: z.string(),
|
|
188
|
+
depth: z.number()
|
|
189
|
+
}))
|
|
190
|
+
}),
|
|
191
|
+
crawlPageCompleted: baseRealtimeEvent.extend({
|
|
192
|
+
linkSourceId: z.string(),
|
|
193
|
+
page: z.object({
|
|
194
|
+
url: z.string(),
|
|
195
|
+
title: z.string().nullable(),
|
|
196
|
+
sizeBytes: z.number(),
|
|
197
|
+
knowledgeId: z.string()
|
|
198
|
+
})
|
|
113
199
|
})
|
|
114
200
|
};
|
|
115
201
|
/**
|
package/realtime-events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-events.js","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { visitorResponseSchema } from \"./api/visitor\";\nimport {\n\tConversationEventType,\n\tConversationTimelineType,\n\tTimelineItemVisibility,\n} from \"./enums\";\nimport { conversationSchema } from \"./schemas\";\nimport { conversationHeaderSchema } from \"./trpc/conversation\";\n\nexport const baseRealtimeEvent = z.object({\n\twebsiteId: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string().nullable(),\n\tuserId: z.string().nullable(),\n});\n\n/**\n * Central event system for real-time communication\n * All WebSocket and Redis Pub/Sub events are defined here\n */\nexport const realtimeSchema = {\n\tuserConnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tuserDisconnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorConnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorDisconnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tuserPresenceUpdate: baseRealtimeEvent.extend({\n\t\tuserId: z.string(),\n\t\tstatus: z.enum([\"online\", \"away\", \"offline\"]),\n\t\tlastSeen: z.string(),\n\t}),\n\tconversationSeen: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tlastSeenAt: z.string(),\n\t}),\n\tconversationTyping: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tisTyping: z.boolean(),\n\t\tvisitorPreview: z.string().max(2000).nullable().optional(),\n\t}),\n\ttimelineItemCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\titem: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\tvisibility: z.enum([\n\t\t\t\tTimelineItemVisibility.PUBLIC,\n\t\t\t\tTimelineItemVisibility.PRIVATE,\n\t\t\t]),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t\t]),\n\t\t\ttext: z.string().nullable(),\n\t\t\tparts: z.array(z.unknown()),\n\t\t\tuserId: z.string().nullable(),\n\t\t\tvisitorId: z.string().nullable(),\n\t\t\taiAgentId: z.string().nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t\ttool: z.string().nullable().optional(),\n\t\t}),\n\t}),\n\tconversationCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\tconversation: conversationSchema,\n\t\theader: conversationHeaderSchema,\n\t}),\n\tvisitorIdentified: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tvisitor: visitorResponseSchema,\n\t}),\n\tconversationEventCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tevent: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationEventType.ASSIGNED,\n\t\t\t\tConversationEventType.UNASSIGNED,\n\t\t\t\tConversationEventType.PARTICIPANT_REQUESTED,\n\t\t\t\tConversationEventType.PARTICIPANT_JOINED,\n\t\t\t\tConversationEventType.PARTICIPANT_LEFT,\n\t\t\t\tConversationEventType.STATUS_CHANGED,\n\t\t\t\tConversationEventType.PRIORITY_CHANGED,\n\t\t\t\tConversationEventType.TAG_ADDED,\n\t\t\t\tConversationEventType.TAG_REMOVED,\n\t\t\t\tConversationEventType.RESOLVED,\n\t\t\t\tConversationEventType.REOPENED,\n\t\t\t\tConversationEventType.VISITOR_BLOCKED,\n\t\t\t\tConversationEventType.VISITOR_UNBLOCKED,\n\t\t\t\tConversationEventType.VISITOR_IDENTIFIED,\n\t\t\t]),\n\t\t\tactorUserId: z.string().nullable(),\n\t\t\tactorAiAgentId: z.string().nullable(),\n\t\t\ttargetUserId: z.string().nullable(),\n\t\t\ttargetAiAgentId: z.string().nullable(),\n\t\t\tmessage: z.string().nullable(),\n\t\t\tmetadata: z.record(z.string(), z.unknown()).nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tupdatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t}),\n\t}),\n} as const;\n\nexport type RealtimeEventType = keyof typeof realtimeSchema;\n\nexport type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<\n\t(typeof realtimeSchema)[T]\n>;\n\nexport type RealtimeEvent<T extends RealtimeEventType> = {\n\ttype: T;\n\tpayload: RealtimeEventPayload<T>;\n};\n\nexport type AnyRealtimeEvent = {\n\t[K in RealtimeEventType]: RealtimeEvent<K>;\n}[RealtimeEventType];\n\nexport type RealtimeEventData<T extends RealtimeEventType> =\n\tRealtimeEventPayload<T>;\n\n/**\n * Validates an event against its schema\n */\nexport function validateRealtimeEvent<T extends RealtimeEventType>(\n\ttype: T,\n\tdata: unknown\n): RealtimeEventPayload<T> {\n\tconst schema = realtimeSchema[type];\n\treturn schema.parse(data) as RealtimeEventPayload<T>;\n}\n\n/**\n * Type guard to check if a string is a valid event type\n */\nexport function isValidEventType(type: unknown): type is RealtimeEventType {\n\treturn typeof type === \"string\" && type in realtimeSchema;\n}\n\nexport function getEventPayload<T extends RealtimeEventType>(\n\tevent: RealtimeEvent<T>\n): RealtimeEventPayload<T> {\n\treturn event.payload;\n}\n"],"mappings":";;;;;;;AAUA,MAAa,oBAAoB,EAAE,OAAO;CACzC,WAAW,EAAE,QAAQ;CACrB,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC;;;;;AAMF,MAAa,iBAAiB;CAC7B,eAAe,kBAAkB,OAAO,EACvC,cAAc,EAAE,QAAQ,EACxB,CAAC;CACF,kBAAkB,kBAAkB,OAAO,EAC1C,cAAc,EAAE,QAAQ,EACxB,CAAC;CACF,kBAAkB,kBAAkB,OAAO;EAC1C,WAAW,EAAE,QAAQ;EACrB,cAAc,EAAE,QAAQ;EACxB,CAAC;CACF,qBAAqB,kBAAkB,OAAO;EAC7C,WAAW,EAAE,QAAQ;EACrB,cAAc,EAAE,QAAQ;EACxB,CAAC;CACF,oBAA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AC3C,WAAW,EAAE,QAAQ;EACrB,SAAS;EACT,CAAC;CACF,0BAA0B,kBAAkB,OAAO;EAClD,gBAAgB,EAAE,QAAQ;EAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;EAChC,OAAO,EAAE,OAAO;GACf,IAAI,EAAE,QAAQ;GACd,gBAAgB,EAAE,QAAQ;GAC1B,gBAAgB,EAAE,QAAQ;GAC1B,MAAM,EAAE,KAAK;IACZ,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,CAAC;GACF,aAAa,EAAE,QAAQ,CAAC,UAAU;GAClC,gBAAgB,EAAE,QAAQ,CAAC,UAAU;GACrC,cAAc,EAAE,QAAQ,CAAC,UAAU;GACnC,iBAAiB,EAAE,QAAQ,CAAC,UAAU;GACtC,SAAS,EAAE,QAAQ,CAAC,UAAU;GAC9B,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC,UAAU;GACtD,WAAW,EAAE,QAAQ;GACrB,WAAW,EAAE,QAAQ;GACrB,WAAW,EAAE,QAAQ,CAAC,UAAU;GAChC,CAAC;EACF,CAAC;CACF;;;;AAuBD,SAAgB,sBACf,MACA,MAC0B;AAE1B,QADe,eAAe,MAChB,MAAM,KAAK;;;;;AAM1B,SAAgB,iBAAiB,MAA0C;AAC1E,QAAO,OAAO,SAAS,YAAY,QAAQ;;AAG5C,SAAgB,gBACf,OAC0B;AAC1B,QAAO,MAAM"}
|
|
1
|
+
{"version":3,"file":"realtime-events.js","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { visitorResponseSchema } from \"./api/visitor\";\nimport {\n\tConversationEventType,\n\tConversationTimelineType,\n\tTimelineItemVisibility,\n} from \"./enums\";\nimport { conversationSchema } from \"./schemas\";\nimport { conversationHeaderSchema } from \"./trpc/conversation\";\n\nexport const baseRealtimeEvent = z.object({\n\twebsiteId: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string().nullable(),\n\tuserId: z.string().nullable(),\n});\n\n/**\n * Central event system for real-time communication\n * All WebSocket and Redis Pub/Sub events are defined here\n */\nexport const realtimeSchema = {\n\tuserConnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tuserDisconnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorConnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorDisconnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tuserPresenceUpdate: baseRealtimeEvent.extend({\n\t\tuserId: z.string(),\n\t\tstatus: z.enum([\"online\", \"away\", \"offline\"]),\n\t\tlastSeen: z.string(),\n\t}),\n\tconversationSeen: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tlastSeenAt: z.string(),\n\t}),\n\tconversationTyping: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tisTyping: z.boolean(),\n\t\tvisitorPreview: z.string().max(2000).nullable().optional(),\n\t}),\n\ttimelineItemCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\titem: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\tvisibility: z.enum([\n\t\t\t\tTimelineItemVisibility.PUBLIC,\n\t\t\t\tTimelineItemVisibility.PRIVATE,\n\t\t\t]),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t\t]),\n\t\t\ttext: z.string().nullable(),\n\t\t\tparts: z.array(z.unknown()),\n\t\t\tuserId: z.string().nullable(),\n\t\t\tvisitorId: z.string().nullable(),\n\t\t\taiAgentId: z.string().nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t\ttool: z.string().nullable().optional(),\n\t\t}),\n\t}),\n\tconversationCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\tconversation: conversationSchema,\n\t\theader: conversationHeaderSchema,\n\t}),\n\tvisitorIdentified: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tvisitor: visitorResponseSchema,\n\t}),\n\tconversationEventCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tevent: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationEventType.ASSIGNED,\n\t\t\t\tConversationEventType.UNASSIGNED,\n\t\t\t\tConversationEventType.PARTICIPANT_REQUESTED,\n\t\t\t\tConversationEventType.PARTICIPANT_JOINED,\n\t\t\t\tConversationEventType.PARTICIPANT_LEFT,\n\t\t\t\tConversationEventType.STATUS_CHANGED,\n\t\t\t\tConversationEventType.PRIORITY_CHANGED,\n\t\t\t\tConversationEventType.TAG_ADDED,\n\t\t\t\tConversationEventType.TAG_REMOVED,\n\t\t\t\tConversationEventType.RESOLVED,\n\t\t\t\tConversationEventType.REOPENED,\n\t\t\t\tConversationEventType.VISITOR_BLOCKED,\n\t\t\t\tConversationEventType.VISITOR_UNBLOCKED,\n\t\t\t\tConversationEventType.VISITOR_IDENTIFIED,\n\t\t\t]),\n\t\t\tactorUserId: z.string().nullable(),\n\t\t\tactorAiAgentId: z.string().nullable(),\n\t\t\ttargetUserId: z.string().nullable(),\n\t\t\ttargetAiAgentId: z.string().nullable(),\n\t\t\tmessage: z.string().nullable(),\n\t\t\tmetadata: z.record(z.string(), z.unknown()).nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tupdatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t}),\n\t}),\n\t// Conversation updated (title, sentiment, escalation status changes)\n\tconversationUpdated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\tupdates: z.object({\n\t\t\ttitle: z.string().nullable().optional(),\n\t\t\tsentiment: z\n\t\t\t\t.enum([\"positive\", \"negative\", \"neutral\"])\n\t\t\t\t.nullable()\n\t\t\t\t.optional(),\n\t\t\tsentimentConfidence: z.number().nullable().optional(),\n\t\t\tescalatedAt: z.string().nullable().optional(),\n\t\t\tescalationReason: z.string().nullable().optional(),\n\t\t}),\n\t\taiAgentId: z.string().nullable(),\n\t}),\n\t// Web crawling events\n\tcrawlStarted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tdiscoveredPages: z.array(\n\t\t\tz.object({\n\t\t\t\turl: z.string(),\n\t\t\t\ttitle: z.string().nullable(),\n\t\t\t\tdepth: z.number(),\n\t\t\t})\n\t\t),\n\t\ttotalPagesCount: z.number(),\n\t}),\n\tcrawlProgress: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tpage: z.object({\n\t\t\turl: z.string(),\n\t\t\ttitle: z.string().nullable(),\n\t\t\tstatus: z.enum([\"pending\", \"crawling\", \"completed\", \"failed\"]),\n\t\t\tsizeBytes: z.number().optional(),\n\t\t\terror: z.string().nullable().optional(),\n\t\t}),\n\t\tcompletedCount: z.number(),\n\t\ttotalCount: z.number(),\n\t}),\n\tcrawlCompleted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tcrawledPagesCount: z.number(),\n\t\ttotalSizeBytes: z.number(),\n\t\tfailedPagesCount: z.number(),\n\t}),\n\tcrawlFailed: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\terror: z.string(),\n\t}),\n\t// Link source updated (for status changes, etc.)\n\tlinkSourceUpdated: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tstatus: z.enum([\"pending\", \"mapping\", \"crawling\", \"completed\", \"failed\"]),\n\t\tdiscoveredPagesCount: z.number().optional(),\n\t\tcrawledPagesCount: z.number().optional(),\n\t\ttotalSizeBytes: z.number().optional(),\n\t\terrorMessage: z.string().nullable().optional(),\n\t}),\n\t// Emitted after map phase with all discovered URLs (for real-time tree display)\n\tcrawlPagesDiscovered: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tpages: z.array(\n\t\t\tz.object({\n\t\t\t\turl: z.string(),\n\t\t\t\tpath: z.string(),\n\t\t\t\tdepth: z.number(),\n\t\t\t})\n\t\t),\n\t}),\n\t// Emitted when each page completes scraping (for real-time updates)\n\tcrawlPageCompleted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tpage: z.object({\n\t\t\turl: z.string(),\n\t\t\ttitle: z.string().nullable(),\n\t\t\tsizeBytes: z.number(),\n\t\t\tknowledgeId: z.string(),\n\t\t}),\n\t}),\n} as const;\n\nexport type RealtimeEventType = keyof typeof realtimeSchema;\n\nexport type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<\n\t(typeof realtimeSchema)[T]\n>;\n\nexport type RealtimeEvent<T extends RealtimeEventType> = {\n\ttype: T;\n\tpayload: RealtimeEventPayload<T>;\n};\n\nexport type AnyRealtimeEvent = {\n\t[K in RealtimeEventType]: RealtimeEvent<K>;\n}[RealtimeEventType];\n\nexport type RealtimeEventData<T extends RealtimeEventType> =\n\tRealtimeEventPayload<T>;\n\n/**\n * Validates an event against its schema\n */\nexport function validateRealtimeEvent<T extends RealtimeEventType>(\n\ttype: T,\n\tdata: unknown\n): RealtimeEventPayload<T> {\n\tconst schema = realtimeSchema[type];\n\treturn schema.parse(data) as RealtimeEventPayload<T>;\n}\n\n/**\n * Type guard to check if a string is a valid event type\n */\nexport function isValidEventType(type: unknown): type is RealtimeEventType {\n\treturn typeof type === \"string\" && type in realtimeSchema;\n}\n\nexport function getEventPayload<T extends RealtimeEventType>(\n\tevent: RealtimeEvent<T>\n): RealtimeEventPayload<T> {\n\treturn event.payload;\n}\n"],"mappings":";;;;;;;AAUA,MAAa,oBAAoB,EAAE,OAAO;CACzC,WAAW,EAAE,QAAQ;CACrB,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC;;;;;AAMF,MAAa,iBAAiB;CAC7B,eAAe,kBAAkB,OAAO,EACvC,cAAc,EAAE,QAAQ,EACxB,CAAC;CACF,kBAAkB,kBAAkB,OAAO,EAC1C,cAAc,EAAE,QAAQ,EACxB,CAAC;CACF,kBAAkB,kBAAkB,OAAO;EAC1C,WAAW,EAAE,QAAQ;EACrB,cAAc,EAAE,QAAQ;EACxB,CAAC;CACF,qBAAqB,kBAAkB,OAAO;EAC7C,WAAW,EAAE,QAAQ;EACrB,cAAc,EAAE,QAAQ;EACxB,CAAC;CACF,oBAAoB,kBAAkB,OAAO;EAC5C,QAAQ,EAAE,QAAQ;EAClB,QAAQ,EAAE,KAAK;GAAC;GAAU;GAAQ;GAAU,CAAC;EAC7C,UAAU,EAAE,QAAQ;EACpB,CAAC;CACF,kBAAkB,kBAAkB,OAAO;EAC1C,gBAAgB,EAAE,QAAQ;EAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;EAChC,YAAY,EAAE,QAAQ;EACtB,CAAC;CACF,oBAAoB,kBAAkB,OAAO;EAC5C,gBAAgB,EAAE,QAAQ;EAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;EAChC,UAAU,EAAE,SAAS;EACrB,gBAAgB,EAAE,QAAQ,CAAC,IAAI,IAAK,CAAC,UAAU,CAAC,UAAU;EAC1D,CAAC;CACF,qBAA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BACf,MACA,MAC0B;AAE1B,QADe,eAAe,MAChB,MAAM,KAAK;;;;;AAM1B,SAAgB,iBAAiB,MAA0C;AAC1E,QAAO,OAAO,SAAS,YAAY,QAAQ;;AAG5C,SAAgB,gBACf,OAC0B;AAC1B,QAAO,MAAM"}
|
package/trpc/conversation.d.ts
CHANGED
|
@@ -49,6 +49,12 @@ declare const conversationRecordSchema: z.ZodObject<{
|
|
|
49
49
|
lastMessageBy: z.ZodNullable<z.ZodString>;
|
|
50
50
|
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
51
51
|
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
52
|
+
escalatedAt: z.ZodNullable<z.ZodString>;
|
|
53
|
+
escalatedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
54
|
+
escalationReason: z.ZodNullable<z.ZodString>;
|
|
55
|
+
escalationHandledAt: z.ZodNullable<z.ZodString>;
|
|
56
|
+
escalationHandledByUserId: z.ZodNullable<z.ZodString>;
|
|
57
|
+
aiPausedUntil: z.ZodNullable<z.ZodString>;
|
|
52
58
|
createdAt: z.ZodString;
|
|
53
59
|
updatedAt: z.ZodString;
|
|
54
60
|
deletedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -87,6 +93,12 @@ declare const conversationMutationResponseSchema: z.ZodObject<{
|
|
|
87
93
|
lastMessageBy: z.ZodNullable<z.ZodString>;
|
|
88
94
|
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
89
95
|
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
96
|
+
escalatedAt: z.ZodNullable<z.ZodString>;
|
|
97
|
+
escalatedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
98
|
+
escalationReason: z.ZodNullable<z.ZodString>;
|
|
99
|
+
escalationHandledAt: z.ZodNullable<z.ZodString>;
|
|
100
|
+
escalationHandledByUserId: z.ZodNullable<z.ZodString>;
|
|
101
|
+
aiPausedUntil: z.ZodNullable<z.ZodString>;
|
|
90
102
|
createdAt: z.ZodString;
|
|
91
103
|
updatedAt: z.ZodString;
|
|
92
104
|
deletedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -130,6 +142,12 @@ declare const conversationHeaderSchema: z.ZodObject<{
|
|
|
130
142
|
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
131
143
|
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
132
144
|
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
145
|
+
escalatedAt: z.ZodNullable<z.ZodString>;
|
|
146
|
+
escalatedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
147
|
+
escalationReason: z.ZodNullable<z.ZodString>;
|
|
148
|
+
escalationHandledAt: z.ZodNullable<z.ZodString>;
|
|
149
|
+
escalationHandledByUserId: z.ZodNullable<z.ZodString>;
|
|
150
|
+
aiPausedUntil: z.ZodNullable<z.ZodString>;
|
|
133
151
|
createdAt: z.ZodString;
|
|
134
152
|
updatedAt: z.ZodString;
|
|
135
153
|
deletedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -325,6 +343,12 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
|
|
|
325
343
|
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
326
344
|
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
327
345
|
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
346
|
+
escalatedAt: z.ZodNullable<z.ZodString>;
|
|
347
|
+
escalatedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
348
|
+
escalationReason: z.ZodNullable<z.ZodString>;
|
|
349
|
+
escalationHandledAt: z.ZodNullable<z.ZodString>;
|
|
350
|
+
escalationHandledByUserId: z.ZodNullable<z.ZodString>;
|
|
351
|
+
aiPausedUntil: z.ZodNullable<z.ZodString>;
|
|
328
352
|
createdAt: z.ZodString;
|
|
329
353
|
updatedAt: z.ZodString;
|
|
330
354
|
deletedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","names":[],"sources":["../../src/trpc/conversation.ts"],"sourcesContent":[],"mappings":";;;cAUa,0BAAwB,CAAA,CAAA;;EAAxB,QAAA,EAAA,UAAA;EAMA,IAAA,EAAA,MAAA;AAOb,CAAA,CAAA;AAQa,cAfA,
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","names":[],"sources":["../../src/trpc/conversation.ts"],"sourcesContent":[],"mappings":";;;cAUa,0BAAwB,CAAA,CAAA;;EAAxB,QAAA,EAAA,UAAA;EAMA,IAAA,EAAA,MAAA;AAOb,CAAA,CAAA;AAQa,cAfA,0BA6CX,EA7CqC,CAAA,CAAA,OA6CrC,CAAA;;;;;;cAtCW,6BAA2B,CAAA,CAAA,YAAA,CAAA,CAAA;;;;;cAQ3B,0BAAwB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,yBAAA,eAAA,YAAA,CAAA;EAAA,aAAA,eAAA,YAAA,CAAA;EAgCzB,SAAA,aAAA;EAIC,SAAA,aAAA;;;KAJD,0BAAA,GAA6B,CAAA,CAAE,aACnC;cAGK,oCAAkC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAIlC,0BAAwB,CAAA,CAAA;EAJU,EAAA,aAAA;EAAA,MAAA,WAAA,CAAA;IAIlC,IAAA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmCA,uCAAqC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAnCb,CAAA,eAAA,CAAA,CAAA;IAAA,CAAA,eAAA,CAAA;IAmCxB,SAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKD,4BAAA,GAA+B,CAAA,CAAE,aACrC;KAGI,kBAAA,GAAqB,CAAA,CAAE,aAAa"}
|
package/trpc/conversation.js
CHANGED
|
@@ -40,6 +40,12 @@ const conversationRecordSchema = z.object({
|
|
|
40
40
|
lastMessageBy: z.string().nullable(),
|
|
41
41
|
resolvedByUserId: z.string().nullable(),
|
|
42
42
|
resolvedByAiAgentId: z.string().nullable(),
|
|
43
|
+
escalatedAt: z.string().nullable(),
|
|
44
|
+
escalatedByAiAgentId: z.string().nullable(),
|
|
45
|
+
escalationReason: z.string().nullable(),
|
|
46
|
+
escalationHandledAt: z.string().nullable(),
|
|
47
|
+
escalationHandledByUserId: z.string().nullable(),
|
|
48
|
+
aiPausedUntil: z.string().nullable(),
|
|
43
49
|
createdAt: z.string(),
|
|
44
50
|
updatedAt: z.string(),
|
|
45
51
|
deletedAt: z.string().nullable()
|
|
@@ -61,6 +67,12 @@ const conversationHeaderSchema = z.object({
|
|
|
61
67
|
resolvedAt: z.string().nullable(),
|
|
62
68
|
resolvedByUserId: z.string().nullable(),
|
|
63
69
|
resolvedByAiAgentId: z.string().nullable(),
|
|
70
|
+
escalatedAt: z.string().nullable(),
|
|
71
|
+
escalatedByAiAgentId: z.string().nullable(),
|
|
72
|
+
escalationReason: z.string().nullable(),
|
|
73
|
+
escalationHandledAt: z.string().nullable(),
|
|
74
|
+
escalationHandledByUserId: z.string().nullable(),
|
|
75
|
+
aiPausedUntil: z.string().nullable(),
|
|
64
76
|
createdAt: z.string(),
|
|
65
77
|
updatedAt: z.string(),
|
|
66
78
|
deletedAt: z.string().nullable(),
|
package/trpc/conversation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","names":[],"sources":["../../src/trpc/conversation.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { timelineItemSchema } from \"../api/timeline-item\";\nimport { visitorProfileSchema } from \"../api/visitor\";\nimport {\n\tConversationPriority,\n\tConversationSentiment,\n\tConversationStatus,\n} from \"../enums\";\nimport { conversationSeenSchema } from \"../schemas\";\n\nexport const conversationStatusSchema = z.enum([\n\tConversationStatus.OPEN,\n\tConversationStatus.RESOLVED,\n\tConversationStatus.SPAM,\n]);\n\nexport const conversationPrioritySchema = z.enum([\n\tConversationPriority.LOW,\n\tConversationPriority.NORMAL,\n\tConversationPriority.HIGH,\n\tConversationPriority.URGENT,\n]);\n\nexport const conversationSentimentSchema = z\n\t.enum([\n\t\tConversationSentiment.POSITIVE,\n\t\tConversationSentiment.NEGATIVE,\n\t\tConversationSentiment.NEUTRAL,\n\t])\n\t.nullable();\n\nexport const conversationRecordSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string(),\n\twebsiteId: z.string(),\n\tstatus: conversationStatusSchema,\n\tpriority: conversationPrioritySchema,\n\tsentiment: conversationSentimentSchema,\n\tsentimentConfidence: z.number().nullable(),\n\tchannel: z.string(),\n\ttitle: z.string().nullable(),\n\tresolutionTime: z.number().nullable(),\n\tstartedAt: z.string().nullable(),\n\tfirstResponseAt: z.string().nullable(),\n\tresolvedAt: z.string().nullable(),\n\tlastMessageAt: z.string().nullable(),\n\tlastMessageBy: z.string().nullable(),\n\tresolvedByUserId: z.string().nullable(),\n\tresolvedByAiAgentId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n});\n\nexport type ConversationRecordResponse = z.infer<\n\ttypeof conversationRecordSchema\n>;\n\nexport const conversationMutationResponseSchema = z.object({\n\tconversation: conversationRecordSchema,\n});\n\nexport const conversationHeaderSchema = z.object({\n\tid: z.string(),\n\tstatus: conversationStatusSchema,\n\tpriority: conversationPrioritySchema,\n\torganizationId: z.string(),\n\tvisitorId: z.string(),\n\tvisitor: visitorProfileSchema,\n\twebsiteId: z.string(),\n\tchannel: z.string(),\n\ttitle: z.string().nullable(),\n\tresolutionTime: z.number().nullable(),\n\tstartedAt: z.string().nullable(),\n\tfirstResponseAt: z.string().nullable(),\n\tresolvedAt: z.string().nullable(),\n\tresolvedByUserId: z.string().nullable(),\n\tresolvedByAiAgentId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n\tlastMessageAt: z.string().nullable(),\n\tlastSeenAt: z.string().nullable(),\n\tlastMessageTimelineItem: timelineItemSchema.nullable(),\n\tlastTimelineItem: timelineItemSchema.nullable(),\n\tviewIds: z.array(z.string()),\n\tseenData: z.array(conversationSeenSchema),\n});\n\nexport const listConversationHeadersResponseSchema = z.object({\n\titems: z.array(conversationHeaderSchema),\n\tnextCursor: z.string().nullable(),\n});\n\nexport type ConversationMutationResponse = z.infer<\n\ttypeof conversationMutationResponseSchema\n>;\n\nexport type ConversationHeader = z.infer<typeof conversationHeaderSchema>;\n"],"mappings":";;;;;;;AAUA,MAAa,2BAA2B,EAAE,KAAK;CAC9C,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,CAAC;AAEF,MAAa,6BAA6B,EAAE,KAAK;CAChD,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,CAAC;AAEF,MAAa,8BAA8B,EACzC,KAAK;CACL,sBAAsB;CACtB,sBAAsB;CACtB,sBAAsB;CACtB,CAAC,CACD,UAAU;AAEZ,MAAa,2BAA2B,EAAE,OAAO;CAChD,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,QAAQ;CACR,UAAU;CACV,WAAW;CACX,qBAAqB,EAAE,QAAQ,CAAC,UAAU;CA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AAE,MAAM,EAAE,QAAQ,CAAC;CAC5B,UAAU,EAAE,MAAM,uBAAuB;CACzC,CAAC;AAEF,MAAa,wCAAwC,EAAE,OAAO;CAC7D,OAAO,EAAE,MAAM,yBAAyB;CACxC,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,CAAC"}
|
|
1
|
+
{"version":3,"file":"conversation.js","names":[],"sources":["../../src/trpc/conversation.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { timelineItemSchema } from \"../api/timeline-item\";\nimport { visitorProfileSchema } from \"../api/visitor\";\nimport {\n\tConversationPriority,\n\tConversationSentiment,\n\tConversationStatus,\n} from \"../enums\";\nimport { conversationSeenSchema } from \"../schemas\";\n\nexport const conversationStatusSchema = z.enum([\n\tConversationStatus.OPEN,\n\tConversationStatus.RESOLVED,\n\tConversationStatus.SPAM,\n]);\n\nexport const conversationPrioritySchema = z.enum([\n\tConversationPriority.LOW,\n\tConversationPriority.NORMAL,\n\tConversationPriority.HIGH,\n\tConversationPriority.URGENT,\n]);\n\nexport const conversationSentimentSchema = z\n\t.enum([\n\t\tConversationSentiment.POSITIVE,\n\t\tConversationSentiment.NEGATIVE,\n\t\tConversationSentiment.NEUTRAL,\n\t])\n\t.nullable();\n\nexport const conversationRecordSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string(),\n\twebsiteId: z.string(),\n\tstatus: conversationStatusSchema,\n\tpriority: conversationPrioritySchema,\n\tsentiment: conversationSentimentSchema,\n\tsentimentConfidence: z.number().nullable(),\n\tchannel: z.string(),\n\ttitle: z.string().nullable(),\n\tresolutionTime: z.number().nullable(),\n\tstartedAt: z.string().nullable(),\n\tfirstResponseAt: z.string().nullable(),\n\tresolvedAt: z.string().nullable(),\n\tlastMessageAt: z.string().nullable(),\n\tlastMessageBy: z.string().nullable(),\n\tresolvedByUserId: z.string().nullable(),\n\tresolvedByAiAgentId: z.string().nullable(),\n\t// Escalation tracking\n\tescalatedAt: z.string().nullable(),\n\tescalatedByAiAgentId: z.string().nullable(),\n\tescalationReason: z.string().nullable(),\n\tescalationHandledAt: z.string().nullable(),\n\tescalationHandledByUserId: z.string().nullable(),\n\t// AI pause control\n\taiPausedUntil: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n});\n\nexport type ConversationRecordResponse = z.infer<\n\ttypeof conversationRecordSchema\n>;\n\nexport const conversationMutationResponseSchema = z.object({\n\tconversation: conversationRecordSchema,\n});\n\nexport const conversationHeaderSchema = z.object({\n\tid: z.string(),\n\tstatus: conversationStatusSchema,\n\tpriority: conversationPrioritySchema,\n\torganizationId: z.string(),\n\tvisitorId: z.string(),\n\tvisitor: visitorProfileSchema,\n\twebsiteId: z.string(),\n\tchannel: z.string(),\n\ttitle: z.string().nullable(),\n\tresolutionTime: z.number().nullable(),\n\tstartedAt: z.string().nullable(),\n\tfirstResponseAt: z.string().nullable(),\n\tresolvedAt: z.string().nullable(),\n\tresolvedByUserId: z.string().nullable(),\n\tresolvedByAiAgentId: z.string().nullable(),\n\t// Escalation tracking\n\tescalatedAt: z.string().nullable(),\n\tescalatedByAiAgentId: z.string().nullable(),\n\tescalationReason: z.string().nullable(),\n\tescalationHandledAt: z.string().nullable(),\n\tescalationHandledByUserId: z.string().nullable(),\n\t// AI pause control\n\taiPausedUntil: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n\tlastMessageAt: z.string().nullable(),\n\tlastSeenAt: z.string().nullable(),\n\tlastMessageTimelineItem: timelineItemSchema.nullable(),\n\tlastTimelineItem: timelineItemSchema.nullable(),\n\tviewIds: z.array(z.string()),\n\tseenData: z.array(conversationSeenSchema),\n});\n\nexport const listConversationHeadersResponseSchema = z.object({\n\titems: z.array(conversationHeaderSchema),\n\tnextCursor: z.string().nullable(),\n});\n\nexport type ConversationMutationResponse = z.infer<\n\ttypeof conversationMutationResponseSchema\n>;\n\nexport type Convers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.d.ts
CHANGED
|
@@ -34,6 +34,12 @@ declare const blockVisitorResponseSchema: z.ZodObject<{
|
|
|
34
34
|
lastMessageBy: z.ZodNullable<z.ZodString>;
|
|
35
35
|
resolvedByUserId: z.ZodNullable<z.ZodString>;
|
|
36
36
|
resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
37
|
+
escalatedAt: z.ZodNullable<z.ZodString>;
|
|
38
|
+
escalatedByAiAgentId: z.ZodNullable<z.ZodString>;
|
|
39
|
+
escalationReason: z.ZodNullable<z.ZodString>;
|
|
40
|
+
escalationHandledAt: z.ZodNullable<z.ZodString>;
|
|
41
|
+
escalationHandledByUserId: z.ZodNullable<z.ZodString>;
|
|
42
|
+
aiPausedUntil: z.ZodNullable<z.ZodString>;
|
|
37
43
|
createdAt: z.ZodString;
|
|
38
44
|
updatedAt: z.ZodString;
|
|
39
45
|
deletedAt: z.ZodNullable<z.ZodString>;
|
package/trpc/visitor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitor.d.ts","names":[],"sources":["../../src/trpc/visitor.ts"],"sourcesContent":[],"mappings":";;;cAIa,4BAA0B,CAAA,CAAA;;IAA1B,EAAA,aAAA
|
|
1
|
+
{"version":3,"file":"visitor.d.ts","names":[],"sources":["../../src/trpc/visitor.ts"],"sourcesContent":[],"mappings":";;;cAIa,4BAA0B,CAAA,CAAA;;IAA1B,EAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKD,oBAAA,GAAuB,CAAA,CAAE,aAAa;cAErC,4BAA0B,CAAA,CAAA;;;;;;;;;;;;;;;;;cAe1B,mCAAiC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;KAQlC,oBAAA,GAAuB,CAAA,CAAE,aAAa;KACtC,2BAAA,GAA8B,CAAA,CAAE,aACpC"}
|