@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/knowledge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge.js","names":[],"sources":["../../src/api/knowledge.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\nexport const knowledgeTypeSchema = z.enum([\"url\", \"faq\", \"article\"]).openapi({\n\tdescription: \"Knowledge entry type\",\n\texample: \"url\",\n});\n\nconst headingSchema = z.object({\n\tlevel: z.number().int().min(1).max(6).openapi({\n\t\tdescription: \"Heading level (1-6)\",\n\t\texample: 2,\n\t}),\n\ttext: z.string().min(1).openapi({\n\t\tdescription: \"Heading text content\",\n\t\texample: \"Getting started\",\n\t}),\n});\n\nconst linkSchema = z.url().openapi({\n\tdescription: \"Absolute URL discovered in the document\",\n\texample: \"https://docs.cossistant.com/guide\",\n});\n\nconst imageSchema = z.object({\n\tsrc: z.url().openapi({\n\t\tdescription: \"Image URL captured during scraping\",\n\t\texample: \"https://cdn.cossistant.com/assets/hero.png\",\n\t}),\n\talt: z.string().nullable().openapi({\n\t\tdescription: \"Optional alt text attached to the image\",\n\t\texample: \"Agent dashboard hero illustration\",\n\t}),\n});\n\nexport const urlKnowledgePayloadSchema = z\n\t.object({\n\t\tmarkdown: z.string().min(1).openapi({\n\t\t\tdescription: \"Scraped markdown body\",\n\t\t\texample: \"# Welcome to the Help Center\",\n\t\t}),\n\t\theadings: z.array(headingSchema).default([]),\n\t\tlinks: z.array(linkSchema).default([]),\n\t\timages: z.array(imageSchema).default([]),\n\t\testimatedTokens: z.number().int().nonnegative().optional().openapi({\n\t\t\tdescription: \"Heuristic token count to assist chunking\",\n\t\t\texample: 2048,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Structured payload for raw page content\",\n\t});\n\nexport const faqKnowledgePayloadSchema = z\n\t.object({\n\t\tquestion: z.string().min(1).openapi({\n\t\t\tdescription: \"FAQ question\",\n\t\t\texample: \"How do I reset my password?\",\n\t\t}),\n\t\tanswer: z.string().min(1).openapi({\n\t\t\tdescription: \"Answer shown to customers\",\n\t\t\texample: \"Go to Settings → Security and click Reset password.\",\n\t\t}),\n\t\tcategories: z.array(z.string()).default([]),\n\t\trelatedQuestions: z.array(z.string()).default([]),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload describing a single FAQ entry\",\n\t});\n\nexport const articleKnowledgePayloadSchema = z\n\t.object({\n\t\ttitle: z.string().min(1).openapi({\n\t\t\tdescription: \"Article title\",\n\t\t\texample: \"Billing and invoicing overview\",\n\t\t}),\n\t\tsummary: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Short synopsis or excerpt\",\n\t\t\texample: \"Understand how billing cycles and invoices are generated.\",\n\t\t}),\n\t\tmarkdown: z.string().min(1).openapi({\n\t\t\tdescription: \"Article body in markdown format\",\n\t\t\texample: \"## Billing cycles\\n\\nCossistant bills you monthly...\",\n\t\t}),\n\t\tkeywords: z.array(z.string()).default([]),\n\t\theroImage: imageSchema.optional(),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload describing a full article or help doc\",\n\t});\n\nconst metadataSchema = z\n\t.record(z.string(), z.unknown())\n\t.optional()\n\t.openapi({\n\t\tdescription: \"Arbitrary metadata such as locale or crawl depth\",\n\t\texample: {\n\t\t\tlocale: \"en-US\",\n\t\t\tsource: \"firecrawl\",\n\t\t},\n\t});\n\nconst baseKnowledgeFields = {\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"Owning organization identifier\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\twebsiteId: z.ulid().openapi({\n\t\tdescription: \"Website identifier\",\n\t\texample: \"01JG000000000000000000001\",\n\t}),\n\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\tdescription:\n\t\t\t\"Optional AI agent identifier; null/omitted means the entry is shared at the website scope.\",\n\t\texample: \"01JG000000000000000000002\",\n\t}),\n\tsourceUrl: z.url().nullable().openapi({\n\t\tdescription:\n\t\t\t\"Origin URL for this entry (required for url knowledge; optional for others)\",\n\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t}),\n\tsourceTitle: z.string().nullable().openapi({\n\t\tdescription: \"Readable title captured during scraping\",\n\t\texample: \"Getting started with the Cossistant dashboard\",\n\t}),\n\torigin: z.string().min(1).openapi({\n\t\tdescription:\n\t\t\t\"Describes how this entry was created (crawl, manual, agent, etc.)\",\n\t\texample: \"crawl\",\n\t}),\n\tcreatedBy: z.string().min(1).openapi({\n\t\tdescription:\n\t\t\t\"Identifier of the actor (user, agent, system) that created this entry\",\n\t\texample: \"user_01JG00000000000000000000\",\n\t}),\n\tcontentHash: z.string().min(1).openapi({\n\t\tdescription: \"Deterministic hash of the payload for deduping\",\n\t\texample: \"5d41402abc4b2a76b9719d911017c592\",\n\t}),\n\tmetadata: metadataSchema,\n};\n\nconst urlKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"url\"),\n\t\tsourceUrl: z.url(),\n\t\tpayload: urlKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"URL knowledge entry\" });\n\nconst faqKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"faq\"),\n\t\tpayload: faqKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"FAQ knowledge entry\" });\n\nconst articleKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"article\"),\n\t\tsourceUrl: z.url().nullable(),\n\t\tpayload: articleKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"Article knowledge entry\" });\n\nexport const knowledgeCreateSchema = z.discriminatedUnion(\"type\", [\n\turlKnowledgeSchema,\n\tfaqKnowledgeSchema,\n\tarticleKnowledgeSchema,\n]);\n\nconst knowledgeAuditFieldsSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"Knowledge entry identifier\",\n\t\texample: \"01JG00000000000000000000A\",\n\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"Creation timestamp\",\n\t\texample: \"2024-06-10T12:00:00.000Z\",\n\t}),\n\tupdatedAt: z.string().openapi({\n\t\tdescription: \"Last update timestamp\",\n\t\texample: \"2024-06-11T08:00:00.000Z\",\n\t}),\n\tdeletedAt: z.string().nullable().openapi({\n\t\tdescription: \"Soft delete timestamp\",\n\t\texample: null,\n\t}),\n});\n\nexport const knowledgeSchema = knowledgeCreateSchema\n\t// Intersection preserves the discriminated union while adding persisted fields.\n\t.and(knowledgeAuditFieldsSchema)\n\t.openapi({\n\t\tdescription: \"Persisted knowledge entry\",\n\t});\n\nexport type KnowledgeType = z.infer<typeof knowledgeTypeSchema>;\nexport type UrlKnowledgePayload = z.infer<typeof urlKnowledgePayloadSchema>;\nexport type FaqKnowledgePayload = z.infer<typeof faqKnowledgePayloadSchema>;\nexport type ArticleKnowledgePayload = z.infer<\n\ttypeof articleKnowledgePayloadSchema\n>;\nexport type KnowledgeCreateInput = z.infer<typeof knowledgeCreateSchema>;\nexport type Knowledge = z.infer<typeof knowledgeSchema>;\n\n// ============================================================================\n// API Request/Response Schemas\n// ============================================================================\n\n/**\n * Knowledge response schema - used for single item responses\n */\nexport const knowledgeResponseSchema = z\n\t.object({\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry identifier\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"Owning organization identifier\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"Website identifier\",\n\t\t\texample: \"01JG000000000000000000001\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent identifier; null means shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().openapi({\n\t\t\tdescription: \"Readable title captured during scraping\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"crawl\",\n\t\t}),\n\t\tcreatedBy: z.string().openapi({\n\t\t\tdescription: \"Identifier of the actor that created this entry\",\n\t\t\texample: \"user_01JG00000000000000000000\",\n\t\t}),\n\t\tcontentHash: z.string().openapi({\n\t\t\tdescription: \"Deterministic hash of the payload for deduping\",\n\t\t\texample: \"5d41402abc4b2a76b9719d911017c592\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t\tcreatedAt: z.string().openapi({\n\t\t\tdescription: \"Creation timestamp\",\n\t\t\texample: \"2024-06-10T12:00:00.000Z\",\n\t\t}),\n\t\tupdatedAt: z.string().openapi({\n\t\t\tdescription: \"Last update timestamp\",\n\t\t\texample: \"2024-06-11T08:00:00.000Z\",\n\t\t}),\n\t\tdeletedAt: z.string().nullable().openapi({\n\t\t\tdescription: \"Soft delete timestamp\",\n\t\t\texample: null,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Knowledge entry response\",\n\t});\n\nexport type KnowledgeResponse = z.infer<typeof knowledgeResponseSchema>;\n\n/**\n * List knowledge request schema (TRPC) - with websiteSlug\n */\nexport const listKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to list knowledge for\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema.optional().openapi({\n\t\t\tdescription: \"Filter by knowledge type\",\n\t\t\texample: \"url\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Filter by AI agent ID; null for shared entries; omit for all\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tpage: z.coerce.number().int().positive().default(1).openapi({\n\t\t\tdescription: \"Page number (1-indexed)\",\n\t\t\texample: 1,\n\t\t}),\n\t\tlimit: z.coerce.number().int().positive().max(100).default(20).openapi({\n\t\t\tdescription: \"Items per page (max 100)\",\n\t\t\texample: 20,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to list knowledge entries with filters and pagination\",\n\t});\n\nexport type ListKnowledgeRequest = z.infer<typeof listKnowledgeRequestSchema>;\n\n/**\n * List knowledge request schema (REST) - without websiteSlug (derived from API key)\n */\nexport const listKnowledgeRestRequestSchema = z\n\t.object({\n\t\ttype: knowledgeTypeSchema.optional().openapi({\n\t\t\tdescription: \"Filter by knowledge type\",\n\t\t\texample: \"url\",\n\t\t}),\n\t\taiAgentId: z\n\t\t\t.union([z.ulid(), z.literal(\"null\"), z.literal(\"\")])\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t'Filter by AI agent ID. Pass a valid ULID to filter by agent, pass \"null\" or empty string to filter for shared/website-scoped entries only, or omit entirely to return all entries.',\n\t\t\t\texample: \"01JG000000000000000000002\",\n\t\t\t}),\n\t\tpage: z.coerce.number().int().positive().default(1).openapi({\n\t\t\tdescription: \"Page number (1-indexed)\",\n\t\t\texample: 1,\n\t\t}),\n\t\tlimit: z.coerce.number().int().positive().max(100).default(20).openapi({\n\t\t\tdescription: \"Items per page (max 100)\",\n\t\t\texample: 20,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to list knowledge entries with filters and pagination (REST)\",\n\t});\n\nexport type ListKnowledgeRestRequest = z.infer<\n\ttypeof listKnowledgeRestRequestSchema\n>;\n\n/**\n * List knowledge response schema\n */\nexport const listKnowledgeResponseSchema = z\n\t.object({\n\t\titems: z.array(knowledgeResponseSchema).openapi({\n\t\t\tdescription: \"Array of knowledge entries\",\n\t\t}),\n\t\tpagination: z\n\t\t\t.object({\n\t\t\t\tpage: z.number().int().positive().openapi({\n\t\t\t\t\tdescription: \"Current page number\",\n\t\t\t\t\texample: 1,\n\t\t\t\t}),\n\t\t\t\tlimit: z.number().int().positive().openapi({\n\t\t\t\t\tdescription: \"Items per page\",\n\t\t\t\t\texample: 20,\n\t\t\t\t}),\n\t\t\t\ttotal: z.number().int().nonnegative().openapi({\n\t\t\t\t\tdescription: \"Total number of items\",\n\t\t\t\t\texample: 100,\n\t\t\t\t}),\n\t\t\t\thasMore: z.boolean().openapi({\n\t\t\t\t\tdescription: \"Whether there are more items available\",\n\t\t\t\t\texample: true,\n\t\t\t\t}),\n\t\t\t})\n\t\t\t.openapi({\n\t\t\t\tdescription: \"Pagination metadata\",\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Paginated list of knowledge entries\",\n\t});\n\nexport type ListKnowledgeResponse = z.infer<typeof listKnowledgeResponseSchema>;\n\n/**\n * Get knowledge request schema (TRPC)\n */\nexport const getKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to get a single knowledge entry\",\n\t});\n\nexport type GetKnowledgeRequest = z.infer<typeof getKnowledgeRequestSchema>;\n\n/**\n * Create knowledge request schema (TRPC) - extends create input with websiteSlug\n */\nexport const createKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to create knowledge for\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().min(1).openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"manual\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to create a new knowledge entry\",\n\t});\n\nexport type CreateKnowledgeRequest = z.infer<\n\ttypeof createKnowledgeRequestSchema\n>;\n\n/**\n * Create knowledge request schema (REST) - without websiteSlug\n */\nexport const createKnowledgeRestRequestSchema = z\n\t.object({\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().min(1).openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"manual\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to create a new knowledge entry (REST)\",\n\t});\n\nexport type CreateKnowledgeRestRequest = z.infer<\n\ttypeof createKnowledgeRestRequestSchema\n>;\n\n/**\n * Update knowledge request schema (TRPC)\n */\nexport const updateKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID to update\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription: \"Update AI agent association\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Update origin URL\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Update readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\tpayload: z\n\t\t\t.union([\n\t\t\t\turlKnowledgePayloadSchema,\n\t\t\t\tfaqKnowledgePayloadSchema,\n\t\t\t\tarticleKnowledgePayloadSchema,\n\t\t\t])\n\t\t\t.optional(),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to update an existing knowledge entry\",\n\t});\n\nexport type UpdateKnowledgeRequest = z.infer<\n\ttypeof updateKnowledgeRequestSchema\n>;\n\n/**\n * Update knowledge request schema (REST) - without websiteSlug\n */\nexport const updateKnowledgeRestRequestSchema = z\n\t.object({\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription: \"Update AI agent association\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Update origin URL\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Update readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\tpayload: z\n\t\t\t.union([\n\t\t\t\turlKnowledgePayloadSchema,\n\t\t\t\tfaqKnowledgePayloadSchema,\n\t\t\t\tarticleKnowledgePayloadSchema,\n\t\t\t])\n\t\t\t.optional(),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to update an existing knowledge entry (REST)\",\n\t});\n\nexport type UpdateKnowledgeRestRequest = z.infer<\n\ttypeof updateKnowledgeRestRequestSchema\n>;\n\n/**\n * Delete knowledge request schema (TRPC)\n */\nexport const deleteKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID to delete\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to delete a knowledge entry\",\n\t});\n"],"mappings":";;;AAEA,MAAa,sBAAsB,EAAE,KAAK;CAAC;CAAO;CAAO;CAAU,CAAC,CAAC,QAAQ;CAC5E,aAAa;CACb,SAAS;CACT,CAAC;AAEF,MAAM,gBAAgB,EAAE,OAAO;CAC9B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ;EAC7C,aAAa;EACb,SAAS;EACT,CAAC;CACF,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC;AAEF,MAAM,aAAa,EAAE,KAAK,CAAC,QAAQ;CAClC,aAAa;CACb,SAAS;CACT,CAAC;AAEF,MAAM,cAAc,EAAE,OAAO;CAC5B,KAAK,EAAE,KAAK,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;EAClC,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC;AAEF,MAAa,4BAA4B,EACvC,OA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EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;EACjD,aAAa;EACb,SAAS;EACT,CAAC;CACF,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;EAChD,aAAa;EACb,SAAS;EACT,CAAC;CACF,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;EACrD,aAAa;EACb,SAAS;EACT,CAAC;CACF,SAAS,EACP,MAAM;EACN;EACA;EACA;EACA,CAAC,CACD,UAAU;CACZ,UAAU;CACV,CAAC,CACD,QAAQ,EACR,aAAa,iDACb,CAAC;;;;AASH,MAAa,mCAAmC,EAC9C,OAAO;CACP,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;EACjD,aAAa;EACb,SAAS;EACT,CAAC;CACF,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;EAChD,aAAa;EACb,SAAS;EACT,CAAC;CACF,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;EACrD,aAAa;EACb,SAAS;EACT,CAAC;CACF,SAAS,EACP,MAAM;EACN;EACA;EACA;EACA,CAAC,CACD,UAAU;CACZ,UAAU;CACV,CAAC,CACD,QAAQ,EACR,aAAa,wDACb,CAAC;;;;AASH,MAAa,+BAA+B,EAC1C,OAAO;CACP,aAAa,EAAE,QAAQ,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,IAAI,EAAE,MAAM,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,uCACb,CAAC"}
|
|
1
|
+
{"version":3,"file":"knowledge.js","names":[],"sources":["../../src/api/knowledge.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\nexport const knowledgeTypeSchema = z.enum([\"url\", \"faq\", \"article\"]).openapi({\n\tdescription: \"Knowledge entry type\",\n\texample: \"url\",\n});\n\nconst headingSchema = z.object({\n\tlevel: z.number().int().min(1).max(6).openapi({\n\t\tdescription: \"Heading level (1-6)\",\n\t\texample: 2,\n\t}),\n\ttext: z.string().min(1).openapi({\n\t\tdescription: \"Heading text content\",\n\t\texample: \"Getting started\",\n\t}),\n});\n\nconst linkSchema = z.url().openapi({\n\tdescription: \"Absolute URL discovered in the document\",\n\texample: \"https://docs.cossistant.com/guide\",\n});\n\nconst imageSchema = z.object({\n\tsrc: z.url().openapi({\n\t\tdescription: \"Image URL captured during scraping\",\n\t\texample: \"https://cdn.cossistant.com/assets/hero.png\",\n\t}),\n\talt: z.string().nullable().openapi({\n\t\tdescription: \"Optional alt text attached to the image\",\n\t\texample: \"Agent dashboard hero illustration\",\n\t}),\n});\n\nexport const urlKnowledgePayloadSchema = z\n\t.object({\n\t\tmarkdown: z.string().min(1).openapi({\n\t\t\tdescription: \"Scraped markdown body\",\n\t\t\texample: \"# Welcome to the Help Center\",\n\t\t}),\n\t\theadings: z.array(headingSchema).default([]),\n\t\tlinks: z.array(linkSchema).default([]),\n\t\timages: z.array(imageSchema).default([]),\n\t\testimatedTokens: z.number().int().nonnegative().optional().openapi({\n\t\t\tdescription: \"Heuristic token count to assist chunking\",\n\t\t\texample: 2048,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Structured payload for raw page content\",\n\t});\n\nexport const faqKnowledgePayloadSchema = z\n\t.object({\n\t\tquestion: z.string().min(1).openapi({\n\t\t\tdescription: \"FAQ question\",\n\t\t\texample: \"How do I reset my password?\",\n\t\t}),\n\t\tanswer: z.string().min(1).openapi({\n\t\t\tdescription: \"Answer shown to customers\",\n\t\t\texample: \"Go to Settings → Security and click Reset password.\",\n\t\t}),\n\t\tcategories: z.array(z.string()).default([]),\n\t\trelatedQuestions: z.array(z.string()).default([]),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload describing a single FAQ entry\",\n\t});\n\nexport const articleKnowledgePayloadSchema = z\n\t.object({\n\t\ttitle: z.string().min(1).openapi({\n\t\t\tdescription: \"Article title\",\n\t\t\texample: \"Billing and invoicing overview\",\n\t\t}),\n\t\tsummary: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Short synopsis or excerpt\",\n\t\t\texample: \"Understand how billing cycles and invoices are generated.\",\n\t\t}),\n\t\tmarkdown: z.string().min(1).openapi({\n\t\t\tdescription: \"Article body in markdown format\",\n\t\t\texample: \"## Billing cycles\\n\\nCossistant bills you monthly...\",\n\t\t}),\n\t\tkeywords: z.array(z.string()).default([]),\n\t\theroImage: imageSchema.optional(),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload describing a full article or help doc\",\n\t});\n\nconst metadataSchema = z\n\t.record(z.string(), z.unknown())\n\t.nullish()\n\t.openapi({\n\t\tdescription: \"Arbitrary metadata such as locale or crawl depth\",\n\t\texample: {\n\t\t\tlocale: \"en-US\",\n\t\t\tsource: \"firecrawl\",\n\t\t},\n\t});\n\nconst baseKnowledgeFields = {\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"Owning organization identifier\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\twebsiteId: z.ulid().openapi({\n\t\tdescription: \"Website identifier\",\n\t\texample: \"01JG000000000000000000001\",\n\t}),\n\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\tdescription:\n\t\t\t\"Optional AI agent identifier; null/omitted means the entry is shared at the website scope.\",\n\t\texample: \"01JG000000000000000000002\",\n\t}),\n\tsourceUrl: z.url().nullable().openapi({\n\t\tdescription:\n\t\t\t\"Origin URL for this entry (required for url knowledge; optional for others)\",\n\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t}),\n\tsourceTitle: z.string().nullable().openapi({\n\t\tdescription: \"Readable title captured during scraping\",\n\t\texample: \"Getting started with the Cossistant dashboard\",\n\t}),\n\torigin: z.string().min(1).openapi({\n\t\tdescription:\n\t\t\t\"Describes how this entry was created (crawl, manual, agent, etc.)\",\n\t\texample: \"crawl\",\n\t}),\n\tcreatedBy: z.string().min(1).openapi({\n\t\tdescription:\n\t\t\t\"Identifier of the actor (user, agent, system) that created this entry\",\n\t\texample: \"user_01JG00000000000000000000\",\n\t}),\n\tcontentHash: z.string().min(1).openapi({\n\t\tdescription: \"Deterministic hash of the payload for deduping\",\n\t\texample: \"5d41402abc4b2a76b9719d911017c592\",\n\t}),\n\tmetadata: metadataSchema,\n};\n\nconst urlKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"url\"),\n\t\tsourceUrl: z.url(),\n\t\tpayload: urlKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"URL knowledge entry\" });\n\nconst faqKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"faq\"),\n\t\tpayload: faqKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"FAQ knowledge entry\" });\n\nconst articleKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"article\"),\n\t\tsourceUrl: z.url().nullable(),\n\t\tpayload: articleKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"Article knowledge entry\" });\n\nexport const knowledgeCreateSchema = z.discriminatedUnion(\"type\", [\n\turlKnowledgeSchema,\n\tfaqKnowledgeSchema,\n\tarticleKnowledgeSchema,\n]);\n\nconst knowledgeAuditFieldsSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"Knowledge entry identifier\",\n\t\texample: \"01JG00000000000000000000A\",\n\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"Creation timestamp\",\n\t\texample: \"2024-06-10T12:00:00.000Z\",\n\t}),\n\tupdatedAt: z.string().openapi({\n\t\tdescription: \"Last update timestamp\",\n\t\texample: \"2024-06-11T08:00:00.000Z\",\n\t}),\n\tdeletedAt: z.string().nullable().openapi({\n\t\tdescription: \"Soft delete timestamp\",\n\t\texample: null,\n\t}),\n});\n\nexport const knowledgeSchema = knowledgeCreateSchema\n\t// Intersection preserves the discriminated union while adding persisted fields.\n\t.and(knowledgeAuditFieldsSchema)\n\t.openapi({\n\t\tdescription: \"Persisted knowledge entry\",\n\t});\n\nexport type KnowledgeType = z.infer<typeof knowledgeTypeSchema>;\nexport type UrlKnowledgePayload = z.infer<typeof urlKnowledgePayloadSchema>;\nexport type FaqKnowledgePayload = z.infer<typeof faqKnowledgePayloadSchema>;\nexport type ArticleKnowledgePayload = z.infer<\n\ttypeof articleKnowledgePayloadSchema\n>;\nexport type KnowledgeCreateInput = z.infer<typeof knowledgeCreateSchema>;\nexport type Knowledge = z.infer<typeof knowledgeSchema>;\n\n// ============================================================================\n// API Request/Response Schemas\n// ============================================================================\n\n/**\n * Knowledge response schema - used for single item responses\n */\nexport const knowledgeResponseSchema = z\n\t.object({\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry identifier\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"Owning organization identifier\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"Website identifier\",\n\t\t\texample: \"01JG000000000000000000001\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent identifier; null means shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tlinkSourceId: z.ulid().nullable().openapi({\n\t\t\tdescription: \"Reference to the link source that created this entry\",\n\t\t\texample: \"01JG000000000000000000003\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().openapi({\n\t\t\tdescription: \"Readable title captured during scraping\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"crawl\",\n\t\t}),\n\t\tcreatedBy: z.string().openapi({\n\t\t\tdescription: \"Identifier of the actor that created this entry\",\n\t\t\texample: \"user_01JG00000000000000000000\",\n\t\t}),\n\t\tcontentHash: z.string().openapi({\n\t\t\tdescription: \"Deterministic hash of the payload for deduping\",\n\t\t\texample: \"5d41402abc4b2a76b9719d911017c592\",\n\t\t}),\n\t\t// Note: We use .passthrough() to prevent Zod's union validation from stripping\n\t\t// fields when the first matching schema doesn't include all fields from other schemas.\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema.passthrough(),\n\t\t\tfaqKnowledgePayloadSchema.passthrough(),\n\t\t\tarticleKnowledgePayloadSchema.passthrough(),\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t\tisIncluded: z.boolean().openapi({\n\t\t\tdescription: \"Whether this entry is included in training\",\n\t\t\texample: true,\n\t\t}),\n\t\tsizeBytes: z.number().int().nonnegative().openapi({\n\t\t\tdescription: \"Size of this entry in bytes\",\n\t\t\texample: 4096,\n\t\t}),\n\t\tcreatedAt: z.string().openapi({\n\t\t\tdescription: \"Creation timestamp\",\n\t\t\texample: \"2024-06-10T12:00:00.000Z\",\n\t\t}),\n\t\tupdatedAt: z.string().openapi({\n\t\t\tdescription: \"Last update timestamp\",\n\t\t\texample: \"2024-06-11T08:00:00.000Z\",\n\t\t}),\n\t\tdeletedAt: z.string().nullable().openapi({\n\t\t\tdescription: \"Soft delete timestamp\",\n\t\t\texample: null,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Knowledge entry response\",\n\t});\n\nexport type KnowledgeResponse = z.infer<typeof knowledgeResponseSchema>;\n\n/**\n * List knowledge request schema (TRPC) - with websiteSlug\n */\nexport const listKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to list knowledge for\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema.optional().openapi({\n\t\t\tdescription: \"Filter by knowledge type\",\n\t\t\texample: \"url\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Filter by AI agent ID; null for shared entries; omit for all\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tpage: z.coerce.number().int().positive().default(1).openapi({\n\t\t\tdescription: \"Page number (1-indexed)\",\n\t\t\texample: 1,\n\t\t}),\n\t\tlimit: z.coerce.number().int().positive().max(100).default(20).openapi({\n\t\t\tdescription: \"Items per page (max 100)\",\n\t\t\texample: 20,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to list knowledge entries with filters and pagination\",\n\t});\n\nexport type ListKnowledgeRequest = z.infer<typeof listKnowledgeRequestSchema>;\n\n/**\n * List knowledge request schema (REST) - without websiteSlug (derived from API key)\n */\nexport const listKnowledgeRestRequestSchema = z\n\t.object({\n\t\ttype: knowledgeTypeSchema.optional().openapi({\n\t\t\tdescription: \"Filter by knowledge type\",\n\t\t\texample: \"url\",\n\t\t}),\n\t\taiAgentId: z\n\t\t\t.union([z.ulid(), z.literal(\"null\"), z.literal(\"\")])\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t'Filter by AI agent ID. Pass a valid ULID to filter by agent, pass \"null\" or empty string to filter for shared/website-scoped entries only, or omit entirely to return all entries.',\n\t\t\t\texample: \"01JG000000000000000000002\",\n\t\t\t}),\n\t\tpage: z.coerce.number().int().positive().default(1).openapi({\n\t\t\tdescription: \"Page number (1-indexed)\",\n\t\t\texample: 1,\n\t\t}),\n\t\tlimit: z.coerce.number().int().positive().max(100).default(20).openapi({\n\t\t\tdescription: \"Items per page (max 100)\",\n\t\t\texample: 20,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to list knowledge entries with filters and pagination (REST)\",\n\t});\n\nexport type ListKnowledgeRestRequest = z.infer<\n\ttypeof listKnowledgeRestRequestSchema\n>;\n\n/**\n * List knowledge response schema\n */\nexport const listKnowledgeResponseSchema = z\n\t.object({\n\t\titems: z.array(knowledgeResponseSchema).openapi({\n\t\t\tdescription: \"Array of knowledge entries\",\n\t\t}),\n\t\tpagination: z\n\t\t\t.object({\n\t\t\t\tpage: z.number().int().positive().openapi({\n\t\t\t\t\tdescription: \"Current page number\",\n\t\t\t\t\texample: 1,\n\t\t\t\t}),\n\t\t\t\tlimit: z.number().int().positive().openapi({\n\t\t\t\t\tdescription: \"Items per page\",\n\t\t\t\t\texample: 20,\n\t\t\t\t}),\n\t\t\t\ttotal: z.number().int().nonnegative().openapi({\n\t\t\t\t\tdescription: \"Total number of items\",\n\t\t\t\t\texample: 100,\n\t\t\t\t}),\n\t\t\t\thasMore: z.boolean().openapi({\n\t\t\t\t\tdescription: \"Whether there are more items available\",\n\t\t\t\t\texample: true,\n\t\t\t\t}),\n\t\t\t})\n\t\t\t.openapi({\n\t\t\t\tdescription: \"Pagination metadata\",\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Paginated list of knowledge entries\",\n\t});\n\nexport type ListKnowledgeResponse = z.infer<typeof listKnowledgeResponseSchema>;\n\n/**\n * Get knowledge request schema (TRPC)\n */\nexport const getKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to get a single knowledge entry\",\n\t});\n\nexport type GetKnowledgeRequest = z.infer<typeof getKnowledgeRequestSchema>;\n\n/**\n * Create knowledge request schema (TRPC) - extends create input with websiteSlug\n */\nexport const createKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to create knowledge for\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().min(1).openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"manual\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to create a new knowledge entry\",\n\t});\n\nexport type CreateKnowledgeRequest = z.infer<\n\ttypeof createKnowledgeRequestSchema\n>;\n\n/**\n * Create knowledge request schema (REST) - without websiteSlug\n */\nexport const createKnowledgeRestRequestSchema = z\n\t.object({\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().min(1).openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"manual\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to create a new knowledge entry (REST)\",\n\t});\n\nexport type CreateKnowledgeRestRequest = z.infer<\n\ttypeof createKnowledgeRestRequestSchema\n>;\n\n/**\n * Update knowledge request schema (TRPC)\n *\n * Note: We use .passthrough() on payload schemas to prevent Zod's union validation\n * from stripping fields when the first matching schema (urlKnowledgePayloadSchema)\n * doesn't include all fields from other schemas (like articleKnowledgePayloadSchema's title).\n */\nexport const updateKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID to update\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription: \"Update AI agent association\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Update origin URL\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Update readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\tpayload: z\n\t\t\t.union([\n\t\t\t\turlKnowledgePayloadSchema.passthrough(),\n\t\t\t\tfaqKnowledgePayloadSchema.passthrough(),\n\t\t\t\tarticleKnowledgePayloadSchema.passthrough(),\n\t\t\t])\n\t\t\t.optional(),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to update an existing knowledge entry\",\n\t});\n\nexport type UpdateKnowledgeRequest = z.infer<\n\ttypeof updateKnowledgeRequestSchema\n>;\n\n/**\n * Update knowledge request schema (REST) - without websiteSlug\n *\n * Note: We use .passthrough() on payload schemas to prevent Zod's union validation\n * from stripping fields. See updateKnowledgeRequestSchema for details.\n */\nexport const updateKnowledgeRestRequestSchema = z\n\t.object({\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription: \"Update AI agent association\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Update origin URL\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Update readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\tpayload: z\n\t\t\t.union([\n\t\t\t\turlKnowledgePayloadSchema.passthrough(),\n\t\t\t\tfaqKnowledgePayloadSchema.passthrough(),\n\t\t\t\tarticleKnowledgePayloadSchema.passthrough(),\n\t\t\t])\n\t\t\t.optional(),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to update an existing knowledge entry (REST)\",\n\t});\n\nexport type UpdateKnowledgeRestRequest = z.infer<\n\ttypeof updateKnowledgeRestRequestSchema\n>;\n\n/**\n * Delete knowledge request schema (TRPC)\n */\nexport const deleteKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID to delete\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to delete a knowledge entry\",\n\t});\n\nexport type DeleteKnowledgeRequest = z.infer<\n\ttypeof deleteKnowledgeRequestSchema\n>;\n\n/**\n * Toggle knowledge entry included request schema (TRPC)\n * Named differently from link-source's toggleKnowledgeIncludedRequestSchema to avoid export conflict\n */\nexport const toggleKnowledgeEntryIncludedRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\tisIncluded: z.boolean().openapi({\n\t\t\tdescription: \"Whether this entry should be included in training\",\n\t\t\texample: true,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to toggle knowledge entry inclusion in training\",\n\t});\n\nexport type ToggleKnowledgeEntryIncludedRequest = z.infer<\n\ttypeof toggleKnowledgeEntryIncludedRequestSchema\n>;\n\n/**\n * Upload knowledge file request schema (TRPC)\n */\nexport const uploadKnowledgeFileRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tfileName: z.string().min(1).openapi({\n\t\t\tdescription: \"Original file name\",\n\t\t\texample: \"getting-started.md\",\n\t\t}),\n\t\tfileContent: z.string().min(1).openapi({\n\t\t\tdescription: \"Raw file content\",\n\t\t\texample: \"# Getting Started\\n\\nWelcome to our documentation...\",\n\t\t}),\n\t\tfileExtension: z.enum([\"md\", \"txt\"]).openapi({\n\t\t\tdescription: \"File extension\",\n\t\t\texample: \"md\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to upload a file as a knowledge entry\",\n\t});\n\nexport type UploadKnowledgeFileRequest = z.infer<\n\ttypeof uploadKnowledgeFileRequestS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AAa,2DACb,CAAC;;;;AASH,MAAa,mCAAmC,EAC9C,OAAO;CACP,aAAa,EAAE,QAAQ,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;EACjD,aACC;EACD,SAAS;EACT,CAAC;CACF,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ;EACnC,aAAa;EACb,SAAS;EACT,CAAC;CACF,aAAa,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ;EACtC,aAAa;EACb,SAAS;EACT,CAAC;CACF,eAAe,EAAE,KAAK,CAAC,MAAM,MAAM,CAAC,CAAC,QAAQ;EAC5C,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,iDACb,CAAC"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
|
|
3
|
+
//#region src/api/link-source.d.ts
|
|
4
|
+
declare const linkSourceStatusSchema: z.ZodEnum<{
|
|
5
|
+
pending: "pending";
|
|
6
|
+
mapping: "mapping";
|
|
7
|
+
crawling: "crawling";
|
|
8
|
+
completed: "completed";
|
|
9
|
+
failed: "failed";
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Link source response schema - used for single item responses
|
|
13
|
+
*/
|
|
14
|
+
declare const linkSourceResponseSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodULID;
|
|
16
|
+
organizationId: z.ZodULID;
|
|
17
|
+
websiteId: z.ZodULID;
|
|
18
|
+
aiAgentId: z.ZodNullable<z.ZodULID>;
|
|
19
|
+
parentLinkSourceId: z.ZodNullable<z.ZodULID>;
|
|
20
|
+
url: z.ZodURL;
|
|
21
|
+
status: z.ZodEnum<{
|
|
22
|
+
pending: "pending";
|
|
23
|
+
mapping: "mapping";
|
|
24
|
+
crawling: "crawling";
|
|
25
|
+
completed: "completed";
|
|
26
|
+
failed: "failed";
|
|
27
|
+
}>;
|
|
28
|
+
firecrawlJobId: z.ZodNullable<z.ZodString>;
|
|
29
|
+
depth: z.ZodNumber;
|
|
30
|
+
discoveredPagesCount: z.ZodNumber;
|
|
31
|
+
crawledPagesCount: z.ZodNumber;
|
|
32
|
+
totalSizeBytes: z.ZodNumber;
|
|
33
|
+
includePaths: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
34
|
+
excludePaths: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
35
|
+
ignoredUrls: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
36
|
+
lastCrawledAt: z.ZodNullable<z.ZodString>;
|
|
37
|
+
errorMessage: z.ZodNullable<z.ZodString>;
|
|
38
|
+
createdAt: z.ZodString;
|
|
39
|
+
updatedAt: z.ZodString;
|
|
40
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
type LinkSourceResponse = z.infer<typeof linkSourceResponseSchema>;
|
|
43
|
+
type LinkSourceStatus = z.infer<typeof linkSourceStatusSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* List link sources request schema (TRPC) - with websiteSlug
|
|
46
|
+
*/
|
|
47
|
+
declare const listLinkSourcesRequestSchema: z.ZodObject<{
|
|
48
|
+
websiteSlug: z.ZodString;
|
|
49
|
+
aiAgentId: z.ZodOptional<z.ZodNullable<z.ZodULID>>;
|
|
50
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
pending: "pending";
|
|
52
|
+
mapping: "mapping";
|
|
53
|
+
crawling: "crawling";
|
|
54
|
+
completed: "completed";
|
|
55
|
+
failed: "failed";
|
|
56
|
+
}>>;
|
|
57
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
58
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
type ListLinkSourcesRequest = z.infer<typeof listLinkSourcesRequestSchema>;
|
|
61
|
+
/**
|
|
62
|
+
* List link sources response schema
|
|
63
|
+
*/
|
|
64
|
+
declare const listLinkSourcesResponseSchema: z.ZodObject<{
|
|
65
|
+
items: z.ZodArray<z.ZodObject<{
|
|
66
|
+
id: z.ZodULID;
|
|
67
|
+
organizationId: z.ZodULID;
|
|
68
|
+
websiteId: z.ZodULID;
|
|
69
|
+
aiAgentId: z.ZodNullable<z.ZodULID>;
|
|
70
|
+
parentLinkSourceId: z.ZodNullable<z.ZodULID>;
|
|
71
|
+
url: z.ZodURL;
|
|
72
|
+
status: z.ZodEnum<{
|
|
73
|
+
pending: "pending";
|
|
74
|
+
mapping: "mapping";
|
|
75
|
+
crawling: "crawling";
|
|
76
|
+
completed: "completed";
|
|
77
|
+
failed: "failed";
|
|
78
|
+
}>;
|
|
79
|
+
firecrawlJobId: z.ZodNullable<z.ZodString>;
|
|
80
|
+
depth: z.ZodNumber;
|
|
81
|
+
discoveredPagesCount: z.ZodNumber;
|
|
82
|
+
crawledPagesCount: z.ZodNumber;
|
|
83
|
+
totalSizeBytes: z.ZodNumber;
|
|
84
|
+
includePaths: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
85
|
+
excludePaths: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
86
|
+
ignoredUrls: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
87
|
+
lastCrawledAt: z.ZodNullable<z.ZodString>;
|
|
88
|
+
errorMessage: z.ZodNullable<z.ZodString>;
|
|
89
|
+
createdAt: z.ZodString;
|
|
90
|
+
updatedAt: z.ZodString;
|
|
91
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
pagination: z.ZodObject<{
|
|
94
|
+
page: z.ZodNumber;
|
|
95
|
+
limit: z.ZodNumber;
|
|
96
|
+
total: z.ZodNumber;
|
|
97
|
+
hasMore: z.ZodBoolean;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
type ListLinkSourcesResponse = z.infer<typeof listLinkSourcesResponseSchema>;
|
|
101
|
+
/**
|
|
102
|
+
* Get link source request schema (TRPC)
|
|
103
|
+
*/
|
|
104
|
+
declare const getLinkSourceRequestSchema: z.ZodObject<{
|
|
105
|
+
websiteSlug: z.ZodString;
|
|
106
|
+
id: z.ZodULID;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
type GetLinkSourceRequest = z.infer<typeof getLinkSourceRequestSchema>;
|
|
109
|
+
/**
|
|
110
|
+
* Create link source request schema (TRPC)
|
|
111
|
+
*/
|
|
112
|
+
declare const createLinkSourceRequestSchema: z.ZodObject<{
|
|
113
|
+
websiteSlug: z.ZodString;
|
|
114
|
+
aiAgentId: z.ZodOptional<z.ZodNullable<z.ZodULID>>;
|
|
115
|
+
parentLinkSourceId: z.ZodOptional<z.ZodNullable<z.ZodULID>>;
|
|
116
|
+
url: z.ZodURL;
|
|
117
|
+
includePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
excludePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
119
|
+
maxDepth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
type CreateLinkSourceRequest = z.infer<typeof createLinkSourceRequestSchema>;
|
|
122
|
+
/**
|
|
123
|
+
* Delete link source request schema (TRPC)
|
|
124
|
+
*/
|
|
125
|
+
declare const deleteLinkSourceRequestSchema: z.ZodObject<{
|
|
126
|
+
websiteSlug: z.ZodString;
|
|
127
|
+
id: z.ZodULID;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
type DeleteLinkSourceRequest = z.infer<typeof deleteLinkSourceRequestSchema>;
|
|
130
|
+
/**
|
|
131
|
+
* Recrawl link source request schema (TRPC)
|
|
132
|
+
*/
|
|
133
|
+
declare const recrawlLinkSourceRequestSchema: z.ZodObject<{
|
|
134
|
+
websiteSlug: z.ZodString;
|
|
135
|
+
id: z.ZodULID;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
type RecrawlLinkSourceRequest = z.infer<typeof recrawlLinkSourceRequestSchema>;
|
|
138
|
+
/**
|
|
139
|
+
* Cancel link source request schema (TRPC)
|
|
140
|
+
*/
|
|
141
|
+
declare const cancelLinkSourceRequestSchema: z.ZodObject<{
|
|
142
|
+
websiteSlug: z.ZodString;
|
|
143
|
+
id: z.ZodULID;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
type CancelLinkSourceRequest = z.infer<typeof cancelLinkSourceRequestSchema>;
|
|
146
|
+
/**
|
|
147
|
+
* Get crawl status request schema (TRPC)
|
|
148
|
+
*/
|
|
149
|
+
declare const getCrawlStatusRequestSchema: z.ZodObject<{
|
|
150
|
+
websiteSlug: z.ZodString;
|
|
151
|
+
id: z.ZodULID;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
type GetCrawlStatusRequest = z.infer<typeof getCrawlStatusRequestSchema>;
|
|
154
|
+
/**
|
|
155
|
+
* Training stats response schema
|
|
156
|
+
*/
|
|
157
|
+
declare const trainingStatsResponseSchema: z.ZodObject<{
|
|
158
|
+
linkSourcesCount: z.ZodNumber;
|
|
159
|
+
urlKnowledgeCount: z.ZodNumber;
|
|
160
|
+
faqKnowledgeCount: z.ZodNumber;
|
|
161
|
+
articleKnowledgeCount: z.ZodNumber;
|
|
162
|
+
totalSizeBytes: z.ZodNumber;
|
|
163
|
+
planLimitBytes: z.ZodNullable<z.ZodNumber>;
|
|
164
|
+
planLimitLinks: z.ZodNullable<z.ZodNumber>;
|
|
165
|
+
crawlPagesPerSourceLimit: z.ZodNullable<z.ZodNumber>;
|
|
166
|
+
totalPagesLimit: z.ZodNullable<z.ZodNumber>;
|
|
167
|
+
planLimitFaqs: z.ZodNullable<z.ZodNumber>;
|
|
168
|
+
planLimitFiles: z.ZodNullable<z.ZodNumber>;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
type TrainingStatsResponse = z.infer<typeof trainingStatsResponseSchema>;
|
|
171
|
+
/**
|
|
172
|
+
* Get training stats request schema (TRPC)
|
|
173
|
+
*/
|
|
174
|
+
declare const getTrainingStatsRequestSchema: z.ZodObject<{
|
|
175
|
+
websiteSlug: z.ZodString;
|
|
176
|
+
aiAgentId: z.ZodOptional<z.ZodNullable<z.ZodULID>>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
type GetTrainingStatsRequest = z.infer<typeof getTrainingStatsRequestSchema>;
|
|
179
|
+
/**
|
|
180
|
+
* Scan subpages request schema (TRPC)
|
|
181
|
+
* Used to trigger crawl of deeper subpages for a specific knowledge entry
|
|
182
|
+
*/
|
|
183
|
+
declare const scanSubpagesRequestSchema: z.ZodObject<{
|
|
184
|
+
websiteSlug: z.ZodString;
|
|
185
|
+
linkSourceId: z.ZodULID;
|
|
186
|
+
knowledgeId: z.ZodULID;
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
type ScanSubpagesRequest = z.infer<typeof scanSubpagesRequestSchema>;
|
|
189
|
+
/**
|
|
190
|
+
* List knowledge by link source request schema (TRPC)
|
|
191
|
+
*/
|
|
192
|
+
declare const listKnowledgeByLinkSourceRequestSchema: z.ZodObject<{
|
|
193
|
+
websiteSlug: z.ZodString;
|
|
194
|
+
linkSourceId: z.ZodULID;
|
|
195
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
196
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
type ListKnowledgeByLinkSourceRequest = z.infer<typeof listKnowledgeByLinkSourceRequestSchema>;
|
|
199
|
+
/**
|
|
200
|
+
* Toggle knowledge included request schema (TRPC)
|
|
201
|
+
*/
|
|
202
|
+
declare const toggleKnowledgeIncludedRequestSchema: z.ZodObject<{
|
|
203
|
+
websiteSlug: z.ZodString;
|
|
204
|
+
knowledgeId: z.ZodULID;
|
|
205
|
+
isIncluded: z.ZodBoolean;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
type ToggleKnowledgeIncludedRequest = z.infer<typeof toggleKnowledgeIncludedRequestSchema>;
|
|
208
|
+
/**
|
|
209
|
+
* Discovered page schema for realtime updates
|
|
210
|
+
*/
|
|
211
|
+
declare const discoveredPageSchema: z.ZodObject<{
|
|
212
|
+
url: z.ZodString;
|
|
213
|
+
title: z.ZodNullable<z.ZodString>;
|
|
214
|
+
depth: z.ZodNumber;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
type DiscoveredPage = z.infer<typeof discoveredPageSchema>;
|
|
217
|
+
/**
|
|
218
|
+
* Crawl progress page schema for realtime updates
|
|
219
|
+
*/
|
|
220
|
+
declare const crawlProgressPageSchema: z.ZodObject<{
|
|
221
|
+
url: z.ZodString;
|
|
222
|
+
title: z.ZodNullable<z.ZodString>;
|
|
223
|
+
status: z.ZodEnum<{
|
|
224
|
+
pending: "pending";
|
|
225
|
+
crawling: "crawling";
|
|
226
|
+
completed: "completed";
|
|
227
|
+
failed: "failed";
|
|
228
|
+
}>;
|
|
229
|
+
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
type CrawlProgressPage = z.infer<typeof crawlProgressPageSchema>;
|
|
233
|
+
/**
|
|
234
|
+
* Ignore page request schema (TRPC)
|
|
235
|
+
* Adds URL to ignoredUrls and soft-deletes the knowledge entry
|
|
236
|
+
*/
|
|
237
|
+
declare const ignorePageRequestSchema: z.ZodObject<{
|
|
238
|
+
websiteSlug: z.ZodString;
|
|
239
|
+
linkSourceId: z.ZodULID;
|
|
240
|
+
knowledgeId: z.ZodULID;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
type IgnorePageRequest = z.infer<typeof ignorePageRequestSchema>;
|
|
243
|
+
/**
|
|
244
|
+
* Reindex page request schema (TRPC)
|
|
245
|
+
* Re-scrapes a single URL and updates the knowledge entry
|
|
246
|
+
*/
|
|
247
|
+
declare const reindexPageRequestSchema: z.ZodObject<{
|
|
248
|
+
websiteSlug: z.ZodString;
|
|
249
|
+
linkSourceId: z.ZodULID;
|
|
250
|
+
knowledgeId: z.ZodULID;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
type ReindexPageRequest = z.infer<typeof reindexPageRequestSchema>;
|
|
253
|
+
/**
|
|
254
|
+
* Delete page request schema (TRPC)
|
|
255
|
+
* Soft-deletes a knowledge entry without ignoring future crawls
|
|
256
|
+
*/
|
|
257
|
+
declare const deletePageRequestSchema: z.ZodObject<{
|
|
258
|
+
websiteSlug: z.ZodString;
|
|
259
|
+
knowledgeId: z.ZodULID;
|
|
260
|
+
}, z.core.$strip>;
|
|
261
|
+
type DeletePageRequest = z.infer<typeof deletePageRequestSchema>;
|
|
262
|
+
//#endregion
|
|
263
|
+
export { 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 };
|
|
264
|
+
//# sourceMappingURL=link-source.d.ts.map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