clivly 0.20.0 → 0.21.0

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 (135) hide show
  1. package/{adapter-BXykDFyG.d.mts → adapter-B4v4dwgD.d.mts} +1 -1
  2. package/{adapter-BiUN_I3u.d.cts → adapter-BK3gsby5.d.cts} +1 -1
  3. package/{auth-adapter-BNvri2gX.d.mts → auth-adapter-BIa-ZyVV.d.mts} +1 -1
  4. package/{auth-adapter-D2MUT1Hk.d.cts → auth-adapter-DwtMJb7D.d.cts} +1 -1
  5. package/auth-better-auth.d.cts +1 -1
  6. package/auth-better-auth.d.mts +1 -1
  7. package/auth-clerk.d.cts +1 -1
  8. package/auth-clerk.d.mts +1 -1
  9. package/auth-workos.d.cts +1 -1
  10. package/auth-workos.d.mts +1 -1
  11. package/core-adapter.d.cts +2 -1
  12. package/core-adapter.d.mts +2 -1
  13. package/core-auth-adapter.d.cts +2 -1
  14. package/core-auth-adapter.d.mts +2 -1
  15. package/core-drizzle.d.cts +1 -1
  16. package/core-drizzle.d.mts +1 -1
  17. package/core-entity-config.cjs +1 -1
  18. package/core-entity-config.d.cts +2 -1
  19. package/core-entity-config.d.mts +2 -1
  20. package/core-entity-config.mjs +1 -1
  21. package/core-entity-heuristics.cjs +1 -1
  22. package/core-entity-heuristics.d.cts +1 -1
  23. package/core-entity-heuristics.d.mts +1 -1
  24. package/core-entity-heuristics.mjs +1 -1
  25. package/core-mapping-form.d.cts +2 -1
  26. package/core-mapping-form.d.mts +2 -1
  27. package/core-mappings-config.cjs +1 -1
  28. package/core-mappings-config.d.cts +2 -1
  29. package/core-mappings-config.d.mts +2 -1
  30. package/core-mappings-config.mjs +1 -1
  31. package/core-sync-engine.cjs +1 -1
  32. package/core-sync-engine.d.cts +2 -1
  33. package/core-sync-engine.d.mts +2 -1
  34. package/core-sync-engine.mjs +1 -1
  35. package/core-types.d.cts +2 -1
  36. package/core-types.d.mts +2 -1
  37. package/core-view-compiler.cjs +1 -1
  38. package/core-view-compiler.d.cts +2 -1
  39. package/core-view-compiler.d.mts +2 -1
  40. package/core-view-compiler.mjs +1 -1
  41. package/core.cjs +7 -7
  42. package/core.d.cts +10 -10
  43. package/core.d.mts +10 -10
  44. package/core.mjs +7 -7
  45. package/{drizzle-B9cjBavj.d.cts → drizzle-BNHGQXiY.d.cts} +1 -1
  46. package/{drizzle-L5FOGe_-.d.mts → drizzle-DFe7ILmd.d.mts} +1 -1
  47. package/drizzle.cjs +2 -2
  48. package/drizzle.d.cts +4 -3
  49. package/drizzle.d.mts +4 -3
  50. package/drizzle.mjs +2 -2
  51. package/{entity-config-DiCJ6mhI.cjs → entity-config-BP8Cc_nC.cjs} +54 -53
  52. package/{entity-config-g_oMPXlN.mjs → entity-config-CI5CGfaN.mjs} +54 -53
  53. package/{entity-config-X-KlnYXX.d.mts → entity-config-CXpGowQa.d.cts} +339 -339
  54. package/{entity-config-dNclLyBM.d.cts → entity-config-CXpGowQa.d.mts} +339 -339
  55. package/{entity-heuristics-DE5ujoHw.mjs → entity-heuristics-DAxqagJA.mjs} +1 -1
  56. package/{entity-heuristics-CIParuQe.cjs → entity-heuristics-DNmrcd0b.cjs} +1 -1
  57. package/index-Bh7o2J7K.d.mts +308 -0
  58. package/index-DRRTE5IJ.d.cts +308 -0
  59. package/index.cjs +3 -3
  60. package/index.mjs +3 -3
  61. package/{internal-COALpgov.d.cts → internal-C8TGcv_X.d.mts} +2 -131
  62. package/{internal-9oDwwbNg.mjs → internal-DWpLw0t5.mjs} +5 -5
  63. package/{internal-BKYt5j0l.cjs → internal-G5tXjqwl.cjs} +5 -5
  64. package/{internal-D3q4FPcA.d.mts → internal-Nrhf76Jn.d.cts} +2 -131
  65. package/internal-adapter.d.cts +1 -1
  66. package/internal-adapter.d.mts +1 -1
  67. package/internal-auth-adapter.d.cts +1 -1
  68. package/internal-auth-adapter.d.mts +1 -1
  69. package/internal-drizzle.d.cts +1 -1
  70. package/internal-drizzle.d.mts +1 -1
  71. package/internal-entity-config.cjs +1 -1
  72. package/internal-entity-config.d.cts +1 -1
  73. package/internal-entity-config.d.mts +1 -1
  74. package/internal-entity-config.mjs +1 -1
  75. package/internal-entity-heuristics.cjs +1 -1
  76. package/internal-entity-heuristics.d.cts +1 -1
  77. package/internal-entity-heuristics.d.mts +1 -1
  78. package/internal-entity-heuristics.mjs +1 -1
  79. package/internal-mapping-form.d.cts +1 -1
  80. package/internal-mapping-form.d.mts +1 -1
  81. package/internal-mappings-config.cjs +1 -1
  82. package/internal-mappings-config.d.cts +1 -1
  83. package/internal-mappings-config.d.mts +1 -1
  84. package/internal-mappings-config.mjs +1 -1
  85. package/internal-sync-engine.cjs +1 -1
  86. package/internal-sync-engine.d.cts +1 -1
  87. package/internal-sync-engine.d.mts +1 -1
  88. package/internal-sync-engine.mjs +1 -1
  89. package/internal-types.d.cts +1 -1
  90. package/internal-types.d.mts +1 -1
  91. package/internal-view-compiler.cjs +1 -1
  92. package/internal-view-compiler.d.cts +1 -1
  93. package/internal-view-compiler.d.mts +1 -1
  94. package/internal-view-compiler.mjs +1 -1
  95. package/internal.cjs +7 -7
  96. package/internal.d.cts +10 -10
  97. package/internal.d.mts +10 -10
  98. package/internal.mjs +7 -7
  99. package/{mapping-form-Bpvgf5b8.d.mts → mapping-form-Bg_hgNoL.d.cts} +1 -1
  100. package/{mapping-form-CV7y6qox.d.cts → mapping-form-KHUlnC7A.d.mts} +1 -1
  101. package/{mappings-config-CNxBrbt9.cjs → mappings-config-CC-vltWb.cjs} +1 -1
  102. package/{mappings-config-BBppW9fp.d.cts → mappings-config-DNo_Cum_.d.cts} +1 -1
  103. package/{mappings-config-D_g20PyS.mjs → mappings-config-Opw7ZM6Y.mjs} +1 -1
  104. package/{mappings-config-Dmm0H6p_.d.mts → mappings-config-wAe-p1rG.d.mts} +1 -1
  105. package/{namespace-probe-C1tm5rGh.d.cts → namespace-probe-Dh6LFwfo.d.cts} +9 -2
  106. package/{namespace-probe-ah2awcHO.d.mts → namespace-probe-xESu83KG.d.mts} +9 -2
  107. package/package.json +6 -4
  108. package/projection-CzBI2NL8.mjs +95 -0
  109. package/{projection-sql-CHz7KzNS.cjs → projection-sql-BkrHR2ea.cjs} +1 -1
  110. package/{projection-sql-C3gZE3GS.mjs → projection-sql-DQQdjw9I.mjs} +1 -1
  111. package/projection-w4Z6vSL2.cjs +118 -0
  112. package/{sdk-ChyrSl32.mjs → sdk-DfdHv-S9.mjs} +154 -13
  113. package/{sdk-BEHVvB18.cjs → sdk-oUjl5HNU.cjs} +154 -13
  114. package/sdk.cjs +2 -2
  115. package/sdk.d.cts +2 -2
  116. package/sdk.d.mts +2 -2
  117. package/sdk.mjs +2 -2
  118. package/{sync-engine-C7W0Gkq0.d.cts → sync-engine-DCjTr2XQ.d.cts} +2 -2
  119. package/{sync-engine-Di-vF26b.cjs → sync-engine-DNSoZeo0.cjs} +1 -1
  120. package/{sync-engine-C9Q2FkR9.d.mts → sync-engine-UNORma7f.d.mts} +2 -2
  121. package/{sync-engine-CwdLkmch.mjs → sync-engine-yFLEyId3.mjs} +1 -1
  122. package/{types-C08UluBS.d.cts → types-BBfwsDxe.d.cts} +13 -7
  123. package/{types-CZsSYbeC.d.mts → types-BBfwsDxe.d.mts} +13 -7
  124. package/{view-compiler-M23WiVGG.d.mts → view-compiler-BDD93Luw.d.cts} +1 -1
  125. package/{view-compiler-CLTi1VL-.mjs → view-compiler-CSHSqZl7.mjs} +2 -2
  126. package/{view-compiler-cXqt4X-c.d.cts → view-compiler-CSNhmCY2.d.mts} +1 -1
  127. package/{view-compiler-DaOz5QVl.cjs → view-compiler-NqiortOA.cjs} +2 -2
  128. package/vite.d.cts +1 -1
  129. package/vite.d.mts +1 -1
  130. package/integration-state-xK4PLm5T.d.cts +0 -171
  131. package/integration-state-xK4PLm5T.d.mts +0 -171
  132. package/projection-BkYXvjTr.mjs +0 -5587
  133. package/projection-By63gMC-.cjs +0 -5670
  134. package/schemas-BSuo_eZQ.d.cts +0 -2160
  135. package/schemas-BSuo_eZQ.d.mts +0 -2160
package/internal.d.mts CHANGED
@@ -1,11 +1,11 @@
1
- import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, L as ContactSegment, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, R as contactSegmentSchema, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-CZsSYbeC.mjs";
2
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-BNvri2gX.mjs";
3
- import { t as CRMAdapter } from "./adapter-BXykDFyG.mjs";
4
- import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-X-KlnYXX.mjs";
5
- import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Bpvgf5b8.mjs";
6
- import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-Dmm0H6p_.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-M23WiVGG.mjs";
8
- import { c as SyncAction, f as isRemovalAction, g as runSync, h as resolveActions, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-C9Q2FkR9.mjs";
9
- import { A as PerSeatValueSource, C as HostOwnedCompanyField, D as isHostOwned, E as hostOwnedFieldMessage, O as rejectedCompanyFields, S as joinFansOut, T as SourcedRecord, _ as compileProjectionJoins, a as matchesCondition, b as quoteIdent, c as columnMetaFor, d as primaryKeyColumns, f as validateProjection, g as compileProjectionIdentity, h as compileProjectionFrom, i as evaluateStage, j as computeDealValue, k as rejectedContactFields, l as coversUniqueKey, m as PREVIEW_MAX_ROWS, n as ConditionOp, o as slugify, p as validateProjectionFilter, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as hasRichMeta, v as compileProjectionPreview, w as HostOwnedContactField, x as fanOutJoins, y as compileProjectionSelect } from "./internal-D3q4FPcA.mjs";
10
- import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-xK4PLm5T.mjs";
1
+ import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, L as ContactSegment, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, R as contactSegmentSchema, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-BBfwsDxe.mjs";
2
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-BIa-ZyVV.mjs";
3
+ import { t as CRMAdapter } from "./adapter-B4v4dwgD.mjs";
4
+ import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-CXpGowQa.mjs";
5
+ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-KHUlnC7A.mjs";
6
+ import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-wAe-p1rG.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-CSNhmCY2.mjs";
8
+ import { c as SyncAction, f as isRemovalAction, g as runSync, h as resolveActions, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-UNORma7f.mjs";
9
+ import { a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as computeDealValue, h as PerSeatValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord } from "./internal-C8TGcv_X.mjs";
10
+ import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-Bh7o2J7K.mjs";
11
11
  export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, 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 DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
package/internal.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs, t as BASE_REF } from "./projection-BkYXvjTr.mjs";
2
- import { C as hasRichMeta, S as coversUniqueKey, _ as validateProjection, a as MATERIALIZING_CONCEPTS, b as joinFansOut, c as defineClivlyConfig, d as missingRequiredFields, f as projectionFields, g as validateEntitiesConfig, h as requiredFieldsFor, i as ClivlyConfigError, l as entitiesConfigSchema, m as relationshipsSchema, n as CRM_CONCEPTS, o as REQUIRED_FIELDS, p as relationshipSchema, t as CANONICAL_FIELDS, u as filterSchema, v as validateProjectionFilter, w as primaryKeyColumns, x as columnMetaFor, y as fanOutJoins } from "./entity-config-g_oMPXlN.mjs";
3
- import { n as mappingsToEntitiesConfig } from "./mappings-config-D_g20PyS.mjs";
1
+ import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs, t as BASE_REF } from "./projection-CzBI2NL8.mjs";
2
+ import { C as hasRichMeta, S as coversUniqueKey, _ as validateProjection, a as MATERIALIZING_CONCEPTS, b as joinFansOut, c as defineClivlyConfig, d as missingRequiredFields, f as projectionFields, g as validateEntitiesConfig, h as requiredFieldsFor, i as ClivlyConfigError, l as entitiesConfigSchema, m as relationshipsSchema, n as CRM_CONCEPTS, o as REQUIRED_FIELDS, p as relationshipSchema, t as CANONICAL_FIELDS, u as filterSchema, v as validateProjectionFilter, w as primaryKeyColumns, x as columnMetaFor, y as fanOutJoins } from "./entity-config-CI5CGfaN.mjs";
3
+ import { n as mappingsToEntitiesConfig } from "./mappings-config-Opw7ZM6Y.mjs";
4
4
  import { t as authCustom } from "./auth-adapter-u91PByaw.mjs";
5
- import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage, u as contactSegmentSchema } from "./internal-9oDwwbNg.mjs";
5
+ import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage, u as contactSegmentSchema } from "./internal-DWpLw0t5.mjs";
6
6
  import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-C7kDMWzp.mjs";
7
- import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, r as compileProjectionIdentity, s as quoteIdent, t as PREVIEW_MAX_ROWS } from "./projection-sql-C3gZE3GS.mjs";
8
- import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-CLTi1VL-.mjs";
9
- import { a as resolveActions, i as reconcile, n as isRemovalAction, o as runSync } from "./sync-engine-CwdLkmch.mjs";
7
+ import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, r as compileProjectionIdentity, s as quoteIdent, t as PREVIEW_MAX_ROWS } from "./projection-sql-DQQdjw9I.mjs";
8
+ import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-CSHSqZl7.mjs";
9
+ import { a as resolveActions, i as reconcile, n as isRemovalAction, o as runSync } from "./sync-engine-yFLEyId3.mjs";
10
10
  import { n as isClosedStageType, t as OPEN_STAGE_TYPE } from "./types-8KSw2AWg.mjs";
11
11
  export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, REQUIRED_FIELDS, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
@@ -1,4 +1,4 @@
1
- import { S as RelationshipsMap, h as FilterExpr, x as RelationshipVia } from "./entity-config-X-KlnYXX.mjs";
1
+ import { S as RelationshipsMap, h as FilterExpr, x as RelationshipVia } from "./entity-config-CXpGowQa.cjs";
2
2
  /**
3
3
  * A relationship the mapping UI can offer or has configured, in the shape the
4
4
  * heuristic suggester produces. `entityTable` is the *host table name*; the
@@ -1,4 +1,4 @@
1
- import { S as RelationshipsMap, h as FilterExpr, x as RelationshipVia } from "./entity-config-dNclLyBM.cjs";
1
+ import { S as RelationshipsMap, h as FilterExpr, x as RelationshipVia } from "./entity-config-CXpGowQa.mjs";
2
2
  /**
3
3
  * A relationship the mapping UI can offer or has configured, in the shape the
4
4
  * heuristic suggester produces. `entityTable` is the *host table name*; the
@@ -1,4 +1,4 @@
1
- const require_entity_config = require("./entity-config-DiCJ6mhI.cjs");
1
+ const require_entity_config = require("./entity-config-BP8Cc_nC.cjs");
2
2
  // ../core/src/mappings-config.ts
3
3
  const RESERVED_FIELD = "id";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { R as ProjectionMapping, S as RelationshipsMap, a as ClivlyEntitiesConfig, h as FilterExpr } from "./entity-config-dNclLyBM.cjs";
1
+ import { R as ProjectionMapping, S as RelationshipsMap, a as ClivlyEntitiesConfig, h as FilterExpr } from "./entity-config-CXpGowQa.cjs";
2
2
  /**
3
3
  * Mappings → Entity Config bridge.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { f as projectionFields, t as CANONICAL_FIELDS } from "./entity-config-g_oMPXlN.mjs";
1
+ import { f as projectionFields, t as CANONICAL_FIELDS } from "./entity-config-CI5CGfaN.mjs";
2
2
  // ../core/src/mappings-config.ts
3
3
  const RESERVED_FIELD = "id";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { R as ProjectionMapping, S as RelationshipsMap, a as ClivlyEntitiesConfig, h as FilterExpr } from "./entity-config-X-KlnYXX.mjs";
1
+ import { R as ProjectionMapping, S as RelationshipsMap, a as ClivlyEntitiesConfig, h as FilterExpr } from "./entity-config-CXpGowQa.mjs";
2
2
  /**
3
3
  * Mappings → Entity Config bridge.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { R as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-dNclLyBM.cjs";
2
- import { r as IntegrationState } from "./integration-state-xK4PLm5T.cjs";
1
+ import { R as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-CXpGowQa.cjs";
2
+ import { v as IntegrationState } from "./index-DRRTE5IJ.cjs";
3
3
  declare const DRIZZLE_META: "__clivly_drizzle_source_meta__";
4
4
  interface DrizzleSourceMeta {
5
5
  /** Drizzle property keys of every column on the source table. */
@@ -199,6 +199,13 @@ interface ClivlySDKConfig {
199
199
  * rollback switch if this misbehaves in production.
200
200
  */
201
201
  instant?: boolean;
202
+ /**
203
+ * Most instant pushes sent per second by one process (default 20).
204
+ * Beyond it, and while Clivly answers 429 or keeps failing, instant
205
+ * pushes are skipped rather than queued; skipped rows sync on the next
206
+ * delta run.
207
+ */
208
+ instantPushesPerSecond?: number;
202
209
  };
203
210
  /**
204
211
  * The remote sync trigger: how Clivly Cloud asks this app to run a sync.
@@ -1,5 +1,5 @@
1
- import { R as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-X-KlnYXX.mjs";
2
- import { r as IntegrationState } from "./integration-state-xK4PLm5T.mjs";
1
+ import { R as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-CXpGowQa.mjs";
2
+ import { v as IntegrationState } from "./index-Bh7o2J7K.mjs";
3
3
  declare const DRIZZLE_META: "__clivly_drizzle_source_meta__";
4
4
  interface DrizzleSourceMeta {
5
5
  /** Drizzle property keys of every column on the source table. */
@@ -199,6 +199,13 @@ interface ClivlySDKConfig {
199
199
  * rollback switch if this misbehaves in production.
200
200
  */
201
201
  instant?: boolean;
202
+ /**
203
+ * Most instant pushes sent per second by one process (default 20).
204
+ * Beyond it, and while Clivly answers 429 or keeps failing, instant
205
+ * pushes are skipped rather than queued; skipped rows sync on the next
206
+ * delta run.
207
+ */
208
+ instantPushesPerSecond?: number;
202
209
  };
203
210
  /**
204
211
  * The remote sync trigger: how Clivly Cloud asks this app to run a sync.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clivly",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Clivly CLI — scaffold a CRM into your app (clivly init).",
@@ -362,7 +362,8 @@
362
362
  "./package.json": "./package.json"
363
363
  },
364
364
  "dependencies": {
365
- "jiti": "^2.7.0"
365
+ "jiti": "^2.7.0",
366
+ "zod": "^4.6.7"
366
367
  },
367
368
  "peerDependencies": {
368
369
  "@clerk/backend": ">=1",
@@ -392,9 +393,10 @@
392
393
  "engines": {
393
394
  "node": ">=22"
394
395
  },
395
- "homepage": "https://clivly.com",
396
+ "homepage": "https://clivly.com/docs",
396
397
  "bugs": {
397
- "url": "https://github.com/amani-joseph/clivly.com/issues"
398
+ "url": "https://clivly.com/docs",
399
+ "email": "support@clivly.com"
398
400
  },
399
401
  "keywords": [
400
402
  "crm",
@@ -0,0 +1,95 @@
1
+ import { z } from "zod";
2
+ // ../core/src/projection.ts
3
+ /**
4
+ * Projection-backed custom mappings — one custom object derived from a base
5
+ * table plus explicit joins.
6
+ *
7
+ * A projection is deliberately narrow: equality joins only, direct column
8
+ * bindings only, no expressions and no aggregation. Everything a user can
9
+ * express here compiles to a single read-only view whose `id` column is
10
+ * provably unique per row, which is what lets the sync engine consume it
11
+ * unchanged.
12
+ *
13
+ * Refs address tables symbolically: `"base"` for the base table, or a join's
14
+ * `key`. Raw table names are never accepted in a ref, so a projection can
15
+ * never reach a table it did not declare.
16
+ */
17
+ /** The reserved ref name for the projection's base table. */
18
+ const BASE_REF = "base";
19
+ /**
20
+ * Entity keys become view names (`crm_src_<entityKey>`), so keep them slugs.
21
+ *
22
+ * Accepts hyphens as well as underscores, matching `OBJECT_TYPE_SLUG_PATTERN`
23
+ * on the server. Those two were widened apart: the server learned hyphens
24
+ * because the SDK's own `slugify` collapses non-alphanumerics to them and
25
+ * `clivly status` reports that form as canonical — but this pattern was missed,
26
+ * so `clivly status` would tell you to key an entity `client-accounts` and then
27
+ * `defineClivlyConfig` would reject the config it had just asked for. Same bug,
28
+ * opposite half of the product.
29
+ *
30
+ * Widening is the safe direction: every key that was valid before still is, so
31
+ * nothing existing is renamed. Safe at all because neither use is ever a bare
32
+ * SQL identifier — the view name is quoted (`view-compiler.ts`, `quoteIdent`),
33
+ * and so is a join's `key` when it is emitted as an alias.
34
+ */
35
+ const PROJECTION_KEY_PATTERN = /^[a-z][a-z0-9_-]*$/;
36
+ /**
37
+ * Stated in prose because the default for a failed `.regex()` reports only the
38
+ * pattern — the developer is told the config is wrong and handed a regex to
39
+ * decode. Naming the rule is what makes the failure actionable.
40
+ */
41
+ const PROJECTION_KEY_MESSAGE = "must be lowercase letters, digits, \"-\" or \"_\", starting with a letter";
42
+ const projectionRefSchema = z.strictObject({
43
+ table: z.string().min(1),
44
+ column: z.string().min(1)
45
+ });
46
+ const projectionJoinConditionSchema = z.strictObject({
47
+ left: projectionRefSchema,
48
+ op: z.literal("eq"),
49
+ right: projectionRefSchema
50
+ });
51
+ const projectionJoinSchema = z.strictObject({
52
+ /** SQL alias and ref target. Unique within the projection. */
53
+ key: z.string().regex(PROJECTION_KEY_PATTERN, { message: `join key ${PROJECTION_KEY_MESSAGE}` }),
54
+ table: z.string().min(1),
55
+ type: z.enum(["inner", "left"]),
56
+ on: z.array(projectionJoinConditionSchema).min(1)
57
+ });
58
+ const projectionFieldBindingSchema = z.strictObject({ from: projectionRefSchema });
59
+ const projectionIdentitySchema = z.union([
60
+ z.strictObject({
61
+ kind: z.literal("base_pk"),
62
+ /** Defaults to the discovered single-column PK of the base table. */
63
+ column: z.string().min(1).optional()
64
+ }),
65
+ z.strictObject({
66
+ kind: z.literal("column"),
67
+ from: projectionRefSchema
68
+ }),
69
+ z.strictObject({
70
+ kind: z.literal("composite"),
71
+ parts: z.array(projectionRefSchema).min(2)
72
+ })
73
+ ]);
74
+ const projectionSchema = z.strictObject({
75
+ version: z.literal(1),
76
+ kind: z.literal("projection"),
77
+ entityKey: z.string().regex(PROJECTION_KEY_PATTERN, { message: `entityKey ${PROJECTION_KEY_MESSAGE}` }),
78
+ baseTable: z.string().min(1),
79
+ joins: z.array(projectionJoinSchema),
80
+ fieldBindings: z.record(z.string(), projectionFieldBindingSchema).refine((b) => Object.keys(b).length > 0, { message: "at least one field must be bound" }),
81
+ identity: projectionIdentitySchema
82
+ });
83
+ /**
84
+ * Every column ref an identity depends on. `basePkColumn` is the base table's
85
+ * discovered PK, used only when a `base_pk` identity omits an explicit column.
86
+ */
87
+ function identityRefs(identity, basePkColumn) {
88
+ if (identity.kind === "base_pk") return [{
89
+ table: BASE_REF,
90
+ column: identity.column ?? basePkColumn
91
+ }];
92
+ if (identity.kind === "column") return [identity.from];
93
+ return identity.parts;
94
+ }
95
+ export { projectionSchema as i, PROJECTION_KEY_PATTERN as n, identityRefs as r, BASE_REF as t };
@@ -1,4 +1,4 @@
1
- const require_projection = require("./projection-By63gMC-.cjs");
1
+ const require_projection = require("./projection-w4Z6vSL2.cjs");
2
2
  // ../core/src/projection-sql.ts
3
3
  /**
4
4
  * SQL generation for projection-backed entities.
@@ -1,4 +1,4 @@
1
- import { r as identityRefs, t as BASE_REF } from "./projection-BkYXvjTr.mjs";
1
+ import { r as identityRefs, t as BASE_REF } from "./projection-CzBI2NL8.mjs";
2
2
  // ../core/src/projection-sql.ts
3
3
  /**
4
4
  * SQL generation for projection-backed entities.
@@ -0,0 +1,118 @@
1
+ let zod = require("zod");
2
+ // ../core/src/projection.ts
3
+ /**
4
+ * Projection-backed custom mappings — one custom object derived from a base
5
+ * table plus explicit joins.
6
+ *
7
+ * A projection is deliberately narrow: equality joins only, direct column
8
+ * bindings only, no expressions and no aggregation. Everything a user can
9
+ * express here compiles to a single read-only view whose `id` column is
10
+ * provably unique per row, which is what lets the sync engine consume it
11
+ * unchanged.
12
+ *
13
+ * Refs address tables symbolically: `"base"` for the base table, or a join's
14
+ * `key`. Raw table names are never accepted in a ref, so a projection can
15
+ * never reach a table it did not declare.
16
+ */
17
+ /** The reserved ref name for the projection's base table. */
18
+ const BASE_REF = "base";
19
+ /**
20
+ * Entity keys become view names (`crm_src_<entityKey>`), so keep them slugs.
21
+ *
22
+ * Accepts hyphens as well as underscores, matching `OBJECT_TYPE_SLUG_PATTERN`
23
+ * on the server. Those two were widened apart: the server learned hyphens
24
+ * because the SDK's own `slugify` collapses non-alphanumerics to them and
25
+ * `clivly status` reports that form as canonical — but this pattern was missed,
26
+ * so `clivly status` would tell you to key an entity `client-accounts` and then
27
+ * `defineClivlyConfig` would reject the config it had just asked for. Same bug,
28
+ * opposite half of the product.
29
+ *
30
+ * Widening is the safe direction: every key that was valid before still is, so
31
+ * nothing existing is renamed. Safe at all because neither use is ever a bare
32
+ * SQL identifier — the view name is quoted (`view-compiler.ts`, `quoteIdent`),
33
+ * and so is a join's `key` when it is emitted as an alias.
34
+ */
35
+ const PROJECTION_KEY_PATTERN = /^[a-z][a-z0-9_-]*$/;
36
+ /**
37
+ * Stated in prose because the default for a failed `.regex()` reports only the
38
+ * pattern — the developer is told the config is wrong and handed a regex to
39
+ * decode. Naming the rule is what makes the failure actionable.
40
+ */
41
+ const PROJECTION_KEY_MESSAGE = "must be lowercase letters, digits, \"-\" or \"_\", starting with a letter";
42
+ const projectionRefSchema = zod.z.strictObject({
43
+ table: zod.z.string().min(1),
44
+ column: zod.z.string().min(1)
45
+ });
46
+ const projectionJoinConditionSchema = zod.z.strictObject({
47
+ left: projectionRefSchema,
48
+ op: zod.z.literal("eq"),
49
+ right: projectionRefSchema
50
+ });
51
+ const projectionJoinSchema = zod.z.strictObject({
52
+ /** SQL alias and ref target. Unique within the projection. */
53
+ key: zod.z.string().regex(PROJECTION_KEY_PATTERN, { message: `join key ${PROJECTION_KEY_MESSAGE}` }),
54
+ table: zod.z.string().min(1),
55
+ type: zod.z.enum(["inner", "left"]),
56
+ on: zod.z.array(projectionJoinConditionSchema).min(1)
57
+ });
58
+ const projectionFieldBindingSchema = zod.z.strictObject({ from: projectionRefSchema });
59
+ const projectionIdentitySchema = zod.z.union([
60
+ zod.z.strictObject({
61
+ kind: zod.z.literal("base_pk"),
62
+ /** Defaults to the discovered single-column PK of the base table. */
63
+ column: zod.z.string().min(1).optional()
64
+ }),
65
+ zod.z.strictObject({
66
+ kind: zod.z.literal("column"),
67
+ from: projectionRefSchema
68
+ }),
69
+ zod.z.strictObject({
70
+ kind: zod.z.literal("composite"),
71
+ parts: zod.z.array(projectionRefSchema).min(2)
72
+ })
73
+ ]);
74
+ const projectionSchema = zod.z.strictObject({
75
+ version: zod.z.literal(1),
76
+ kind: zod.z.literal("projection"),
77
+ entityKey: zod.z.string().regex(PROJECTION_KEY_PATTERN, { message: `entityKey ${PROJECTION_KEY_MESSAGE}` }),
78
+ baseTable: zod.z.string().min(1),
79
+ joins: zod.z.array(projectionJoinSchema),
80
+ fieldBindings: zod.z.record(zod.z.string(), projectionFieldBindingSchema).refine((b) => Object.keys(b).length > 0, { message: "at least one field must be bound" }),
81
+ identity: projectionIdentitySchema
82
+ });
83
+ /**
84
+ * Every column ref an identity depends on. `basePkColumn` is the base table's
85
+ * discovered PK, used only when a `base_pk` identity omits an explicit column.
86
+ */
87
+ function identityRefs(identity, basePkColumn) {
88
+ if (identity.kind === "base_pk") return [{
89
+ table: BASE_REF,
90
+ column: identity.column ?? basePkColumn
91
+ }];
92
+ if (identity.kind === "column") return [identity.from];
93
+ return identity.parts;
94
+ }
95
+ Object.defineProperty(exports, "BASE_REF", {
96
+ enumerable: true,
97
+ get: function() {
98
+ return BASE_REF;
99
+ }
100
+ });
101
+ Object.defineProperty(exports, "PROJECTION_KEY_PATTERN", {
102
+ enumerable: true,
103
+ get: function() {
104
+ return PROJECTION_KEY_PATTERN;
105
+ }
106
+ });
107
+ Object.defineProperty(exports, "identityRefs", {
108
+ enumerable: true,
109
+ get: function() {
110
+ return identityRefs;
111
+ }
112
+ });
113
+ Object.defineProperty(exports, "projectionSchema", {
114
+ enumerable: true,
115
+ get: function() {
116
+ return projectionSchema;
117
+ }
118
+ });