clivly 0.9.6 → 0.10.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 (146) hide show
  1. package/README.md +24 -12
  2. package/{adapter-C2eRbBfo.d.cts → adapter-1TN0zohk.d.cts} +1 -1
  3. package/{adapter-D5LRa-NA.d.mts → adapter-uxirB88i.d.mts} +1 -1
  4. package/{auth-adapter-Bjgo8LhN.d.mts → auth-adapter-CXTiW3Mb.d.cts} +1 -1
  5. package/{auth-adapter-DWzgl5Yq.d.cts → auth-adapter-DSuYwv1c.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.cjs +1 -1
  15. package/core-auth-adapter.d.cts +1 -1
  16. package/core-auth-adapter.d.mts +1 -1
  17. package/core-auth-adapter.mjs +1 -1
  18. package/core-drizzle.cjs +1 -1
  19. package/core-drizzle.d.cts +1 -1
  20. package/core-drizzle.d.mts +1 -1
  21. package/core-drizzle.mjs +1 -1
  22. package/core-entity-config.cjs +1 -1
  23. package/core-entity-config.d.cts +1 -1
  24. package/core-entity-config.d.mts +1 -1
  25. package/core-entity-config.mjs +1 -1
  26. package/core-entity-heuristics.cjs +1 -0
  27. package/core-entity-heuristics.d.cts +3 -3
  28. package/core-entity-heuristics.d.mts +3 -3
  29. package/core-entity-heuristics.mjs +2 -2
  30. package/core-mapping-form.cjs +1 -1
  31. package/core-mapping-form.d.cts +1 -1
  32. package/core-mapping-form.d.mts +1 -1
  33. package/core-mapping-form.mjs +1 -1
  34. package/core-mappings-config.cjs +1 -1
  35. package/core-mappings-config.d.cts +1 -1
  36. package/core-mappings-config.d.mts +1 -1
  37. package/core-mappings-config.mjs +1 -1
  38. package/core-sync-engine.cjs +1 -1
  39. package/core-sync-engine.d.cts +1 -1
  40. package/core-sync-engine.d.mts +1 -1
  41. package/core-sync-engine.mjs +1 -1
  42. package/core-types.cjs +4 -0
  43. package/core-types.d.cts +2 -2
  44. package/core-types.d.mts +2 -2
  45. package/core-types.mjs +2 -1
  46. package/core-view-compiler.cjs +1 -1
  47. package/core-view-compiler.d.cts +1 -1
  48. package/core-view-compiler.d.mts +1 -1
  49. package/core-view-compiler.mjs +1 -1
  50. package/core.cjs +18 -17
  51. package/core.d.cts +10 -10
  52. package/core.d.mts +10 -10
  53. package/core.mjs +10 -9
  54. package/{drizzle-DEtRrqtc.d.cts → drizzle-DTOuGXEn.d.cts} +4 -2
  55. package/{drizzle-bfjVzYR6.cjs → drizzle-DcB7OfBp.cjs} +9 -1
  56. package/{drizzle-CiK8MMEZ.d.mts → drizzle-SGapoly2.d.mts} +4 -2
  57. package/{drizzle-3kvhkwO7.mjs → drizzle-wbcuG-cy.mjs} +9 -1
  58. package/drizzle.cjs +58 -24
  59. package/drizzle.d.cts +10 -4
  60. package/drizzle.d.mts +10 -4
  61. package/drizzle.mjs +58 -24
  62. package/{entity-config-CusbTOJ1.mjs → entity-config-C4d3K9CP.mjs} +114 -8
  63. package/{entity-config-B2RA53nw.d.cts → entity-config-DNQAMbMS.d.cts} +27 -1
  64. package/{entity-config-B2RA53nw.d.mts → entity-config-DNQAMbMS.d.mts} +27 -1
  65. package/{entity-config-DE30_RpU.cjs → entity-config-DgAe0_YD.cjs} +119 -7
  66. package/index.cjs +56 -15
  67. package/index.mjs +56 -15
  68. package/internal-BAOG5eE4.d.mts +226 -0
  69. package/internal-BHJ0X3fC.d.cts +226 -0
  70. package/internal-Bgiimp5D.mjs +144 -0
  71. package/internal-Cz59xMj8.cjs +167 -0
  72. package/internal-adapter.d.cts +1 -1
  73. package/internal-adapter.d.mts +1 -1
  74. package/internal-auth-adapter.d.cts +1 -1
  75. package/internal-auth-adapter.d.mts +1 -1
  76. package/internal-drizzle.cjs +1 -1
  77. package/internal-drizzle.d.cts +1 -1
  78. package/internal-drizzle.d.mts +1 -1
  79. package/internal-drizzle.mjs +1 -1
  80. package/internal-entity-config.cjs +1 -1
  81. package/internal-entity-config.d.cts +1 -1
  82. package/internal-entity-config.d.mts +1 -1
  83. package/internal-entity-config.mjs +1 -1
  84. package/internal-entity-heuristics.cjs +34 -1
  85. package/internal-entity-heuristics.d.cts +8 -2
  86. package/internal-entity-heuristics.d.mts +8 -2
  87. package/internal-entity-heuristics.mjs +34 -2
  88. package/internal-mapping-form.d.cts +1 -1
  89. package/internal-mapping-form.d.mts +1 -1
  90. package/internal-mappings-config.cjs +1 -1
  91. package/internal-mappings-config.d.cts +1 -1
  92. package/internal-mappings-config.d.mts +1 -1
  93. package/internal-mappings-config.mjs +1 -1
  94. package/internal-sync-engine.cjs +1 -1
  95. package/internal-sync-engine.d.cts +1 -1
  96. package/internal-sync-engine.d.mts +1 -1
  97. package/internal-sync-engine.mjs +1 -1
  98. package/internal-types.cjs +4 -0
  99. package/internal-types.d.cts +2 -2
  100. package/internal-types.d.mts +2 -2
  101. package/internal-types.mjs +2 -1
  102. package/internal-view-compiler.cjs +1 -1
  103. package/internal-view-compiler.d.cts +1 -1
  104. package/internal-view-compiler.d.mts +1 -1
  105. package/internal-view-compiler.mjs +1 -1
  106. package/internal.cjs +17 -15
  107. package/internal.d.cts +10 -10
  108. package/internal.d.mts +10 -10
  109. package/internal.mjs +9 -8
  110. package/{mapping-form-DH77BXLv.d.mts → mapping-form-Cc7Ewv8c.d.mts} +1 -1
  111. package/{mapping-form-J0aU6O7l.d.cts → mapping-form-DwdbYAfR.d.cts} +1 -1
  112. package/{mappings-config-D9dsonoi.d.mts → mappings-config-Be9D43Np.d.mts} +1 -1
  113. package/{mappings-config-RQLGx8ub.d.cts → mappings-config-DUt4-9iO.d.cts} +1 -1
  114. package/{mappings-config-CjCmT-aU.cjs → mappings-config-Dx9ldgdf.cjs} +2 -16
  115. package/{mappings-config-7qQ47p9K.mjs → mappings-config-MoXBeI8p.mjs} +1 -15
  116. package/{namespace-probe-Ckn9yJ6F.d.mts → namespace-probe-9ScMDR0t.d.mts} +42 -2
  117. package/{namespace-probe-DaTJINS-.d.cts → namespace-probe-DC4tbmLj.d.cts} +42 -2
  118. package/package.json +1 -1
  119. package/{projection-hnPSgH6G.mjs → projection-CSGJbZlZ.mjs} +1 -1
  120. package/{projection-DEwL-D8R.cjs → projection-Dz6_i1-w.cjs} +0 -6
  121. package/{projection-sql-iHy-Cx6V.cjs → projection-sql-CbXCKt3s.cjs} +1 -1
  122. package/{projection-sql-9zzTVGvf.mjs → projection-sql-iHoiYr1R.mjs} +1 -1
  123. package/{sdk-w8Kv_XnW.cjs → sdk-B1vX4kUJ.cjs} +347 -17
  124. package/{sdk-Dkq6ELkf.mjs → sdk-D6gX0TXS.mjs} +347 -17
  125. package/sdk.cjs +2 -2
  126. package/sdk.d.cts +3 -3
  127. package/sdk.d.mts +3 -3
  128. package/sdk.mjs +2 -2
  129. package/{sync-engine-BLgwLpR6.cjs → sync-engine-B0FT1ax6.cjs} +1 -1
  130. package/{sync-engine-B_IzoUSx.mjs → sync-engine-CTSIcLlZ.mjs} +1 -1
  131. package/{sync-engine-BG2O1an2.d.cts → sync-engine-Df0kHAoJ.d.cts} +2 -2
  132. package/{sync-engine-DgQbrJON.d.mts → sync-engine-ugFacJ6G.d.mts} +2 -2
  133. package/{types-B1oRXdNP.d.cts → types-Cq1uHUKp.d.cts} +28 -2
  134. package/{types-B1oRXdNP.d.mts → types-Cq1uHUKp.d.mts} +28 -2
  135. package/types-Cq5gHCTq.cjs +20 -0
  136. package/types-YJTkXKzU.mjs +9 -0
  137. package/{view-compiler-D_6gfXFr.mjs → view-compiler-BzKk8nY3.mjs} +2 -2
  138. package/{view-compiler-CmEdAMwj.d.cts → view-compiler-D3zp9S3K.d.cts} +1 -1
  139. package/{view-compiler-Bo7pqXW3.d.mts → view-compiler-TpzDTu7z.d.mts} +1 -1
  140. package/{view-compiler-BHI5E4QI.cjs → view-compiler-ZKZbd3SK.cjs} +2 -2
  141. package/vite.d.cts +1 -1
  142. package/vite.d.mts +1 -1
  143. package/internal-BQ47iN6f.cjs +0 -259
  144. package/internal-ChufvXE6.mjs +0 -212
  145. package/internal-CvlFk3KC.d.mts +0 -180
  146. package/internal-DGUOLQAq.d.cts +0 -180
package/internal.d.cts CHANGED
@@ -1,11 +1,11 @@
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 { A as BASE_REF, C as defineClivlyConfig, D as relationshipSchema, F as ProjectionRef, I as identityRefs, L as projectionSchema, M as ProjectionIdentity, N as ProjectionJoin, O as relationshipsSchema, P as ProjectionMapping, T as filterSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipVia, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as ProjectionFieldBinding, k as validateEntitiesConfig, 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 entitiesConfigSchema, x as RelationshipsMap, y as RelationshipSpec } from "./entity-config-B2RA53nw.cjs";
5
- import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-J0aU6O7l.cjs";
6
- import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-RQLGx8ub.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-CmEdAMwj.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-BG2O1an2.cjs";
1
+ import { A as ValueInterval, C as TaskEntityType, D as UpdateContactInput, E as TaskStatus, O as UpdateDealInput, S as Task, T as TaskPriority, _ as PipelineConfig, a as ContactFilters, b as RecordSource, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as OPEN_STAGE_TYPE, h as Note, i as Contact, j as isClosedStageType, k as UpdateTaskInput, 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 PipelineKind, w as TaskFilters, x as StageType, y as PipelineStageConfig } from "./types-Cq1uHUKp.cjs";
2
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CXTiW3Mb.cjs";
3
+ import { t as CRMAdapter } from "./adapter-1TN0zohk.cjs";
4
+ import { A as BASE_REF, C as defineClivlyConfig, D as relationshipSchema, E as projectionFields, F as ProjectionMapping, I as ProjectionRef, L as identityRefs, M as ProjectionFieldBinding, N as ProjectionIdentity, O as relationshipsSchema, P as ProjectionJoin, R as projectionSchema, T as filterSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipVia, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as PROJECTION_KEY_PATTERN, k as validateEntitiesConfig, 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 entitiesConfigSchema, x as RelationshipsMap, y as RelationshipSpec } from "./entity-config-DNQAMbMS.cjs";
5
+ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-DwdbYAfR.cjs";
6
+ import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-DUt4-9iO.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-D3zp9S3K.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-Df0kHAoJ.cjs";
9
9
  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-BK-riZnm.cjs";
10
- import { C as fanOutJoins, S as suggestJoinConditions, _ as draftErrors, a as validateProjection, b as emptyProjectionDraft, c as compileProjectionIdentity, d as compileProjectionSelect, f as quoteIdent, g as describeCardinality, h as addDraftJoin, i as primaryKeyColumns, l as compileProjectionJoins, m as ProjectionDraft, n as coversUniqueKey, o as PREVIEW_MAX_ROWS, p as DraftRefOption, r as hasRichMeta, s as compileProjectionFrom, t as columnMetaFor, u as compileProjectionPreview, v as draftRefOptions, w as joinFansOut, x as removeDraftJoin, y as draftToProjection } from "./internal-DGUOLQAq.cjs";
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 CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, 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 DiscoveredColumnMeta, type DiscoveredSchemaTable, type DraftRefOption, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, PREVIEW_MAX_ROWS, type PersistAction, type ProjectionDraft, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, addDraftJoin, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, describeCardinality, draftErrors, draftRefOptions, draftToProjection, emptyProjectionDraft, entitiesConfigSchema, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, joinFansOut, mappingsToEntitiesConfig, primaryKeyColumns, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, removeDraftJoin, runSync, suggestJoinConditions, validateEntitiesConfig, validateProjection };
10
+ import { S as joinFansOut, _ 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, 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, x as fanOutJoins, y as compileProjectionSelect } from "./internal-BHJ0X3fC.cjs";
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 CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, 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 DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, 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 PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, 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 UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, isClosedStageType, joinFansOut, mappingsToEntitiesConfig, matchesCondition, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
package/internal.d.mts CHANGED
@@ -1,11 +1,11 @@
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 { A as BASE_REF, C as defineClivlyConfig, D as relationshipSchema, F as ProjectionRef, I as identityRefs, L as projectionSchema, M as ProjectionIdentity, N as ProjectionJoin, O as relationshipsSchema, P as ProjectionMapping, T as filterSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipVia, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as ProjectionFieldBinding, k as validateEntitiesConfig, 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 entitiesConfigSchema, x as RelationshipsMap, y as RelationshipSpec } from "./entity-config-B2RA53nw.mjs";
5
- import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-DH77BXLv.mjs";
6
- import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-D9dsonoi.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-Bo7pqXW3.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-DgQbrJON.mjs";
1
+ import { A as ValueInterval, C as TaskEntityType, D as UpdateContactInput, E as TaskStatus, O as UpdateDealInput, S as Task, T as TaskPriority, _ as PipelineConfig, a as ContactFilters, b as RecordSource, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as OPEN_STAGE_TYPE, h as Note, i as Contact, j as isClosedStageType, k as UpdateTaskInput, 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 PipelineKind, w as TaskFilters, x as StageType, y as PipelineStageConfig } from "./types-Cq1uHUKp.mjs";
2
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-DSuYwv1c.mjs";
3
+ import { t as CRMAdapter } from "./adapter-uxirB88i.mjs";
4
+ import { A as BASE_REF, C as defineClivlyConfig, D as relationshipSchema, E as projectionFields, F as ProjectionMapping, I as ProjectionRef, L as identityRefs, M as ProjectionFieldBinding, N as ProjectionIdentity, O as relationshipsSchema, P as ProjectionJoin, R as projectionSchema, T as filterSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipVia, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as PROJECTION_KEY_PATTERN, k as validateEntitiesConfig, 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 entitiesConfigSchema, x as RelationshipsMap, y as RelationshipSpec } from "./entity-config-DNQAMbMS.mjs";
5
+ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Cc7Ewv8c.mjs";
6
+ import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-Be9D43Np.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-TpzDTu7z.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-ugFacJ6G.mjs";
9
9
  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-BK-riZnm.mjs";
10
- import { C as fanOutJoins, S as suggestJoinConditions, _ as draftErrors, a as validateProjection, b as emptyProjectionDraft, c as compileProjectionIdentity, d as compileProjectionSelect, f as quoteIdent, g as describeCardinality, h as addDraftJoin, i as primaryKeyColumns, l as compileProjectionJoins, m as ProjectionDraft, n as coversUniqueKey, o as PREVIEW_MAX_ROWS, p as DraftRefOption, r as hasRichMeta, s as compileProjectionFrom, t as columnMetaFor, u as compileProjectionPreview, v as draftRefOptions, w as joinFansOut, x as removeDraftJoin, y as draftToProjection } from "./internal-CvlFk3KC.mjs";
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 CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, 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 DiscoveredColumnMeta, type DiscoveredSchemaTable, type DraftRefOption, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, PREVIEW_MAX_ROWS, type PersistAction, type ProjectionDraft, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, addDraftJoin, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, describeCardinality, draftErrors, draftRefOptions, draftToProjection, emptyProjectionDraft, entitiesConfigSchema, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, joinFansOut, mappingsToEntitiesConfig, primaryKeyColumns, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, removeDraftJoin, runSync, suggestJoinConditions, validateEntitiesConfig, validateProjection };
10
+ import { S as joinFansOut, _ 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, 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, x as fanOutJoins, y as compileProjectionSelect } from "./internal-BAOG5eE4.mjs";
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 CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, 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 DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, 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 PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, 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 UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, isClosedStageType, joinFansOut, mappingsToEntitiesConfig, matchesCondition, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
package/internal.mjs CHANGED
@@ -1,10 +1,11 @@
1
- import { a as projectionSchema, i as identityRefs, t as BASE_REF } from "./projection-hnPSgH6G.mjs";
2
- import { _ as columnMetaFor, a as MATERIALIZING_CONCEPTS, b as primaryKeyColumns, c as entitiesConfigSchema, d as relationshipSchema, f as relationshipsSchema, g as joinFansOut, h as fanOutJoins, i as ClivlyConfigError, l as filterSchema, m as validateProjection, n as CRM_CONCEPTS, p as validateEntitiesConfig, s as defineClivlyConfig, t as CANONICAL_FIELDS, v as coversUniqueKey, y as hasRichMeta } from "./entity-config-CusbTOJ1.mjs";
3
- import { n as mappingsToEntitiesConfig } from "./mappings-config-7qQ47p9K.mjs";
1
+ import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs, t as BASE_REF } from "./projection-CSGJbZlZ.mjs";
2
+ import { _ as joinFansOut, a as MATERIALIZING_CONCEPTS, b as hasRichMeta, c as entitiesConfigSchema, d as relationshipSchema, f as relationshipsSchema, g as fanOutJoins, h as validateProjectionFilter, i as ClivlyConfigError, l as filterSchema, m as validateProjection, n as CRM_CONCEPTS, p as validateEntitiesConfig, s as defineClivlyConfig, t as CANONICAL_FIELDS, u as projectionFields, v as columnMetaFor, x as primaryKeyColumns, y as coversUniqueKey } from "./entity-config-C4d3K9CP.mjs";
3
+ import { n as mappingsToEntitiesConfig } from "./mappings-config-MoXBeI8p.mjs";
4
4
  import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
5
5
  import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
6
- import { a as draftToProjection, c as suggestJoinConditions, i as draftRefOptions, n as describeCardinality, o as emptyProjectionDraft, r as draftErrors, s as removeDraftJoin, t as addDraftJoin } from "./internal-ChufvXE6.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-9zzTVGvf.mjs";
8
- import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-D_6gfXFr.mjs";
9
- import { i as runSync, r as reconcile } from "./sync-engine-B_IzoUSx.mjs";
10
- export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, PREVIEW_MAX_ROWS, addDraftJoin, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, describeCardinality, draftErrors, draftRefOptions, draftToProjection, emptyProjectionDraft, entitiesConfigSchema, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, joinFansOut, mappingsToEntitiesConfig, primaryKeyColumns, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, removeDraftJoin, runSync, suggestJoinConditions, validateEntitiesConfig, validateProjection };
6
+ 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-iHoiYr1R.mjs";
7
+ import { i as toObjectTypeSlug, n as matchesCondition, r as slugify, t as evaluateStage } from "./internal-Bgiimp5D.mjs";
8
+ import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-BzKk8nY3.mjs";
9
+ import { i as runSync, r as reconcile } from "./sync-engine-CTSIcLlZ.mjs";
10
+ import { n as isClosedStageType, t as OPEN_STAGE_TYPE } from "./types-YJTkXKzU.mjs";
11
+ export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, isClosedStageType, joinFansOut, mappingsToEntitiesConfig, matchesCondition, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
@@ -1,4 +1,4 @@
1
- import { b as RelationshipVia, h as FilterExpr, x as RelationshipsMap } from "./entity-config-B2RA53nw.mjs";
1
+ import { b as RelationshipVia, h as FilterExpr, x as RelationshipsMap } from "./entity-config-DNQAMbMS.mjs";
2
2
  //#region ../core/src/mapping-form.d.ts
3
3
  /**
4
4
  * A relationship the mapping UI can offer or has configured, in the shape the
@@ -1,4 +1,4 @@
1
- import { b as RelationshipVia, h as FilterExpr, x as RelationshipsMap } from "./entity-config-B2RA53nw.cjs";
1
+ import { b as RelationshipVia, h as FilterExpr, x as RelationshipsMap } from "./entity-config-DNQAMbMS.cjs";
2
2
  //#region ../core/src/mapping-form.d.ts
3
3
  /**
4
4
  * A relationship the mapping UI can offer or has configured, in the shape the
@@ -1,4 +1,4 @@
1
- import { P as ProjectionMapping, a as ClivlyEntitiesConfig, h as FilterExpr, x as RelationshipsMap } from "./entity-config-B2RA53nw.mjs";
1
+ import { F as ProjectionMapping, a as ClivlyEntitiesConfig, h as FilterExpr, x as RelationshipsMap } from "./entity-config-DNQAMbMS.mjs";
2
2
  //#region ../core/src/mappings-config.d.ts
3
3
  /**
4
4
  * Mappings → Entity Config bridge.
@@ -1,4 +1,4 @@
1
- import { P as ProjectionMapping, a as ClivlyEntitiesConfig, h as FilterExpr, x as RelationshipsMap } from "./entity-config-B2RA53nw.cjs";
1
+ import { F as ProjectionMapping, a as ClivlyEntitiesConfig, h as FilterExpr, x as RelationshipsMap } from "./entity-config-DNQAMbMS.cjs";
2
2
  //#region ../core/src/mappings-config.d.ts
3
3
  /**
4
4
  * Mappings → Entity Config bridge.
@@ -1,4 +1,4 @@
1
- const require_entity_config = require("./entity-config-DE30_RpU.cjs");
1
+ const require_entity_config = require("./entity-config-DgAe0_YD.cjs");
2
2
  //#region ../core/src/mappings-config.ts
3
3
  const RESERVED_FIELD = "id";
4
4
  /**
@@ -47,26 +47,12 @@ function uniquify(base, used) {
47
47
  used.add(key);
48
48
  return key;
49
49
  }
50
- /**
51
- * A projection's `fields` map, derived mechanically from its bindings.
52
- *
53
- * `ClivlyEntityConfig.fields` is required and read by existing consumers, so a
54
- * projection entity must populate it. The values are ref *tokens*
55
- * (`"base.full_name"`), never host column names — the compiler reads
56
- * `projection.fieldBindings`, and `validateEntitiesConfig` skips the legacy
57
- * column check for projection entities precisely because of this.
58
- */
59
- function projectionFields(projection) {
60
- const fields = {};
61
- for (const [field, binding] of Object.entries(projection.fieldBindings)) fields[field] = `${binding.from.table}.${binding.from.column}`;
62
- return fields;
63
- }
64
50
  function buildEntity(row, refIndex) {
65
51
  const entity = {
66
52
  concept: row.targetConcept,
67
53
  source: row.projection?.baseTable ?? row.sourceTable,
68
54
  role: row.role ?? DEFAULT_ROLE,
69
- fields: row.projection ? projectionFields(row.projection) : canonicalFields(row.targetConcept, row.fieldMap)
55
+ fields: row.projection ? require_entity_config.projectionFields(row.projection) : canonicalFields(row.targetConcept, row.fieldMap)
70
56
  };
71
57
  if (row.projection) entity.projection = row.projection;
72
58
  if (row.targetConcept === "custom" && row.targetObjectTypeId) entity.targetObjectTypeId = row.targetObjectTypeId;
@@ -1,4 +1,4 @@
1
- import { t as CANONICAL_FIELDS } from "./entity-config-CusbTOJ1.mjs";
1
+ import { t as CANONICAL_FIELDS, u as projectionFields } from "./entity-config-C4d3K9CP.mjs";
2
2
  //#region ../core/src/mappings-config.ts
3
3
  const RESERVED_FIELD = "id";
4
4
  /**
@@ -47,20 +47,6 @@ function uniquify(base, used) {
47
47
  used.add(key);
48
48
  return key;
49
49
  }
50
- /**
51
- * A projection's `fields` map, derived mechanically from its bindings.
52
- *
53
- * `ClivlyEntityConfig.fields` is required and read by existing consumers, so a
54
- * projection entity must populate it. The values are ref *tokens*
55
- * (`"base.full_name"`), never host column names — the compiler reads
56
- * `projection.fieldBindings`, and `validateEntitiesConfig` skips the legacy
57
- * column check for projection entities precisely because of this.
58
- */
59
- function projectionFields(projection) {
60
- const fields = {};
61
- for (const [field, binding] of Object.entries(projection.fieldBindings)) fields[field] = `${binding.from.table}.${binding.from.column}`;
62
- return fields;
63
- }
64
50
  function buildEntity(row, refIndex) {
65
51
  const entity = {
66
52
  concept: row.targetConcept,
@@ -1,4 +1,4 @@
1
- import { P as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-B2RA53nw.mjs";
1
+ import { F as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-DNQAMbMS.mjs";
2
2
  import { r as IntegrationState } from "./integration-state-BK-riZnm.mjs";
3
3
  //#region ../sdk/src/drizzle-meta.d.ts
4
4
  declare const DRIZZLE_META: "__clivly_drizzle_source_meta__";
@@ -354,6 +354,17 @@ interface SyncTriggerDescription {
354
354
  */
355
355
  resolved?: string;
356
356
  }
357
+ /** @see ClivlySDK.describeRemoteProjections */
358
+ interface RemoteProjectionsDescription {
359
+ /** False when no `introspector` is configured — nothing can run. */
360
+ capable: boolean;
361
+ failed: number;
362
+ invalid: number;
363
+ ok: number;
364
+ /** False until a sync has run in this process. */
365
+ ran: boolean;
366
+ skipped: number;
367
+ }
357
368
  interface ClivlySDK {
358
369
  /**
359
370
  * Send a single heartbeat and report the outcome richly: `ok`, the HTTP
@@ -389,6 +400,15 @@ interface ClivlySDK {
389
400
  * anyone who can reach it — set a secret if it's publicly routable.
390
401
  */
391
402
  createClivlyHandler(): (req: Request) => Promise<Response>;
403
+ /**
404
+ * What this app would tell Clivly about dashboard-authored derived objects,
405
+ * right now. Counts rather than the outcomes themselves: this reports
406
+ * health, and the per-object reasons already travel to the dashboard, which
407
+ * is where an author fixes them.
408
+ *
409
+ * Read by `clivly status`.
410
+ */
411
+ describeRemoteProjections(): RemoteProjectionsDescription;
392
412
  /**
393
413
  * What this app would tell Clivly about its sync trigger route, right now.
394
414
  *
@@ -477,6 +497,26 @@ interface ClivlySDK {
477
497
  interface NamespaceIntrospector {
478
498
  /** All base table names in the reachable schema. */
479
499
  listTables(): Promise<string[]>;
500
+ /**
501
+ * Build a runnable sync source from a projection, for derived objects
502
+ * authored in the dashboard rather than in `clivly.config.ts`.
503
+ *
504
+ * Optional for the same reason `runProjection` is: an introspector may be
505
+ * hand-written. Absent, remote projections report `skipped` with a reason
506
+ * naming this method, rather than failing the run.
507
+ *
508
+ * This is deliberately the only route to a database handle for remote
509
+ * projections. `drizzleIntrospector(db)` already closes over the
510
+ * connection, so `introspector:` is the single config line that turns
511
+ * dashboard-authored objects on — and the SDK core never holds a raw
512
+ * client.
513
+ */
514
+ projectionSource?(projection: ProjectionMapping, opts: {
515
+ basePkColumn?: string;
516
+ objectType: string;
517
+ }): SyncSource & {
518
+ objectType: string;
519
+ };
480
520
  /**
481
521
  * Read a few rows through an unsaved projection, for the dashboard's derived
482
522
  * object preview. Rows are keyed by field name.
@@ -498,4 +538,4 @@ interface NamespaceIntrospector {
498
538
  sampleSelect(table: string): Promise<void>;
499
539
  }
500
540
  //#endregion
501
- export { SyncSource as _, ClivlyConnectResult as a, ClivlyUser as c, DiscoveredTable as d, DoctorCheck as f, EnsuredObjectTypeResult as g, EnsuredMappingResult as h, ClivlyConnectReason as i, CreateChatSessionHandlerOptions as l, EnsureSchemaResult as m, ChatSessionRequestBody as n, ClivlySDK as o, DoctorReport as p, ChatWidgetVisitor as r, ClivlySDKConfig as s, NamespaceIntrospector as t, CursorStore as u, SyncTriggerDescription as v };
541
+ export { RemoteProjectionsDescription as _, ClivlyConnectResult as a, ClivlyUser as c, DiscoveredTable as d, DoctorCheck as f, EnsuredObjectTypeResult as g, EnsuredMappingResult as h, ClivlyConnectReason as i, CreateChatSessionHandlerOptions as l, EnsureSchemaResult as m, ChatSessionRequestBody as n, ClivlySDK as o, DoctorReport as p, ChatWidgetVisitor as r, ClivlySDKConfig as s, NamespaceIntrospector as t, CursorStore as u, SyncSource as v, SyncTriggerDescription as y };
@@ -1,4 +1,4 @@
1
- import { P as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-B2RA53nw.cjs";
1
+ import { F as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-DNQAMbMS.cjs";
2
2
  import { r as IntegrationState } from "./integration-state-BK-riZnm.cjs";
3
3
  //#region ../sdk/src/drizzle-meta.d.ts
4
4
  declare const DRIZZLE_META: "__clivly_drizzle_source_meta__";
@@ -354,6 +354,17 @@ interface SyncTriggerDescription {
354
354
  */
355
355
  resolved?: string;
356
356
  }
357
+ /** @see ClivlySDK.describeRemoteProjections */
358
+ interface RemoteProjectionsDescription {
359
+ /** False when no `introspector` is configured — nothing can run. */
360
+ capable: boolean;
361
+ failed: number;
362
+ invalid: number;
363
+ ok: number;
364
+ /** False until a sync has run in this process. */
365
+ ran: boolean;
366
+ skipped: number;
367
+ }
357
368
  interface ClivlySDK {
358
369
  /**
359
370
  * Send a single heartbeat and report the outcome richly: `ok`, the HTTP
@@ -389,6 +400,15 @@ interface ClivlySDK {
389
400
  * anyone who can reach it — set a secret if it's publicly routable.
390
401
  */
391
402
  createClivlyHandler(): (req: Request) => Promise<Response>;
403
+ /**
404
+ * What this app would tell Clivly about dashboard-authored derived objects,
405
+ * right now. Counts rather than the outcomes themselves: this reports
406
+ * health, and the per-object reasons already travel to the dashboard, which
407
+ * is where an author fixes them.
408
+ *
409
+ * Read by `clivly status`.
410
+ */
411
+ describeRemoteProjections(): RemoteProjectionsDescription;
392
412
  /**
393
413
  * What this app would tell Clivly about its sync trigger route, right now.
394
414
  *
@@ -477,6 +497,26 @@ interface ClivlySDK {
477
497
  interface NamespaceIntrospector {
478
498
  /** All base table names in the reachable schema. */
479
499
  listTables(): Promise<string[]>;
500
+ /**
501
+ * Build a runnable sync source from a projection, for derived objects
502
+ * authored in the dashboard rather than in `clivly.config.ts`.
503
+ *
504
+ * Optional for the same reason `runProjection` is: an introspector may be
505
+ * hand-written. Absent, remote projections report `skipped` with a reason
506
+ * naming this method, rather than failing the run.
507
+ *
508
+ * This is deliberately the only route to a database handle for remote
509
+ * projections. `drizzleIntrospector(db)` already closes over the
510
+ * connection, so `introspector:` is the single config line that turns
511
+ * dashboard-authored objects on — and the SDK core never holds a raw
512
+ * client.
513
+ */
514
+ projectionSource?(projection: ProjectionMapping, opts: {
515
+ basePkColumn?: string;
516
+ objectType: string;
517
+ }): SyncSource & {
518
+ objectType: string;
519
+ };
480
520
  /**
481
521
  * Read a few rows through an unsaved projection, for the dashboard's derived
482
522
  * object preview. Rows are keyed by field name.
@@ -498,4 +538,4 @@ interface NamespaceIntrospector {
498
538
  sampleSelect(table: string): Promise<void>;
499
539
  }
500
540
  //#endregion
501
- export { SyncSource as _, ClivlyConnectResult as a, ClivlyUser as c, DiscoveredTable as d, DoctorCheck as f, EnsuredObjectTypeResult as g, EnsuredMappingResult as h, ClivlyConnectReason as i, CreateChatSessionHandlerOptions as l, EnsureSchemaResult as m, ChatSessionRequestBody as n, ClivlySDK as o, DoctorReport as p, ChatWidgetVisitor as r, ClivlySDKConfig as s, NamespaceIntrospector as t, CursorStore as u, SyncTriggerDescription as v };
541
+ export { RemoteProjectionsDescription as _, ClivlyConnectResult as a, ClivlyUser as c, DiscoveredTable as d, DoctorCheck as f, EnsuredObjectTypeResult as g, EnsuredMappingResult as h, ClivlyConnectReason as i, CreateChatSessionHandlerOptions as l, EnsureSchemaResult as m, ChatSessionRequestBody as n, ClivlySDK as o, DoctorReport as p, ChatWidgetVisitor as r, ClivlySDKConfig as s, NamespaceIntrospector as t, CursorStore as u, SyncSource as v, SyncTriggerDescription as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clivly",
3
- "version": "0.9.6",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Clivly CLI — scaffold a CRM into your app (clivly init).",
@@ -4297,4 +4297,4 @@ function identityRefs(identity, basePkColumn) {
4297
4297
  return identity.parts;
4298
4298
  }
4299
4299
  //#endregion
4300
- export { projectionSchema as a, boolean as c, record as d, strictObject as f, identityRefs as i, literal as l, union as m, PROJECTION_KEY_MESSAGE as n, _enum as o, string as p, PROJECTION_KEY_PATTERN as r, array as s, BASE_REF as t, number as u };
4300
+ export { _enum as a, literal as c, strictObject as d, string as f, projectionSchema as i, number as l, PROJECTION_KEY_PATTERN as n, array as o, union as p, identityRefs as r, boolean as s, BASE_REF as t, record as u };
@@ -4303,12 +4303,6 @@ Object.defineProperty(exports, "BASE_REF", {
4303
4303
  return BASE_REF;
4304
4304
  }
4305
4305
  });
4306
- Object.defineProperty(exports, "PROJECTION_KEY_MESSAGE", {
4307
- enumerable: true,
4308
- get: function() {
4309
- return PROJECTION_KEY_MESSAGE;
4310
- }
4311
- });
4312
4306
  Object.defineProperty(exports, "PROJECTION_KEY_PATTERN", {
4313
4307
  enumerable: true,
4314
4308
  get: function() {
@@ -1,4 +1,4 @@
1
- const require_projection = require("./projection-DEwL-D8R.cjs");
1
+ const require_projection = require("./projection-Dz6_i1-w.cjs");
2
2
  //#region ../core/src/projection-sql.ts
3
3
  /**
4
4
  * SQL generation for projection-backed entities.
@@ -1,4 +1,4 @@
1
- import { i as identityRefs, t as BASE_REF } from "./projection-hnPSgH6G.mjs";
1
+ import { r as identityRefs, t as BASE_REF } from "./projection-CSGJbZlZ.mjs";
2
2
  //#region ../core/src/projection-sql.ts
3
3
  /**
4
4
  * SQL generation for projection-backed entities.