@clivly/core 0.4.0 → 0.7.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.
@@ -1,5 +1,4 @@
1
1
  import { Activity, Company, Contact, ContactFilters, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, Deal, RecordSource, Task, TaskFilters, UpdateContactInput, UpdateDealInput, UpdateTaskInput } from "./types.cjs";
2
-
3
2
  //#region src/adapter.d.ts
4
3
  /**
5
4
  * The contract every ORM implementation fulfils. `packages/drizzle` is the first
@@ -1,5 +1,4 @@
1
1
  import { Activity, Company, Contact, ContactFilters, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, Deal, RecordSource, Task, TaskFilters, UpdateContactInput, UpdateDealInput, UpdateTaskInput } from "./types.mjs";
2
-
3
2
  //#region src/adapter.d.ts
4
3
  /**
5
4
  * The contract every ORM implementation fulfils. `packages/drizzle` is the first
@@ -1,5 +1,4 @@
1
1
  import { CrmRole } from "./types.cjs";
2
-
3
2
  //#region src/auth-adapter.d.ts
4
3
  interface ClivlyUser {
5
4
  email: string;
@@ -1,5 +1,4 @@
1
1
  import { CrmRole } from "./types.mjs";
2
-
3
2
  //#region src/auth-adapter.d.ts
4
3
  interface ClivlyUser {
5
4
  email: string;
@@ -1,5 +1,4 @@
1
1
  import { DiscoveredSchemaTable } from "./entity-config.cjs";
2
-
3
2
  //#region src/drizzle.d.ts
4
3
  /**
5
4
  * Derive Clivly's discovery shape (table + column names) from a Drizzle schema
@@ -1,5 +1,4 @@
1
1
  import { DiscoveredSchemaTable } from "./entity-config.mjs";
2
-
3
2
  //#region src/drizzle.d.ts
4
3
  /**
5
4
  * Derive Clivly's discovery shape (table + column names) from a Drizzle schema
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
-
3
2
  //#region src/entity-config.d.ts
4
3
  /**
5
4
  * Entity Config v2 — the declarative contract that turns Clivly's "schema-aware"
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
-
3
2
  //#region src/entity-config.d.ts
4
3
  /**
5
4
  * Entity Config v2 — the declarative contract that turns Clivly's "schema-aware"
@@ -1,5 +1,4 @@
1
1
  import { Scored } from "./mapping-score.cjs";
2
-
3
2
  //#region src/entity-heuristics.d.ts
4
3
  declare const TARGET_CONCEPTS: readonly ["contact", "company", "deal", "activity", "conversation", "note"];
5
4
  type TargetConcept = (typeof TARGET_CONCEPTS)[number];
@@ -1,5 +1,4 @@
1
1
  import { Scored } from "./mapping-score.mjs";
2
-
3
2
  //#region src/entity-heuristics.d.ts
4
3
  declare const TARGET_CONCEPTS: readonly ["contact", "company", "deal", "activity", "conversation", "note"];
5
4
  type TargetConcept = (typeof TARGET_CONCEPTS)[number];
package/dist/index.d.cts CHANGED
@@ -6,4 +6,4 @@ import { RelationshipCandidate, buildFilterFromDiscriminator, buildRelationships
6
6
  import { EntityMappingRow, mappingsToEntitiesConfig } from "./mappings-config.cjs";
7
7
  import { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig } from "./view-compiler.cjs";
8
8
  import { EntitySyncResult, MirrorRecord, PersistAction, SourceRow, SyncAction, SyncResult, SyncStore, reconcile, runSync } from "./sync-engine.cjs";
9
- export { Activity, ActivityType, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, Company, type CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, type CrmConcept, type CrmMembership, CrmRole, DEFAULT_VIEW_PREFIX, Deal, DealStage, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, Note, type PersistAction, RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SyncAction, type SyncResult, type SyncStore, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateContactInput, UpdateDealInput, UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
9
+ export { type Activity, type ActivityType, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type Note, type PersistAction, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
package/dist/index.d.mts CHANGED
@@ -6,4 +6,4 @@ import { RelationshipCandidate, buildFilterFromDiscriminator, buildRelationships
6
6
  import { EntityMappingRow, mappingsToEntitiesConfig } from "./mappings-config.mjs";
7
7
  import { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig } from "./view-compiler.mjs";
8
8
  import { EntitySyncResult, MirrorRecord, PersistAction, SourceRow, SyncAction, SyncResult, SyncStore, reconcile, runSync } from "./sync-engine.mjs";
9
- export { Activity, ActivityType, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, Company, type CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, type CrmConcept, type CrmMembership, CrmRole, DEFAULT_VIEW_PREFIX, Deal, DealStage, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, Note, type PersistAction, RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SyncAction, type SyncResult, type SyncStore, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateContactInput, UpdateDealInput, UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
9
+ export { type Activity, type ActivityType, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type Note, type PersistAction, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
@@ -1,5 +1,4 @@
1
1
  import { FilterExpr, RelationshipVia, RelationshipsMap } from "./entity-config.cjs";
2
-
3
2
  //#region src/mapping-form.d.ts
4
3
  /**
5
4
  * A relationship the mapping UI can offer or has configured, in the shape the
@@ -1,5 +1,4 @@
1
1
  import { FilterExpr, RelationshipVia, RelationshipsMap } from "./entity-config.mjs";
2
-
3
2
  //#region src/mapping-form.d.ts
4
3
  /**
5
4
  * A relationship the mapping UI can offer or has configured, in the shape the
@@ -1,5 +1,4 @@
1
1
  import { ClivlyEntitiesConfig } from "./entity-config.cjs";
2
-
3
2
  //#region src/mappings-config.d.ts
4
3
  /**
5
4
  * Mappings → Entity Config bridge.
@@ -1,5 +1,4 @@
1
1
  import { ClivlyEntitiesConfig } from "./entity-config.mjs";
2
-
3
2
  //#region src/mappings-config.d.ts
4
3
  /**
5
4
  * Mappings → Entity Config bridge.
@@ -1,6 +1,5 @@
1
1
  import { ClivlyEntitiesConfig } from "./entity-config.cjs";
2
2
  import { CompileOptions, CompiledView } from "./view-compiler.cjs";
3
-
4
3
  //#region src/sync-engine.d.ts
5
4
  /**
6
5
  * Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
@@ -108,13 +107,15 @@ interface SyncStore {
108
107
  /** Current mirror rows for a concept + role (including archived). */
109
108
  listMirror(input: {
110
109
  concept: string;
111
- role: string; /** Target custom-object type id, for `concept: "custom"` entities. */
110
+ role: string;
111
+ /** Target custom-object type id, for `concept: "custom"` entities. */
112
112
  objectTypeId?: string;
113
113
  }): Promise<MirrorRecord[]>;
114
114
  /** Apply the resolved actions to the mirror table for this concept + role. */
115
115
  persist(input: {
116
116
  concept: string;
117
- role: string; /** Target custom-object type id, for `concept: "custom"` entities. */
117
+ role: string;
118
+ /** Target custom-object type id, for `concept: "custom"` entities. */
118
119
  objectTypeId?: string;
119
120
  actions: PersistAction[];
120
121
  }): Promise<void>;
@@ -1,6 +1,5 @@
1
1
  import { ClivlyEntitiesConfig } from "./entity-config.mjs";
2
2
  import { CompileOptions, CompiledView } from "./view-compiler.mjs";
3
-
4
3
  //#region src/sync-engine.d.ts
5
4
  /**
6
5
  * Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
@@ -108,13 +107,15 @@ interface SyncStore {
108
107
  /** Current mirror rows for a concept + role (including archived). */
109
108
  listMirror(input: {
110
109
  concept: string;
111
- role: string; /** Target custom-object type id, for `concept: "custom"` entities. */
110
+ role: string;
111
+ /** Target custom-object type id, for `concept: "custom"` entities. */
112
112
  objectTypeId?: string;
113
113
  }): Promise<MirrorRecord[]>;
114
114
  /** Apply the resolved actions to the mirror table for this concept + role. */
115
115
  persist(input: {
116
116
  concept: string;
117
- role: string; /** Target custom-object type id, for `concept: "custom"` entities. */
117
+ role: string;
118
+ /** Target custom-object type id, for `concept: "custom"` entities. */
118
119
  objectTypeId?: string;
119
120
  actions: PersistAction[];
120
121
  }): Promise<void>;
@@ -1,5 +1,4 @@
1
1
  import { ClivlyEntitiesConfig } from "./entity-config.cjs";
2
-
3
2
  //#region src/view-compiler.d.ts
4
3
  declare const DEFAULT_VIEW_PREFIX = "crm_src_";
5
4
  interface CompileOptions {
@@ -1,5 +1,4 @@
1
1
  import { ClivlyEntitiesConfig } from "./entity-config.mjs";
2
-
3
2
  //#region src/view-compiler.d.ts
4
3
  declare const DEFAULT_VIEW_PREFIX = "crm_src_";
5
4
  interface CompileOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clivly/core",
3
- "version": "0.4.0",
3
+ "version": "0.7.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "ORM/auth-agnostic CRM adapter contracts and shared domain types for Clivly.",
@@ -147,10 +147,13 @@
147
147
  },
148
148
  "devDependencies": {
149
149
  "drizzle-orm": "^0.45.1",
150
- "tsdown": "^0.21.9",
150
+ "tsdown": "^0.22.14",
151
151
  "typescript": "^6",
152
152
  "vitest": "3.2.7"
153
153
  },
154
+ "engines": {
155
+ "node": ">=22"
156
+ },
154
157
  "scripts": {
155
158
  "build": "tsdown",
156
159
  "check-types": "tsc --noEmit",