clivly 0.4.1 → 0.7.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 (164) hide show
  1. package/README.md +89 -10
  2. package/{adapter-CXr12l4K.d.cts → adapter-C2eRbBfo.d.cts} +1 -2
  3. package/{adapter-CvNBD_3y.d.mts → adapter-D5LRa-NA.d.mts} +1 -2
  4. package/{auth-adapter-CdLODn2p.d.cts → auth-adapter-Bjgo8LhN.d.mts} +1 -2
  5. package/{auth-adapter-CRBW4elj.d.mts → auth-adapter-DWzgl5Yq.d.cts} +1 -2
  6. package/auth-better-auth.d.cts +1 -2
  7. package/auth-better-auth.d.mts +1 -2
  8. package/auth-clerk.d.cts +1 -2
  9. package/auth-clerk.d.mts +1 -2
  10. package/auth-workos.d.cts +1 -2
  11. package/auth-workos.d.mts +1 -2
  12. package/core-adapter.cjs +5 -0
  13. package/core-adapter.d.cts +1 -1
  14. package/core-adapter.d.mts +1 -1
  15. package/core-adapter.mjs +5 -0
  16. package/core-auth-adapter.cjs +6 -1
  17. package/core-auth-adapter.d.cts +1 -1
  18. package/core-auth-adapter.d.mts +1 -1
  19. package/core-auth-adapter.mjs +6 -1
  20. package/core-drizzle.cjs +6 -30
  21. package/core-drizzle.d.cts +1 -20
  22. package/core-drizzle.d.mts +1 -20
  23. package/core-drizzle.mjs +5 -29
  24. package/core-entity-config.cjs +4 -1
  25. package/core-entity-config.d.cts +1 -1
  26. package/core-entity-config.d.mts +1 -1
  27. package/core-entity-config.mjs +5 -1
  28. package/core-entity-heuristics.cjs +14 -453
  29. package/core-entity-heuristics.d.cts +1 -67
  30. package/core-entity-heuristics.d.mts +1 -67
  31. package/core-entity-heuristics.mjs +4 -442
  32. package/core-mapping-form.cjs +6 -1
  33. package/core-mapping-form.d.cts +1 -1
  34. package/core-mapping-form.d.mts +1 -1
  35. package/core-mapping-form.mjs +6 -1
  36. package/core-mapping-score.cjs +4 -1
  37. package/core-mapping-score.d.cts +1 -1
  38. package/core-mapping-score.d.mts +1 -1
  39. package/core-mapping-score.mjs +5 -1
  40. package/core-mappings-config.cjs +6 -1
  41. package/core-mappings-config.d.cts +1 -1
  42. package/core-mappings-config.d.mts +1 -1
  43. package/core-mappings-config.mjs +6 -1
  44. package/core-sync-engine.cjs +6 -1
  45. package/core-sync-engine.d.cts +1 -1
  46. package/core-sync-engine.d.mts +1 -1
  47. package/core-sync-engine.mjs +6 -1
  48. package/core-types.cjs +5 -0
  49. package/core-types.d.cts +1 -1
  50. package/core-types.d.mts +1 -1
  51. package/core-types.mjs +5 -0
  52. package/core-view-compiler.cjs +6 -1
  53. package/core-view-compiler.d.cts +1 -1
  54. package/core-view-compiler.d.mts +1 -1
  55. package/core-view-compiler.mjs +6 -1
  56. package/core.cjs +11 -6
  57. package/core.d.cts +9 -9
  58. package/core.d.mts +9 -9
  59. package/core.mjs +11 -6
  60. package/deprecate-subpath-B9ngvizt.cjs +30 -0
  61. package/deprecate-subpath-CmvZtCpE.mjs +25 -0
  62. package/drizzle-B89tLo4T.mjs +31 -0
  63. package/drizzle-CFOr9dU9.d.mts +20 -0
  64. package/drizzle-DiReZf6d.cjs +36 -0
  65. package/drizzle-DmeKSqeF.d.cts +20 -0
  66. package/drizzle.cjs +3 -1
  67. package/drizzle.d.cts +11 -3
  68. package/drizzle.d.mts +11 -3
  69. package/drizzle.mjs +3 -2
  70. package/{entity-config-DMuZpchz.cjs → entity-config-D87rV-tE.cjs} +194 -192
  71. package/{entity-config-D1DFyeUp.d.mts → entity-config-DoUCXtq5.d.cts} +48 -35
  72. package/{entity-config-GczjD3y8.d.cts → entity-config-DoUCXtq5.d.mts} +48 -35
  73. package/{entity-config-D3YpQB0z.mjs → entity-config-va2bkH5o.mjs} +194 -192
  74. package/index.cjs +910 -234
  75. package/index.d.cts +30 -2
  76. package/index.d.mts +30 -2
  77. package/index.mjs +900 -226
  78. package/internal-adapter.cjs +0 -0
  79. package/internal-adapter.d.cts +2 -0
  80. package/internal-adapter.d.mts +2 -0
  81. package/internal-adapter.mjs +1 -0
  82. package/internal-auth-adapter.cjs +3 -0
  83. package/internal-auth-adapter.d.cts +2 -0
  84. package/internal-auth-adapter.d.mts +2 -0
  85. package/internal-auth-adapter.mjs +2 -0
  86. package/internal-drizzle.cjs +3 -0
  87. package/internal-drizzle.d.cts +2 -0
  88. package/internal-drizzle.d.mts +2 -0
  89. package/internal-drizzle.mjs +2 -0
  90. package/internal-entity-config.cjs +13 -0
  91. package/internal-entity-config.d.cts +2 -0
  92. package/internal-entity-config.d.mts +2 -0
  93. package/internal-entity-config.mjs +2 -0
  94. package/internal-entity-heuristics.cjs +455 -0
  95. package/internal-entity-heuristics.d.cts +67 -0
  96. package/internal-entity-heuristics.d.mts +67 -0
  97. package/internal-entity-heuristics.mjs +444 -0
  98. package/internal-mapping-form.cjs +5 -0
  99. package/internal-mapping-form.d.cts +2 -0
  100. package/internal-mapping-form.d.mts +2 -0
  101. package/internal-mapping-form.mjs +2 -0
  102. package/internal-mapping-score.cjs +12 -0
  103. package/internal-mapping-score.d.cts +2 -0
  104. package/internal-mapping-score.d.mts +2 -0
  105. package/internal-mapping-score.mjs +2 -0
  106. package/internal-mappings-config.cjs +3 -0
  107. package/internal-mappings-config.d.cts +2 -0
  108. package/internal-mappings-config.d.mts +2 -0
  109. package/internal-mappings-config.mjs +2 -0
  110. package/internal-sync-engine.cjs +6 -0
  111. package/internal-sync-engine.d.cts +2 -0
  112. package/internal-sync-engine.d.mts +2 -0
  113. package/internal-sync-engine.mjs +2 -0
  114. package/internal-types.cjs +0 -0
  115. package/internal-types.d.cts +2 -0
  116. package/internal-types.d.mts +2 -0
  117. package/internal-types.mjs +1 -0
  118. package/internal-view-compiler.cjs +6 -0
  119. package/internal-view-compiler.d.cts +2 -0
  120. package/internal-view-compiler.d.mts +2 -0
  121. package/internal-view-compiler.mjs +2 -0
  122. package/internal.cjs +28 -0
  123. package/internal.d.cts +9 -0
  124. package/internal.d.mts +9 -0
  125. package/internal.mjs +7 -0
  126. package/{mapping-form-CUlFVfG8.d.cts → mapping-form-D93lhHEc.d.mts} +1 -2
  127. package/{mapping-form-kjSiJaCX.d.mts → mapping-form-lfyEE7EJ.d.cts} +1 -2
  128. package/{mappings-config-DYZ_uOOB.cjs → mappings-config-BsRADNRv.cjs} +1 -1
  129. package/{mappings-config-CNTZRD4g.mjs → mappings-config-Dbgxx3Nv.mjs} +1 -1
  130. package/{mappings-config-DjRLCb2Q.d.cts → mappings-config-DsUa7-1w.d.mts} +1 -2
  131. package/{mappings-config-GxiYsSBQ.d.mts → mappings-config-XmzB4dag.d.cts} +1 -2
  132. package/package.json +152 -4
  133. package/{sdk-DdzBxgMx.mjs → sdk-C6WANW8M.mjs} +173 -34
  134. package/{sdk-D1BHQDf5.cjs → sdk-iqOXeWIp.cjs} +173 -34
  135. package/sdk.cjs +3 -1
  136. package/sdk.d.cts +1 -41
  137. package/sdk.d.mts +1 -41
  138. package/sdk.mjs +3 -2
  139. package/{sync-engine-DIVMG9EV.d.cts → sync-engine-B7QIbXro.d.cts} +6 -5
  140. package/{sync-engine-BtzkzKmY.cjs → sync-engine-CzEbpQGv.cjs} +1 -1
  141. package/{sync-engine-DLx243iw.d.mts → sync-engine-DGk_AeHJ.d.mts} +6 -5
  142. package/{sync-engine-D9vghQab.mjs → sync-engine-Do5ru3WF.mjs} +1 -1
  143. package/types-CsL0rFYh.d.cts +155 -0
  144. package/types-CsL0rFYh.d.mts +155 -0
  145. package/{view-compiler-4HsRUTWH.d.cts → view-compiler-BWz0sGdm.d.cts} +1 -2
  146. package/{view-compiler-BpIDExjd.d.mts → view-compiler-Bn_EJJMO.d.mts} +1 -2
  147. package/vite.d.cts +1 -2
  148. package/vite.d.mts +1 -2
  149. package/namespace-probe-CA4Vj40g.d.mts +0 -331
  150. package/namespace-probe-CkHCj9tQ.d.cts +0 -331
  151. /package/{auth-adapter-CBOKDhlc.cjs → auth-adapter-CiEXcweZ.cjs} +0 -0
  152. /package/{auth-adapter-wqnnEjo3.mjs → auth-adapter-gfVDxf3d.mjs} +0 -0
  153. /package/{drizzle-meta-BVR1qiyu.cjs → drizzle-meta-Bb1JWYqf.cjs} +0 -0
  154. /package/{drizzle-meta-DpMKataU.mjs → drizzle-meta-D-5k3n0i.mjs} +0 -0
  155. /package/{mapping-form-DdmDebC3.cjs → mapping-form-BpfON_ME.cjs} +0 -0
  156. /package/{mapping-form-BHtPexzI.mjs → mapping-form-DigkuvFc.mjs} +0 -0
  157. /package/{mapping-score-CPPvwoZC.mjs → mapping-score-C68uAqGB.mjs} +0 -0
  158. /package/{mapping-score-i3p8LWDF.cjs → mapping-score-CaB3F4Uu.cjs} +0 -0
  159. /package/{mapping-score-A2lRnlpk.d.mts → mapping-score-D7Gzg7Ii.d.cts} +0 -0
  160. /package/{mapping-score-BcjC0ZQs.d.cts → mapping-score-D7Gzg7Ii.d.mts} +0 -0
  161. /package/{types-BpsKVccL.d.cts → types-B1oRXdNP.d.cts} +0 -0
  162. /package/{types-_qbJXMt_.d.mts → types-B1oRXdNP.d.mts} +0 -0
  163. /package/{view-compiler-BcgJINr7.cjs → view-compiler-BIwvm-o2.cjs} +0 -0
  164. /package/{view-compiler-DeZzx_jn.mjs → view-compiler-ChWr_Lml.mjs} +0 -0
package/core.cjs CHANGED
@@ -1,10 +1,15 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_entity_config = require("./entity-config-DMuZpchz.cjs");
3
- const require_auth_adapter = require("./auth-adapter-CBOKDhlc.cjs");
4
- const require_mapping_form = require("./mapping-form-DdmDebC3.cjs");
5
- const require_mappings_config = require("./mappings-config-DYZ_uOOB.cjs");
6
- const require_view_compiler = require("./view-compiler-BcgJINr7.cjs");
7
- const require_sync_engine = require("./sync-engine-BtzkzKmY.cjs");
2
+ const require_entity_config = require("./entity-config-D87rV-tE.cjs");
3
+ const require_deprecate_subpath = require("./deprecate-subpath-B9ngvizt.cjs");
4
+ const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
5
+ const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
6
+ const require_mappings_config = require("./mappings-config-BsRADNRv.cjs");
7
+ const require_view_compiler = require("./view-compiler-BIwvm-o2.cjs");
8
+ const require_sync_engine = require("./sync-engine-CzEbpQGv.cjs");
9
+ require("./internal.cjs");
10
+ //#region src/core.ts
11
+ require_deprecate_subpath.warnDeprecatedSubpath("clivly/core", "clivly/sdk", "Import \"defineClivlyConfig\" and its config types from \"clivly/sdk\"; import everything else from \"clivly/internal\" (no stability guarantee — see STABILITY.md).");
12
+ //#endregion
8
13
  exports.CANONICAL_FIELDS = require_entity_config.CANONICAL_FIELDS;
9
14
  exports.CRM_CONCEPTS = require_entity_config.CRM_CONCEPTS;
10
15
  exports.ClivlyConfigError = require_entity_config.ClivlyConfigError;
package/core.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { C as UpdateDealInput, S as UpdateContactInput, _ as Task, a as ContactFilters, b as TaskPriority, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as RecordSource, h as Note, i as Contact, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as TaskEntityType, w as UpdateTaskInput, x as TaskStatus, y as TaskFilters } from "./types-BpsKVccL.cjs";
2
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CdLODn2p.cjs";
3
- import { t as CRMAdapter } from "./adapter-CXr12l4K.cjs";
4
- import { C as validateEntitiesConfig, S as relationshipsSchema, _ as RelationshipsMap, a as ClivlyEntitiesConfig, b as filterSchema, c as ConfigValidationResult, d as FilterExpr, f as FilterValue, g as RelationshipVia, h as RelationshipSpec, i as ClivlyConfigError, l as CrmConcept, m as MaterializingConcept, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as MATERIALIZING_CONCEPTS, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredSchemaTable, v as defineClivlyConfig, x as relationshipSchema, y as entitiesConfigSchema } from "./entity-config-GczjD3y8.cjs";
5
- import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-CUlFVfG8.cjs";
6
- import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-DjRLCb2Q.cjs";
7
- import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-4HsRUTWH.cjs";
8
- import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine-DIVMG9EV.cjs";
9
- export { Activity, ActivityType, CANONICAL_FIELDS, CRMAdapter, CRM_CONCEPTS, ClivlyAuthAdapter, ClivlyConfigError, ClivlyEntitiesConfig, ClivlyEntityConfig, ClivlyUser, Company, CompileOptions, CompiledView, ConfigValidationError, ConfigValidationResult, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmConcept, CrmMembership, CrmRole, DEFAULT_VIEW_PREFIX, Deal, DealStage, DiscoveredSchemaTable, EntityMappingRow, EntitySyncResult, ExplainResult, FilterExpr, FilterValue, MATERIALIZING_CONCEPTS, MaterializingConcept, MembershipResolver, MirrorRecord, Note, PersistAction, RecordSource, RelationshipCandidate, RelationshipSpec, RelationshipVia, RelationshipsMap, SourceRow, SyncAction, SyncResult, SyncStore, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateContactInput, UpdateDealInput, UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
1
+ import { C as UpdateDealInput, S as UpdateContactInput, _ as Task, a as ContactFilters, b as TaskPriority, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as RecordSource, h as Note, i as Contact, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as TaskEntityType, w as UpdateTaskInput, x as TaskStatus, y as TaskFilters } from "./types-B1oRXdNP.cjs";
2
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-DWzgl5Yq.cjs";
3
+ import { t as CRMAdapter } from "./adapter-C2eRbBfo.cjs";
4
+ import { C as validateEntitiesConfig, S as relationshipsSchema, _ as RelationshipsMap, a as ClivlyEntitiesConfig, b as filterSchema, c as ConfigValidationResult, d as FilterExpr, f as FilterValue, g as RelationshipVia, h as RelationshipSpec, i as ClivlyConfigError, l as CrmConcept, m as MaterializingConcept, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as MATERIALIZING_CONCEPTS, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredSchemaTable, v as defineClivlyConfig, x as relationshipSchema, y as entitiesConfigSchema } from "./entity-config-DoUCXtq5.cjs";
5
+ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-lfyEE7EJ.cjs";
6
+ import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-XmzB4dag.cjs";
7
+ import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-BWz0sGdm.cjs";
8
+ import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine-B7QIbXro.cjs";
9
+ export { type Activity, type ActivityType, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type Note, type PersistAction, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
package/core.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { C as UpdateDealInput, S as UpdateContactInput, _ as Task, a as ContactFilters, b as TaskPriority, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as RecordSource, h as Note, i as Contact, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as TaskEntityType, w as UpdateTaskInput, x as TaskStatus, y as TaskFilters } from "./types-_qbJXMt_.mjs";
2
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CRBW4elj.mjs";
3
- import { t as CRMAdapter } from "./adapter-CvNBD_3y.mjs";
4
- import { C as validateEntitiesConfig, S as relationshipsSchema, _ as RelationshipsMap, a as ClivlyEntitiesConfig, b as filterSchema, c as ConfigValidationResult, d as FilterExpr, f as FilterValue, g as RelationshipVia, h as RelationshipSpec, i as ClivlyConfigError, l as CrmConcept, m as MaterializingConcept, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as MATERIALIZING_CONCEPTS, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredSchemaTable, v as defineClivlyConfig, x as relationshipSchema, y as entitiesConfigSchema } from "./entity-config-D1DFyeUp.mjs";
5
- import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-kjSiJaCX.mjs";
6
- import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-GxiYsSBQ.mjs";
7
- import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-BpIDExjd.mjs";
8
- import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine-DLx243iw.mjs";
9
- export { Activity, ActivityType, CANONICAL_FIELDS, CRMAdapter, CRM_CONCEPTS, ClivlyAuthAdapter, ClivlyConfigError, ClivlyEntitiesConfig, ClivlyEntityConfig, ClivlyUser, Company, CompileOptions, CompiledView, ConfigValidationError, ConfigValidationResult, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmConcept, CrmMembership, CrmRole, DEFAULT_VIEW_PREFIX, Deal, DealStage, DiscoveredSchemaTable, EntityMappingRow, EntitySyncResult, ExplainResult, FilterExpr, FilterValue, MATERIALIZING_CONCEPTS, MaterializingConcept, MembershipResolver, MirrorRecord, Note, PersistAction, RecordSource, RelationshipCandidate, RelationshipSpec, RelationshipVia, RelationshipsMap, SourceRow, SyncAction, SyncResult, SyncStore, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateContactInput, UpdateDealInput, UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
1
+ import { C as UpdateDealInput, S as UpdateContactInput, _ as Task, a as ContactFilters, b as TaskPriority, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as RecordSource, h as Note, i as Contact, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as TaskEntityType, w as UpdateTaskInput, x as TaskStatus, y as TaskFilters } from "./types-B1oRXdNP.mjs";
2
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bjgo8LhN.mjs";
3
+ import { t as CRMAdapter } from "./adapter-D5LRa-NA.mjs";
4
+ import { C as validateEntitiesConfig, S as relationshipsSchema, _ as RelationshipsMap, a as ClivlyEntitiesConfig, b as filterSchema, c as ConfigValidationResult, d as FilterExpr, f as FilterValue, g as RelationshipVia, h as RelationshipSpec, i as ClivlyConfigError, l as CrmConcept, m as MaterializingConcept, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as MATERIALIZING_CONCEPTS, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredSchemaTable, v as defineClivlyConfig, x as relationshipSchema, y as entitiesConfigSchema } from "./entity-config-DoUCXtq5.mjs";
5
+ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-D93lhHEc.mjs";
6
+ import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-DsUa7-1w.mjs";
7
+ import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-Bn_EJJMO.mjs";
8
+ import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine-DGk_AeHJ.mjs";
9
+ export { type Activity, type ActivityType, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type Note, type PersistAction, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
package/core.mjs CHANGED
@@ -1,7 +1,12 @@
1
- import { a as MATERIALIZING_CONCEPTS, c as filterSchema, d as validateEntitiesConfig, i as ClivlyConfigError, l as relationshipSchema, n as CRM_CONCEPTS, o as defineClivlyConfig, s as entitiesConfigSchema, t as CANONICAL_FIELDS, u as relationshipsSchema } from "./entity-config-D3YpQB0z.mjs";
2
- import { t as authCustom } from "./auth-adapter-wqnnEjo3.mjs";
3
- import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-BHtPexzI.mjs";
4
- import { t as mappingsToEntitiesConfig } from "./mappings-config-CNTZRD4g.mjs";
5
- import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-DeZzx_jn.mjs";
6
- import { i as runSync, r as reconcile } from "./sync-engine-D9vghQab.mjs";
1
+ import { a as MATERIALIZING_CONCEPTS, c as filterSchema, d as validateEntitiesConfig, i as ClivlyConfigError, l as relationshipSchema, n as CRM_CONCEPTS, o as defineClivlyConfig, s as entitiesConfigSchema, t as CANONICAL_FIELDS, u as relationshipsSchema } from "./entity-config-va2bkH5o.mjs";
2
+ import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
3
+ import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
4
+ import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
5
+ import { t as mappingsToEntitiesConfig } from "./mappings-config-Dbgxx3Nv.mjs";
6
+ import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-ChWr_Lml.mjs";
7
+ import { i as runSync, r as reconcile } from "./sync-engine-Do5ru3WF.mjs";
8
+ import "./internal.mjs";
9
+ //#region src/core.ts
10
+ warnDeprecatedSubpath("clivly/core", "clivly/sdk", "Import \"defineClivlyConfig\" and its config types from \"clivly/sdk\"; import everything else from \"clivly/internal\" (no stability guarantee — see STABILITY.md).");
11
+ //#endregion
7
12
  export { CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
@@ -0,0 +1,30 @@
1
+ //#region src/deprecate-subpath.ts
2
+ const warned = /* @__PURE__ */ new Set();
3
+ /**
4
+ * Warn once per process that a deprecated subpath was imported.
5
+ *
6
+ * `process.emitWarning` rather than `console.warn`: it is suppressible with
7
+ * `--no-deprecation`, honours `--throw-deprecation` in CI, and stays off stdout,
8
+ * so it cannot corrupt a CLI that pipes machine-readable output.
9
+ *
10
+ * Once per specifier, because a warning that repeats per import site trains
11
+ * people to filter it out.
12
+ *
13
+ * `newSpecifier` doubles as the default replacement clause ("Import X
14
+ * instead."). Pass `replacementClause` to override it when a single target
15
+ * can't describe the migration — e.g. bare `clivly/core`, whose ~39 exports
16
+ * split across two destinations depending on which one you used.
17
+ */
18
+ function warnDeprecatedSubpath(oldSpecifier, newSpecifier, replacementClause) {
19
+ if (warned.has(oldSpecifier)) return;
20
+ warned.add(oldSpecifier);
21
+ const clause = replacementClause ?? `Import "${newSpecifier}" instead.`;
22
+ process.emitWarning(`"${oldSpecifier}" is deprecated and will be removed in a future release. ${clause}`, "DeprecationWarning");
23
+ }
24
+ //#endregion
25
+ Object.defineProperty(exports, "warnDeprecatedSubpath", {
26
+ enumerable: true,
27
+ get: function() {
28
+ return warnDeprecatedSubpath;
29
+ }
30
+ });
@@ -0,0 +1,25 @@
1
+ //#region src/deprecate-subpath.ts
2
+ const warned = /* @__PURE__ */ new Set();
3
+ /**
4
+ * Warn once per process that a deprecated subpath was imported.
5
+ *
6
+ * `process.emitWarning` rather than `console.warn`: it is suppressible with
7
+ * `--no-deprecation`, honours `--throw-deprecation` in CI, and stays off stdout,
8
+ * so it cannot corrupt a CLI that pipes machine-readable output.
9
+ *
10
+ * Once per specifier, because a warning that repeats per import site trains
11
+ * people to filter it out.
12
+ *
13
+ * `newSpecifier` doubles as the default replacement clause ("Import X
14
+ * instead."). Pass `replacementClause` to override it when a single target
15
+ * can't describe the migration — e.g. bare `clivly/core`, whose ~39 exports
16
+ * split across two destinations depending on which one you used.
17
+ */
18
+ function warnDeprecatedSubpath(oldSpecifier, newSpecifier, replacementClause) {
19
+ if (warned.has(oldSpecifier)) return;
20
+ warned.add(oldSpecifier);
21
+ const clause = replacementClause ?? `Import "${newSpecifier}" instead.`;
22
+ process.emitWarning(`"${oldSpecifier}" is deprecated and will be removed in a future release. ${clause}`, "DeprecationWarning");
23
+ }
24
+ //#endregion
25
+ export { warnDeprecatedSubpath as t };
@@ -0,0 +1,31 @@
1
+ import { Table, getTableColumns, getTableName, is } from "drizzle-orm";
2
+ //#region ../core/src/drizzle.ts
3
+ /**
4
+ * Derive Clivly's discovery shape (table + column names) from a Drizzle schema
5
+ * object — the `* as schema` you pass to `drizzle(client, { schema })`. This
6
+ * delivers the "reads your schema" promise for Drizzle hosts: no hand-authored
7
+ * `DiscoveredTable[]`. Feed the result to the SDK's `schema` option, or diff it
8
+ * against your entity config.
9
+ *
10
+ * Column names are the real database column names (e.g. `full_name`), not the
11
+ * Drizzle property keys (`fullName`). Non-table values in the schema object
12
+ * (relations, enums, helpers) are ignored.
13
+ *
14
+ * `drizzle-orm` is an **optional peer dependency** — you only need it installed
15
+ * when you import this entry (`@clivly/core/drizzle`); the rest of `@clivly/core`
16
+ * stays dependency-free.
17
+ */
18
+ function discoverFromDrizzle(schema) {
19
+ const tables = [];
20
+ for (const value of Object.values(schema)) {
21
+ if (!is(value, Table)) continue;
22
+ const columns = getTableColumns(value);
23
+ tables.push({
24
+ name: getTableName(value),
25
+ columns: Object.values(columns).map((column) => column.name)
26
+ });
27
+ }
28
+ return tables;
29
+ }
30
+ //#endregion
31
+ export { discoverFromDrizzle as t };
@@ -0,0 +1,20 @@
1
+ import { u as DiscoveredSchemaTable } from "./entity-config-DoUCXtq5.mjs";
2
+ //#region ../core/src/drizzle.d.ts
3
+ /**
4
+ * Derive Clivly's discovery shape (table + column names) from a Drizzle schema
5
+ * object — the `* as schema` you pass to `drizzle(client, { schema })`. This
6
+ * delivers the "reads your schema" promise for Drizzle hosts: no hand-authored
7
+ * `DiscoveredTable[]`. Feed the result to the SDK's `schema` option, or diff it
8
+ * against your entity config.
9
+ *
10
+ * Column names are the real database column names (e.g. `full_name`), not the
11
+ * Drizzle property keys (`fullName`). Non-table values in the schema object
12
+ * (relations, enums, helpers) are ignored.
13
+ *
14
+ * `drizzle-orm` is an **optional peer dependency** — you only need it installed
15
+ * when you import this entry (`@clivly/core/drizzle`); the rest of `@clivly/core`
16
+ * stays dependency-free.
17
+ */
18
+ declare function discoverFromDrizzle(schema: Record<string, unknown>): DiscoveredSchemaTable[];
19
+ //#endregion
20
+ export { discoverFromDrizzle as t };
@@ -0,0 +1,36 @@
1
+ let drizzle_orm = require("drizzle-orm");
2
+ //#region ../core/src/drizzle.ts
3
+ /**
4
+ * Derive Clivly's discovery shape (table + column names) from a Drizzle schema
5
+ * object — the `* as schema` you pass to `drizzle(client, { schema })`. This
6
+ * delivers the "reads your schema" promise for Drizzle hosts: no hand-authored
7
+ * `DiscoveredTable[]`. Feed the result to the SDK's `schema` option, or diff it
8
+ * against your entity config.
9
+ *
10
+ * Column names are the real database column names (e.g. `full_name`), not the
11
+ * Drizzle property keys (`fullName`). Non-table values in the schema object
12
+ * (relations, enums, helpers) are ignored.
13
+ *
14
+ * `drizzle-orm` is an **optional peer dependency** — you only need it installed
15
+ * when you import this entry (`@clivly/core/drizzle`); the rest of `@clivly/core`
16
+ * stays dependency-free.
17
+ */
18
+ function discoverFromDrizzle(schema) {
19
+ const tables = [];
20
+ for (const value of Object.values(schema)) {
21
+ if (!(0, drizzle_orm.is)(value, drizzle_orm.Table)) continue;
22
+ const columns = (0, drizzle_orm.getTableColumns)(value);
23
+ tables.push({
24
+ name: (0, drizzle_orm.getTableName)(value),
25
+ columns: Object.values(columns).map((column) => column.name)
26
+ });
27
+ }
28
+ return tables;
29
+ }
30
+ //#endregion
31
+ Object.defineProperty(exports, "discoverFromDrizzle", {
32
+ enumerable: true,
33
+ get: function() {
34
+ return discoverFromDrizzle;
35
+ }
36
+ });
@@ -0,0 +1,20 @@
1
+ import { u as DiscoveredSchemaTable } from "./entity-config-DoUCXtq5.cjs";
2
+ //#region ../core/src/drizzle.d.ts
3
+ /**
4
+ * Derive Clivly's discovery shape (table + column names) from a Drizzle schema
5
+ * object — the `* as schema` you pass to `drizzle(client, { schema })`. This
6
+ * delivers the "reads your schema" promise for Drizzle hosts: no hand-authored
7
+ * `DiscoveredTable[]`. Feed the result to the SDK's `schema` option, or diff it
8
+ * against your entity config.
9
+ *
10
+ * Column names are the real database column names (e.g. `full_name`), not the
11
+ * Drizzle property keys (`fullName`). Non-table values in the schema object
12
+ * (relations, enums, helpers) are ignored.
13
+ *
14
+ * `drizzle-orm` is an **optional peer dependency** — you only need it installed
15
+ * when you import this entry (`@clivly/core/drizzle`); the rest of `@clivly/core`
16
+ * stays dependency-free.
17
+ */
18
+ declare function discoverFromDrizzle(schema: Record<string, unknown>): DiscoveredSchemaTable[];
19
+ //#endregion
20
+ export { discoverFromDrizzle as t };
package/drizzle.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_drizzle_meta = require("./drizzle-meta-BVR1qiyu.cjs");
2
+ const require_drizzle_meta = require("./drizzle-meta-Bb1JWYqf.cjs");
3
+ const require_drizzle = require("./drizzle-DiReZf6d.cjs");
3
4
  let drizzle_orm = require("drizzle-orm");
4
5
  let drizzle_orm_pg_core = require("drizzle-orm/pg-core");
5
6
  //#region ../sdk/src/drizzle.ts
@@ -103,5 +104,6 @@ function drizzleIntrospector(db) {
103
104
  };
104
105
  }
105
106
  //#endregion
107
+ exports.discoverFromDrizzle = require_drizzle.discoverFromDrizzle;
106
108
  exports.drizzleIntrospector = drizzleIntrospector;
107
109
  exports.fromDrizzle = fromDrizzle;
package/drizzle.d.cts CHANGED
@@ -1,6 +1,14 @@
1
- import { m as SyncSource, t as NamespaceIntrospector } from "./namespace-probe-CkHCj9tQ.cjs";
1
+ import { t as discoverFromDrizzle } from "./drizzle-DmeKSqeF.cjs";
2
+ import { n as SyncSource } from "./types-CsL0rFYh.cjs";
2
3
  import { Table } from "drizzle-orm";
3
-
4
+ //#region ../sdk/src/namespace-probe.d.ts
5
+ interface NamespaceIntrospector {
6
+ /** All base table names in the reachable schema. */
7
+ listTables(): Promise<string[]>;
8
+ /** Prove a table is genuinely selectable (SELECT ... LIMIT 1). Throws if unreachable/denied. */
9
+ sampleSelect(table: string): Promise<void>;
10
+ }
11
+ //#endregion
4
12
  //#region ../sdk/src/drizzle.d.ts
5
13
  interface DrizzleDb {
6
14
  select: (...args: any[]) => any;
@@ -25,4 +33,4 @@ declare function fromDrizzle(db: DrizzleDb, table: Table, opts: {
25
33
  */
26
34
  declare function drizzleIntrospector(db: unknown): NamespaceIntrospector;
27
35
  //#endregion
28
- export { drizzleIntrospector, fromDrizzle };
36
+ export { discoverFromDrizzle, drizzleIntrospector, fromDrizzle };
package/drizzle.d.mts CHANGED
@@ -1,6 +1,14 @@
1
- import { m as SyncSource, t as NamespaceIntrospector } from "./namespace-probe-CA4Vj40g.mjs";
1
+ import { t as discoverFromDrizzle } from "./drizzle-CFOr9dU9.mjs";
2
+ import { n as SyncSource } from "./types-CsL0rFYh.mjs";
2
3
  import { Table } from "drizzle-orm";
3
-
4
+ //#region ../sdk/src/namespace-probe.d.ts
5
+ interface NamespaceIntrospector {
6
+ /** All base table names in the reachable schema. */
7
+ listTables(): Promise<string[]>;
8
+ /** Prove a table is genuinely selectable (SELECT ... LIMIT 1). Throws if unreachable/denied. */
9
+ sampleSelect(table: string): Promise<void>;
10
+ }
11
+ //#endregion
4
12
  //#region ../sdk/src/drizzle.d.ts
5
13
  interface DrizzleDb {
6
14
  select: (...args: any[]) => any;
@@ -25,4 +33,4 @@ declare function fromDrizzle(db: DrizzleDb, table: Table, opts: {
25
33
  */
26
34
  declare function drizzleIntrospector(db: unknown): NamespaceIntrospector;
27
35
  //#endregion
28
- export { drizzleIntrospector, fromDrizzle };
36
+ export { discoverFromDrizzle, drizzleIntrospector, fromDrizzle };
package/drizzle.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import { t as DRIZZLE_META } from "./drizzle-meta-DpMKataU.mjs";
1
+ import { t as DRIZZLE_META } from "./drizzle-meta-D-5k3n0i.mjs";
2
+ import { t as discoverFromDrizzle } from "./drizzle-B89tLo4T.mjs";
2
3
  import { asc, getTableColumns, getTableName, sql } from "drizzle-orm";
3
4
  import { getTableConfig } from "drizzle-orm/pg-core";
4
5
  //#region ../sdk/src/drizzle.ts
@@ -102,4 +103,4 @@ function drizzleIntrospector(db) {
102
103
  };
103
104
  }
104
105
  //#endregion
105
- export { drizzleIntrospector, fromDrizzle };
106
+ export { discoverFromDrizzle, drizzleIntrospector, fromDrizzle };