@cossistant/types 0.0.28 → 0.0.30
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 +170 -4
- package/api/ai-agent.d.ts.map +1 -1
- package/api/ai-agent.js +233 -7
- package/api/ai-agent.js.map +1 -1
- package/api/contact.d.ts.map +1 -1
- package/api/conversation.d.ts +458 -78
- package/api/conversation.d.ts.map +1 -1
- package/api/index.d.ts +5 -4
- package/api/index.js +5 -4
- package/api/knowledge.d.ts +63 -25
- package/api/knowledge.d.ts.map +1 -1
- package/api/knowledge.js +73 -11
- package/api/knowledge.js.map +1 -1
- package/api/link-source.d.ts +264 -0
- package/api/link-source.d.ts.map +1 -0
- package/api/link-source.js +461 -0
- package/api/link-source.js.map +1 -0
- package/api/timeline-item.d.ts +580 -91
- package/api/timeline-item.d.ts.map +1 -1
- package/api/timeline-item.js +68 -20
- package/api/timeline-item.js.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 +6 -5
- package/index.d.ts.map +1 -1
- package/index.js +6 -5
- package/package.json +1 -1
- package/realtime-events.d.ts +570 -48
- package/realtime-events.d.ts.map +1 -1
- package/realtime-events.js +202 -1
- package/realtime-events.js.map +1 -1
- package/schemas.d.ts +92 -16
- package/schemas.d.ts.map +1 -1
- package/trpc/conversation.d.ts +393 -65
- 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 +7 -1
- package/trpc/visitor.d.ts.map +1 -1
package/api/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { AIModel, AI_MODELS, AiAgentResponse, CreateAiAgentRequest, GetAiAgentRequest, ToggleAiAgentActiveRequest, UpdateAiAgentRequest, aiAgentResponseSchema, createAiAgentRequestSchema, getAiAgentRequestSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema } from "./ai-agent.js";
|
|
1
|
+
import { AIAgentGoal, AIModel, AIModelConfig, AI_AGENT_GOALS, AI_MODELS, AiAgentBehaviorSettings, AiAgentResponse, CreateAiAgentRequest, DeleteAiAgentRequest, GenerateBasePromptRequest, GenerateBasePromptResponse, GetAiAgentRequest, GetBehaviorSettingsRequest, GetBehaviorSettingsResponse, ToggleAiAgentActiveRequest, UpdateAiAgentRequest, UpdateBehaviorSettingsRequest, UpdateBehaviorSettingsResponse, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, createAiAgentRequestSchema, deleteAiAgentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema } from "./ai-agent.js";
|
|
2
2
|
import { PaginationInput, PaginationResponse, emailSchema, optionalUserIdSchema, paginationResponseSchema, paginationSchema, userIdSchema } from "./common.js";
|
|
3
3
|
import { Contact, ContactMetadata, ContactOrganizationResponse, ContactResponse, CreateContactOrganizationRequest, CreateContactRequest, IdentifyContactRequest, IdentifyContactResponse, UpdateContactMetadataRequest, UpdateContactOrganizationRequest, UpdateContactRequest, contactMetadataSchema, contactOrganization, contactOrganizationResponseSchema, contactResponseSchema, createContactOrganizationRequestSchema, createContactRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema } from "./contact.js";
|
|
4
4
|
import { CreateConversationRequestBody, CreateConversationResponseBody, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, ListConversationsRequest, ListConversationsResponse, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, SetConversationTypingRequestBody, SetConversationTypingResponseBody, createConversationRequestSchema, createConversationResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema } from "./conversation.js";
|
|
5
|
-
import { ArticleKnowledgePayload, CreateKnowledgeRequest, CreateKnowledgeRestRequest, FaqKnowledgePayload, GetKnowledgeRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UrlKnowledgePayload, articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema } from "./knowledge.js";
|
|
5
|
+
import { ArticleKnowledgePayload, CreateKnowledgeRequest, CreateKnowledgeRestRequest, DeleteKnowledgeRequest, FaqKnowledgePayload, GetKnowledgeRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, ToggleKnowledgeEntryIncludedRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UploadKnowledgeFileRequest, UrlKnowledgePayload, articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, uploadKnowledgeFileRequestSchema, urlKnowledgePayloadSchema } from "./knowledge.js";
|
|
6
|
+
import { CancelLinkSourceRequest, CrawlProgressPage, CreateLinkSourceRequest, DeleteLinkSourceRequest, DeletePageRequest, DiscoveredPage, GetCrawlStatusRequest, GetLinkSourceRequest, GetTrainingStatsRequest, IgnorePageRequest, LinkSourceResponse, LinkSourceStatus, ListKnowledgeByLinkSourceRequest, ListLinkSourcesRequest, ListLinkSourcesResponse, RecrawlLinkSourceRequest, ReindexPageRequest, ScanSubpagesRequest, ToggleKnowledgeIncludedRequest, TrainingStatsResponse, cancelLinkSourceRequestSchema, crawlProgressPageSchema, createLinkSourceRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, getCrawlStatusRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, ignorePageRequestSchema, linkSourceResponseSchema, linkSourceStatusSchema, listKnowledgeByLinkSourceRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, scanSubpagesRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema } from "./link-source.js";
|
|
6
7
|
import { ContactNotificationSettings, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, MemberNotificationChannelDefinition, MemberNotificationPreference, MemberNotificationSettingsResponse, UpdateMemberNotificationSettingsRequest, UpdateMemberNotificationSettingsResponse, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, getDefaultMemberNotificationPreference, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema } from "./notification.js";
|
|
7
8
|
import { OrganizationResponse, organizationResponseSchema } from "./organization.js";
|
|
8
|
-
import { GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, SendTimelineItemRequest, SendTimelineItemResponse, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, timelineItemPartsSchema, timelineItemSchema } from "./timeline-item.js";
|
|
9
|
+
import { CossistantProviderMetadata, FilePart, GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, ImagePart, ReasoningPart, SendTimelineItemRequest, SendTimelineItemResponse, SourceDocumentPart, SourceUrlPart, StepStartPart, TextPart, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, ToolPart, ToolState, cossistantProviderMetadataSchema, filePartSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, imagePartSchema, reasoningPartSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, sourceDocumentPartSchema, sourceUrlPartSchema, stepStartPartSchema, textPartSchema, timelineItemPartsSchema, timelineItemSchema, timelinePartEventSchema, timelinePartMetadataSchema, toolPartSchema, toolStateSchema } from "./timeline-item.js";
|
|
9
10
|
import { GenerateUploadUrlRequest, GenerateUploadUrlResponse, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema } from "./upload.js";
|
|
10
11
|
import { UpdateUserProfileRequest, UserResponse, updateUserProfileRequestSchema, userResponseSchema } from "./user.js";
|
|
11
12
|
import { PublicContact, PublicVisitor, PublicVisitorResponse, UpdateVisitorMetadataRequest, UpdateVisitorRequest, Visitor, VisitorMetadata, VisitorResponse, publicContactResponseSchema, publicVisitorResponseSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema } from "./visitor.js";
|
|
12
13
|
import { AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, CheckWebsiteDomainRequest, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, ListByOrganizationRequest, PublicWebsiteResponse, RevokeWebsiteApiKeyRequest, UpdateWebsiteRequest, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteListItem, WebsiteSummary, availableHumanAgentSchema, checkWebsiteDomainRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, listByOrganizationRequestSchema, publicWebsiteResponseSchema, revokeWebsiteApiKeyRequestSchema, updateWebsiteRequestSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema } from "./website.js";
|
|
13
|
-
export { AIModel, AI_MODELS, AiAgentResponse, ArticleKnowledgePayload, AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, CheckWebsiteDomainRequest, Contact, ContactMetadata, ContactNotificationSettings, ContactOrganizationResponse, ContactResponse, CreateAiAgentRequest, CreateContactOrganizationRequest, CreateContactRequest, CreateConversationRequestBody, CreateConversationResponseBody, CreateKnowledgeRequest, CreateKnowledgeRestRequest, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, FaqKnowledgePayload, GenerateUploadUrlRequest, GenerateUploadUrlResponse, GetAiAgentRequest, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, GetKnowledgeRequest, IdentifyContactRequest, IdentifyContactResponse, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListByOrganizationRequest, ListConversationsRequest, ListConversationsResponse, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, MemberNotificationChannel, MemberNotificationChannelDefinition, MemberNotificationPreference, MemberNotificationSettingsResponse, OrganizationResponse, PaginationInput, PaginationResponse, PublicContact, PublicVisitor, PublicVisitorResponse, PublicWebsiteResponse, RevokeWebsiteApiKeyRequest, SendTimelineItemRequest, SendTimelineItemResponse, SetConversationTypingRequestBody, SetConversationTypingResponseBody, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, ToggleAiAgentActiveRequest, UpdateAiAgentRequest, UpdateContactMetadataRequest, UpdateContactOrganizationRequest, UpdateContactRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UpdateMemberNotificationSettingsRequest, UpdateMemberNotificationSettingsResponse, UpdateUserProfileRequest, UpdateVisitorMetadataRequest, UpdateVisitorRequest, UpdateWebsiteRequest, UrlKnowledgePayload, UserResponse, Visitor, VisitorMetadata, VisitorResponse, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteListItem, WebsiteSummary, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, checkWebsiteDomainRequestSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganization, contactOrganizationResponseSchema, contactResponseSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteKnowledgeRequestSchema, emailSchema, faqKnowledgePayloadSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getDefaultMemberNotificationPreference, getKnowledgeRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listByOrganizationRequestSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, 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, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
|
|
14
|
+
export { AIAgentGoal, AIModel, AIModelConfig, AI_AGENT_GOALS, AI_MODELS, AiAgentBehaviorSettings, AiAgentResponse, ArticleKnowledgePayload, AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, CancelLinkSourceRequest, CheckWebsiteDomainRequest, Contact, ContactMetadata, ContactNotificationSettings, ContactOrganizationResponse, ContactResponse, CossistantProviderMetadata, CrawlProgressPage, CreateAiAgentRequest, CreateContactOrganizationRequest, CreateContactRequest, CreateConversationRequestBody, CreateConversationResponseBody, CreateKnowledgeRequest, CreateKnowledgeRestRequest, CreateLinkSourceRequest, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, DeleteAiAgentRequest, DeleteKnowledgeRequest, DeleteLinkSourceRequest, DeletePageRequest, DiscoveredPage, FaqKnowledgePayload, FilePart, GenerateBasePromptRequest, GenerateBasePromptResponse, GenerateUploadUrlRequest, GenerateUploadUrlResponse, GetAiAgentRequest, GetBehaviorSettingsRequest, GetBehaviorSettingsResponse, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, GetCrawlStatusRequest, GetKnowledgeRequest, GetLinkSourceRequest, GetTrainingStatsRequest, IdentifyContactRequest, IdentifyContactResponse, IgnorePageRequest, ImagePart, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, LinkSourceResponse, LinkSourceStatus, ListByOrganizationRequest, ListConversationsRequest, ListConversationsResponse, ListKnowledgeByLinkSourceRequest, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, ListLinkSourcesRequest, ListLinkSourcesResponse, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, MemberNotificationChannel, MemberNotificationChannelDefinition, MemberNotificationPreference, MemberNotificationSettingsResponse, OrganizationResponse, PaginationInput, PaginationResponse, PublicContact, PublicVisitor, PublicVisitorResponse, PublicWebsiteResponse, ReasoningPart, RecrawlLinkSourceRequest, ReindexPageRequest, RevokeWebsiteApiKeyRequest, ScanSubpagesRequest, SendTimelineItemRequest, SendTimelineItemResponse, SetConversationTypingRequestBody, SetConversationTypingResponseBody, SourceDocumentPart, SourceUrlPart, StepStartPart, TextPart, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, ToggleAiAgentActiveRequest, ToggleKnowledgeEntryIncludedRequest, ToggleKnowledgeIncludedRequest, ToolPart, ToolState, TrainingStatsResponse, UpdateAiAgentRequest, UpdateBehaviorSettingsRequest, UpdateBehaviorSettingsResponse, UpdateContactMetadataRequest, UpdateContactOrganizationRequest, UpdateContactRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UpdateMemberNotificationSettingsRequest, UpdateMemberNotificationSettingsResponse, UpdateUserProfileRequest, UpdateVisitorMetadataRequest, UpdateVisitorRequest, UpdateWebsiteRequest, UploadKnowledgeFileRequest, UrlKnowledgePayload, UserResponse, Visitor, VisitorMetadata, VisitorResponse, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteListItem, WebsiteSummary, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganization, contactOrganizationResponseSchema, contactResponseSchema, cossistantProviderMetadataSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, filePartSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, imagePartSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, reasoningPartSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, sourceDocumentPartSchema, sourceUrlPartSchema, stepStartPartSchema, textPartSchema, timelineItemPartsSchema, timelineItemSchema, timelinePartEventSchema, timelinePartMetadataSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, toggleKnowledgeIncludedRequestSchema, toolPartSchema, toolStateSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadKnowledgeFileRequestSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
|
package/api/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AI_MODELS, aiAgentResponseSchema, createAiAgentRequestSchema, getAiAgentRequestSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema } from "./ai-agent.js";
|
|
1
|
+
import { AI_AGENT_GOALS, AI_MODELS, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, createAiAgentRequestSchema, deleteAiAgentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema } from "./ai-agent.js";
|
|
2
2
|
import { emailSchema, optionalUserIdSchema, paginationResponseSchema, paginationSchema, userIdSchema } from "./common.js";
|
|
3
3
|
import { contactMetadataSchema, contactOrganizationResponseSchema, contactResponseSchema, createContactOrganizationRequestSchema, createContactRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema } from "./contact.js";
|
|
4
|
-
import { getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, timelineItemPartsSchema, timelineItemSchema } from "./timeline-item.js";
|
|
4
|
+
import { cossistantProviderMetadataSchema, filePartSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, imagePartSchema, reasoningPartSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, sourceDocumentPartSchema, sourceUrlPartSchema, stepStartPartSchema, textPartSchema, timelineItemPartsSchema, timelineItemSchema, timelinePartEventSchema, timelinePartMetadataSchema, toolPartSchema, toolStateSchema } from "./timeline-item.js";
|
|
5
5
|
import { createConversationRequestSchema, createConversationResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema } from "./conversation.js";
|
|
6
|
-
import { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema } from "./knowledge.js";
|
|
6
|
+
import { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, uploadKnowledgeFileRequestSchema, urlKnowledgePayloadSchema } from "./knowledge.js";
|
|
7
|
+
import { cancelLinkSourceRequestSchema, crawlProgressPageSchema, createLinkSourceRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, getCrawlStatusRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, ignorePageRequestSchema, linkSourceResponseSchema, linkSourceStatusSchema, listKnowledgeByLinkSourceRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, scanSubpagesRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema } from "./link-source.js";
|
|
7
8
|
import { MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, getDefaultMemberNotificationPreference, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema } from "./notification.js";
|
|
8
9
|
import { organizationResponseSchema } from "./organization.js";
|
|
9
10
|
import { generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema } from "./upload.js";
|
|
@@ -11,4 +12,4 @@ import { updateUserProfileRequestSchema, userResponseSchema } from "./user.js";
|
|
|
11
12
|
import { publicContactResponseSchema, publicVisitorResponseSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema } from "./visitor.js";
|
|
12
13
|
import { AvailableAIAgentSchema, availableHumanAgentSchema, checkWebsiteDomainRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, listByOrganizationRequestSchema, publicWebsiteResponseSchema, revokeWebsiteApiKeyRequestSchema, updateWebsiteRequestSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema } from "./website.js";
|
|
13
14
|
|
|
14
|
-
export { AI_MODELS, AvailableAIAgentSchema, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, checkWebsiteDomainRequestSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganizationResponseSchema, contactResponseSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteKnowledgeRequestSchema, emailSchema, faqKnowledgePayloadSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getDefaultMemberNotificationPreference, getKnowledgeRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listByOrganizationRequestSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, 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, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
|
|
15
|
+
export { AI_AGENT_GOALS, AI_MODELS, AvailableAIAgentSchema, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganizationResponseSchema, contactResponseSchema, cossistantProviderMetadataSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, filePartSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, imagePartSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, reasoningPartSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, sourceDocumentPartSchema, sourceUrlPartSchema, stepStartPartSchema, textPartSchema, timelineItemPartsSchema, timelineItemSchema, timelinePartEventSchema, timelinePartMetadataSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, toggleKnowledgeIncludedRequestSchema, toolPartSchema, toolStateSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadKnowledgeFileRequestSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
|
package/api/knowledge.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ declare const knowledgeCreateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
43
43
|
origin: z.ZodString;
|
|
44
44
|
createdBy: z.ZodString;
|
|
45
45
|
contentHash: z.ZodString;
|
|
46
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
46
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
47
47
|
type: z.ZodLiteral<"url">;
|
|
48
48
|
sourceUrl: z.ZodURL;
|
|
49
49
|
payload: z.ZodObject<{
|
|
@@ -68,7 +68,7 @@ declare const knowledgeCreateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
68
68
|
origin: z.ZodString;
|
|
69
69
|
createdBy: z.ZodString;
|
|
70
70
|
contentHash: z.ZodString;
|
|
71
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
71
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
72
72
|
type: z.ZodLiteral<"faq">;
|
|
73
73
|
payload: z.ZodObject<{
|
|
74
74
|
question: z.ZodString;
|
|
@@ -84,7 +84,7 @@ declare const knowledgeCreateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
84
84
|
origin: z.ZodString;
|
|
85
85
|
createdBy: z.ZodString;
|
|
86
86
|
contentHash: z.ZodString;
|
|
87
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
87
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
88
88
|
type: z.ZodLiteral<"article">;
|
|
89
89
|
sourceUrl: z.ZodNullable<z.ZodURL>;
|
|
90
90
|
payload: z.ZodObject<{
|
|
@@ -106,7 +106,7 @@ declare const knowledgeSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
106
106
|
origin: z.ZodString;
|
|
107
107
|
createdBy: z.ZodString;
|
|
108
108
|
contentHash: z.ZodString;
|
|
109
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
109
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
110
110
|
type: z.ZodLiteral<"url">;
|
|
111
111
|
sourceUrl: z.ZodURL;
|
|
112
112
|
payload: z.ZodObject<{
|
|
@@ -131,7 +131,7 @@ declare const knowledgeSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
131
131
|
origin: z.ZodString;
|
|
132
132
|
createdBy: z.ZodString;
|
|
133
133
|
contentHash: z.ZodString;
|
|
134
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
134
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
135
135
|
type: z.ZodLiteral<"faq">;
|
|
136
136
|
payload: z.ZodObject<{
|
|
137
137
|
question: z.ZodString;
|
|
@@ -147,7 +147,7 @@ declare const knowledgeSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
147
147
|
origin: z.ZodString;
|
|
148
148
|
createdBy: z.ZodString;
|
|
149
149
|
contentHash: z.ZodString;
|
|
150
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
150
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
151
151
|
type: z.ZodLiteral<"article">;
|
|
152
152
|
sourceUrl: z.ZodNullable<z.ZodURL>;
|
|
153
153
|
payload: z.ZodObject<{
|
|
@@ -180,6 +180,7 @@ declare const knowledgeResponseSchema: z.ZodObject<{
|
|
|
180
180
|
organizationId: z.ZodULID;
|
|
181
181
|
websiteId: z.ZodULID;
|
|
182
182
|
aiAgentId: z.ZodNullable<z.ZodULID>;
|
|
183
|
+
linkSourceId: z.ZodNullable<z.ZodULID>;
|
|
183
184
|
type: z.ZodEnum<{
|
|
184
185
|
url: "url";
|
|
185
186
|
faq: "faq";
|
|
@@ -202,12 +203,12 @@ declare const knowledgeResponseSchema: z.ZodObject<{
|
|
|
202
203
|
alt: z.ZodNullable<z.ZodString>;
|
|
203
204
|
}, z.core.$strip>>>;
|
|
204
205
|
estimatedTokens: z.ZodOptional<z.ZodNumber>;
|
|
205
|
-
}, z.core.$
|
|
206
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
206
207
|
question: z.ZodString;
|
|
207
208
|
answer: z.ZodString;
|
|
208
209
|
categories: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
209
210
|
relatedQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
210
|
-
}, z.core.$
|
|
211
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
211
212
|
title: z.ZodString;
|
|
212
213
|
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
214
|
markdown: z.ZodString;
|
|
@@ -216,8 +217,10 @@ declare const knowledgeResponseSchema: z.ZodObject<{
|
|
|
216
217
|
src: z.ZodURL;
|
|
217
218
|
alt: z.ZodNullable<z.ZodString>;
|
|
218
219
|
}, z.core.$strip>>;
|
|
219
|
-
}, z.core.$
|
|
220
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
220
|
+
}, z.core.$loose>]>;
|
|
221
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
222
|
+
isIncluded: z.ZodBoolean;
|
|
223
|
+
sizeBytes: z.ZodNumber;
|
|
221
224
|
createdAt: z.ZodString;
|
|
222
225
|
updatedAt: z.ZodString;
|
|
223
226
|
deletedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -261,6 +264,7 @@ declare const listKnowledgeResponseSchema: z.ZodObject<{
|
|
|
261
264
|
organizationId: z.ZodULID;
|
|
262
265
|
websiteId: z.ZodULID;
|
|
263
266
|
aiAgentId: z.ZodNullable<z.ZodULID>;
|
|
267
|
+
linkSourceId: z.ZodNullable<z.ZodULID>;
|
|
264
268
|
type: z.ZodEnum<{
|
|
265
269
|
url: "url";
|
|
266
270
|
faq: "faq";
|
|
@@ -283,12 +287,12 @@ declare const listKnowledgeResponseSchema: z.ZodObject<{
|
|
|
283
287
|
alt: z.ZodNullable<z.ZodString>;
|
|
284
288
|
}, z.core.$strip>>>;
|
|
285
289
|
estimatedTokens: z.ZodOptional<z.ZodNumber>;
|
|
286
|
-
}, z.core.$
|
|
290
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
287
291
|
question: z.ZodString;
|
|
288
292
|
answer: z.ZodString;
|
|
289
293
|
categories: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
290
294
|
relatedQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
291
|
-
}, z.core.$
|
|
295
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
292
296
|
title: z.ZodString;
|
|
293
297
|
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
294
298
|
markdown: z.ZodString;
|
|
@@ -297,8 +301,10 @@ declare const listKnowledgeResponseSchema: z.ZodObject<{
|
|
|
297
301
|
src: z.ZodURL;
|
|
298
302
|
alt: z.ZodNullable<z.ZodString>;
|
|
299
303
|
}, z.core.$strip>>;
|
|
300
|
-
}, z.core.$
|
|
301
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
304
|
+
}, z.core.$loose>]>;
|
|
305
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
306
|
+
isIncluded: z.ZodBoolean;
|
|
307
|
+
sizeBytes: z.ZodNumber;
|
|
302
308
|
createdAt: z.ZodString;
|
|
303
309
|
updatedAt: z.ZodString;
|
|
304
310
|
deletedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -360,7 +366,7 @@ declare const createKnowledgeRequestSchema: z.ZodObject<{
|
|
|
360
366
|
alt: z.ZodNullable<z.ZodString>;
|
|
361
367
|
}, z.core.$strip>>;
|
|
362
368
|
}, z.core.$strip>]>;
|
|
363
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
369
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
364
370
|
}, z.core.$strip>;
|
|
365
371
|
type CreateKnowledgeRequest = z.infer<typeof createKnowledgeRequestSchema>;
|
|
366
372
|
/**
|
|
@@ -403,11 +409,15 @@ declare const createKnowledgeRestRequestSchema: z.ZodObject<{
|
|
|
403
409
|
alt: z.ZodNullable<z.ZodString>;
|
|
404
410
|
}, z.core.$strip>>;
|
|
405
411
|
}, z.core.$strip>]>;
|
|
406
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
412
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
407
413
|
}, z.core.$strip>;
|
|
408
414
|
type CreateKnowledgeRestRequest = z.infer<typeof createKnowledgeRestRequestSchema>;
|
|
409
415
|
/**
|
|
410
416
|
* Update knowledge request schema (TRPC)
|
|
417
|
+
*
|
|
418
|
+
* Note: We use .passthrough() on payload schemas to prevent Zod's union validation
|
|
419
|
+
* from stripping fields when the first matching schema (urlKnowledgePayloadSchema)
|
|
420
|
+
* doesn't include all fields from other schemas (like articleKnowledgePayloadSchema's title).
|
|
411
421
|
*/
|
|
412
422
|
declare const updateKnowledgeRequestSchema: z.ZodObject<{
|
|
413
423
|
websiteSlug: z.ZodString;
|
|
@@ -427,12 +437,12 @@ declare const updateKnowledgeRequestSchema: z.ZodObject<{
|
|
|
427
437
|
alt: z.ZodNullable<z.ZodString>;
|
|
428
438
|
}, z.core.$strip>>>;
|
|
429
439
|
estimatedTokens: z.ZodOptional<z.ZodNumber>;
|
|
430
|
-
}, z.core.$
|
|
440
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
431
441
|
question: z.ZodString;
|
|
432
442
|
answer: z.ZodString;
|
|
433
443
|
categories: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
434
444
|
relatedQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
435
|
-
}, z.core.$
|
|
445
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
436
446
|
title: z.ZodString;
|
|
437
447
|
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
438
448
|
markdown: z.ZodString;
|
|
@@ -441,12 +451,15 @@ declare const updateKnowledgeRequestSchema: z.ZodObject<{
|
|
|
441
451
|
src: z.ZodURL;
|
|
442
452
|
alt: z.ZodNullable<z.ZodString>;
|
|
443
453
|
}, z.core.$strip>>;
|
|
444
|
-
}, z.core.$
|
|
445
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
454
|
+
}, z.core.$loose>]>>;
|
|
455
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
446
456
|
}, z.core.$strip>;
|
|
447
457
|
type UpdateKnowledgeRequest = z.infer<typeof updateKnowledgeRequestSchema>;
|
|
448
458
|
/**
|
|
449
459
|
* Update knowledge request schema (REST) - without websiteSlug
|
|
460
|
+
*
|
|
461
|
+
* Note: We use .passthrough() on payload schemas to prevent Zod's union validation
|
|
462
|
+
* from stripping fields. See updateKnowledgeRequestSchema for details.
|
|
450
463
|
*/
|
|
451
464
|
declare const updateKnowledgeRestRequestSchema: z.ZodObject<{
|
|
452
465
|
aiAgentId: z.ZodOptional<z.ZodNullable<z.ZodULID>>;
|
|
@@ -464,12 +477,12 @@ declare const updateKnowledgeRestRequestSchema: z.ZodObject<{
|
|
|
464
477
|
alt: z.ZodNullable<z.ZodString>;
|
|
465
478
|
}, z.core.$strip>>>;
|
|
466
479
|
estimatedTokens: z.ZodOptional<z.ZodNumber>;
|
|
467
|
-
}, z.core.$
|
|
480
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
468
481
|
question: z.ZodString;
|
|
469
482
|
answer: z.ZodString;
|
|
470
483
|
categories: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
471
484
|
relatedQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
472
|
-
}, z.core.$
|
|
485
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
473
486
|
title: z.ZodString;
|
|
474
487
|
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
475
488
|
markdown: z.ZodString;
|
|
@@ -478,8 +491,8 @@ declare const updateKnowledgeRestRequestSchema: z.ZodObject<{
|
|
|
478
491
|
src: z.ZodURL;
|
|
479
492
|
alt: z.ZodNullable<z.ZodString>;
|
|
480
493
|
}, z.core.$strip>>;
|
|
481
|
-
}, z.core.$
|
|
482
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
494
|
+
}, z.core.$loose>]>>;
|
|
495
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
483
496
|
}, z.core.$strip>;
|
|
484
497
|
type UpdateKnowledgeRestRequest = z.infer<typeof updateKnowledgeRestRequestSchema>;
|
|
485
498
|
/**
|
|
@@ -489,6 +502,31 @@ declare const deleteKnowledgeRequestSchema: z.ZodObject<{
|
|
|
489
502
|
websiteSlug: z.ZodString;
|
|
490
503
|
id: z.ZodULID;
|
|
491
504
|
}, z.core.$strip>;
|
|
505
|
+
type DeleteKnowledgeRequest = z.infer<typeof deleteKnowledgeRequestSchema>;
|
|
506
|
+
/**
|
|
507
|
+
* Toggle knowledge entry included request schema (TRPC)
|
|
508
|
+
* Named differently from link-source's toggleKnowledgeIncludedRequestSchema to avoid export conflict
|
|
509
|
+
*/
|
|
510
|
+
declare const toggleKnowledgeEntryIncludedRequestSchema: z.ZodObject<{
|
|
511
|
+
websiteSlug: z.ZodString;
|
|
512
|
+
id: z.ZodULID;
|
|
513
|
+
isIncluded: z.ZodBoolean;
|
|
514
|
+
}, z.core.$strip>;
|
|
515
|
+
type ToggleKnowledgeEntryIncludedRequest = z.infer<typeof toggleKnowledgeEntryIncludedRequestSchema>;
|
|
516
|
+
/**
|
|
517
|
+
* Upload knowledge file request schema (TRPC)
|
|
518
|
+
*/
|
|
519
|
+
declare const uploadKnowledgeFileRequestSchema: z.ZodObject<{
|
|
520
|
+
websiteSlug: z.ZodString;
|
|
521
|
+
aiAgentId: z.ZodOptional<z.ZodNullable<z.ZodULID>>;
|
|
522
|
+
fileName: z.ZodString;
|
|
523
|
+
fileContent: z.ZodString;
|
|
524
|
+
fileExtension: z.ZodEnum<{
|
|
525
|
+
md: "md";
|
|
526
|
+
txt: "txt";
|
|
527
|
+
}>;
|
|
528
|
+
}, z.core.$strip>;
|
|
529
|
+
type UploadKnowledgeFileRequest = z.infer<typeof uploadKnowledgeFileRequestSchema>;
|
|
492
530
|
//#endregion
|
|
493
|
-
export { ArticleKnowledgePayload, CreateKnowledgeRequest, CreateKnowledgeRestRequest, FaqKnowledgePayload, GetKnowledgeRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UrlKnowledgePayload, articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema };
|
|
531
|
+
export { ArticleKnowledgePayload, CreateKnowledgeRequest, CreateKnowledgeRestRequest, DeleteKnowledgeRequest, FaqKnowledgePayload, GetKnowledgeRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, ToggleKnowledgeEntryIncludedRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UploadKnowledgeFileRequest, UrlKnowledgePayload, articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, uploadKnowledgeFileRequestSchema, urlKnowledgePayloadSchema };
|
|
494
532
|
//# sourceMappingURL=knowledge.d.ts.map
|
package/api/knowledge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge.d.ts","names":[],"sources":["../../src/api/knowledge.ts"],"sourcesContent":[],"mappings":";;;cAEa,qBAAmB,CAAA,CAAA;;EAAnB,GAAA,EAAA,KAAA;EAgCA,OAAA,EAAA,SAAA;;cAAA,2BAAyB,CAAA,CAAA;;;;;;;;;;;;;cAkBzB,2BAAyB,CAAA,CAAA;;;;;;AAlBA,cAmCzB,6BAnCyB,EAmCI,CAAA,CAAA,SAnCJ,CAAA;EAAA,KAAA,aAAA;EAkBzB,OAAA,eAAA,cAeV,YAAA,CAAA,CAAA;;;;;;;;cAoGU,uBAAqB,CAAA,CAAA,uBAAA,CAAA,CAAA;;EAnHI,SAAA,WAAA;EAAA,SAAA,eAAA,cAAA,UAAA,CAAA,CAAA;EAiBzB,WAAA,eAAA,YAmBV,CAAA;;;;;;;;;;;;;;;;MAnBuC,GAAA,eAAA,YAAA,CAAA;IAAA,CAAA,eAAA,CAAA,CAAA,CAAA;IAkG7B,eAAA,eAIX,YAAA,CAAA
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","names":[],"sources":["../../src/api/knowledge.ts"],"sourcesContent":[],"mappings":"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"}
|
package/api/knowledge.js
CHANGED
|
@@ -74,7 +74,7 @@ const articleKnowledgePayloadSchema = z.object({
|
|
|
74
74
|
keywords: z.array(z.string()).default([]),
|
|
75
75
|
heroImage: imageSchema.optional()
|
|
76
76
|
}).openapi({ description: "Payload describing a full article or help doc" });
|
|
77
|
-
const metadataSchema = z.record(z.string(), z.unknown()).
|
|
77
|
+
const metadataSchema = z.record(z.string(), z.unknown()).nullish().openapi({
|
|
78
78
|
description: "Arbitrary metadata such as locale or crawl depth",
|
|
79
79
|
example: {
|
|
80
80
|
locale: "en-US",
|
|
@@ -174,6 +174,10 @@ const knowledgeResponseSchema = z.object({
|
|
|
174
174
|
description: "Optional AI agent identifier; null means shared at website scope",
|
|
175
175
|
example: "01JG000000000000000000002"
|
|
176
176
|
}),
|
|
177
|
+
linkSourceId: z.ulid().nullable().openapi({
|
|
178
|
+
description: "Reference to the link source that created this entry",
|
|
179
|
+
example: "01JG000000000000000000003"
|
|
180
|
+
}),
|
|
177
181
|
type: knowledgeTypeSchema,
|
|
178
182
|
sourceUrl: z.url().nullable().openapi({
|
|
179
183
|
description: "Origin URL for this entry",
|
|
@@ -196,11 +200,19 @@ const knowledgeResponseSchema = z.object({
|
|
|
196
200
|
example: "5d41402abc4b2a76b9719d911017c592"
|
|
197
201
|
}),
|
|
198
202
|
payload: z.union([
|
|
199
|
-
urlKnowledgePayloadSchema,
|
|
200
|
-
faqKnowledgePayloadSchema,
|
|
201
|
-
articleKnowledgePayloadSchema
|
|
203
|
+
urlKnowledgePayloadSchema.passthrough(),
|
|
204
|
+
faqKnowledgePayloadSchema.passthrough(),
|
|
205
|
+
articleKnowledgePayloadSchema.passthrough()
|
|
202
206
|
]),
|
|
203
207
|
metadata: metadataSchema,
|
|
208
|
+
isIncluded: z.boolean().openapi({
|
|
209
|
+
description: "Whether this entry is included in training",
|
|
210
|
+
example: true
|
|
211
|
+
}),
|
|
212
|
+
sizeBytes: z.number().int().nonnegative().openapi({
|
|
213
|
+
description: "Size of this entry in bytes",
|
|
214
|
+
example: 4096
|
|
215
|
+
}),
|
|
204
216
|
createdAt: z.string().openapi({
|
|
205
217
|
description: "Creation timestamp",
|
|
206
218
|
example: "2024-06-10T12:00:00.000Z"
|
|
@@ -363,6 +375,10 @@ const createKnowledgeRestRequestSchema = z.object({
|
|
|
363
375
|
}).openapi({ description: "Request to create a new knowledge entry (REST)" });
|
|
364
376
|
/**
|
|
365
377
|
* Update knowledge request schema (TRPC)
|
|
378
|
+
*
|
|
379
|
+
* Note: We use .passthrough() on payload schemas to prevent Zod's union validation
|
|
380
|
+
* from stripping fields when the first matching schema (urlKnowledgePayloadSchema)
|
|
381
|
+
* doesn't include all fields from other schemas (like articleKnowledgePayloadSchema's title).
|
|
366
382
|
*/
|
|
367
383
|
const updateKnowledgeRequestSchema = z.object({
|
|
368
384
|
websiteSlug: z.string().openapi({
|
|
@@ -386,14 +402,17 @@ const updateKnowledgeRequestSchema = z.object({
|
|
|
386
402
|
example: "Getting started with the Cossistant dashboard"
|
|
387
403
|
}),
|
|
388
404
|
payload: z.union([
|
|
389
|
-
urlKnowledgePayloadSchema,
|
|
390
|
-
faqKnowledgePayloadSchema,
|
|
391
|
-
articleKnowledgePayloadSchema
|
|
405
|
+
urlKnowledgePayloadSchema.passthrough(),
|
|
406
|
+
faqKnowledgePayloadSchema.passthrough(),
|
|
407
|
+
articleKnowledgePayloadSchema.passthrough()
|
|
392
408
|
]).optional(),
|
|
393
409
|
metadata: metadataSchema
|
|
394
410
|
}).openapi({ description: "Request to update an existing knowledge entry" });
|
|
395
411
|
/**
|
|
396
412
|
* Update knowledge request schema (REST) - without websiteSlug
|
|
413
|
+
*
|
|
414
|
+
* Note: We use .passthrough() on payload schemas to prevent Zod's union validation
|
|
415
|
+
* from stripping fields. See updateKnowledgeRequestSchema for details.
|
|
397
416
|
*/
|
|
398
417
|
const updateKnowledgeRestRequestSchema = z.object({
|
|
399
418
|
aiAgentId: z.ulid().nullable().optional().openapi({
|
|
@@ -409,9 +428,9 @@ const updateKnowledgeRestRequestSchema = z.object({
|
|
|
409
428
|
example: "Getting started with the Cossistant dashboard"
|
|
410
429
|
}),
|
|
411
430
|
payload: z.union([
|
|
412
|
-
urlKnowledgePayloadSchema,
|
|
413
|
-
faqKnowledgePayloadSchema,
|
|
414
|
-
articleKnowledgePayloadSchema
|
|
431
|
+
urlKnowledgePayloadSchema.passthrough(),
|
|
432
|
+
faqKnowledgePayloadSchema.passthrough(),
|
|
433
|
+
articleKnowledgePayloadSchema.passthrough()
|
|
415
434
|
]).optional(),
|
|
416
435
|
metadata: metadataSchema
|
|
417
436
|
}).openapi({ description: "Request to update an existing knowledge entry (REST)" });
|
|
@@ -428,7 +447,50 @@ const deleteKnowledgeRequestSchema = z.object({
|
|
|
428
447
|
example: "01JG00000000000000000000A"
|
|
429
448
|
})
|
|
430
449
|
}).openapi({ description: "Request to delete a knowledge entry" });
|
|
450
|
+
/**
|
|
451
|
+
* Toggle knowledge entry included request schema (TRPC)
|
|
452
|
+
* Named differently from link-source's toggleKnowledgeIncludedRequestSchema to avoid export conflict
|
|
453
|
+
*/
|
|
454
|
+
const toggleKnowledgeEntryIncludedRequestSchema = z.object({
|
|
455
|
+
websiteSlug: z.string().openapi({
|
|
456
|
+
description: "The website slug",
|
|
457
|
+
example: "my-website"
|
|
458
|
+
}),
|
|
459
|
+
id: z.ulid().openapi({
|
|
460
|
+
description: "Knowledge entry ID",
|
|
461
|
+
example: "01JG00000000000000000000A"
|
|
462
|
+
}),
|
|
463
|
+
isIncluded: z.boolean().openapi({
|
|
464
|
+
description: "Whether this entry should be included in training",
|
|
465
|
+
example: true
|
|
466
|
+
})
|
|
467
|
+
}).openapi({ description: "Request to toggle knowledge entry inclusion in training" });
|
|
468
|
+
/**
|
|
469
|
+
* Upload knowledge file request schema (TRPC)
|
|
470
|
+
*/
|
|
471
|
+
const uploadKnowledgeFileRequestSchema = z.object({
|
|
472
|
+
websiteSlug: z.string().openapi({
|
|
473
|
+
description: "The website slug",
|
|
474
|
+
example: "my-website"
|
|
475
|
+
}),
|
|
476
|
+
aiAgentId: z.ulid().nullable().optional().openapi({
|
|
477
|
+
description: "Optional AI agent ID; null/omit for shared at website scope",
|
|
478
|
+
example: "01JG000000000000000000002"
|
|
479
|
+
}),
|
|
480
|
+
fileName: z.string().min(1).openapi({
|
|
481
|
+
description: "Original file name",
|
|
482
|
+
example: "getting-started.md"
|
|
483
|
+
}),
|
|
484
|
+
fileContent: z.string().min(1).openapi({
|
|
485
|
+
description: "Raw file content",
|
|
486
|
+
example: "# Getting Started\n\nWelcome to our documentation..."
|
|
487
|
+
}),
|
|
488
|
+
fileExtension: z.enum(["md", "txt"]).openapi({
|
|
489
|
+
description: "File extension",
|
|
490
|
+
example: "md"
|
|
491
|
+
})
|
|
492
|
+
}).openapi({ description: "Request to upload a file as a knowledge entry" });
|
|
431
493
|
|
|
432
494
|
//#endregion
|
|
433
|
-
export { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema };
|
|
495
|
+
export { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, uploadKnowledgeFileRequestSchema, urlKnowledgePayloadSchema };
|
|
434
496
|
//# sourceMappingURL=knowledge.js.map
|