clivly 0.14.1 → 0.15.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 (38) hide show
  1. package/README.md +3 -3
  2. package/{adapter-B-iBMhl0.d.mts → adapter-BMAUq4hf.d.mts} +15 -1
  3. package/{adapter-JpXSAnj-.d.cts → adapter-IH3r_I8v.d.cts} +15 -1
  4. package/{auth-adapter-C6rDx3XH.d.mts → auth-adapter-Bt1GZiag.d.cts} +1 -1
  5. package/{auth-adapter-Csk9KkvI.d.cts → auth-adapter-CHy273qb.d.mts} +1 -1
  6. package/auth-better-auth.d.cts +1 -1
  7. package/auth-better-auth.d.mts +1 -1
  8. package/auth-clerk.d.cts +1 -1
  9. package/auth-clerk.d.mts +1 -1
  10. package/auth-workos.d.cts +1 -1
  11. package/auth-workos.d.mts +1 -1
  12. package/core-adapter.d.cts +1 -1
  13. package/core-adapter.d.mts +1 -1
  14. package/core-auth-adapter.d.cts +1 -1
  15. package/core-auth-adapter.d.mts +1 -1
  16. package/core-types.d.cts +1 -1
  17. package/core-types.d.mts +1 -1
  18. package/core.cjs +1 -1
  19. package/core.d.cts +4 -4
  20. package/core.d.mts +4 -4
  21. package/core.mjs +1 -1
  22. package/{internal-Cmx7Zevf.d.mts → internal-C7NlPM3M.d.mts} +3 -1
  23. package/{internal-u0Bks5Gr.mjs → internal-CLvZdVj5.mjs} +12 -0
  24. package/{internal-vH5Rlg6Q.d.cts → internal-D2J4VQWT.d.cts} +3 -1
  25. package/{internal-BxtvxF7Z.cjs → internal-DsArcqkP.cjs} +12 -0
  26. package/internal-adapter.d.cts +1 -1
  27. package/internal-adapter.d.mts +1 -1
  28. package/internal-auth-adapter.d.cts +1 -1
  29. package/internal-auth-adapter.d.mts +1 -1
  30. package/internal-types.d.cts +1 -1
  31. package/internal-types.d.mts +1 -1
  32. package/internal.cjs +1 -1
  33. package/internal.d.cts +4 -4
  34. package/internal.d.mts +4 -4
  35. package/internal.mjs +1 -1
  36. package/package.json +1 -1
  37. package/{types-B17TWEOL.d.cts → types-CpAtAtxd.d.cts} +35 -0
  38. package/{types-B17TWEOL.d.mts → types-CpAtAtxd.d.mts} +35 -0
package/README.md CHANGED
@@ -245,9 +245,9 @@ would never load.
245
245
 
246
246
  The pairing endpoints are feature-flagged server-side
247
247
  (`CLIVLY_CLI_PAIRING_ENABLED`). **Clivly Cloud has pairing enabled**, so
248
- `clivly login` is the normal path there. The flag defaults to `false`, so a
249
- self-hosted backend must opt in — otherwise `clivly login` says so and exits
250
- non-zero.
248
+ `clivly login` is the normal path there. Against a backend
249
+ with the flag off, `clivly login` says so and exits non-zero; use the manual
250
+ credential path below.
251
251
 
252
252
  #### Manual credential path
253
253
 
@@ -1,4 +1,4 @@
1
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-B17TWEOL.mjs";
1
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-CpAtAtxd.mjs";
2
2
  //#region ../core/src/adapter.d.ts
3
3
  /**
4
4
  * The contract every ORM implementation fulfils. `packages/drizzle` is the first
@@ -19,6 +19,20 @@ interface CRMAdapter {
19
19
  archiveContact(orgId: string, id: string): Promise<Contact>;
20
20
  archiveTask(orgId: string, id: string): Promise<Task>;
21
21
  completeTask(orgId: string, id: string): Promise<Task>;
22
+ /**
23
+ * How many contacts match `filters`, ignoring pagination entirely.
24
+ *
25
+ * Exists so a caller can state the size of a selection before acting on it —
26
+ * a bulk send has to say "this will go to N contacts", and the paged read
27
+ * cannot answer that: it knows only whether *another* page exists, never how
28
+ * many rows are behind it.
29
+ *
30
+ * Takes the same `ContactFilters` as {@link CRMAdapter.listContactsPage} and
31
+ * applies exactly the same predicates, so the count and the list can never
32
+ * disagree about what matches. It returns a number rather than rows, so it
33
+ * stays bounded however large the match is.
34
+ */
35
+ countContacts(orgId: string, filters?: ContactFilters): Promise<number>;
22
36
  createActivity(orgId: string, data: CreateActivityInput): Promise<Activity>;
23
37
  createCompany(orgId: string, data: CreateCompanyInput): Promise<Company>;
24
38
  createContact(orgId: string, data: CreateContactInput): Promise<Contact>;
@@ -1,4 +1,4 @@
1
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-B17TWEOL.cjs";
1
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-CpAtAtxd.cjs";
2
2
  //#region ../core/src/adapter.d.ts
3
3
  /**
4
4
  * The contract every ORM implementation fulfils. `packages/drizzle` is the first
@@ -19,6 +19,20 @@ interface CRMAdapter {
19
19
  archiveContact(orgId: string, id: string): Promise<Contact>;
20
20
  archiveTask(orgId: string, id: string): Promise<Task>;
21
21
  completeTask(orgId: string, id: string): Promise<Task>;
22
+ /**
23
+ * How many contacts match `filters`, ignoring pagination entirely.
24
+ *
25
+ * Exists so a caller can state the size of a selection before acting on it —
26
+ * a bulk send has to say "this will go to N contacts", and the paged read
27
+ * cannot answer that: it knows only whether *another* page exists, never how
28
+ * many rows are behind it.
29
+ *
30
+ * Takes the same `ContactFilters` as {@link CRMAdapter.listContactsPage} and
31
+ * applies exactly the same predicates, so the count and the list can never
32
+ * disagree about what matches. It returns a number rather than rows, so it
33
+ * stays bounded however large the match is.
34
+ */
35
+ countContacts(orgId: string, filters?: ContactFilters): Promise<number>;
22
36
  createActivity(orgId: string, data: CreateActivityInput): Promise<Activity>;
23
37
  createCompany(orgId: string, data: CreateCompanyInput): Promise<Company>;
24
38
  createContact(orgId: string, data: CreateContactInput): Promise<Contact>;
@@ -1,4 +1,4 @@
1
- import { p as CrmRole } from "./types-B17TWEOL.mjs";
1
+ import { p as CrmRole } from "./types-CpAtAtxd.cjs";
2
2
  //#region ../core/src/auth-adapter.d.ts
3
3
  interface ClivlyUser {
4
4
  email: string;
@@ -1,4 +1,4 @@
1
- import { p as CrmRole } from "./types-B17TWEOL.cjs";
1
+ import { p as CrmRole } from "./types-CpAtAtxd.mjs";
2
2
  //#region ../core/src/auth-adapter.d.ts
3
3
  interface ClivlyUser {
4
4
  email: string;
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
2
2
  //#region ../auth-better-auth/src/map.d.ts
3
3
  interface BetterAuthLikeUser {
4
4
  email?: string | null;
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
2
2
  //#region ../auth-better-auth/src/map.d.ts
3
3
  interface BetterAuthLikeUser {
4
4
  email?: string | null;
package/auth-clerk.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
2
2
  //#region ../auth-clerk/src/map.d.ts
3
3
  interface ClerkLikeUser {
4
4
  emailAddresses?: Array<{
package/auth-clerk.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
2
2
  //#region ../auth-clerk/src/map.d.ts
3
3
  interface ClerkLikeUser {
4
4
  emailAddresses?: Array<{
package/auth-workos.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
2
2
  //#region ../auth-workos/src/map.d.ts
3
3
  interface WorkOSLikeUser {
4
4
  email: string;
package/auth-workos.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
2
2
  //#region ../auth-workos/src/map.d.ts
3
3
  interface WorkOSLikeUser {
4
4
  email: string;
@@ -1,2 +1,2 @@
1
- import { t as CRMAdapter } from "./adapter-JpXSAnj-.cjs";
1
+ import { t as CRMAdapter } from "./adapter-IH3r_I8v.cjs";
2
2
  export { CRMAdapter };
@@ -1,2 +1,2 @@
1
- import { t as CRMAdapter } from "./adapter-B-iBMhl0.mjs";
1
+ import { t as CRMAdapter } from "./adapter-BMAUq4hf.mjs";
2
2
  export { CRMAdapter };
@@ -1,2 +1,2 @@
1
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
1
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
2
2
  export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
@@ -1,2 +1,2 @@
1
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
1
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
2
2
  export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
package/core-types.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.cjs";
1
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.cjs";
2
2
  export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
package/core-types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.mjs";
1
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.mjs";
2
2
  export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
package/core.cjs CHANGED
@@ -3,7 +3,7 @@ const require_projection = require("./projection-BELgANG2.cjs");
3
3
  const require_entity_config = require("./entity-config-BI4RYNKL.cjs");
4
4
  const require_mappings_config = require("./mappings-config-BCsRLohT.cjs");
5
5
  const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
6
- const require_internal = require("./internal-BxtvxF7Z.cjs");
6
+ const require_internal = require("./internal-DsArcqkP.cjs");
7
7
  const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
8
8
  const require_projection_sql = require("./projection-sql-DuCtFE9t.cjs");
9
9
  const require_view_compiler = require("./view-compiler-xiwm5iar.cjs");
package/core.d.cts CHANGED
@@ -1,11 +1,11 @@
1
1
  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-ApnT5j3X.cjs";
2
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.cjs";
3
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
4
- import { t as CRMAdapter } from "./adapter-JpXSAnj-.cjs";
2
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.cjs";
3
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
4
+ import { t as CRMAdapter } from "./adapter-IH3r_I8v.cjs";
5
5
  import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-XsLLCqW_.cjs";
6
6
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-iJzbcUMp.cjs";
7
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-Cq8apvZ4.cjs";
8
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-CYsWOujz.cjs";
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-vH5Rlg6Q.cjs";
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-D2J4VQWT.cjs";
10
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-BA4c0RbD.cjs";
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 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, 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/core.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  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-CKcj4-M_.mjs";
2
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.mjs";
3
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
4
- import { t as CRMAdapter } from "./adapter-B-iBMhl0.mjs";
2
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.mjs";
3
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
4
+ import { t as CRMAdapter } from "./adapter-BMAUq4hf.mjs";
5
5
  import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Btn-7gzv.mjs";
6
6
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-D6_oCi2Q.mjs";
7
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-CwKVoK1w.mjs";
8
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-C_5TpvfX.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-Cmx7Zevf.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-C7NlPM3M.mjs";
10
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-BA4c0RbD.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 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, 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/core.mjs CHANGED
@@ -2,7 +2,7 @@ import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs,
2
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-Ccfb2IL9.mjs";
3
3
  import { n as mappingsToEntitiesConfig } from "./mappings-config-CwQNQ6bA.mjs";
4
4
  import { t as authCustom } from "./auth-adapter-gfVDxf3d.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 } from "./internal-u0Bks5Gr.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 } from "./internal-CLvZdVj5.mjs";
6
6
  import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
7
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-DweUaWRc.mjs";
8
8
  import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-C-6RydKK.mjs";
@@ -9,7 +9,7 @@ import { L as ProjectionJoin, R as ProjectionMapping, h as FilterExpr, l as Conf
9
9
  * D8 made for stage-rule conditions.
10
10
  */
11
11
  interface PerSeatValueSource {
12
- /** Flat monthly fee in cents, added before the interval is normalised. */
12
+ /** Flat fee in cents, using the same price basis as the plan prices. */
13
13
  baseFeeCents?: number;
14
14
  /** Mapped column holding "month" or "year". Absent means always monthly. */
15
15
  intervalField?: string;
@@ -18,6 +18,8 @@ interface PerSeatValueSource {
18
18
  planField: string;
19
19
  /** Unit price in cents, keyed by the value found in `planField`. */
20
20
  plans: Record<string, number>;
21
+ /** Monthly rates or amounts charged each billing period. Omitted preserves legacy behaviour. */
22
+ priceBasis?: "monthly" | "billing_interval";
21
23
  /** Mapped column holding the seat count. */
22
24
  seatField: string;
23
25
  /** Stage types whose deals are worth nothing (usually `["lost"]`). */
@@ -23,6 +23,18 @@ function computeDealValue(source, fields, mappedFields, stageType) {
23
23
  const seats = Number(rawSeats);
24
24
  if (!Number.isSafeInteger(seats)) return null;
25
25
  const monthly = (source.baseFeeCents ?? 0) + seats * unitPriceCents;
26
+ if (!Number.isSafeInteger(monthly) || monthly < 0) return null;
27
+ return normalizePrice(monthly, source, fields, mappedFields);
28
+ }
29
+ /** Preserve old configurations while making new price bases explicit. */
30
+ function normalizePrice(monthly, source, fields, mappedFields) {
31
+ if (source.priceBasis === "monthly") return monthly;
32
+ if (source.priceBasis === "billing_interval") {
33
+ const interval = source.intervalField && mappedFields.has(source.intervalField) ? fields[source.intervalField]?.trim().toLowerCase() : null;
34
+ if (interval === "month" || interval === "monthly") return monthly;
35
+ if (interval === "year" || interval === "annual" || interval === "annually" || interval === "yearly") return Math.round(monthly / MONTHS_PER_YEAR);
36
+ return null;
37
+ }
26
38
  return source.intervalField !== void 0 && mappedFields.has(source.intervalField) && fields[source.intervalField] === "year" ? Math.round(monthly / MONTHS_PER_YEAR) : monthly;
27
39
  }
28
40
  //#endregion
@@ -9,7 +9,7 @@ import { L as ProjectionJoin, R as ProjectionMapping, h as FilterExpr, l as Conf
9
9
  * D8 made for stage-rule conditions.
10
10
  */
11
11
  interface PerSeatValueSource {
12
- /** Flat monthly fee in cents, added before the interval is normalised. */
12
+ /** Flat fee in cents, using the same price basis as the plan prices. */
13
13
  baseFeeCents?: number;
14
14
  /** Mapped column holding "month" or "year". Absent means always monthly. */
15
15
  intervalField?: string;
@@ -18,6 +18,8 @@ interface PerSeatValueSource {
18
18
  planField: string;
19
19
  /** Unit price in cents, keyed by the value found in `planField`. */
20
20
  plans: Record<string, number>;
21
+ /** Monthly rates or amounts charged each billing period. Omitted preserves legacy behaviour. */
22
+ priceBasis?: "monthly" | "billing_interval";
21
23
  /** Mapped column holding the seat count. */
22
24
  seatField: string;
23
25
  /** Stage types whose deals are worth nothing (usually `["lost"]`). */
@@ -23,6 +23,18 @@ function computeDealValue(source, fields, mappedFields, stageType) {
23
23
  const seats = Number(rawSeats);
24
24
  if (!Number.isSafeInteger(seats)) return null;
25
25
  const monthly = (source.baseFeeCents ?? 0) + seats * unitPriceCents;
26
+ if (!Number.isSafeInteger(monthly) || monthly < 0) return null;
27
+ return normalizePrice(monthly, source, fields, mappedFields);
28
+ }
29
+ /** Preserve old configurations while making new price bases explicit. */
30
+ function normalizePrice(monthly, source, fields, mappedFields) {
31
+ if (source.priceBasis === "monthly") return monthly;
32
+ if (source.priceBasis === "billing_interval") {
33
+ const interval = source.intervalField && mappedFields.has(source.intervalField) ? fields[source.intervalField]?.trim().toLowerCase() : null;
34
+ if (interval === "month" || interval === "monthly") return monthly;
35
+ if (interval === "year" || interval === "annual" || interval === "annually" || interval === "yearly") return Math.round(monthly / MONTHS_PER_YEAR);
36
+ return null;
37
+ }
26
38
  return source.intervalField !== void 0 && mappedFields.has(source.intervalField) && fields[source.intervalField] === "year" ? Math.round(monthly / MONTHS_PER_YEAR) : monthly;
27
39
  }
28
40
  //#endregion
@@ -1,2 +1,2 @@
1
- import { t as CRMAdapter } from "./adapter-JpXSAnj-.cjs";
1
+ import { t as CRMAdapter } from "./adapter-IH3r_I8v.cjs";
2
2
  export { CRMAdapter };
@@ -1,2 +1,2 @@
1
- import { t as CRMAdapter } from "./adapter-B-iBMhl0.mjs";
1
+ import { t as CRMAdapter } from "./adapter-BMAUq4hf.mjs";
2
2
  export { CRMAdapter };
@@ -1,2 +1,2 @@
1
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
1
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
2
2
  export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
@@ -1,2 +1,2 @@
1
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
1
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
2
2
  export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
@@ -1,2 +1,2 @@
1
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.cjs";
1
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.cjs";
2
2
  export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
@@ -1,2 +1,2 @@
1
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.mjs";
1
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.mjs";
2
2
  export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
package/internal.cjs CHANGED
@@ -3,7 +3,7 @@ const require_projection = require("./projection-BELgANG2.cjs");
3
3
  const require_entity_config = require("./entity-config-BI4RYNKL.cjs");
4
4
  const require_mappings_config = require("./mappings-config-BCsRLohT.cjs");
5
5
  const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
6
- const require_internal = require("./internal-BxtvxF7Z.cjs");
6
+ const require_internal = require("./internal-DsArcqkP.cjs");
7
7
  const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
8
8
  const require_projection_sql = require("./projection-sql-DuCtFE9t.cjs");
9
9
  const require_view_compiler = require("./view-compiler-xiwm5iar.cjs");
package/internal.d.cts CHANGED
@@ -1,11 +1,11 @@
1
1
  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-ApnT5j3X.cjs";
2
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.cjs";
3
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
4
- import { t as CRMAdapter } from "./adapter-JpXSAnj-.cjs";
2
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.cjs";
3
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
4
+ import { t as CRMAdapter } from "./adapter-IH3r_I8v.cjs";
5
5
  import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-XsLLCqW_.cjs";
6
6
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-iJzbcUMp.cjs";
7
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-Cq8apvZ4.cjs";
8
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-CYsWOujz.cjs";
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-vH5Rlg6Q.cjs";
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-D2J4VQWT.cjs";
10
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-BA4c0RbD.cjs";
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 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, 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.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  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-CKcj4-M_.mjs";
2
- import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.mjs";
3
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
4
- import { t as CRMAdapter } from "./adapter-B-iBMhl0.mjs";
2
+ import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.mjs";
3
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
4
+ import { t as CRMAdapter } from "./adapter-BMAUq4hf.mjs";
5
5
  import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Btn-7gzv.mjs";
6
6
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-D6_oCi2Q.mjs";
7
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-CwKVoK1w.mjs";
8
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-C_5TpvfX.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-Cmx7Zevf.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-C7NlPM3M.mjs";
10
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-BA4c0RbD.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 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, 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
@@ -2,7 +2,7 @@ import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs,
2
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-Ccfb2IL9.mjs";
3
3
  import { n as mappingsToEntitiesConfig } from "./mappings-config-CwQNQ6bA.mjs";
4
4
  import { t as authCustom } from "./auth-adapter-gfVDxf3d.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 } from "./internal-u0Bks5Gr.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 } from "./internal-CLvZdVj5.mjs";
6
6
  import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
7
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-DweUaWRc.mjs";
8
8
  import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-C-6RydKK.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clivly",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Clivly CLI — scaffold a CRM into your app (clivly init).",
@@ -84,12 +84,21 @@ interface Company {
84
84
  }
85
85
  interface Deal {
86
86
  closeDate: Date | null;
87
+ /** The organisation this deal belongs to, when one is linked. */
88
+ companyId: string | null;
87
89
  contactId: string | null;
88
90
  createdAt: Date;
89
91
  id: string;
90
92
  name: string;
91
93
  orgId: string;
92
94
  owner: string | null;
95
+ /**
96
+ * The board this deal belongs to. NULL means the org's default pipeline: the
97
+ * sync mirror wrote deals before pipelines existed, and a deal created with
98
+ * no pipeline lands on the default. Stage keys are unique per pipeline, so
99
+ * a board must filter on this, never on stage key alone.
100
+ */
101
+ pipelineId: string | null;
93
102
  position: number | null;
94
103
  stage: DealStage;
95
104
  /**
@@ -116,6 +125,11 @@ interface Task {
116
125
  createdAt: Date;
117
126
  createdBy: string | null;
118
127
  description: string | null;
128
+ /**
129
+ * Whether `dueAt` is a calendar date (stored as midnight UTC) rather than a
130
+ * moment. Absent or null: a midnight-UTC `dueAt` is read as a date.
131
+ */
132
+ dueAllDay?: boolean | null;
119
133
  dueAt: Date | null;
120
134
  entityId: string | null;
121
135
  entityType: TaskEntityType | null;
@@ -203,6 +217,11 @@ interface CreateTaskInput {
203
217
  assignee?: string;
204
218
  createdBy?: string;
205
219
  description?: string;
220
+ /**
221
+ * Whether `dueAt` is a calendar date (stored as midnight UTC) rather than a
222
+ * moment. Absent or null: a midnight-UTC `dueAt` is read as a date.
223
+ */
224
+ dueAllDay?: boolean | null;
206
225
  dueAt?: Date;
207
226
  entityId?: string;
208
227
  entityType?: TaskEntityType;
@@ -212,6 +231,11 @@ interface CreateTaskInput {
212
231
  interface UpdateTaskInput {
213
232
  assignee?: string | null;
214
233
  description?: string | null;
234
+ /**
235
+ * Whether `dueAt` is a calendar date (stored as midnight UTC) rather than a
236
+ * moment. Absent or null: a midnight-UTC `dueAt` is read as a date.
237
+ */
238
+ dueAllDay?: boolean | null;
215
239
  dueAt?: Date | null;
216
240
  entityId?: string | null;
217
241
  entityType?: TaskEntityType | null;
@@ -244,6 +268,17 @@ interface ContactFilters {
244
268
  * row is no longer sync-provenanced.
245
269
  */
246
270
  excludeArchived?: boolean;
271
+ /**
272
+ * Case-insensitive substring match on name or email.
273
+ *
274
+ * Applied in SQL, not over an already-fetched page: a filter applied after
275
+ * paging returns a partial page and a cursor that skips the rows it dropped,
276
+ * so "page 2" of a search is not the second page of the matches. An empty or
277
+ * whitespace-only value is ignored rather than matching nothing.
278
+ *
279
+ * LIKE metacharacters in the term are escaped and matched literally — a
280
+ * search for `%` finds contacts containing a percent sign, not every row.
281
+ */
247
282
  search?: string;
248
283
  source?: RecordSource;
249
284
  status?: ContactStatus;
@@ -84,12 +84,21 @@ interface Company {
84
84
  }
85
85
  interface Deal {
86
86
  closeDate: Date | null;
87
+ /** The organisation this deal belongs to, when one is linked. */
88
+ companyId: string | null;
87
89
  contactId: string | null;
88
90
  createdAt: Date;
89
91
  id: string;
90
92
  name: string;
91
93
  orgId: string;
92
94
  owner: string | null;
95
+ /**
96
+ * The board this deal belongs to. NULL means the org's default pipeline: the
97
+ * sync mirror wrote deals before pipelines existed, and a deal created with
98
+ * no pipeline lands on the default. Stage keys are unique per pipeline, so
99
+ * a board must filter on this, never on stage key alone.
100
+ */
101
+ pipelineId: string | null;
93
102
  position: number | null;
94
103
  stage: DealStage;
95
104
  /**
@@ -116,6 +125,11 @@ interface Task {
116
125
  createdAt: Date;
117
126
  createdBy: string | null;
118
127
  description: string | null;
128
+ /**
129
+ * Whether `dueAt` is a calendar date (stored as midnight UTC) rather than a
130
+ * moment. Absent or null: a midnight-UTC `dueAt` is read as a date.
131
+ */
132
+ dueAllDay?: boolean | null;
119
133
  dueAt: Date | null;
120
134
  entityId: string | null;
121
135
  entityType: TaskEntityType | null;
@@ -203,6 +217,11 @@ interface CreateTaskInput {
203
217
  assignee?: string;
204
218
  createdBy?: string;
205
219
  description?: string;
220
+ /**
221
+ * Whether `dueAt` is a calendar date (stored as midnight UTC) rather than a
222
+ * moment. Absent or null: a midnight-UTC `dueAt` is read as a date.
223
+ */
224
+ dueAllDay?: boolean | null;
206
225
  dueAt?: Date;
207
226
  entityId?: string;
208
227
  entityType?: TaskEntityType;
@@ -212,6 +231,11 @@ interface CreateTaskInput {
212
231
  interface UpdateTaskInput {
213
232
  assignee?: string | null;
214
233
  description?: string | null;
234
+ /**
235
+ * Whether `dueAt` is a calendar date (stored as midnight UTC) rather than a
236
+ * moment. Absent or null: a midnight-UTC `dueAt` is read as a date.
237
+ */
238
+ dueAllDay?: boolean | null;
215
239
  dueAt?: Date | null;
216
240
  entityId?: string | null;
217
241
  entityType?: TaskEntityType | null;
@@ -244,6 +268,17 @@ interface ContactFilters {
244
268
  * row is no longer sync-provenanced.
245
269
  */
246
270
  excludeArchived?: boolean;
271
+ /**
272
+ * Case-insensitive substring match on name or email.
273
+ *
274
+ * Applied in SQL, not over an already-fetched page: a filter applied after
275
+ * paging returns a partial page and a cursor that skips the rows it dropped,
276
+ * so "page 2" of a search is not the second page of the matches. An empty or
277
+ * whitespace-only value is ignored rather than matching nothing.
278
+ *
279
+ * LIKE metacharacters in the term are escaped and matched literally — a
280
+ * search for `%` finds contacts containing a percent sign, not every row.
281
+ */
247
282
  search?: string;
248
283
  source?: RecordSource;
249
284
  status?: ContactStatus;