clivly 0.17.0 → 0.17.1

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 (130) hide show
  1. package/README.md +21 -27
  2. package/{adapter-BpAfha3z.d.mts → adapter-C63F9VZL.d.mts} +1 -1
  3. package/{adapter-BvSigBPG.d.cts → adapter-OO5g17qF.d.cts} +1 -1
  4. package/{auth-adapter-CsZE4ugg.d.cts → auth-adapter-COMP0Fud.d.cts} +1 -1
  5. package/{auth-adapter-Q6CL2VHr.d.mts → auth-adapter-ZlhllVpm.d.mts} +1 -1
  6. package/auth-better-auth.d.cts +1 -1
  7. package/auth-better-auth.d.mts +1 -1
  8. package/auth-clerk.d.cts +1 -1
  9. package/auth-clerk.d.mts +1 -1
  10. package/auth-workos.d.cts +1 -1
  11. package/auth-workos.d.mts +1 -1
  12. package/core-adapter.d.cts +1 -1
  13. package/core-adapter.d.mts +1 -1
  14. package/core-auth-adapter.d.cts +1 -1
  15. package/core-auth-adapter.d.mts +1 -1
  16. package/core-drizzle.d.cts +1 -1
  17. package/core-drizzle.d.mts +1 -1
  18. package/core-entity-config.cjs +1 -1
  19. package/core-entity-config.d.cts +1 -1
  20. package/core-entity-config.d.mts +1 -1
  21. package/core-entity-config.mjs +1 -1
  22. package/core-entity-heuristics.cjs +16 -15
  23. package/core-entity-heuristics.d.cts +3 -3
  24. package/core-entity-heuristics.d.mts +3 -3
  25. package/core-entity-heuristics.mjs +1 -1
  26. package/core-mapping-form.d.cts +1 -1
  27. package/core-mapping-form.d.mts +1 -1
  28. package/core-mappings-config.cjs +1 -1
  29. package/core-mappings-config.d.cts +1 -1
  30. package/core-mappings-config.d.mts +1 -1
  31. package/core-mappings-config.mjs +1 -1
  32. package/core-sync-engine.cjs +1 -1
  33. package/core-sync-engine.d.cts +1 -1
  34. package/core-sync-engine.d.mts +1 -1
  35. package/core-sync-engine.mjs +1 -1
  36. package/core-types.d.cts +1 -1
  37. package/core-types.d.mts +1 -1
  38. package/core-view-compiler.cjs +1 -1
  39. package/core-view-compiler.d.cts +1 -1
  40. package/core-view-compiler.d.mts +1 -1
  41. package/core-view-compiler.mjs +1 -1
  42. package/core.cjs +7 -7
  43. package/core.d.cts +9 -9
  44. package/core.d.mts +9 -9
  45. package/core.mjs +7 -7
  46. package/{drizzle-MUNZgh1l.d.cts → drizzle-B9cjBavj.d.cts} +1 -1
  47. package/{drizzle-UJbPCzPJ.d.mts → drizzle-L5FOGe_-.d.mts} +1 -1
  48. package/drizzle.cjs +2 -2
  49. package/drizzle.d.cts +3 -3
  50. package/drizzle.d.mts +3 -3
  51. package/drizzle.mjs +2 -2
  52. package/{entity-config-nWWgJXLw.cjs → entity-config-DiCJ6mhI.cjs} +1 -1
  53. package/{entity-config-BF7pcXFB.d.cts → entity-config-X-KlnYXX.d.mts} +1 -1
  54. package/{entity-config-pzamFSKw.d.mts → entity-config-dNclLyBM.d.cts} +1 -1
  55. package/{entity-config-DQVSprlG.mjs → entity-config-g_oMPXlN.mjs} +1 -1
  56. package/entity-heuristics-CIParuQe.cjs +655 -0
  57. package/entity-heuristics-DE5ujoHw.mjs +566 -0
  58. package/index.cjs +16 -15
  59. package/index.mjs +4 -3
  60. package/{internal-DtLZyjf8.mjs → internal-9oDwwbNg.mjs} +1 -1
  61. package/{internal-CjJy-cy1.cjs → internal-BKYt5j0l.cjs} +1 -1
  62. package/{internal-Gie7hCpK.d.mts → internal-COALpgov.d.cts} +1 -1
  63. package/{internal-C-uvosSL.d.cts → internal-D3q4FPcA.d.mts} +1 -1
  64. package/internal-adapter.d.cts +1 -1
  65. package/internal-adapter.d.mts +1 -1
  66. package/internal-auth-adapter.d.cts +1 -1
  67. package/internal-auth-adapter.d.mts +1 -1
  68. package/internal-drizzle.d.cts +1 -1
  69. package/internal-drizzle.d.mts +1 -1
  70. package/internal-entity-config.cjs +1 -1
  71. package/internal-entity-config.d.cts +1 -1
  72. package/internal-entity-config.d.mts +1 -1
  73. package/internal-entity-config.mjs +1 -1
  74. package/internal-entity-heuristics.cjs +16 -575
  75. package/internal-entity-heuristics.d.cts +3 -1
  76. package/internal-entity-heuristics.d.mts +3 -1
  77. package/internal-entity-heuristics.mjs +1 -562
  78. package/internal-mapping-form.d.cts +1 -1
  79. package/internal-mapping-form.d.mts +1 -1
  80. package/internal-mappings-config.cjs +1 -1
  81. package/internal-mappings-config.d.cts +1 -1
  82. package/internal-mappings-config.d.mts +1 -1
  83. package/internal-mappings-config.mjs +1 -1
  84. package/internal-sync-engine.cjs +1 -1
  85. package/internal-sync-engine.d.cts +1 -1
  86. package/internal-sync-engine.d.mts +1 -1
  87. package/internal-sync-engine.mjs +1 -1
  88. package/internal-types.d.cts +1 -1
  89. package/internal-types.d.mts +1 -1
  90. package/internal-view-compiler.cjs +1 -1
  91. package/internal-view-compiler.d.cts +1 -1
  92. package/internal-view-compiler.d.mts +1 -1
  93. package/internal-view-compiler.mjs +1 -1
  94. package/internal.cjs +7 -7
  95. package/internal.d.cts +9 -9
  96. package/internal.d.mts +9 -9
  97. package/internal.mjs +7 -7
  98. package/{mapping-form-BymksK7h.d.mts → mapping-form-Bpvgf5b8.d.mts} +1 -1
  99. package/{mapping-form-Cmf8y-1m.d.cts → mapping-form-CV7y6qox.d.cts} +1 -1
  100. package/{mappings-config-Dsz6rcJb.d.cts → mappings-config-BBppW9fp.d.cts} +1 -1
  101. package/{mappings-config-DBG-KnYl.cjs → mappings-config-CNxBrbt9.cjs} +1 -1
  102. package/{mappings-config-C7FPwrJT.mjs → mappings-config-D_g20PyS.mjs} +1 -1
  103. package/{mappings-config-ktJhxmHm.d.mts → mappings-config-Dmm0H6p_.d.mts} +1 -1
  104. package/{namespace-probe-CTkb35Ro.d.cts → namespace-probe-BHk3NcyI.d.cts} +31 -2
  105. package/{namespace-probe-By8SCnym.d.mts → namespace-probe-Dt_HXcI-.d.mts} +31 -2
  106. package/package.json +1 -7
  107. package/{projection-DNi_2dVa.mjs → projection-BkYXvjTr.mjs} +2434 -1147
  108. package/{projection-B8RtxuEq.cjs → projection-By63gMC-.cjs} +2434 -1147
  109. package/{projection-sql-BYv40Hen.mjs → projection-sql-C3gZE3GS.mjs} +1 -1
  110. package/{projection-sql-SuhzhsMe.cjs → projection-sql-CHz7KzNS.cjs} +1 -1
  111. package/{schemas-DySv963y.d.cts → schemas-BSuo_eZQ.d.cts} +97 -35
  112. package/{schemas-DySv963y.d.mts → schemas-BSuo_eZQ.d.mts} +97 -35
  113. package/{sdk-BJ3OkhCq.cjs → sdk-BZSTXPyK.cjs} +161 -27
  114. package/{sdk-CXrarwvs.mjs → sdk-KzHpSf7F.mjs} +161 -27
  115. package/sdk.cjs +2 -2
  116. package/sdk.d.cts +4 -4
  117. package/sdk.d.mts +4 -4
  118. package/sdk.mjs +2 -2
  119. package/{sync-engine-D9ltfqkD.d.cts → sync-engine-C7W0Gkq0.d.cts} +2 -2
  120. package/{sync-engine-C_SwnFgF.d.mts → sync-engine-C9Q2FkR9.d.mts} +2 -2
  121. package/{sync-engine-BTUoH82k.mjs → sync-engine-CwdLkmch.mjs} +1 -1
  122. package/{sync-engine-DBlSP9r2.cjs → sync-engine-Di-vF26b.cjs} +1 -1
  123. package/{types-BtQCi_qP.d.cts → types-C9_2vW5a.d.mts} +1 -1
  124. package/{types-CTOl3pAX.d.mts → types-CQ2DgEH7.d.cts} +1 -1
  125. package/{view-compiler-B8tJ5IGw.mjs → view-compiler-CLTi1VL-.mjs} +2 -2
  126. package/{view-compiler-Ce_QE3dh.cjs → view-compiler-DaOz5QVl.cjs} +2 -2
  127. package/{view-compiler-BZgZisTG.d.mts → view-compiler-M23WiVGG.d.mts} +1 -1
  128. package/{view-compiler-D7GLf1n8.d.cts → view-compiler-cXqt4X-c.d.cts} +1 -1
  129. package/vite.d.cts +1 -1
  130. package/vite.d.mts +1 -1
package/sdk.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { C as customObjectDeclarations, M as validateEntitiesConfig, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult, w as defineClivlyConfig } from "./entity-config-pzamFSKw.mjs";
2
- import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-By8SCnym.mjs";
1
+ import { C as customObjectDeclarations, M as validateEntitiesConfig, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult, w as defineClivlyConfig } from "./entity-config-X-KlnYXX.mjs";
2
+ import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, b as ExposurePolicy, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-Dt_HXcI-.mjs";
3
3
  export declare function isPlaceholderUrl(value: string): boolean;
4
- export declare function createChatSessionHandler({ allowedOrigins, apiKey, apiUrl, fetchImpl, resolveUser }: CreateChatSessionHandlerOptions): (request: Request) => Promise<Response>;
4
+ export declare function createChatSessionHandler({ allowedOrigins, apiKey, apiUrl, fetchImpl, resolveUser, resolveVisitorIp }: CreateChatSessionHandlerOptions): (request: Request) => Promise<Response>;
5
5
  export declare class ClivlyError extends Error {
6
6
  /** HTTP status, or null when the request never completed (network error). */
7
7
  readonly status: number | null;
@@ -60,4 +60,4 @@ export declare function kvCursorStore(kv: CursorKV, options?: {
60
60
  * clearly-marked TODOs) and land with the Cloudflare infrastructure.
61
61
  */
62
62
  export declare function createClivlySDK(config: ClivlySDKConfig): ClivlySDK;
63
- export { type ChatSessionRequestBody, type ChatWidgetVisitor, type ClivlyConnectReason, type ClivlyConnectResult, type ClivlyEntitiesConfig, type ClivlySDK, type ClivlySDKConfig, type ClivlyUser, type ConfigValidationError, type ConfigValidationResult, type CreateChatSessionHandlerOptions, type CursorStore, type CustomObjectDeclaration, type DiscoveredSchemaTable, type DiscoveredTable, type DoctorCheck, type DoctorReport, type EnsureSchemaResult, type EnsuredMappingResult, type EnsuredObjectTypeResult, type RemoteProjectionsDescription, type SyncTriggerDescription, customObjectDeclarations, defineClivlyConfig, validateEntitiesConfig };
63
+ export { type ChatSessionRequestBody, type ChatWidgetVisitor, type ClivlyConnectReason, type ClivlyConnectResult, type ClivlyEntitiesConfig, type ClivlySDK, type ClivlySDKConfig, type ClivlyUser, type ConfigValidationError, type ConfigValidationResult, type CreateChatSessionHandlerOptions, type CursorStore, type CustomObjectDeclaration, type DiscoveredSchemaTable, type DiscoveredTable, type DoctorCheck, type DoctorReport, type EnsureSchemaResult, type EnsuredMappingResult, type EnsuredObjectTypeResult, type ExposurePolicy, type RemoteProjectionsDescription, type SyncTriggerDescription, customObjectDeclarations, defineClivlyConfig, validateEntitiesConfig };
package/sdk.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { c as defineClivlyConfig, g as validateEntitiesConfig, s as customObjectDeclarations } from "./entity-config-DQVSprlG.mjs";
2
- import { a as ClivlyAuthError, c as ClivlyRateLimitError, i as memoryCursorStore, l as createChatSessionHandler, n as createClivlySDK, o as ClivlyError, r as kvCursorStore, s as ClivlyNetworkError, t as CURSOR_KEY_PREFIX, u as isPlaceholderUrl } from "./sdk-CXrarwvs.mjs";
1
+ import { c as defineClivlyConfig, g as validateEntitiesConfig, s as customObjectDeclarations } from "./entity-config-g_oMPXlN.mjs";
2
+ import { a as ClivlyAuthError, c as ClivlyRateLimitError, i as memoryCursorStore, l as createChatSessionHandler, n as createClivlySDK, o as ClivlyError, r as kvCursorStore, s as ClivlyNetworkError, t as CURSOR_KEY_PREFIX, u as isPlaceholderUrl } from "./sdk-KzHpSf7F.mjs";
3
3
  export { CURSOR_KEY_PREFIX, ClivlyAuthError, ClivlyError, ClivlyNetworkError, ClivlyRateLimitError, createChatSessionHandler, createClivlySDK, customObjectDeclarations, defineClivlyConfig, isPlaceholderUrl, kvCursorStore, memoryCursorStore, validateEntitiesConfig };
@@ -1,5 +1,5 @@
1
- import { a as ClivlyEntitiesConfig } from "./entity-config-BF7pcXFB.cjs";
2
- import { n as CompiledView, t as CompileOptions } from "./view-compiler-D7GLf1n8.cjs";
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-dNclLyBM.cjs";
2
+ import { n as CompiledView, t as CompileOptions } from "./view-compiler-cXqt4X-c.cjs";
3
3
  /**
4
4
  * Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
5
5
  * own mirror tables (`crm_companies`, `crm_contacts`).
@@ -1,5 +1,5 @@
1
- import { a as ClivlyEntitiesConfig } from "./entity-config-pzamFSKw.mjs";
2
- import { n as CompiledView, t as CompileOptions } from "./view-compiler-BZgZisTG.mjs";
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-X-KlnYXX.mjs";
2
+ import { n as CompiledView, t as CompileOptions } from "./view-compiler-M23WiVGG.mjs";
3
3
  /**
4
4
  * Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
5
5
  * own mirror tables (`crm_companies`, `crm_contacts`).
@@ -1,4 +1,4 @@
1
- import { r as compileEntityViews } from "./view-compiler-B8tJ5IGw.mjs";
1
+ import { r as compileEntityViews } from "./view-compiler-CLTi1VL-.mjs";
2
2
  // ../core/src/sync-engine.ts
3
3
  /** Actions that remove something — only safe when the source set is complete. */
4
4
  function isRemovalAction(action) {
@@ -1,4 +1,4 @@
1
- const require_view_compiler = require("./view-compiler-Ce_QE3dh.cjs");
1
+ const require_view_compiler = require("./view-compiler-DaOz5QVl.cjs");
2
2
  // ../core/src/sync-engine.ts
3
3
  /** Actions that remove something — only safe when the source set is complete. */
4
4
  function isRemovalAction(action) {
@@ -1,4 +1,4 @@
1
- import { d as output, f as $strict, l as ZodString, o as ZodObject, r as ZodEnum, s as ZodOptional, t as ZodArray } from "./schemas-DySv963y.cjs";
1
+ import { d as output, f as $strict, l as ZodString, o as ZodObject, r as ZodEnum, s as ZodOptional, t as ZodArray } from "./schemas-BSuo_eZQ.mjs";
2
2
  /** AND conditions over deliberately mapped host fields, never SQL identifiers. */
3
3
  declare const contactSegmentSchema: ZodArray<ZodObject<{
4
4
  field: ZodString;
@@ -1,4 +1,4 @@
1
- import { d as output, f as $strict, l as ZodString, o as ZodObject, r as ZodEnum, s as ZodOptional, t as ZodArray } from "./schemas-DySv963y.mjs";
1
+ import { d as output, f as $strict, l as ZodString, o as ZodObject, r as ZodEnum, s as ZodOptional, t as ZodArray } from "./schemas-BSuo_eZQ.cjs";
2
2
  /** AND conditions over deliberately mapped host fields, never SQL identifiers. */
3
3
  declare const contactSegmentSchema: ZodArray<ZodObject<{
4
4
  field: ZodString;
@@ -1,5 +1,5 @@
1
- import { t as BASE_REF } from "./projection-DNi_2dVa.mjs";
2
- import { i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, s as quoteIdent } from "./projection-sql-BYv40Hen.mjs";
1
+ import { t as BASE_REF } from "./projection-BkYXvjTr.mjs";
2
+ import { i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, s as quoteIdent } from "./projection-sql-C3gZE3GS.mjs";
3
3
  // ../core/src/view-compiler.ts
4
4
  /**
5
5
  * View compiler (Phase 2) — turns a validated entity config into read-only
@@ -1,5 +1,5 @@
1
- const require_projection = require("./projection-B8RtxuEq.cjs");
2
- const require_projection_sql = require("./projection-sql-SuhzhsMe.cjs");
1
+ const require_projection = require("./projection-By63gMC-.cjs");
2
+ const require_projection_sql = require("./projection-sql-CHz7KzNS.cjs");
3
3
  // ../core/src/view-compiler.ts
4
4
  /**
5
5
  * View compiler (Phase 2) — turns a validated entity config into read-only
@@ -1,4 +1,4 @@
1
- import { a as ClivlyEntitiesConfig } from "./entity-config-pzamFSKw.mjs";
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-X-KlnYXX.mjs";
2
2
  declare const DEFAULT_VIEW_PREFIX = "crm_src_";
3
3
  interface CompileOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as ClivlyEntitiesConfig } from "./entity-config-BF7pcXFB.cjs";
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-dNclLyBM.cjs";
2
2
  declare const DEFAULT_VIEW_PREFIX = "crm_src_";
3
3
  interface CompileOptions {
4
4
  /**
package/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as ClivlySDK } from "./namespace-probe-CTkb35Ro.cjs";
1
+ import { o as ClivlySDK } from "./namespace-probe-BHk3NcyI.cjs";
2
2
  import { Plugin } from "vite";
3
3
  export interface ClivlyViteOptions {
4
4
  /** Log prefix for Clivly's boot lines. Defaults to "clivly". */
package/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as ClivlySDK } from "./namespace-probe-By8SCnym.mjs";
1
+ import { o as ClivlySDK } from "./namespace-probe-Dt_HXcI-.mjs";
2
2
  import { Plugin } from "vite";
3
3
  export interface ClivlyViteOptions {
4
4
  /** Log prefix for Clivly's boot lines. Defaults to "clivly". */