@cossistant/core 0.0.25 → 0.0.28

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 (89) hide show
  1. package/_virtual/rolldown_runtime.js +1 -10
  2. package/client.d.ts +37 -5
  3. package/client.d.ts.map +1 -1
  4. package/client.js +19 -1
  5. package/client.js.map +1 -1
  6. package/contact.d.ts +19 -22
  7. package/contact.d.ts.map +1 -1
  8. package/conversation.d.ts +314 -315
  9. package/conversation.d.ts.map +1 -1
  10. package/index.d.ts +6 -4
  11. package/index.js +3 -1
  12. package/package.json +4 -2
  13. package/realtime-events.d.ts +359 -322
  14. package/realtime-events.d.ts.map +1 -1
  15. package/rest-client.d.ts +32 -1
  16. package/rest-client.d.ts.map +1 -1
  17. package/rest-client.js +75 -0
  18. package/rest-client.js.map +1 -1
  19. package/schemas.d.ts +101 -670
  20. package/schemas.d.ts.map +1 -1
  21. package/store/conversations-store.d.ts +6 -6
  22. package/store/conversations-store.d.ts.map +1 -1
  23. package/store/conversations-store.js +2 -1
  24. package/store/conversations-store.js.map +1 -1
  25. package/store/create-store.d.ts.map +1 -1
  26. package/store/seen-store.d.ts +1 -1
  27. package/store/timeline-items-store.js +1 -1
  28. package/store/typing-store.d.ts.map +1 -1
  29. package/store/typing-store.js +6 -6
  30. package/store/typing-store.js.map +1 -1
  31. package/timeline-item.d.ts +189 -193
  32. package/timeline-item.d.ts.map +1 -1
  33. package/types/src/api/timeline-item.js +120 -0
  34. package/types/src/api/timeline-item.js.map +1 -0
  35. package/types/src/enums.js.map +1 -0
  36. package/typing-reporter.d.ts +71 -0
  37. package/typing-reporter.d.ts.map +1 -0
  38. package/typing-reporter.js +145 -0
  39. package/typing-reporter.js.map +1 -0
  40. package/upload-constants.d.ts +40 -0
  41. package/upload-constants.d.ts.map +1 -0
  42. package/upload-constants.js +70 -0
  43. package/upload-constants.js.map +1 -0
  44. package/upload.d.ts +47 -0
  45. package/upload.d.ts.map +1 -0
  46. package/api.d.ts +0 -71
  47. package/api.d.ts.map +0 -1
  48. package/checks.d.ts +0 -189
  49. package/checks.d.ts.map +0 -1
  50. package/coerce.d.ts +0 -9
  51. package/coerce.d.ts.map +0 -1
  52. package/core.d.ts +0 -35
  53. package/core.d.ts.map +0 -1
  54. package/errors.d.ts +0 -121
  55. package/errors.d.ts.map +0 -1
  56. package/errors2.d.ts +0 -24
  57. package/errors2.d.ts.map +0 -1
  58. package/index2.d.ts +0 -4
  59. package/index3.d.ts +0 -1
  60. package/metadata.d.ts +0 -1
  61. package/openapi-generator.d.ts +0 -1
  62. package/openapi-generator2.d.ts +0 -1
  63. package/openapi-generator3.d.ts +0 -1
  64. package/openapi30.d.ts +0 -125
  65. package/openapi30.d.ts.map +0 -1
  66. package/openapi31.d.ts +0 -131
  67. package/openapi31.d.ts.map +0 -1
  68. package/packages/types/src/api/timeline-item.js +0 -122
  69. package/packages/types/src/api/timeline-item.js.map +0 -1
  70. package/packages/types/src/enums.js.map +0 -1
  71. package/parse.d.ts +0 -17
  72. package/parse.d.ts.map +0 -1
  73. package/registries.d.ts +0 -32
  74. package/registries.d.ts.map +0 -1
  75. package/schemas2.d.ts +0 -320
  76. package/schemas2.d.ts.map +0 -1
  77. package/schemas3.d.ts +0 -105
  78. package/schemas3.d.ts.map +0 -1
  79. package/specification-extension.d.ts +0 -9
  80. package/specification-extension.d.ts.map +0 -1
  81. package/standard-schema.d.ts +0 -59
  82. package/standard-schema.d.ts.map +0 -1
  83. package/util.d.ts +0 -41
  84. package/util.d.ts.map +0 -1
  85. package/versions.d.ts +0 -9
  86. package/versions.d.ts.map +0 -1
  87. package/zod-extensions.d.ts +0 -39
  88. package/zod-extensions.d.ts.map +0 -1
  89. /package/{packages/types → types}/src/enums.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","names":[],"sources":["../../types/src/api/conversation.ts"],"sourcesContent":[],"mappings":";;;;;;;cAIa,iCAA+B;;;;;;IAA/B,cAAA,WAAA;;;;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AA,CAAA;IAAA,iBAAA,eAAA,cAAA,YAAA,CAAA,CAAA;IA6B/B,gBAAA,eAAwB,YAC5B,CAAA;MAGK,EAAA,eAAA,YAaV,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAES,yBAAA,GAA4B,CAAA,CAAE,aAClC;cAGK,8BAA4B,CAAA,CAAA;;;KAU7B,sBAAA,GAAyB,CAAA,CAAE,aAC/B;cAGK,+BAA6B,CAAA,CAAA;;;;;;;;;;;;;;;;MAjCE,EAAA,eAAA,YAAA,CAAA;MAAA,cAAA,aAAA;MAehC,cAAA,aAAyB;MAIxB,UAAA,WAAA,CAAA;;;MAA4B,CAAA,CAAA;MAAA,IAAA,WAAA,CAAA;QAU7B,OAAA,EAAA,SAAsB;QAIrB,KAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAQD,uBAAA,GAA0B,CAAA,CAAE,aAChC;cAGK,mCAAiC,CAAA,CAAA;;;KAYlC,+BAAA,GAAkC,CAAA,CAAE,aACxC;cAGK,oCAAkC,CAAA,CAAA;;;;KAcnC,gCAAA,GAAmC,CAAA,CAAE,aACzC;cA0BK,qCAAmC,CAAA,CAAA;;;;;;KAoBpC,iCAAA,GAAoC,CAAA,CAAE,aAC1C;cAGK,uCAAqC,CAAA,CAAA;;;;;;IA7FR,SAAA,eAAA,YAAA,CAAA;IAAA,UAAA,aAAA;IAQ9B,SAAA,aAAuB;IAItB,SAAA,aAAA;;;;AAAiC,KAwHlC,+BAAA,GAAkC,CAAA,CAAE,KAxHF,CAAA,OAyHtC,qCAzHsC,CAAA"}
package/index.d.ts CHANGED
@@ -1,16 +1,18 @@
1
- import { ConversationPagination, ConversationsState, ConversationsStore, createConversationsStore, getConversationById, getConversationPagination, getConversations } from "./store/conversations-store.js";
1
+ import { CossistantAPIError } from "./types.js";
2
+ import { CossistantRestClient } from "./rest-client.js";
3
+ import { ConversationPagination, ConversationWithSeen, ConversationsState, ConversationsStore, createConversationsStore, getConversationById, getConversationPagination, getConversations } from "./store/conversations-store.js";
2
4
  import { ConversationTimelineItemsState, TimelineItemsState, TimelineItemsStore, createTimelineItemsStore, getConversationTimelineItems } from "./store/timeline-items-store.js";
3
5
  import { WebsiteError, WebsiteState, WebsiteStatus, WebsiteStore, createWebsiteStore, getWebsiteState } from "./store/website-store.js";
4
- import { CossistantAPIError } from "./types.js";
5
6
  import { CossistantClient } from "./client.js";
6
7
  import { normalizeLocale } from "./locale-utils.js";
7
- import { CossistantRestClient } from "./rest-client.js";
8
8
  import { ConversationSeenState, SeenActorType, SeenEntry, SeenState, SeenStore, applyConversationSeenEvent, createSeenStore, hydrateConversationSeen, upsertConversationSeen } from "./store/seen-store.js";
9
9
  import { DefaultRoutes, NavigationState, RouteRegistry, SUPPORT_PAGES, SupportConfig, SupportNavigation, SupportPage, SupportStore, SupportStoreActions, SupportStoreOptions, SupportStoreState, SupportStoreStorage, createSupportStore } from "./store/support-store.js";
10
10
  import { ConversationTypingState, TypingActorType, TypingEntry, TypingState, TypingStore, TypingStoreDependencies, applyConversationTypingEvent, clearTypingFromTimelineItem, clearTypingState, createTypingStore, getConversationTyping, setTypingState } from "./store/typing-store.js";
11
+ import { TYPING_KEEP_ALIVE_MS, TYPING_PREVIEW_MAX_LENGTH, TYPING_SEND_INTERVAL_MS, TYPING_STOP_DELAY_MS, TypingReporter, TypingReporterConfig, createTypingReporter } from "./typing-reporter.js";
12
+ import { ALLOWED_FILE_TYPES_DESCRIPTION, ALLOWED_MIME_TYPES, FILE_INPUT_ACCEPT, MAX_FILES_PER_MESSAGE, MAX_FILE_SIZE, formatFileSize, isAllowedMimeType, isImageMimeType, validateFile, validateFiles } from "./upload-constants.js";
11
13
  import { generateConversationId, generateMessageId } from "./utils.js";
12
14
  import { VisitorData, collectVisitorData } from "./visitor-data.js";
13
15
  import { generateVisitorName, getVisitorNameWithFallback } from "./visitor-name.js";
14
16
  import { clearAllVisitorIds, clearVisitorId, getVisitorId, setVisitorId } from "./visitor-tracker.js";
15
17
  import { CossistantConfig, CossistantError } from "@cossistant/types";
16
- export { type ConversationPagination, type ConversationSeenState, type ConversationTimelineItemsState, type ConversationTypingState, type ConversationsState, type ConversationsStore, CossistantAPIError, CossistantClient, type CossistantConfig, type CossistantError, CossistantRestClient, type DefaultRoutes, type NavigationState, type RouteRegistry, type SUPPORT_PAGES, type SeenActorType, type SeenEntry, type SeenState, type SeenStore, type SupportConfig, type SupportNavigation, type SupportPage, type SupportStore, type SupportStoreActions, type SupportStoreOptions, type SupportStoreState, type SupportStoreStorage, type TimelineItemsState, type TimelineItemsStore, type TypingActorType, type TypingEntry, type TypingState, type TypingStore, type TypingStoreDependencies, type VisitorData, type WebsiteError, type WebsiteState, type WebsiteStatus, type WebsiteStore, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingStore, createWebsiteStore, CossistantClient as default, generateConversationId, generateMessageId, generateVisitorName, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getVisitorNameWithFallback, getWebsiteState, hydrateConversationSeen, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen };
18
+ export { ALLOWED_FILE_TYPES_DESCRIPTION, ALLOWED_MIME_TYPES, type ConversationPagination, type ConversationSeenState, type ConversationTimelineItemsState, type ConversationTypingState, type ConversationWithSeen, type ConversationsState, type ConversationsStore, CossistantAPIError, CossistantClient, type CossistantConfig, type CossistantError, CossistantRestClient, type DefaultRoutes, FILE_INPUT_ACCEPT, MAX_FILES_PER_MESSAGE, MAX_FILE_SIZE, type NavigationState, type RouteRegistry, type SUPPORT_PAGES, type SeenActorType, type SeenEntry, type SeenState, type SeenStore, type SupportConfig, type SupportNavigation, type SupportPage, type SupportStore, type SupportStoreActions, type SupportStoreOptions, type SupportStoreState, type SupportStoreStorage, TYPING_KEEP_ALIVE_MS, TYPING_PREVIEW_MAX_LENGTH, TYPING_SEND_INTERVAL_MS, TYPING_STOP_DELAY_MS, type TimelineItemsState, type TimelineItemsStore, type TypingActorType, type TypingEntry, type TypingReporter, type TypingReporterConfig, type TypingState, type TypingStore, type TypingStoreDependencies, type VisitorData, type WebsiteError, type WebsiteState, type WebsiteStatus, type WebsiteStore, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingReporter, createTypingStore, createWebsiteStore, CossistantClient as default, formatFileSize, generateConversationId, generateMessageId, generateVisitorName, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getVisitorNameWithFallback, getWebsiteState, hydrateConversationSeen, isAllowedMimeType, isImageMimeType, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen, validateFile, validateFiles };
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { CossistantAPIError } from "./types.js";
2
+ import { ALLOWED_FILE_TYPES_DESCRIPTION, ALLOWED_MIME_TYPES, FILE_INPUT_ACCEPT, MAX_FILES_PER_MESSAGE, MAX_FILE_SIZE, formatFileSize, isAllowedMimeType, isImageMimeType, validateFile, validateFiles } from "./upload-constants.js";
2
3
  import { generateConversationId, generateMessageId } from "./utils.js";
3
4
  import { collectVisitorData } from "./visitor-data.js";
4
5
  import { clearAllVisitorIds, clearVisitorId, getVisitorId, setVisitorId } from "./visitor-tracker.js";
@@ -11,6 +12,7 @@ import { normalizeLocale } from "./locale-utils.js";
11
12
  import { applyConversationSeenEvent, createSeenStore, hydrateConversationSeen, upsertConversationSeen } from "./store/seen-store.js";
12
13
  import { createSupportStore } from "./store/support-store.js";
13
14
  import { applyConversationTypingEvent, clearTypingFromTimelineItem, clearTypingState, createTypingStore, getConversationTyping, setTypingState } from "./store/typing-store.js";
15
+ import { TYPING_KEEP_ALIVE_MS, TYPING_PREVIEW_MAX_LENGTH, TYPING_SEND_INTERVAL_MS, TYPING_STOP_DELAY_MS, createTypingReporter } from "./typing-reporter.js";
14
16
  import { generateVisitorName, getVisitorNameWithFallback } from "./visitor-name.js";
15
17
 
16
- export { CossistantAPIError, CossistantClient, CossistantRestClient, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingStore, createWebsiteStore, CossistantClient as default, generateConversationId, generateMessageId, generateVisitorName, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getVisitorNameWithFallback, getWebsiteState, hydrateConversationSeen, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen };
18
+ export { ALLOWED_FILE_TYPES_DESCRIPTION, ALLOWED_MIME_TYPES, CossistantAPIError, CossistantClient, CossistantRestClient, FILE_INPUT_ACCEPT, MAX_FILES_PER_MESSAGE, MAX_FILE_SIZE, TYPING_KEEP_ALIVE_MS, TYPING_PREVIEW_MAX_LENGTH, TYPING_SEND_INTERVAL_MS, TYPING_STOP_DELAY_MS, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingReporter, createTypingStore, createWebsiteStore, CossistantClient as default, formatFileSize, generateConversationId, generateMessageId, generateVisitorName, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getVisitorNameWithFallback, getWebsiteState, hydrateConversationSeen, isAllowedMimeType, isImageMimeType, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen, validateFile, validateFiles };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cossistant/core",
3
3
  "type": "module",
4
- "version": "0.0.25",
4
+ "version": "0.0.28",
5
5
  "private": false,
6
6
  "author": "Cossistant Team",
7
7
  "description": "Core library for connecting to Cossistant API and managing data fetching",
@@ -28,7 +28,9 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
+ "@hono/zod-openapi": "^1.1.0",
31
32
  "nanoid": "^5.1.5",
32
- "ulid": "^3.0.1"
33
+ "ulid": "^3.0.1",
34
+ "zod": "^4.1.8"
33
35
  }
34
36
  }