@cossistant/types 0.0.26 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/api/ai-agent.d.ts +283 -0
  2. package/api/ai-agent.d.ts.map +1 -0
  3. package/api/ai-agent.js +416 -0
  4. package/api/ai-agent.js.map +1 -0
  5. package/api/contact.d.ts.map +1 -1
  6. package/api/conversation.d.ts +3 -0
  7. package/api/conversation.d.ts.map +1 -1
  8. package/api/index.d.ts +4 -1
  9. package/api/index.js +4 -1
  10. package/api/knowledge.d.ts +500 -0
  11. package/api/knowledge.d.ts.map +1 -0
  12. package/api/knowledge.js +446 -0
  13. package/api/knowledge.js.map +1 -0
  14. package/api/link-source.d.ts +262 -0
  15. package/api/link-source.d.ts.map +1 -0
  16. package/api/link-source.js +453 -0
  17. package/api/link-source.js.map +1 -0
  18. package/api/upload.d.ts +2 -2
  19. package/api/upload.d.ts.map +1 -1
  20. package/api/upload.js +2 -2
  21. package/api/upload.js.map +1 -1
  22. package/api/website.d.ts +4 -4
  23. package/api/website.d.ts.map +1 -1
  24. package/api/website.js +3 -3
  25. package/api/website.js.map +1 -1
  26. package/enums.d.ts +3 -0
  27. package/enums.d.ts.map +1 -1
  28. package/enums.js +4 -1
  29. package/enums.js.map +1 -1
  30. package/index.d.ts +4 -1
  31. package/index.d.ts.map +1 -1
  32. package/index.js +4 -1
  33. package/package.json +17 -1
  34. package/realtime-events.d.ts +163 -0
  35. package/realtime-events.d.ts.map +1 -1
  36. package/realtime-events.js +121 -1
  37. package/realtime-events.js.map +1 -1
  38. package/schemas.d.ts +1 -0
  39. package/schemas.d.ts.map +1 -1
  40. package/schemas.js +1 -0
  41. package/schemas.js.map +1 -1
  42. package/trpc/conversation.d.ts +24 -0
  43. package/trpc/conversation.d.ts.map +1 -1
  44. package/trpc/conversation.js +12 -0
  45. package/trpc/conversation.js.map +1 -1
  46. package/trpc/visitor.d.ts +6 -0
  47. package/trpc/visitor.d.ts.map +1 -1
package/api/website.js CHANGED
@@ -85,7 +85,7 @@ const websiteSummarySchema = z.object({
85
85
  description: "The primary email visitors can use to reach you.",
86
86
  example: "support@dub.co"
87
87
  }),
88
- logoUrl: z.string().url().nullable().openapi({
88
+ logoUrl: z.url().nullable().openapi({
89
89
  description: "Public URL to the website's logo.",
90
90
  example: "https://cdn.example.com/logo.png"
91
91
  }),
@@ -148,7 +148,7 @@ const websiteUpdateDataSchema = z.object({
148
148
  domain: z.string().min(1).optional(),
149
149
  contactEmail: z.string().email().nullable().optional(),
150
150
  description: z.string().nullable().optional(),
151
- logoUrl: z.string().url().nullable().optional(),
151
+ logoUrl: z.url().nullable().optional(),
152
152
  whitelistedDomains: z.array(z.url()).optional(),
153
153
  defaultParticipantIds: z.array(z.string()).nullable().optional(),
154
154
  installationTarget: z.nativeEnum(WebsiteInstallationTarget).optional(),
@@ -306,7 +306,7 @@ const websiteListItemSchema = z.object({
306
306
  description: "The website's slug.",
307
307
  example: "dub-co"
308
308
  }),
309
- logoUrl: z.string().url().nullable().openapi({
309
+ logoUrl: z.url().nullable().openapi({
310
310
  description: "Public URL to the website's logo.",
311
311
  example: "https://cdn.example.com/logo.png"
312
312
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"website.js","names":[],"sources":["../../src/api/website.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\nimport { APIKeyType, WebsiteInstallationTarget, WebsiteStatus } from \"../enums\";\nimport { publicVisitorResponseSchema } from \"./visitor\";\n\n/**\n * Website creation request schema\n */\nexport const createWebsiteRequestSchema = z.object({\n\tname: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The website's name.\",\n\t\t\texample: \"Dub\",\n\t\t})\n\t\t.min(3, {\n\t\t\tmessage: \"Name must be at least 3 characters\",\n\t\t})\n\t\t.max(30, {\n\t\t\tmessage: \"Name must be less than 30 characters\",\n\t\t}),\n\tdomain: z\n\t\t.string()\n\t\t.regex(/^[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$/)\n\t\t.openapi({\n\t\t\tdescription: \"The website's domain.\",\n\t\t\texample: \"dub.co\",\n\t\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tinstallationTarget: z.nativeEnum(WebsiteInstallationTarget).openapi({\n\t\tdescription: \"The website's library installation target.\",\n\t\texample: WebsiteInstallationTarget.NEXTJS,\n\t}),\n});\n\nexport type CreateWebsiteRequest = z.infer<typeof createWebsiteRequestSchema>;\n\nconst API_KEY_TYPE_VALUES = [APIKeyType.PUBLIC, APIKeyType.PRIVATE] as const;\n\nconst WEBSITE_STATUS_VALUES = [\n\tWebsiteStatus.ACTIVE,\n\tWebsiteStatus.INACTIVE,\n] as const;\n\nexport const websiteApiKeySchema = z\n\t.object({\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"The API key's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tname: z.string().openapi({\n\t\t\tdescription: \"The API key's display name.\",\n\t\t\texample: \"Production public key\",\n\t\t}),\n\t\tkey: z.string().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"The API key's raw value when available. Private keys will be null when fetched after creation.\",\n\t\t\texample: \"pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n\t\t}),\n\t\tkeyType: z.enum(API_KEY_TYPE_VALUES).openapi({\n\t\t\tdescription: \"The API key's type (public or private).\",\n\t\t\texample: APIKeyType.PUBLIC,\n\t\t}),\n\t\tisTest: z.boolean().openapi({\n\t\t\tdescription: \"Whether the API key is a test key.\",\n\t\t\texample: false,\n\t\t}),\n\t\tisActive: z.boolean().openapi({\n\t\t\tdescription: \"Whether the API key is active.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcreatedAt: z.string().openapi({\n\t\t\tdescription: \"Timestamp indicating when the API key was created.\",\n\t\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t\t}),\n\t\tlastUsedAt: z.string().nullable().openapi({\n\t\t\tdescription: \"Timestamp indicating when the API key was last used.\",\n\t\t\texample: \"2024-01-10T12:00:00.000Z\",\n\t\t}),\n\t\trevokedAt: z.string().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Timestamp indicating when the API key was revoked, if applicable.\",\n\t\t\texample: null,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"A website API key summary.\",\n\t});\n\nexport type WebsiteApiKey = z.infer<typeof websiteApiKeySchema>;\n\nexport const websiteSummarySchema = z\n\t.object({\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"The website's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tslug: z.string().openapi({\n\t\t\tdescription: \"The website's slug.\",\n\t\t\texample: \"dub-co\",\n\t\t}),\n\t\tname: z.string().openapi({\n\t\t\tdescription: \"The website's name.\",\n\t\t\texample: \"Dub\",\n\t\t}),\n\t\tdomain: z.string().openapi({\n\t\t\tdescription: \"The website's domain.\",\n\t\t\texample: \"dub.co\",\n\t\t}),\n\t\tcontactEmail: z.string().email().nullable().openapi({\n\t\t\tdescription: \"The primary email visitors can use to reach you.\",\n\t\t\texample: \"support@dub.co\",\n\t\t}),\n\t\tlogoUrl: z.string().url().nullable().openapi({\n\t\t\tdescription: \"Public URL to the website's logo.\",\n\t\t\texample: \"https://cdn.example.com/logo.png\",\n\t\t}),\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"The owning organization's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twhitelistedDomains: z.array(z.url()).openapi({\n\t\t\tdescription: \"The domains allowed to use the website's public keys.\",\n\t\t\texample: [\"https://dub.co\", \"http://localhost:3000\"],\n\t\t}),\n\t\tdefaultParticipantIds: z\n\t\t\t.array(z.string())\n\t\t\t.nullable()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Default participant user IDs for new conversations. null = disabled, [] = auto (admin/owner), [...ids] = specific users.\",\n\t\t\t\texample: [\"01JG000000000000000000000\"],\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Summary information for a website used in settings screens.\",\n\t});\n\nexport type WebsiteSummary = z.infer<typeof websiteSummarySchema>;\n\nexport const websiteDeveloperSettingsResponseSchema = z\n\t.object({\n\t\twebsite: websiteSummarySchema,\n\t\tapiKeys: z.array(websiteApiKeySchema),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Developer settings payload including website information and API keys.\",\n\t});\n\nexport type WebsiteDeveloperSettingsResponse = z.infer<\n\ttypeof websiteDeveloperSettingsResponseSchema\n>;\n\nexport const createWebsiteApiKeyRequestSchema = z\n\t.object({\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"The organization's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"The website's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tname: z.string().min(3).max(80).openapi({\n\t\t\tdescription: \"A human-friendly label for the API key.\",\n\t\t\texample: \"Docs integration\",\n\t\t}),\n\t\tkeyType: z.enum(API_KEY_TYPE_VALUES).openapi({\n\t\t\tdescription: \"The type of API key to generate.\",\n\t\t\texample: APIKeyType.PRIVATE,\n\t\t}),\n\t\tisTest: z.boolean().openapi({\n\t\t\tdescription: \"Whether to generate a test key scoped to localhost.\",\n\t\t\texample: false,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload to create a website API key.\",\n\t});\n\nexport type CreateWebsiteApiKeyRequest = z.infer<\n\ttypeof createWebsiteApiKeyRequestSchema\n>;\n\nexport const revokeWebsiteApiKeyRequestSchema = z\n\t.object({\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"The organization's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"The website's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tapiKeyId: z.ulid().openapi({\n\t\t\tdescription: \"The API key's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload to revoke a website API key.\",\n\t});\n\nexport type RevokeWebsiteApiKeyRequest = z.infer<\n\ttypeof revokeWebsiteApiKeyRequestSchema\n>;\n\nconst websiteUpdateDataSchema = z\n\t.object({\n\t\tname: z.string().min(1).max(120).optional(),\n\t\tslug: z.string().min(1).optional(),\n\t\tdomain: z.string().min(1).optional(),\n\t\tcontactEmail: z.string().email().nullable().optional(),\n\t\tdescription: z.string().nullable().optional(),\n\t\tlogoUrl: z.string().url().nullable().optional(),\n\t\twhitelistedDomains: z.array(z.url()).optional(),\n\t\tdefaultParticipantIds: z.array(z.string()).nullable().optional(),\n\t\tinstallationTarget: z.nativeEnum(WebsiteInstallationTarget).optional(),\n\t\tstatus: z.enum(WEBSITE_STATUS_VALUES).optional(),\n\t\tteamId: z.string().nullable().optional(),\n\t})\n\t.refine((value) => Object.keys(value).length > 0, {\n\t\tmessage: \"Provide at least one field to update.\",\n\t});\n\nexport const updateWebsiteRequestSchema = z\n\t.object({\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"The organization's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"The website's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tdata: websiteUpdateDataSchema.openapi({\n\t\t\tdescription: \"The fields to update on the website.\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload to update website settings.\",\n\t});\n\nexport type UpdateWebsiteRequest = z.infer<typeof updateWebsiteRequestSchema>;\n\n/**\n * Website creation response schema\n */\nexport const createWebsiteResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The website's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The website's name.\",\n\t\texample: \"Dub\",\n\t}),\n\tslug: z.string().openapi({\n\t\tdescription: \"The website's slug.\",\n\t\texample: \"dubdotco\",\n\t}),\n\twhitelistedDomains: z.array(z.url()).openapi({\n\t\tdescription: \"The website's whitelisted domains.\",\n\t\texample: [\"http://localhost:3000\", \"https://dub.co\"],\n\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tapiKeys: z.array(websiteApiKeySchema).openapi({\n\t\tdescription: \"The website's API keys.\",\n\t\texample: [\n\t\t\t{\n\t\t\t\tid: \"01JG000000000000000000000\",\n\t\t\t\tkey: \"pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n\t\t\t\tcreatedAt: \"2021-01-01T00:00:00.000Z\",\n\t\t\t\tisTest: true,\n\t\t\t\tisActive: true,\n\t\t\t\tkeyType: APIKeyType.PUBLIC,\n\t\t\t\tlastUsedAt: null,\n\t\t\t\trevokedAt: null,\n\t\t\t},\n\t\t],\n\t}),\n});\n\nexport type CreateWebsiteResponse = z.infer<typeof createWebsiteResponseSchema>;\n\n/**\n * Website domain validation request schema\n */\nexport const checkWebsiteDomainRequestSchema = z.object({\n\tdomain: z\n\t\t.string()\n\t\t.regex(/^[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$/)\n\t\t.openapi({\n\t\t\tdescription: \"The website's domain.\",\n\t\t\texample: \"dub.co\",\n\t\t}),\n});\n\nexport type CheckWebsiteDomainRequest = z.infer<\n\ttypeof checkWebsiteDomainRequestSchema\n>;\n\nexport const availableHumanAgentSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The human agent's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The agent's name.\",\n\t\texample: \"John Doe\",\n\t}),\n\timage: z.string().nullable().openapi({\n\t\tdescription: \"The agent's avatar URL.\",\n\t\texample: \"https://cossistant.com/avatar.png\",\n\t}),\n\tlastSeenAt: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"The agent's last online timestamp, used to determine if the agent is online. If the agent is offline, this will be null or more than 5 minutes ago.\",\n\t\texample: \"2021-01-01T00:00:00.000Z\",\n\t}),\n});\n\nexport const AvailableAIAgentSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The AI agent's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The AI agent's name.\",\n\t\texample: \"John Doe\",\n\t}),\n\timage: z.string().nullable().openapi({\n\t\tdescription: \"The AI agent's avatar URL.\",\n\t\texample: \"https://cossistant.com/avatar.png\",\n\t}),\n});\n\n/**\n * Website information response schema\n */\nexport const publicWebsiteResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The website's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The website's name.\",\n\t\texample: \"Dub\",\n\t}),\n\tdomain: z.string().openapi({\n\t\tdescription: \"The website's domain.\",\n\t\texample: \"dub.co\",\n\t}),\n\tdescription: z.string().nullable().openapi({\n\t\tdescription: \"The website's description.\",\n\t\texample: \"Link management for modern marketing teams.\",\n\t}),\n\tlogoUrl: z.string().nullable().openapi({\n\t\tdescription: \"The website's logo URL.\",\n\t\texample: \"https://dub.co/logo.png\",\n\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tstatus: z.string().openapi({\n\t\tdescription: \"The website's status.\",\n\t\texample: \"active\",\n\t}),\n\tlastOnlineAt: z.string().nullable().openapi({\n\t\tdescription: \"The website's support last online date.\",\n\t\texample: \"2021-01-01T00:00:00.000Z\",\n\t}),\n\tavailableHumanAgents: z.array(availableHumanAgentSchema),\n\tavailableAIAgents: z.array(AvailableAIAgentSchema),\n\tvisitor: publicVisitorResponseSchema.openapi({\n\t\tdescription:\n\t\t\t\"The visitor information. Either existing visitor data or newly created visitor.\",\n\t}),\n});\n\nexport type PublicWebsiteResponse = z.infer<typeof publicWebsiteResponseSchema>;\nexport type AvailableHumanAgent = z.infer<typeof availableHumanAgentSchema>;\nexport type AvailableAIAgent = z.infer<typeof AvailableAIAgentSchema>;\n\n/**\n * List websites by organization request schema\n */\nexport const listByOrganizationRequestSchema = z.object({\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n});\n\nexport type ListByOrganizationRequest = z.infer<\n\ttypeof listByOrganizationRequestSchema\n>;\n\n/**\n * Website list item schema - simplified website info for listing\n */\nexport const websiteListItemSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The website's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The website's name.\",\n\t\texample: \"Dub\",\n\t}),\n\tslug: z.string().openapi({\n\t\tdescription: \"The website's slug.\",\n\t\texample: \"dub-co\",\n\t}),\n\tlogoUrl: z.string().url().nullable().openapi({\n\t\tdescription: \"Public URL to the website's logo.\",\n\t\texample: \"https://cdn.example.com/logo.png\",\n\t}),\n\tdomain: z.string().openapi({\n\t\tdescription: \"The website's domain.\",\n\t\texample: \"dub.co\",\n\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The owning organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n});\n\nexport type WebsiteListItem = z.infer<typeof websiteListItemSchema>;\n"],"mappings":";;;;;;;;AAOA,MAAa,6BAA6B,EAAE,OAAO;CAClD,MAAM,EACJ,QAAQ,CACR,QAAQ;EACR,aAAa;EACb,SAAS;EACT,CAAC,CACD,IAAI,GAAG,EACP,SAAS,sCACT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AAkC,EAAE,OAAO,EACvD,gBAAgB,EAAE,MAAM,CAAC,QAAQ;CAChC,aAAa;CACb,SAAS;CACT,CAAC,EACF,CAAC;;;;AASF,MAAa,wBAAwB,EAAE,OAAO;CAC7C,IAAI,EAAE,MAAM,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,MAAM,EAAE,QAAQ,CAAC,QAAQ;EACxB,aAAa;EACb,SAAS;EACT,CAAC;CACF,MAAM,EAAE,QAAQ,CAAC,QAAQ;EACxB,aAAa;EACb,SAAS;EACT,CAAC;CACF,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ;EAC5C,aAAa;EACb,SAAS;EACT,CAAC;CACF,QAAQ,EAAE,QAAQ,CAAC,QAAQ;EAC1B,aAAa;EACb,SAAS;EACT,CAAC;CACF,gBAAgB,EAAE,MAAM,CAAC,QAAQ;EAChC,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"website.js","names":[],"sources":["../../src/api/website.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\nimport { APIKeyType, WebsiteInstallationTarget, WebsiteStatus } from \"../enums\";\nimport { publicVisitorResponseSchema } from \"./visitor\";\n\n/**\n * Website creation request schema\n */\nexport const createWebsiteRequestSchema = z.object({\n\tname: z\n\t\t.string()\n\t\t.openapi({\n\t\t\tdescription: \"The website's name.\",\n\t\t\texample: \"Dub\",\n\t\t})\n\t\t.min(3, {\n\t\t\tmessage: \"Name must be at least 3 characters\",\n\t\t})\n\t\t.max(30, {\n\t\t\tmessage: \"Name must be less than 30 characters\",\n\t\t}),\n\tdomain: z\n\t\t.string()\n\t\t.regex(/^[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$/)\n\t\t.openapi({\n\t\t\tdescription: \"The website's domain.\",\n\t\t\texample: \"dub.co\",\n\t\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tinstallationTarget: z.nativeEnum(WebsiteInstallationTarget).openapi({\n\t\tdescription: \"The website's library installation target.\",\n\t\texample: WebsiteInstallationTarget.NEXTJS,\n\t}),\n});\n\nexport type CreateWebsiteRequest = z.infer<typeof createWebsiteRequestSchema>;\n\nconst API_KEY_TYPE_VALUES = [APIKeyType.PUBLIC, APIKeyType.PRIVATE] as const;\n\nconst WEBSITE_STATUS_VALUES = [\n\tWebsiteStatus.ACTIVE,\n\tWebsiteStatus.INACTIVE,\n] as const;\n\nexport const websiteApiKeySchema = z\n\t.object({\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"The API key's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tname: z.string().openapi({\n\t\t\tdescription: \"The API key's display name.\",\n\t\t\texample: \"Production public key\",\n\t\t}),\n\t\tkey: z.string().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"The API key's raw value when available. Private keys will be null when fetched after creation.\",\n\t\t\texample: \"pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n\t\t}),\n\t\tkeyType: z.enum(API_KEY_TYPE_VALUES).openapi({\n\t\t\tdescription: \"The API key's type (public or private).\",\n\t\t\texample: APIKeyType.PUBLIC,\n\t\t}),\n\t\tisTest: z.boolean().openapi({\n\t\t\tdescription: \"Whether the API key is a test key.\",\n\t\t\texample: false,\n\t\t}),\n\t\tisActive: z.boolean().openapi({\n\t\t\tdescription: \"Whether the API key is active.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcreatedAt: z.string().openapi({\n\t\t\tdescription: \"Timestamp indicating when the API key was created.\",\n\t\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t\t}),\n\t\tlastUsedAt: z.string().nullable().openapi({\n\t\t\tdescription: \"Timestamp indicating when the API key was last used.\",\n\t\t\texample: \"2024-01-10T12:00:00.000Z\",\n\t\t}),\n\t\trevokedAt: z.string().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Timestamp indicating when the API key was revoked, if applicable.\",\n\t\t\texample: null,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"A website API key summary.\",\n\t});\n\nexport type WebsiteApiKey = z.infer<typeof websiteApiKeySchema>;\n\nexport const websiteSummarySchema = z\n\t.object({\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"The website's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tslug: z.string().openapi({\n\t\t\tdescription: \"The website's slug.\",\n\t\t\texample: \"dub-co\",\n\t\t}),\n\t\tname: z.string().openapi({\n\t\t\tdescription: \"The website's name.\",\n\t\t\texample: \"Dub\",\n\t\t}),\n\t\tdomain: z.string().openapi({\n\t\t\tdescription: \"The website's domain.\",\n\t\t\texample: \"dub.co\",\n\t\t}),\n\t\tcontactEmail: z.string().email().nullable().openapi({\n\t\t\tdescription: \"The primary email visitors can use to reach you.\",\n\t\t\texample: \"support@dub.co\",\n\t\t}),\n\t\tlogoUrl: z.url().nullable().openapi({\n\t\t\tdescription: \"Public URL to the website's logo.\",\n\t\t\texample: \"https://cdn.example.com/logo.png\",\n\t\t}),\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"The owning organization's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twhitelistedDomains: z.array(z.url()).openapi({\n\t\t\tdescription: \"The domains allowed to use the website's public keys.\",\n\t\t\texample: [\"https://dub.co\", \"http://localhost:3000\"],\n\t\t}),\n\t\tdefaultParticipantIds: z\n\t\t\t.array(z.string())\n\t\t\t.nullable()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Default participant user IDs for new conversations. null = disabled, [] = auto (admin/owner), [...ids] = specific users.\",\n\t\t\t\texample: [\"01JG000000000000000000000\"],\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Summary information for a website used in settings screens.\",\n\t});\n\nexport type WebsiteSummary = z.infer<typeof websiteSummarySchema>;\n\nexport const websiteDeveloperSettingsResponseSchema = z\n\t.object({\n\t\twebsite: websiteSummarySchema,\n\t\tapiKeys: z.array(websiteApiKeySchema),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Developer settings payload including website information and API keys.\",\n\t});\n\nexport type WebsiteDeveloperSettingsResponse = z.infer<\n\ttypeof websiteDeveloperSettingsResponseSchema\n>;\n\nexport const createWebsiteApiKeyRequestSchema = z\n\t.object({\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"The organization's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"The website's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tname: z.string().min(3).max(80).openapi({\n\t\t\tdescription: \"A human-friendly label for the API key.\",\n\t\t\texample: \"Docs integration\",\n\t\t}),\n\t\tkeyType: z.enum(API_KEY_TYPE_VALUES).openapi({\n\t\t\tdescription: \"The type of API key to generate.\",\n\t\t\texample: APIKeyType.PRIVATE,\n\t\t}),\n\t\tisTest: z.boolean().openapi({\n\t\t\tdescription: \"Whether to generate a test key scoped to localhost.\",\n\t\t\texample: false,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload to create a website API key.\",\n\t});\n\nexport type CreateWebsiteApiKeyRequest = z.infer<\n\ttypeof createWebsiteApiKeyRequestSchema\n>;\n\nexport const revokeWebsiteApiKeyRequestSchema = z\n\t.object({\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"The organization's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"The website's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tapiKeyId: z.ulid().openapi({\n\t\t\tdescription: \"The API key's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload to revoke a website API key.\",\n\t});\n\nexport type RevokeWebsiteApiKeyRequest = z.infer<\n\ttypeof revokeWebsiteApiKeyRequestSchema\n>;\n\nconst websiteUpdateDataSchema = z\n\t.object({\n\t\tname: z.string().min(1).max(120).optional(),\n\t\tslug: z.string().min(1).optional(),\n\t\tdomain: z.string().min(1).optional(),\n\t\tcontactEmail: z.string().email().nullable().optional(),\n\t\tdescription: z.string().nullable().optional(),\n\t\tlogoUrl: z.url().nullable().optional(),\n\t\twhitelistedDomains: z.array(z.url()).optional(),\n\t\tdefaultParticipantIds: z.array(z.string()).nullable().optional(),\n\t\tinstallationTarget: z.nativeEnum(WebsiteInstallationTarget).optional(),\n\t\tstatus: z.enum(WEBSITE_STATUS_VALUES).optional(),\n\t\tteamId: z.string().nullable().optional(),\n\t})\n\t.refine((value) => Object.keys(value).length > 0, {\n\t\tmessage: \"Provide at least one field to update.\",\n\t});\n\nexport const updateWebsiteRequestSchema = z\n\t.object({\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"The organization's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"The website's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tdata: websiteUpdateDataSchema.openapi({\n\t\t\tdescription: \"The fields to update on the website.\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload to update website settings.\",\n\t});\n\nexport type UpdateWebsiteRequest = z.infer<typeof updateWebsiteRequestSchema>;\n\n/**\n * Website creation response schema\n */\nexport const createWebsiteResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The website's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The website's name.\",\n\t\texample: \"Dub\",\n\t}),\n\tslug: z.string().openapi({\n\t\tdescription: \"The website's slug.\",\n\t\texample: \"dubdotco\",\n\t}),\n\twhitelistedDomains: z.array(z.url()).openapi({\n\t\tdescription: \"The website's whitelisted domains.\",\n\t\texample: [\"http://localhost:3000\", \"https://dub.co\"],\n\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tapiKeys: z.array(websiteApiKeySchema).openapi({\n\t\tdescription: \"The website's API keys.\",\n\t\texample: [\n\t\t\t{\n\t\t\t\tid: \"01JG000000000000000000000\",\n\t\t\t\tkey: \"pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n\t\t\t\tcreatedAt: \"2021-01-01T00:00:00.000Z\",\n\t\t\t\tisTest: true,\n\t\t\t\tisActive: true,\n\t\t\t\tkeyType: APIKeyType.PUBLIC,\n\t\t\t\tlastUsedAt: null,\n\t\t\t\trevokedAt: null,\n\t\t\t},\n\t\t],\n\t}),\n});\n\nexport type CreateWebsiteResponse = z.infer<typeof createWebsiteResponseSchema>;\n\n/**\n * Website domain validation request schema\n */\nexport const checkWebsiteDomainRequestSchema = z.object({\n\tdomain: z\n\t\t.string()\n\t\t.regex(/^[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$/)\n\t\t.openapi({\n\t\t\tdescription: \"The website's domain.\",\n\t\t\texample: \"dub.co\",\n\t\t}),\n});\n\nexport type CheckWebsiteDomainRequest = z.infer<\n\ttypeof checkWebsiteDomainRequestSchema\n>;\n\nexport const availableHumanAgentSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The human agent's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The agent's name.\",\n\t\texample: \"John Doe\",\n\t}),\n\timage: z.string().nullable().openapi({\n\t\tdescription: \"The agent's avatar URL.\",\n\t\texample: \"https://cossistant.com/avatar.png\",\n\t}),\n\tlastSeenAt: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"The agent's last online timestamp, used to determine if the agent is online. If the agent is offline, this will be null or more than 5 minutes ago.\",\n\t\texample: \"2021-01-01T00:00:00.000Z\",\n\t}),\n});\n\nexport const AvailableAIAgentSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The AI agent's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The AI agent's name.\",\n\t\texample: \"John Doe\",\n\t}),\n\timage: z.string().nullable().openapi({\n\t\tdescription: \"The AI agent's avatar URL.\",\n\t\texample: \"https://cossistant.com/avatar.png\",\n\t}),\n});\n\n/**\n * Website information response schema\n */\nexport const publicWebsiteResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The website's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The website's name.\",\n\t\texample: \"Dub\",\n\t}),\n\tdomain: z.string().openapi({\n\t\tdescription: \"The website's domain.\",\n\t\texample: \"dub.co\",\n\t}),\n\tdescription: z.string().nullable().openapi({\n\t\tdescription: \"The website's description.\",\n\t\texample: \"Link management for modern marketing teams.\",\n\t}),\n\tlogoUrl: z.string().nullable().openapi({\n\t\tdescription: \"The website's logo URL.\",\n\t\texample: \"https://dub.co/logo.png\",\n\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tstatus: z.string().openapi({\n\t\tdescription: \"The website's status.\",\n\t\texample: \"active\",\n\t}),\n\tlastOnlineAt: z.string().nullable().openapi({\n\t\tdescription: \"The website's support last online date.\",\n\t\texample: \"2021-01-01T00:00:00.000Z\",\n\t}),\n\tavailableHumanAgents: z.array(availableHumanAgentSchema),\n\tavailableAIAgents: z.array(AvailableAIAgentSchema),\n\tvisitor: publicVisitorResponseSchema.openapi({\n\t\tdescription:\n\t\t\t\"The visitor information. Either existing visitor data or newly created visitor.\",\n\t}),\n});\n\nexport type PublicWebsiteResponse = z.infer<typeof publicWebsiteResponseSchema>;\nexport type AvailableHumanAgent = z.infer<typeof availableHumanAgentSchema>;\nexport type AvailableAIAgent = z.infer<typeof AvailableAIAgentSchema>;\n\n/**\n * List websites by organization request schema\n */\nexport const listByOrganizationRequestSchema = z.object({\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n});\n\nexport type ListByOrganizationRequest = z.infer<\n\ttypeof listByOrganizationRequestSchema\n>;\n\n/**\n * Website list item schema - simplified website info for listing\n */\nexport const websiteListItemSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The website's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The website's name.\",\n\t\texample: \"Dub\",\n\t}),\n\tslug: z.string().openapi({\n\t\tdescription: \"The website's slug.\",\n\t\texample: \"dub-co\",\n\t}),\n\tlogoUrl: z.url().nullable().openapi({\n\t\tdescription: \"Public URL to the website's logo.\",\n\t\texample: \"https://cdn.example.com/logo.png\",\n\t}),\n\tdomain: z.string().openapi({\n\t\tdescription: \"The website's domain.\",\n\t\texample: \"dub.co\",\n\t}),\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"The owning organization's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n});\n\nexport type WebsiteListItem = z.infer<typeof websiteListItemSchema>;\n"],"mappings":";;;;;;;;AAOA,MAAa,6BAA6B,EAAE,OAAO;CAClD,MAAM,EACJ,QAAQ,CACR,QAAQ;EACR,aAAa;EACb,SAAS;EACT,CAAC,CACD,IAAI,GAAG,EACP,SAAS,sCACT,CAAC,CACD,IAAI,IAAI,EACR,SAAS,wCACT,CAAC;CACH,QAAQ,EACN,QAAQ,CACR,MAAM,oCAAoC,CAC1C,QAAQ;EACR,aAAa;EACb,SAAS;EACT,CAAC;CACH,gBAAgB,EAAE,MAAM,CAAC,Q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EACT,CAAC;CACF,MAAM,EAAE,QAAQ,CAAC,QAAQ;EACxB,aAAa;EACb,SAAS;EACT,CAAC;CACF,MAAM,EAAE,QAAQ,CAAC,QAAQ;EACxB,aAAa;EACb,SAAS;EACT,CAAC;CACF,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,QAAQ;EACnC,aAAa;EACb,SAAS;EACT,CAAC;CACF,QAAQ,EAAE,QAAQ,CAAC,QAAQ;EAC1B,aAAa;EACb,SAAS;EACT,CAAC;CACF,gBAAgB,EAAE,MAAM,CAAC,QAAQ;EAChC,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC"}
package/enums.d.ts CHANGED
@@ -42,6 +42,9 @@ declare const ConversationEventType: {
42
42
  readonly VISITOR_BLOCKED: "visitor_blocked";
43
43
  readonly VISITOR_UNBLOCKED: "visitor_unblocked";
44
44
  readonly VISITOR_IDENTIFIED: "visitor_identified";
45
+ readonly AI_ANALYZED: "ai_analyzed";
46
+ readonly TITLE_GENERATED: "title_generated";
47
+ readonly AI_ESCALATED: "ai_escalated";
45
48
  };
46
49
  declare const ConversationParticipationStatus: {
47
50
  readonly REQUESTED: "requested";
package/enums.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","names":[],"sources":["../src/enums.ts"],"sourcesContent":[],"mappings":";cAAa;EAAA,SAAA,OAIH,EAAA,SAAA;EAEE,SAAA,WAAU,EAAA,aAAW;EAEpB,SAAA,EAAA,EAAA,IAAA;AAMb,CAAA;AAGa,KAXD,UAAA,GAWC,CAAA,OAXoB,UAgBvB,CAAA,CAAA,MAAA,OAhBgD,UAgBhD,CAAA;AAEG,cAhBA,kBAmBH,EAAA;EAEG,SAAA,IAAA,EAAA,MAAA;EAMD,SAAA,QAAA,EAAA,UAAwB;EAGvB,SAAA,IAAA,EAAA,MAAA;AAiBb,CAAA;AAOa,KAhDD,kBAAA,GAoDF,CAAA,OAnDD,kBAmDC,CAAA,CAAA,MAAA,OAnDgC,kBAmDhC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AA,EAAA,MAAA;EAGA,SAAA,MAAA,EAAA,QAAoB;AAGhC,CAAA;AAKa,cApEA,sBAuEH,EAAA;EAEE,SAAA,MAAA,EAAa,QAAA;EAEb,SAAA,OAAA,EAAA,SAAA;AAGZ,CAAA;AAKY,cA9EC,wBA8E6C,EAAA;;;;;KAxE9C,wBAAA,WACH,uCAAuC;cAEnC;;;;;;;;;;;;;;;;;;;cAqBA;;;;;;cAOA;;;;;KAMD,qBAAA,WACH,oCAAoC;KAEjC,+BAAA,WACH,8CAA8C;KAE3C,qBAAA,WACH,oCAAoC;KAEjC,sBAAA,WACH,qCAAqC;KAElC,oBAAA,WACH,mCAAmC;cAE/B;;;;cAKA;;;;KAKD,aAAA,WAAwB,4BAA4B;KAEpD,yBAAA,WACH,wCAAwC;cAEpC;;;;KAKD,UAAA,WAAqB,yBAAyB"}
package/enums.js CHANGED
@@ -38,7 +38,10 @@ const ConversationEventType = {
38
38
  REOPENED: "reopened",
39
39
  VISITOR_BLOCKED: "visitor_blocked",
40
40
  VISITOR_UNBLOCKED: "visitor_unblocked",
41
- VISITOR_IDENTIFIED: "visitor_identified"
41
+ VISITOR_IDENTIFIED: "visitor_identified",
42
+ AI_ANALYZED: "ai_analyzed",
43
+ TITLE_GENERATED: "title_generated",
44
+ AI_ESCALATED: "ai_escalated"
42
45
  };
43
46
  const ConversationParticipationStatus = {
44
47
  REQUESTED: "requested",
package/enums.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":[],"sources":["../src/enums.ts"],"sourcesContent":["export const SenderType = {\n\tVISITOR: \"visitor\",\n\tTEAM_MEMBER: \"team_member\",\n\tAI: \"ai\",\n} as const;\n\nexport type SenderType = (typeof SenderType)[keyof typeof SenderType];\n\nexport const ConversationStatus = {\n\tOPEN: \"open\",\n\tRESOLVED: \"resolved\",\n\tSPAM: \"spam\",\n} as const;\n\nexport type ConversationStatus =\n\t(typeof ConversationStatus)[keyof typeof ConversationStatus];\n\nexport const ConversationPriority = {\n\tLOW: \"low\",\n\tNORMAL: \"normal\",\n\tHIGH: \"high\",\n\tURGENT: \"urgent\",\n} as const;\n\nexport const TimelineItemVisibility = {\n\tPUBLIC: \"public\",\n\tPRIVATE: \"private\",\n} as const;\n\nexport const ConversationTimelineType = {\n\tMESSAGE: \"message\",\n\tEVENT: \"event\",\n\tIDENTIFICATION: \"identification\",\n} as const;\n\nexport type ConversationTimelineType =\n\t(typeof ConversationTimelineType)[keyof typeof ConversationTimelineType];\n\nexport const ConversationEventType = {\n\tASSIGNED: \"assigned\",\n\tUNASSIGNED: \"unassigned\",\n\tPARTICIPANT_REQUESTED: \"participant_requested\",\n\tPARTICIPANT_JOINED: \"participant_joined\",\n\tPARTICIPANT_LEFT: \"participant_left\",\n\tSTATUS_CHANGED: \"status_changed\",\n\tPRIORITY_CHANGED: \"priority_changed\",\n\tTAG_ADDED: \"tag_added\",\n\tTAG_REMOVED: \"tag_removed\",\n\tRESOLVED: \"resolved\",\n\tREOPENED: \"reopened\",\n\tVISITOR_BLOCKED: \"visitor_blocked\",\n\tVISITOR_UNBLOCKED: \"visitor_unblocked\",\n\tVISITOR_IDENTIFIED: \"visitor_identified\",\n} as const;\n\nexport const ConversationParticipationStatus = {\n\tREQUESTED: \"requested\",\n\tACTIVE: \"active\",\n\tLEFT: \"left\",\n\tDECLINED: \"declined\",\n} as const;\n\nexport const ConversationSentiment = {\n\tPOSITIVE: \"positive\",\n\tNEGATIVE: \"negative\",\n\tNEUTRAL: \"neutral\",\n} as const;\n\nexport type ConversationSentiment =\n\t(typeof ConversationSentiment)[keyof typeof ConversationSentiment];\n\nexport type ConversationParticipationStatus =\n\t(typeof ConversationParticipationStatus)[keyof typeof ConversationParticipationStatus];\n\nexport type ConversationEventType =\n\t(typeof ConversationEventType)[keyof typeof ConversationEventType];\n\nexport type TimelineItemVisibility =\n\t(typeof TimelineItemVisibility)[keyof typeof TimelineItemVisibility];\n\nexport type ConversationPriority =\n\t(typeof ConversationPriority)[keyof typeof ConversationPriority];\n\nexport const WebsiteInstallationTarget = {\n\tNEXTJS: \"nextjs\",\n\tREACT: \"react\",\n} as const;\n\nexport const WebsiteStatus = {\n\tACTIVE: \"active\",\n\tINACTIVE: \"inactive\",\n} as const;\n\nexport type WebsiteStatus = (typeof WebsiteStatus)[keyof typeof WebsiteStatus];\n\nexport type WebsiteInstallationTarget =\n\t(typeof WebsiteInstallationTarget)[keyof typeof WebsiteInstallationTarget];\n\nexport const APIKeyType = {\n\tPRIVATE: \"private\",\n\tPUBLIC: \"public\",\n} as const;\n\nexport type APIKeyType = (typeof APIKeyType)[keyof typeof APIKeyType];\n"],"mappings":";AAAA,MAAa,aAAa;CACzB,SAAS;CACT,aAAa;CACb,IAAI;CACJ;AAID,MAAa,qBAAqB;CACjC,MAAM;CACN,UAAU;CACV,MAAM;CACN;AAKD,MAAa,uBAAuB;CACnC,KAAK;CACL,QAAQ;CACR,MAAM;CACN,QAAQ;CACR;AAED,MAAa,yBAAyB;CACrC,QAAQ;CACR,SAAS;CACT;AAED,MAAa,2BAA2B;CACvC,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB;AAKD,MAAa,wBAAwB;CACpC,UAAU;CACV,YAAY;CACZ,uBAAuB;CACvB,oBAAoB;CACpB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,WAAW;CACX,aAAa;CACb,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CACpB;AAED,MAAa,kCAAkC;CAC9C,WAAW;CACX,QAAQ;CACR,MAAM;CACN,UAAU;CACV;AAED,MAAa,wBAAwB;CACpC,UAAU;CACV,UAAU;CACV,SAAS;CACT;AAiBD,MAAa,4BAA4B;CACxC,QAAQ;CACR,OAAO;CACP;AAED,MAAa,gBAAgB;CAC5B,QAAQ;CACR,UAAU;CACV;AAOD,MAAa,aAAa;CACzB,SAAS;CACT,QAAQ;CACR"}
1
+ {"version":3,"file":"enums.js","names":[],"sources":["../src/enums.ts"],"sourcesContent":["export const SenderType = {\n\tVISITOR: \"visitor\",\n\tTEAM_MEMBER: \"team_member\",\n\tAI: \"ai\",\n} as const;\n\nexport type SenderType = (typeof SenderType)[keyof typeof SenderType];\n\nexport const ConversationStatus = {\n\tOPEN: \"open\",\n\tRESOLVED: \"resolved\",\n\tSPAM: \"spam\",\n} as const;\n\nexport type ConversationStatus =\n\t(typeof ConversationStatus)[keyof typeof ConversationStatus];\n\nexport const ConversationPriority = {\n\tLOW: \"low\",\n\tNORMAL: \"normal\",\n\tHIGH: \"high\",\n\tURGENT: \"urgent\",\n} as const;\n\nexport const TimelineItemVisibility = {\n\tPUBLIC: \"public\",\n\tPRIVATE: \"private\",\n} as const;\n\nexport const ConversationTimelineType = {\n\tMESSAGE: \"message\",\n\tEVENT: \"event\",\n\tIDENTIFICATION: \"identification\",\n} as const;\n\nexport type ConversationTimelineType =\n\t(typeof ConversationTimelineType)[keyof typeof ConversationTimelineType];\n\nexport const ConversationEventType = {\n\tASSIGNED: \"assigned\",\n\tUNASSIGNED: \"unassigned\",\n\tPARTICIPANT_REQUESTED: \"participant_requested\",\n\tPARTICIPANT_JOINED: \"participant_joined\",\n\tPARTICIPANT_LEFT: \"participant_left\",\n\tSTATUS_CHANGED: \"status_changed\",\n\tPRIORITY_CHANGED: \"priority_changed\",\n\tTAG_ADDED: \"tag_added\",\n\tTAG_REMOVED: \"tag_removed\",\n\tRESOLVED: \"resolved\",\n\tREOPENED: \"reopened\",\n\tVISITOR_BLOCKED: \"visitor_blocked\",\n\tVISITOR_UNBLOCKED: \"visitor_unblocked\",\n\tVISITOR_IDENTIFIED: \"visitor_identified\",\n\t// Private AI events (team only, not visible to visitors)\n\tAI_ANALYZED: \"ai_analyzed\",\n\tTITLE_GENERATED: \"title_generated\",\n\tAI_ESCALATED: \"ai_escalated\",\n} as const;\n\nexport const ConversationParticipationStatus = {\n\tREQUESTED: \"requested\",\n\tACTIVE: \"active\",\n\tLEFT: \"left\",\n\tDECLINED: \"declined\",\n} as const;\n\nexport const ConversationSentiment = {\n\tPOSITIVE: \"positive\",\n\tNEGATIVE: \"negative\",\n\tNEUTRAL: \"neutral\",\n} as const;\n\nexport type ConversationSentiment =\n\t(typeof ConversationSentiment)[keyof typeof ConversationSentiment];\n\nexport type ConversationParticipationStatus =\n\t(typeof ConversationParticipationStatus)[keyof typeof ConversationParticipationStatus];\n\nexport type ConversationEventType =\n\t(typeof ConversationEventType)[keyof typeof ConversationEventType];\n\nexport type TimelineItemVisibility =\n\t(typeof TimelineItemVisibility)[keyof typeof TimelineItemVisibility];\n\nexport type ConversationPriority =\n\t(typeof ConversationPriority)[keyof typeof ConversationPriority];\n\nexport const WebsiteInstallationTarget = {\n\tNEXTJS: \"nextjs\",\n\tREACT: \"react\",\n} as const;\n\nexport const WebsiteStatus = {\n\tACTIVE: \"active\",\n\tINACTIVE: \"inactive\",\n} as const;\n\nexport type WebsiteStatus = (typeof WebsiteStatus)[keyof typeof WebsiteStatus];\n\nexport type WebsiteInstallationTarget =\n\t(typeof WebsiteInstallationTarget)[keyof typeof WebsiteInstallationTarget];\n\nexport const APIKeyType = {\n\tPRIVATE: \"private\",\n\tPUBLIC: \"public\",\n} as const;\n\nexport type APIKeyType = (typeof APIKeyType)[keyof typeof APIKeyType];\n"],"mappings":";AAAA,MAAa,aAAa;CACzB,SAAS;CACT,aAAa;CACb,IAAI;CACJ;AAID,MAAa,qBAAqB;CACjC,MAAM;CACN,UAAU;CACV,MAAM;CACN;AAKD,MAAa,uBAAuB;CACnC,KAAK;CACL,QAAQ;CACR,MAAM;CACN,QAAQ;CACR;AAED,MAAa,yBAAyB;CACrC,QAAQ;CACR,SAAS;CACT;AAED,MAAa,2BAA2B;CACvC,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB;AAKD,MAAa,wBAAwB;CACpC,UAAU;CACV,YAAY;CACZ,uBAAuB;CACvB,oBAAoB;CACpB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,WAAW;CACX,aAAa;CACb,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CAEpB,aAAa;CACb,iBAAiB;CACjB,cAAc;CACd;AAED,MAAa,kCAAkC;CAC9C,WAAW;CACX,QAAQ;CACR,MAAM;CACN,UAAU;CACV;AAED,MAAa,wBAAwB;CACpC,UAAU;CACV,UAAU;CACV,SAAS;CACT;AAiBD,MAAa,4BAA4B;CACxC,QAAQ;CACR,OAAO;CACP;AAED,MAAa,gBAAgB;CAC5B,QAAQ;CACR,UAAU;CACV;AAOD,MAAa,aAAa;CACzB,SAAS;CACT,QAAQ;CACR"}
package/index.d.ts CHANGED
@@ -1,6 +1,9 @@
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 "./api/ai-agent.js";
1
2
  import { PaginationInput, PaginationResponse, emailSchema, optionalUserIdSchema, paginationResponseSchema, paginationSchema, userIdSchema } from "./api/common.js";
2
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 "./api/contact.js";
3
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 "./api/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 "./api/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 "./api/link-source.js";
4
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 "./api/notification.js";
5
8
  import { OrganizationResponse, organizationResponseSchema } from "./api/organization.js";
6
9
  import { GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, SendTimelineItemRequest, SendTimelineItemResponse, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, timelineItemPartsSchema, timelineItemSchema } from "./api/timeline-item.js";
@@ -37,5 +40,5 @@ type DefaultMessage = {
37
40
  senderId?: string;
38
41
  };
39
42
  //#endregion
40
- export { APIKeyType, AnyRealtimeEvent, AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, BlockVisitorResponse, CheckWebsiteDomainRequest, Contact, ContactDetailResponse, ContactListItem, ContactListVisitorStatus, ContactMetadata, ContactNotificationSettings, ContactOrganizationResponse, ContactResponse, ContactVisitorSummary, type Conversation, ConversationEventType, ConversationHeader, ConversationMutationResponse, ConversationParticipationStatus, ConversationPriority, ConversationRecordResponse, ConversationSentiment, ConversationStatus, ConversationTimelineType, CossistantConfig, CossistantError, CreateContactOrganizationRequest, CreateContactRequest, CreateConversationRequestBody, CreateConversationResponseBody, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, DefaultMessage, GenerateUploadUrlRequest, GenerateUploadUrlResponse, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, IdentifyContactRequest, IdentifyContactResponse, ListByOrganizationRequest, ListContactsResponse, ListConversationsRequest, ListConversationsResponse, ListVisitorPresenceResponse, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, MemberNotificationChannel, MemberNotificationChannelDefinition, MemberNotificationPreference, MemberNotificationSettingsResponse, OrganizationResponse, PRESENCE_AWAY_WINDOW_MS, PRESENCE_ONLINE_WINDOW_MS, PRESENCE_PING_INTERVAL_MS, PaginationInput, PaginationResponse, PublicContact, PublicVisitor, PublicVisitorResponse, PublicWebsiteResponse, RealtimeEvent, RealtimeEventData, RealtimeEventPayload, RealtimeEventType, RevokeWebsiteApiKeyRequest, SendTimelineItemRequest, SendTimelineItemResponse, SenderType, SetConversationTypingRequestBody, SetConversationTypingResponseBody, TimelineItem, TimelineItemParts, TimelineItemVisibility, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, UpdateContactMetadataRequest, UpdateContactOrganizationRequest, UpdateContactRequest, UpdateMemberNotificationSettingsRequest, UpdateMemberNotificationSettingsResponse, UpdateUserProfileRequest, UpdateVisitorMetadataRequest, UpdateVisitorRequest, UpdateWebsiteRequest, UserResponse, Visitor, VisitorMetadata, VisitorPresenceEntry, VisitorResponse, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteInstallationTarget, WebsiteListItem, WebsiteStatus, WebsiteSummary, availableHumanAgentSchema, baseRealtimeEvent, blockVisitorResponseSchema, checkWebsiteDomainRequestSchema, contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganization, contactOrganizationResponseSchema, contactResponseSchema, contactVisitorSummarySchema, conversationHeaderSchema, conversationMutationResponseSchema, conversationPrioritySchema, conversationRecordSchema, conversationSchema, conversationSentimentSchema, conversationStatusSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, emailSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getDefaultMemberNotificationPreference, getEventPayload, identifyContactRequestSchema, identifyContactResponseSchema, isValidEventType, listByOrganizationRequestSchema, listContactsResponseSchema, listConversationHeadersResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, listVisitorPresenceResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, realtimeSchema, revokeWebsiteApiKeyRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, timelineItemPartsSchema, timelineItemSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, userIdSchema, userResponseSchema, validateRealtimeEvent, visitorMetadataSchema, visitorPresenceEntrySchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
43
+ export { AIAgentGoal, AIModel, AIModelConfig, AI_AGENT_GOALS, AI_MODELS, APIKeyType, AiAgentBehaviorSettings, AiAgentResponse, AnyRealtimeEvent, ArticleKnowledgePayload, AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, BlockVisitorResponse, CancelLinkSourceRequest, CheckWebsiteDomainRequest, Contact, ContactDetailResponse, ContactListItem, ContactListVisitorStatus, ContactMetadata, ContactNotificationSettings, ContactOrganizationResponse, ContactResponse, ContactVisitorSummary, type Conversation, ConversationEventType, ConversationHeader, ConversationMutationResponse, ConversationParticipationStatus, ConversationPriority, ConversationRecordResponse, ConversationSentiment, ConversationStatus, ConversationTimelineType, CossistantConfig, CossistantError, CrawlProgressPage, CreateAiAgentRequest, CreateContactOrganizationRequest, CreateContactRequest, CreateConversationRequestBody, CreateConversationResponseBody, CreateKnowledgeRequest, CreateKnowledgeRestRequest, CreateLinkSourceRequest, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, DefaultMessage, DeleteAiAgentRequest, DeleteLinkSourceRequest, DeletePageRequest, DiscoveredPage, FaqKnowledgePayload, GenerateBasePromptRequest, GenerateBasePromptResponse, GenerateUploadUrlRequest, GenerateUploadUrlResponse, GetAiAgentRequest, GetBehaviorSettingsRequest, GetBehaviorSettingsResponse, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, GetCrawlStatusRequest, GetKnowledgeRequest, GetLinkSourceRequest, GetTrainingStatsRequest, IdentifyContactRequest, IdentifyContactResponse, IgnorePageRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, LinkSourceResponse, LinkSourceStatus, ListByOrganizationRequest, ListContactsResponse, ListConversationsRequest, ListConversationsResponse, ListKnowledgeByLinkSourceRequest, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, ListLinkSourcesRequest, ListLinkSourcesResponse, ListVisitorPresenceResponse, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, MemberNotificationChannel, MemberNotificationChannelDefinition, MemberNotificationPreference, MemberNotificationSettingsResponse, OrganizationResponse, PRESENCE_AWAY_WINDOW_MS, PRESENCE_ONLINE_WINDOW_MS, PRESENCE_PING_INTERVAL_MS, PaginationInput, PaginationResponse, PublicContact, PublicVisitor, PublicVisitorResponse, PublicWebsiteResponse, RealtimeEvent, RealtimeEventData, RealtimeEventPayload, RealtimeEventType, RecrawlLinkSourceRequest, ReindexPageRequest, RevokeWebsiteApiKeyRequest, ScanSubpagesRequest, SendTimelineItemRequest, SendTimelineItemResponse, SenderType, SetConversationTypingRequestBody, SetConversationTypingResponseBody, TimelineItem, TimelineItemParts, TimelineItemVisibility, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, ToggleAiAgentActiveRequest, ToggleKnowledgeIncludedRequest, TrainingStatsResponse, UpdateAiAgentRequest, UpdateBehaviorSettingsRequest, UpdateBehaviorSettingsResponse, UpdateContactMetadataRequest, UpdateContactOrganizationRequest, UpdateContactRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UpdateMemberNotificationSettingsRequest, UpdateMemberNotificationSettingsResponse, UpdateUserProfileRequest, UpdateVisitorMetadataRequest, UpdateVisitorRequest, UpdateWebsiteRequest, UrlKnowledgePayload, UserResponse, Visitor, VisitorMetadata, VisitorPresenceEntry, VisitorResponse, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteInstallationTarget, WebsiteListItem, WebsiteStatus, WebsiteSummary, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, baseRealtimeEvent, blockVisitorResponseSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganization, contactOrganizationResponseSchema, contactResponseSchema, contactVisitorSummarySchema, conversationHeaderSchema, conversationMutationResponseSchema, conversationPrioritySchema, conversationRecordSchema, conversationSchema, conversationSentimentSchema, conversationStatusSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getEventPayload, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, isValidEventType, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listContactsResponseSchema, listConversationHeadersResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, listVisitorPresenceResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, realtimeSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, timelineItemPartsSchema, timelineItemSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, validateRealtimeEvent, visitorMetadataSchema, visitorPresenceEntrySchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
41
44
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;KAYY,gBAAA;;;;;;;;KASA,eAAA;;EATA,OAAA,EAAA,MAAA;EASA,OAAA,CAAA,EAGD,MAHC,CAAA,MAAe,EAAA,OAGhB,CAAA;AAGX,CAAA;KAAY,cAAA;;cAEC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;KAYY,gBAAA;;;;;;;;KASA,eAAA;;;YAGD;;AAZC,KAeA,cAAA,GAfgB;EAShB,OAAA,EAAA,MAAA;EAMA,UAAA,EAEC,UAFa"}
package/index.js CHANGED
@@ -1,9 +1,12 @@
1
1
  import { APIKeyType, ConversationEventType, ConversationParticipationStatus, ConversationPriority, ConversationSentiment, ConversationStatus, ConversationTimelineType, SenderType, TimelineItemVisibility, WebsiteInstallationTarget, WebsiteStatus } from "./enums.js";
2
+ import { AI_AGENT_GOALS, AI_MODELS, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, createAiAgentRequestSchema, deleteAiAgentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema } from "./api/ai-agent.js";
2
3
  import { emailSchema, optionalUserIdSchema, paginationResponseSchema, paginationSchema, userIdSchema } from "./api/common.js";
3
4
  import { contactMetadataSchema, contactOrganizationResponseSchema, contactResponseSchema, createContactOrganizationRequestSchema, createContactRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema } from "./api/contact.js";
4
5
  import { getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, timelineItemPartsSchema, timelineItemSchema } from "./api/timeline-item.js";
5
6
  import { conversationSchema } from "./schemas.js";
6
7
  import { createConversationRequestSchema, createConversationResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema } from "./api/conversation.js";
8
+ import { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema } from "./api/knowledge.js";
9
+ import { cancelLinkSourceRequestSchema, crawlProgressPageSchema, createLinkSourceRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, getCrawlStatusRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, ignorePageRequestSchema, linkSourceResponseSchema, linkSourceStatusSchema, listKnowledgeByLinkSourceRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, scanSubpagesRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema } from "./api/link-source.js";
7
10
  import { MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, getDefaultMemberNotificationPreference, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema } from "./api/notification.js";
8
11
  import { organizationResponseSchema } from "./api/organization.js";
9
12
  import { generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema } from "./api/upload.js";
@@ -16,4 +19,4 @@ import { baseRealtimeEvent, getEventPayload, isValidEventType, realtimeSchema, v
16
19
  import { contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactVisitorSummarySchema, listContactsResponseSchema } from "./trpc/contact.js";
17
20
  import { blockVisitorResponseSchema, listVisitorPresenceResponseSchema, visitorPresenceEntrySchema } from "./trpc/visitor.js";
18
21
 
19
- export { APIKeyType, AvailableAIAgentSchema, ConversationEventType, ConversationParticipationStatus, ConversationPriority, ConversationSentiment, ConversationStatus, ConversationTimelineType, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, PRESENCE_AWAY_WINDOW_MS, PRESENCE_ONLINE_WINDOW_MS, PRESENCE_PING_INTERVAL_MS, SenderType, TimelineItemVisibility, WebsiteInstallationTarget, WebsiteStatus, availableHumanAgentSchema, baseRealtimeEvent, blockVisitorResponseSchema, checkWebsiteDomainRequestSchema, contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganizationResponseSchema, contactResponseSchema, contactVisitorSummarySchema, conversationHeaderSchema, conversationMutationResponseSchema, conversationPrioritySchema, conversationRecordSchema, conversationSchema, conversationSentimentSchema, conversationStatusSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, emailSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getDefaultMemberNotificationPreference, getEventPayload, identifyContactRequestSchema, identifyContactResponseSchema, isValidEventType, listByOrganizationRequestSchema, listContactsResponseSchema, listConversationHeadersResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, listVisitorPresenceResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, realtimeSchema, revokeWebsiteApiKeyRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, timelineItemPartsSchema, timelineItemSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, userIdSchema, userResponseSchema, validateRealtimeEvent, visitorMetadataSchema, visitorPresenceEntrySchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
22
+ export { AI_AGENT_GOALS, AI_MODELS, APIKeyType, AvailableAIAgentSchema, ConversationEventType, ConversationParticipationStatus, ConversationPriority, ConversationSentiment, ConversationStatus, ConversationTimelineType, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, PRESENCE_AWAY_WINDOW_MS, PRESENCE_ONLINE_WINDOW_MS, PRESENCE_PING_INTERVAL_MS, SenderType, TimelineItemVisibility, WebsiteInstallationTarget, WebsiteStatus, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, baseRealtimeEvent, blockVisitorResponseSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactDetailResponseSchema, contactListItemSchema, contactListVisitorStatusSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganizationResponseSchema, contactResponseSchema, contactVisitorSummarySchema, conversationHeaderSchema, conversationMutationResponseSchema, conversationPrioritySchema, conversationRecordSchema, conversationSchema, conversationSentimentSchema, conversationStatusSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getEventPayload, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, isValidEventType, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listContactsResponseSchema, listConversationHeadersResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, listVisitorPresenceResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, realtimeSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, timelineItemPartsSchema, timelineItemSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, validateRealtimeEvent, visitorMetadataSchema, visitorPresenceEntrySchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cossistant/types",
3
3
  "type": "module",
4
- "version": "0.0.26",
4
+ "version": "0.0.29",
5
5
  "private": false,
6
6
  "author": "Cossistant Team",
7
7
  "description": "Shared TypeScript types for Cossistant packages",
@@ -20,6 +20,22 @@
20
20
  "./*": {
21
21
  "types": "./*.d.ts",
22
22
  "import": "./*.js"
23
+ },
24
+ "./api": {
25
+ "types": "./api/index.d.ts",
26
+ "import": "./api/index.js"
27
+ },
28
+ "./api/*": {
29
+ "types": "./api/*.d.ts",
30
+ "import": "./api/*.js"
31
+ },
32
+ "./trpc/*": {
33
+ "types": "./trpc/*.d.ts",
34
+ "import": "./trpc/*.js"
35
+ },
36
+ "./enums": {
37
+ "types": "./enums.d.ts",
38
+ "import": "./enums.js"
23
39
  }
24
40
  },
25
41
  "main": "./index.js",
@@ -119,6 +119,7 @@ declare const realtimeSchema: {
119
119
  spam: "spam";
120
120
  }>>;
121
121
  deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
122
+ visitorLastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
123
  lastTimelineItem: z.ZodOptional<z.ZodObject<{
123
124
  id: z.ZodOptional<z.ZodString>;
124
125
  conversationId: z.ZodString;
@@ -227,6 +228,12 @@ declare const realtimeSchema: {
227
228
  resolvedAt: z.ZodNullable<z.ZodString>;
228
229
  resolvedByUserId: z.ZodNullable<z.ZodString>;
229
230
  resolvedByAiAgentId: z.ZodNullable<z.ZodString>;
231
+ escalatedAt: z.ZodNullable<z.ZodString>;
232
+ escalatedByAiAgentId: z.ZodNullable<z.ZodString>;
233
+ escalationReason: z.ZodNullable<z.ZodString>;
234
+ escalationHandledAt: z.ZodNullable<z.ZodString>;
235
+ escalationHandledByUserId: z.ZodNullable<z.ZodString>;
236
+ aiPausedUntil: z.ZodNullable<z.ZodString>;
230
237
  createdAt: z.ZodString;
231
238
  updatedAt: z.ZodString;
232
239
  deletedAt: z.ZodNullable<z.ZodString>;
@@ -432,6 +439,162 @@ declare const realtimeSchema: {
432
439
  }, z.core.$strip>>;
433
440
  }, z.core.$strip>;
434
441
  }, z.core.$strip>;
442
+ readonly conversationEventCreated: z.ZodObject<{
443
+ websiteId: z.ZodString;
444
+ organizationId: z.ZodString;
445
+ visitorId: z.ZodNullable<z.ZodString>;
446
+ userId: z.ZodNullable<z.ZodString>;
447
+ conversationId: z.ZodString;
448
+ aiAgentId: z.ZodNullable<z.ZodString>;
449
+ event: z.ZodObject<{
450
+ id: z.ZodString;
451
+ conversationId: z.ZodString;
452
+ organizationId: z.ZodString;
453
+ type: z.ZodEnum<{
454
+ resolved: "resolved";
455
+ assigned: "assigned";
456
+ unassigned: "unassigned";
457
+ participant_requested: "participant_requested";
458
+ participant_joined: "participant_joined";
459
+ participant_left: "participant_left";
460
+ status_changed: "status_changed";
461
+ priority_changed: "priority_changed";
462
+ tag_added: "tag_added";
463
+ tag_removed: "tag_removed";
464
+ reopened: "reopened";
465
+ visitor_blocked: "visitor_blocked";
466
+ visitor_unblocked: "visitor_unblocked";
467
+ visitor_identified: "visitor_identified";
468
+ }>;
469
+ actorUserId: z.ZodNullable<z.ZodString>;
470
+ actorAiAgentId: z.ZodNullable<z.ZodString>;
471
+ targetUserId: z.ZodNullable<z.ZodString>;
472
+ targetAiAgentId: z.ZodNullable<z.ZodString>;
473
+ message: z.ZodNullable<z.ZodString>;
474
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
475
+ createdAt: z.ZodString;
476
+ updatedAt: z.ZodString;
477
+ deletedAt: z.ZodNullable<z.ZodString>;
478
+ }, z.core.$strip>;
479
+ }, z.core.$strip>;
480
+ readonly conversationUpdated: z.ZodObject<{
481
+ websiteId: z.ZodString;
482
+ organizationId: z.ZodString;
483
+ visitorId: z.ZodNullable<z.ZodString>;
484
+ userId: z.ZodNullable<z.ZodString>;
485
+ conversationId: z.ZodString;
486
+ updates: z.ZodObject<{
487
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
488
+ sentiment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
489
+ positive: "positive";
490
+ negative: "negative";
491
+ neutral: "neutral";
492
+ }>>>;
493
+ sentimentConfidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
494
+ escalatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
495
+ escalationReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
496
+ }, z.core.$strip>;
497
+ aiAgentId: z.ZodNullable<z.ZodString>;
498
+ }, z.core.$strip>;
499
+ readonly crawlStarted: z.ZodObject<{
500
+ websiteId: z.ZodString;
501
+ organizationId: z.ZodString;
502
+ visitorId: z.ZodNullable<z.ZodString>;
503
+ userId: z.ZodNullable<z.ZodString>;
504
+ linkSourceId: z.ZodString;
505
+ url: z.ZodString;
506
+ discoveredPages: z.ZodArray<z.ZodObject<{
507
+ url: z.ZodString;
508
+ title: z.ZodNullable<z.ZodString>;
509
+ depth: z.ZodNumber;
510
+ }, z.core.$strip>>;
511
+ totalPagesCount: z.ZodNumber;
512
+ }, z.core.$strip>;
513
+ readonly crawlProgress: z.ZodObject<{
514
+ websiteId: z.ZodString;
515
+ organizationId: z.ZodString;
516
+ visitorId: z.ZodNullable<z.ZodString>;
517
+ userId: z.ZodNullable<z.ZodString>;
518
+ linkSourceId: z.ZodString;
519
+ url: z.ZodString;
520
+ page: z.ZodObject<{
521
+ url: z.ZodString;
522
+ title: z.ZodNullable<z.ZodString>;
523
+ status: z.ZodEnum<{
524
+ pending: "pending";
525
+ crawling: "crawling";
526
+ completed: "completed";
527
+ failed: "failed";
528
+ }>;
529
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
530
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
531
+ }, z.core.$strip>;
532
+ completedCount: z.ZodNumber;
533
+ totalCount: z.ZodNumber;
534
+ }, z.core.$strip>;
535
+ readonly crawlCompleted: z.ZodObject<{
536
+ websiteId: z.ZodString;
537
+ organizationId: z.ZodString;
538
+ visitorId: z.ZodNullable<z.ZodString>;
539
+ userId: z.ZodNullable<z.ZodString>;
540
+ linkSourceId: z.ZodString;
541
+ url: z.ZodString;
542
+ crawledPagesCount: z.ZodNumber;
543
+ totalSizeBytes: z.ZodNumber;
544
+ failedPagesCount: z.ZodNumber;
545
+ }, z.core.$strip>;
546
+ readonly crawlFailed: z.ZodObject<{
547
+ websiteId: z.ZodString;
548
+ organizationId: z.ZodString;
549
+ visitorId: z.ZodNullable<z.ZodString>;
550
+ userId: z.ZodNullable<z.ZodString>;
551
+ linkSourceId: z.ZodString;
552
+ url: z.ZodString;
553
+ error: z.ZodString;
554
+ }, z.core.$strip>;
555
+ readonly linkSourceUpdated: z.ZodObject<{
556
+ websiteId: z.ZodString;
557
+ organizationId: z.ZodString;
558
+ visitorId: z.ZodNullable<z.ZodString>;
559
+ userId: z.ZodNullable<z.ZodString>;
560
+ linkSourceId: z.ZodString;
561
+ status: z.ZodEnum<{
562
+ pending: "pending";
563
+ mapping: "mapping";
564
+ crawling: "crawling";
565
+ completed: "completed";
566
+ failed: "failed";
567
+ }>;
568
+ discoveredPagesCount: z.ZodOptional<z.ZodNumber>;
569
+ crawledPagesCount: z.ZodOptional<z.ZodNumber>;
570
+ totalSizeBytes: z.ZodOptional<z.ZodNumber>;
571
+ errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
572
+ }, z.core.$strip>;
573
+ readonly crawlPagesDiscovered: z.ZodObject<{
574
+ websiteId: z.ZodString;
575
+ organizationId: z.ZodString;
576
+ visitorId: z.ZodNullable<z.ZodString>;
577
+ userId: z.ZodNullable<z.ZodString>;
578
+ linkSourceId: z.ZodString;
579
+ pages: z.ZodArray<z.ZodObject<{
580
+ url: z.ZodString;
581
+ path: z.ZodString;
582
+ depth: z.ZodNumber;
583
+ }, z.core.$strip>>;
584
+ }, z.core.$strip>;
585
+ readonly crawlPageCompleted: z.ZodObject<{
586
+ websiteId: z.ZodString;
587
+ organizationId: z.ZodString;
588
+ visitorId: z.ZodNullable<z.ZodString>;
589
+ userId: z.ZodNullable<z.ZodString>;
590
+ linkSourceId: z.ZodString;
591
+ page: z.ZodObject<{
592
+ url: z.ZodString;
593
+ title: z.ZodNullable<z.ZodString>;
594
+ sizeBytes: z.ZodNumber;
595
+ knowledgeId: z.ZodString;
596
+ }, z.core.$strip>;
597
+ }, z.core.$strip>;
435
598
  };
436
599
  type RealtimeEventType = keyof typeof realtimeSchema;
437
600
  type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<(typeof realtimeSchema)[T]>;
@@ -1 +1 @@
1
- {"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;cAMa,mBAAiB,CAAA,CAAA;;EAAjB,cAAA,aAKX;;;;;;;;AAL4B,cAWjB,cAXiB,EAAA;EAAA,SAAA,aAAA,aAAA,CAAA;IAWjB,SAAA,aAiEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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