clivly 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +330 -134
- package/core-drizzle.cjs +3 -1
- package/core-drizzle.d.cts +3 -2
- package/core-drizzle.d.mts +3 -2
- package/core-drizzle.mjs +2 -2
- package/core-entity-config.cjs +2 -1
- package/core-entity-config.d.cts +2 -2
- package/core-entity-config.d.mts +2 -2
- package/core-entity-config.mjs +2 -2
- package/core-entity-heuristics.d.cts +3 -2
- package/core-entity-heuristics.d.mts +3 -2
- package/core-mapping-form.d.cts +1 -1
- package/core-mapping-form.d.mts +1 -1
- package/core-mappings-config.cjs +1 -1
- package/core-mappings-config.d.cts +1 -1
- package/core-mappings-config.d.mts +1 -1
- package/core-mappings-config.mjs +1 -1
- package/core-sync-engine.cjs +1 -1
- package/core-sync-engine.d.cts +1 -1
- package/core-sync-engine.d.mts +1 -1
- package/core-sync-engine.mjs +1 -1
- package/core-view-compiler.cjs +2 -1
- package/core-view-compiler.d.cts +2 -2
- package/core-view-compiler.d.mts +2 -2
- package/core-view-compiler.mjs +2 -2
- package/core.cjs +21 -5
- package/core.d.cts +7 -6
- package/core.d.mts +7 -6
- package/core.mjs +7 -6
- package/drizzle-3kvhkwO7.mjs +110 -0
- package/drizzle-DooDUGqO.d.mts +41 -0
- package/drizzle-bfjVzYR6.cjs +127 -0
- package/drizzle-jz0lrAgl.d.cts +41 -0
- package/drizzle.cjs +12 -40
- package/drizzle.d.cts +3 -11
- package/drizzle.d.mts +3 -11
- package/drizzle.mjs +12 -41
- package/entity-config-D08zAeFY.mjs +657 -0
- package/{entity-config-DoUCXtq5.d.cts → entity-config-fKQhimtD.d.cts} +263 -2
- package/{entity-config-DoUCXtq5.d.mts → entity-config-fKQhimtD.d.mts} +263 -2
- package/entity-config-nuXge6rY.cjs +778 -0
- package/index.cjs +768 -122
- package/index.d.cts +12 -0
- package/index.d.mts +12 -0
- package/index.mjs +769 -123
- package/internal-BGVUG312.mjs +68 -0
- package/internal-BLCK81kB.d.mts +72 -0
- package/internal-C-YBW2DB.d.cts +72 -0
- package/internal-D4HDi2GC.cjs +97 -0
- package/internal-drizzle.cjs +3 -1
- package/internal-drizzle.d.cts +2 -2
- package/internal-drizzle.d.mts +2 -2
- package/internal-drizzle.mjs +2 -2
- package/internal-entity-config.cjs +2 -1
- package/internal-entity-config.d.cts +2 -2
- package/internal-entity-config.d.mts +2 -2
- package/internal-entity-config.mjs +2 -2
- package/internal-entity-heuristics.cjs +28 -8
- package/internal-entity-heuristics.d.cts +2 -12
- package/internal-entity-heuristics.d.mts +2 -12
- package/internal-entity-heuristics.mjs +28 -8
- package/internal-mapping-form.d.cts +1 -1
- package/internal-mapping-form.d.mts +1 -1
- package/internal-mappings-config.cjs +1 -1
- package/internal-mappings-config.d.cts +1 -1
- package/internal-mappings-config.d.mts +1 -1
- package/internal-mappings-config.mjs +1 -1
- package/internal-sync-engine.cjs +1 -1
- package/internal-sync-engine.d.cts +1 -1
- package/internal-sync-engine.d.mts +1 -1
- package/internal-sync-engine.mjs +1 -1
- package/internal-view-compiler.cjs +2 -1
- package/internal-view-compiler.d.cts +2 -2
- package/internal-view-compiler.d.mts +2 -2
- package/internal-view-compiler.mjs +2 -2
- package/internal.cjs +21 -4
- package/internal.d.cts +7 -6
- package/internal.d.mts +7 -6
- package/internal.mjs +7 -5
- package/{mapping-form-D93lhHEc.d.mts → mapping-form-DhY0iFmN.d.cts} +1 -1
- package/{mapping-form-lfyEE7EJ.d.cts → mapping-form-Du36VZr1.d.mts} +1 -1
- package/{mappings-config-DsUa7-1w.d.mts → mappings-config-B1qNM8VL.d.cts} +7 -1
- package/{mappings-config-XmzB4dag.d.cts → mappings-config-BChZsany.d.mts} +7 -1
- package/{mappings-config-BsRADNRv.cjs → mappings-config-C8ynKmDK.cjs} +32 -6
- package/{mappings-config-Dbgxx3Nv.mjs → mappings-config-DNaYGyKN.mjs} +32 -6
- package/namespace-probe-BkUs8raG.d.mts +381 -0
- package/namespace-probe-aRFmpU85.d.cts +381 -0
- package/package.json +1 -1
- package/{entity-config-va2bkH5o.mjs → projection-C5244vGa.cjs} +130 -309
- package/{entity-config-D87rV-tE.cjs → projection-D7xmQP4S.mjs} +60 -381
- package/{sdk-iqOXeWIp.cjs → sdk-Bj-ZDf4u.cjs} +126 -28
- package/{sdk-C6WANW8M.mjs → sdk-BvRD2jAp.mjs} +126 -28
- package/sdk.cjs +2 -2
- package/sdk.d.cts +36 -1
- package/sdk.d.mts +36 -1
- package/sdk.mjs +2 -2
- package/{sync-engine-DGk_AeHJ.d.mts → sync-engine-DHQ7rXZe.d.mts} +2 -2
- package/{sync-engine-B7QIbXro.d.cts → sync-engine-DiPjH53O.d.cts} +2 -2
- package/{sync-engine-Do5ru3WF.mjs → sync-engine-SuxSzbZ4.mjs} +9 -2
- package/{sync-engine-CzEbpQGv.cjs → sync-engine-abE94g6X.cjs} +9 -2
- package/{view-compiler-BIwvm-o2.cjs → view-compiler-Blu4OXJ7.cjs} +103 -12
- package/{view-compiler-ChWr_Lml.mjs → view-compiler-CQx8TRrW.mjs} +98 -13
- package/{view-compiler-BWz0sGdm.d.cts → view-compiler-CcUwzZut.d.mts} +12 -2
- package/{view-compiler-Bn_EJJMO.d.mts → view-compiler-DqAdVxLq.d.cts} +12 -2
- package/vite.d.cts +1 -1
- package/vite.d.mts +1 -1
- package/drizzle-B89tLo4T.mjs +0 -31
- package/drizzle-CFOr9dU9.d.mts +0 -20
- package/drizzle-DiReZf6d.cjs +0 -36
- package/drizzle-DmeKSqeF.d.cts +0 -20
- package/types-CsL0rFYh.d.cts +0 -155
- package/types-CsL0rFYh.d.mts +0 -155
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_view_compiler = require("./view-compiler-
|
|
2
|
+
const require_view_compiler = require("./view-compiler-Blu4OXJ7.cjs");
|
|
3
3
|
exports.DEFAULT_VIEW_PREFIX = require_view_compiler.DEFAULT_VIEW_PREFIX;
|
|
4
4
|
exports.compileEntityView = require_view_compiler.compileEntityView;
|
|
5
5
|
exports.compileEntityViews = require_view_compiler.compileEntityViews;
|
|
6
6
|
exports.explainEntitiesConfig = require_view_compiler.explainEntitiesConfig;
|
|
7
|
+
exports.explainViewExecutionError = require_view_compiler.explainViewExecutionError;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
2
|
-
export { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig };
|
|
1
|
+
import { a as compileEntityView, c as explainViewExecutionError, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-DqAdVxLq.cjs";
|
|
2
|
+
export { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig, explainViewExecutionError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
2
|
-
export { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig };
|
|
1
|
+
import { a as compileEntityView, c as explainViewExecutionError, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-CcUwzZut.mjs";
|
|
2
|
+
export { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig, explainViewExecutionError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-
|
|
2
|
-
export { DEFAULT_VIEW_PREFIX, compileEntityView, compileEntityViews, explainEntitiesConfig };
|
|
1
|
+
import { a as explainViewExecutionError, i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-CQx8TRrW.mjs";
|
|
2
|
+
export { DEFAULT_VIEW_PREFIX, compileEntityView, compileEntityViews, explainEntitiesConfig, explainViewExecutionError };
|
package/internal.cjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_projection = require("./projection-C5244vGa.cjs");
|
|
3
|
+
const require_entity_config = require("./entity-config-nuXge6rY.cjs");
|
|
3
4
|
const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
|
|
4
5
|
const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
|
|
5
|
-
const require_mappings_config = require("./mappings-config-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const require_mappings_config = require("./mappings-config-C8ynKmDK.cjs");
|
|
7
|
+
const require_internal = require("./internal-D4HDi2GC.cjs");
|
|
8
|
+
const require_view_compiler = require("./view-compiler-Blu4OXJ7.cjs");
|
|
9
|
+
const require_sync_engine = require("./sync-engine-abE94g6X.cjs");
|
|
10
|
+
exports.BASE_REF = require_projection.BASE_REF;
|
|
8
11
|
exports.CANONICAL_FIELDS = require_entity_config.CANONICAL_FIELDS;
|
|
9
12
|
exports.CRM_CONCEPTS = require_entity_config.CRM_CONCEPTS;
|
|
10
13
|
exports.ClivlyConfigError = require_entity_config.ClivlyConfigError;
|
|
@@ -13,16 +16,30 @@ exports.MATERIALIZING_CONCEPTS = require_entity_config.MATERIALIZING_CONCEPTS;
|
|
|
13
16
|
exports.authCustom = require_auth_adapter.authCustom;
|
|
14
17
|
exports.buildFilterFromDiscriminator = require_mapping_form.buildFilterFromDiscriminator;
|
|
15
18
|
exports.buildRelationships = require_mapping_form.buildRelationships;
|
|
19
|
+
exports.columnMetaFor = require_entity_config.columnMetaFor;
|
|
16
20
|
exports.compileEntityView = require_view_compiler.compileEntityView;
|
|
17
21
|
exports.compileEntityViews = require_view_compiler.compileEntityViews;
|
|
22
|
+
exports.coversUniqueKey = require_entity_config.coversUniqueKey;
|
|
18
23
|
exports.defineClivlyConfig = require_entity_config.defineClivlyConfig;
|
|
24
|
+
exports.describeCardinality = require_internal.describeCardinality;
|
|
25
|
+
exports.draftErrors = require_internal.draftErrors;
|
|
26
|
+
exports.draftToProjection = require_internal.draftToProjection;
|
|
27
|
+
exports.emptyProjectionDraft = require_internal.emptyProjectionDraft;
|
|
19
28
|
exports.entitiesConfigSchema = require_entity_config.entitiesConfigSchema;
|
|
20
29
|
exports.explainEntitiesConfig = require_view_compiler.explainEntitiesConfig;
|
|
30
|
+
exports.fanOutJoins = require_entity_config.fanOutJoins;
|
|
21
31
|
exports.filterSchema = require_entity_config.filterSchema;
|
|
32
|
+
exports.hasRichMeta = require_entity_config.hasRichMeta;
|
|
33
|
+
exports.identityRefs = require_projection.identityRefs;
|
|
34
|
+
exports.joinFansOut = require_entity_config.joinFansOut;
|
|
22
35
|
exports.mappingsToEntitiesConfig = require_mappings_config.mappingsToEntitiesConfig;
|
|
36
|
+
exports.primaryKeyColumns = require_entity_config.primaryKeyColumns;
|
|
37
|
+
exports.projectionSchema = require_projection.projectionSchema;
|
|
23
38
|
exports.reconcile = require_sync_engine.reconcile;
|
|
24
39
|
exports.relationshipSchema = require_entity_config.relationshipSchema;
|
|
25
40
|
exports.relationshipViaSignature = require_mapping_form.relationshipViaSignature;
|
|
26
41
|
exports.relationshipsSchema = require_entity_config.relationshipsSchema;
|
|
27
42
|
exports.runSync = require_sync_engine.runSync;
|
|
43
|
+
exports.suggestJoinConditions = require_internal.suggestJoinConditions;
|
|
28
44
|
exports.validateEntitiesConfig = require_entity_config.validateEntitiesConfig;
|
|
45
|
+
exports.validateProjection = require_entity_config.validateProjection;
|
package/internal.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
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
2
|
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-DWzgl5Yq.cjs";
|
|
3
3
|
import { t as CRMAdapter } from "./adapter-C2eRbBfo.cjs";
|
|
4
|
-
import { C as validateEntitiesConfig,
|
|
5
|
-
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-
|
|
6
|
-
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-
|
|
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-
|
|
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-
|
|
9
|
-
|
|
4
|
+
import { A as ProjectionIdentity, C as filterSchema, D as validateEntitiesConfig, E as relationshipsSchema, F as projectionSchema, M as ProjectionMapping, N as ProjectionRef, O as BASE_REF, P as identityRefs, S as entitiesConfigSchema, T as relationshipSchema, _ as MaterializingConcept, a as ClivlyEntitiesConfig, b as RelationshipsMap, d as CrmConcept, f as DiscoveredColumnMeta, g as MATERIALIZING_CONCEPTS, h as FilterValue, i as ClivlyConfigError, j as ProjectionJoin, k as ProjectionFieldBinding, l as ConfigValidationError, m as FilterExpr, n as CRM_CONCEPTS, p as DiscoveredSchemaTable, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as RelationshipSpec, x as defineClivlyConfig, y as RelationshipVia } from "./entity-config-fKQhimtD.cjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-DhY0iFmN.cjs";
|
|
6
|
+
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-B1qNM8VL.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-DqAdVxLq.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-DiPjH53O.cjs";
|
|
9
|
+
import { a as validateProjection, c as draftErrors, d as suggestJoinConditions, f as fanOutJoins, i as primaryKeyColumns, l as draftToProjection, n as coversUniqueKey, o as ProjectionDraft, p as joinFansOut, r as hasRichMeta, s as describeCardinality, t as columnMetaFor, u as emptyProjectionDraft } from "./internal-C-YBW2DB.cjs";
|
|
10
|
+
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 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 ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type Note, 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 SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, coversUniqueKey, defineClivlyConfig, describeCardinality, draftErrors, draftToProjection, emptyProjectionDraft, entitiesConfigSchema, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, joinFansOut, mappingsToEntitiesConfig, primaryKeyColumns, projectionSchema, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, suggestJoinConditions, validateEntitiesConfig, validateProjection };
|
package/internal.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
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
2
|
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bjgo8LhN.mjs";
|
|
3
3
|
import { t as CRMAdapter } from "./adapter-D5LRa-NA.mjs";
|
|
4
|
-
import { C as validateEntitiesConfig,
|
|
5
|
-
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-
|
|
6
|
-
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-
|
|
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-
|
|
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-
|
|
9
|
-
|
|
4
|
+
import { A as ProjectionIdentity, C as filterSchema, D as validateEntitiesConfig, E as relationshipsSchema, F as projectionSchema, M as ProjectionMapping, N as ProjectionRef, O as BASE_REF, P as identityRefs, S as entitiesConfigSchema, T as relationshipSchema, _ as MaterializingConcept, a as ClivlyEntitiesConfig, b as RelationshipsMap, d as CrmConcept, f as DiscoveredColumnMeta, g as MATERIALIZING_CONCEPTS, h as FilterValue, i as ClivlyConfigError, j as ProjectionJoin, k as ProjectionFieldBinding, l as ConfigValidationError, m as FilterExpr, n as CRM_CONCEPTS, p as DiscoveredSchemaTable, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as RelationshipSpec, x as defineClivlyConfig, y as RelationshipVia } from "./entity-config-fKQhimtD.mjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Du36VZr1.mjs";
|
|
6
|
+
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-BChZsany.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-CcUwzZut.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-DHQ7rXZe.mjs";
|
|
9
|
+
import { a as validateProjection, c as draftErrors, d as suggestJoinConditions, f as fanOutJoins, i as primaryKeyColumns, l as draftToProjection, n as coversUniqueKey, o as ProjectionDraft, p as joinFansOut, r as hasRichMeta, s as describeCardinality, t as columnMetaFor, u as emptyProjectionDraft } from "./internal-BLCK81kB.mjs";
|
|
10
|
+
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 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 ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type Note, 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 SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, coversUniqueKey, defineClivlyConfig, describeCardinality, draftErrors, draftToProjection, emptyProjectionDraft, entitiesConfigSchema, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, joinFansOut, mappingsToEntitiesConfig, primaryKeyColumns, projectionSchema, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, suggestJoinConditions, validateEntitiesConfig, validateProjection };
|
package/internal.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as projectionSchema, r as identityRefs, t as BASE_REF } from "./projection-D7xmQP4S.mjs";
|
|
2
|
+
import { _ as coversUniqueKey, a as MATERIALIZING_CONCEPTS, c as filterSchema, d as relationshipsSchema, f as validateEntitiesConfig, g as columnMetaFor, h as joinFansOut, i as ClivlyConfigError, m as fanOutJoins, n as CRM_CONCEPTS, o as defineClivlyConfig, p as validateProjection, s as entitiesConfigSchema, t as CANONICAL_FIELDS, u as relationshipSchema, v as hasRichMeta, y as primaryKeyColumns } from "./entity-config-D08zAeFY.mjs";
|
|
2
3
|
import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
|
|
3
4
|
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
|
|
4
|
-
import { t as mappingsToEntitiesConfig } from "./mappings-config-
|
|
5
|
-
import { i as
|
|
6
|
-
import { i as
|
|
7
|
-
|
|
5
|
+
import { t as mappingsToEntitiesConfig } from "./mappings-config-DNaYGyKN.mjs";
|
|
6
|
+
import { a as suggestJoinConditions, i as emptyProjectionDraft, n as draftErrors, r as draftToProjection, t as describeCardinality } from "./internal-BGVUG312.mjs";
|
|
7
|
+
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-CQx8TRrW.mjs";
|
|
8
|
+
import { i as runSync, r as reconcile } from "./sync-engine-SuxSzbZ4.mjs";
|
|
9
|
+
export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, coversUniqueKey, defineClivlyConfig, describeCardinality, draftErrors, draftToProjection, emptyProjectionDraft, entitiesConfigSchema, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, joinFansOut, mappingsToEntitiesConfig, primaryKeyColumns, projectionSchema, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, suggestJoinConditions, validateEntitiesConfig, validateProjection };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as RelationshipsMap, m as FilterExpr, y as RelationshipVia } from "./entity-config-fKQhimtD.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 {
|
|
1
|
+
import { b as RelationshipsMap, m as FilterExpr, y as RelationshipVia } from "./entity-config-fKQhimtD.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 { a as ClivlyEntitiesConfig } from "./entity-config-
|
|
1
|
+
import { M as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-fKQhimtD.cjs";
|
|
2
2
|
//#region ../core/src/mappings-config.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Mappings → Entity Config bridge.
|
|
@@ -23,6 +23,12 @@ import { a as ClivlyEntitiesConfig } from "./entity-config-DoUCXtq5.mjs";
|
|
|
23
23
|
interface EntityMappingRow {
|
|
24
24
|
fieldMap: Record<string, string>;
|
|
25
25
|
filter?: Record<string, unknown> | null;
|
|
26
|
+
/**
|
|
27
|
+
* Advanced mapping: a base table plus explicit joins. When set, this — not
|
|
28
|
+
* `fieldMap` — is the authored source of truth, and `sourceTable` merely
|
|
29
|
+
* mirrors `projection.baseTable`.
|
|
30
|
+
*/
|
|
31
|
+
projection?: ProjectionMapping | null;
|
|
26
32
|
relationships?: Record<string, unknown> | null;
|
|
27
33
|
role?: string | null;
|
|
28
34
|
sourceTable: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ClivlyEntitiesConfig } from "./entity-config-
|
|
1
|
+
import { M as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-fKQhimtD.mjs";
|
|
2
2
|
//#region ../core/src/mappings-config.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Mappings → Entity Config bridge.
|
|
@@ -23,6 +23,12 @@ import { a as ClivlyEntitiesConfig } from "./entity-config-DoUCXtq5.cjs";
|
|
|
23
23
|
interface EntityMappingRow {
|
|
24
24
|
fieldMap: Record<string, string>;
|
|
25
25
|
filter?: Record<string, unknown> | null;
|
|
26
|
+
/**
|
|
27
|
+
* Advanced mapping: a base table plus explicit joins. When set, this — not
|
|
28
|
+
* `fieldMap` — is the authored source of truth, and `sourceTable` merely
|
|
29
|
+
* mirrors `projection.baseTable`.
|
|
30
|
+
*/
|
|
31
|
+
projection?: ProjectionMapping | null;
|
|
26
32
|
relationships?: Record<string, unknown> | null;
|
|
27
33
|
role?: string | null;
|
|
28
34
|
sourceTable: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_entity_config = require("./entity-config-
|
|
1
|
+
const require_entity_config = require("./entity-config-nuXge6rY.cjs");
|
|
2
2
|
//#region ../core/src/mappings-config.ts
|
|
3
3
|
const RESERVED_FIELD = "id";
|
|
4
4
|
/**
|
|
@@ -21,7 +21,9 @@ function canonicalFields(concept, fieldMap) {
|
|
|
21
21
|
const DEFAULT_ROLE = "primary";
|
|
22
22
|
const ACTIVE_STATUS = "active";
|
|
23
23
|
function isEligible(row) {
|
|
24
|
-
|
|
24
|
+
if ((row.status ?? ACTIVE_STATUS) !== ACTIVE_STATUS) return false;
|
|
25
|
+
if (row.projection) return Object.keys(row.projection.fieldBindings ?? {}).length > 0;
|
|
26
|
+
return Object.keys(row.fieldMap ?? {}).length > 0;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Preferred key for a row: the bare source table when it backs a single entity,
|
|
@@ -45,13 +47,28 @@ function uniquify(base, used) {
|
|
|
45
47
|
used.add(key);
|
|
46
48
|
return key;
|
|
47
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
|
+
}
|
|
48
64
|
function buildEntity(row, refIndex) {
|
|
49
65
|
const entity = {
|
|
50
66
|
concept: row.targetConcept,
|
|
51
|
-
source: row.sourceTable,
|
|
67
|
+
source: row.projection?.baseTable ?? row.sourceTable,
|
|
52
68
|
role: row.role ?? DEFAULT_ROLE,
|
|
53
|
-
fields: canonicalFields(row.targetConcept, row.fieldMap)
|
|
69
|
+
fields: row.projection ? projectionFields(row.projection) : canonicalFields(row.targetConcept, row.fieldMap)
|
|
54
70
|
};
|
|
71
|
+
if (row.projection) entity.projection = row.projection;
|
|
55
72
|
if (row.targetConcept === "custom" && row.targetObjectTypeId) entity.targetObjectTypeId = row.targetObjectTypeId;
|
|
56
73
|
if (row.filter && Object.keys(row.filter).length > 0) entity.filter = row.filter;
|
|
57
74
|
if (row.relationships && Object.keys(row.relationships).length > 0) {
|
|
@@ -76,11 +93,16 @@ function buildEntity(row, refIndex) {
|
|
|
76
93
|
function mappingsToEntitiesConfig(rows) {
|
|
77
94
|
const eligible = rows.filter(isEligible);
|
|
78
95
|
const tableCounts = /* @__PURE__ */ new Map();
|
|
79
|
-
for (const row of eligible)
|
|
96
|
+
for (const row of eligible) {
|
|
97
|
+
if (row.projection) continue;
|
|
98
|
+
tableCounts.set(row.sourceTable, (tableCounts.get(row.sourceTable) ?? 0) + 1);
|
|
99
|
+
}
|
|
80
100
|
const used = /* @__PURE__ */ new Set();
|
|
81
101
|
const tableAnchor = /* @__PURE__ */ new Map();
|
|
82
102
|
const assigned = [];
|
|
83
|
-
|
|
103
|
+
const legacyRows = eligible.filter((row) => !row.projection);
|
|
104
|
+
const projectionRows = eligible.filter((row) => row.projection);
|
|
105
|
+
for (const row of legacyRows) {
|
|
84
106
|
const key = uniquify(preferredKey(row, tableCounts), used);
|
|
85
107
|
assigned.push({
|
|
86
108
|
row,
|
|
@@ -88,6 +110,10 @@ function mappingsToEntitiesConfig(rows) {
|
|
|
88
110
|
});
|
|
89
111
|
if ((row.role ?? DEFAULT_ROLE) === DEFAULT_ROLE || !tableAnchor.has(row.sourceTable)) tableAnchor.set(row.sourceTable, key);
|
|
90
112
|
}
|
|
113
|
+
for (const row of projectionRows) assigned.push({
|
|
114
|
+
row,
|
|
115
|
+
key: uniquify(row.projection?.entityKey ?? row.sourceTable, used)
|
|
116
|
+
});
|
|
91
117
|
const refIndex = /* @__PURE__ */ new Map();
|
|
92
118
|
for (const { key } of assigned) refIndex.set(key, key);
|
|
93
119
|
for (const [table, key] of tableAnchor) if (!refIndex.has(table)) refIndex.set(table, key);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CANONICAL_FIELDS } from "./entity-config-
|
|
1
|
+
import { t as CANONICAL_FIELDS } from "./entity-config-D08zAeFY.mjs";
|
|
2
2
|
//#region ../core/src/mappings-config.ts
|
|
3
3
|
const RESERVED_FIELD = "id";
|
|
4
4
|
/**
|
|
@@ -21,7 +21,9 @@ function canonicalFields(concept, fieldMap) {
|
|
|
21
21
|
const DEFAULT_ROLE = "primary";
|
|
22
22
|
const ACTIVE_STATUS = "active";
|
|
23
23
|
function isEligible(row) {
|
|
24
|
-
|
|
24
|
+
if ((row.status ?? ACTIVE_STATUS) !== ACTIVE_STATUS) return false;
|
|
25
|
+
if (row.projection) return Object.keys(row.projection.fieldBindings ?? {}).length > 0;
|
|
26
|
+
return Object.keys(row.fieldMap ?? {}).length > 0;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Preferred key for a row: the bare source table when it backs a single entity,
|
|
@@ -45,13 +47,28 @@ function uniquify(base, used) {
|
|
|
45
47
|
used.add(key);
|
|
46
48
|
return key;
|
|
47
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
|
+
}
|
|
48
64
|
function buildEntity(row, refIndex) {
|
|
49
65
|
const entity = {
|
|
50
66
|
concept: row.targetConcept,
|
|
51
|
-
source: row.sourceTable,
|
|
67
|
+
source: row.projection?.baseTable ?? row.sourceTable,
|
|
52
68
|
role: row.role ?? DEFAULT_ROLE,
|
|
53
|
-
fields: canonicalFields(row.targetConcept, row.fieldMap)
|
|
69
|
+
fields: row.projection ? projectionFields(row.projection) : canonicalFields(row.targetConcept, row.fieldMap)
|
|
54
70
|
};
|
|
71
|
+
if (row.projection) entity.projection = row.projection;
|
|
55
72
|
if (row.targetConcept === "custom" && row.targetObjectTypeId) entity.targetObjectTypeId = row.targetObjectTypeId;
|
|
56
73
|
if (row.filter && Object.keys(row.filter).length > 0) entity.filter = row.filter;
|
|
57
74
|
if (row.relationships && Object.keys(row.relationships).length > 0) {
|
|
@@ -76,11 +93,16 @@ function buildEntity(row, refIndex) {
|
|
|
76
93
|
function mappingsToEntitiesConfig(rows) {
|
|
77
94
|
const eligible = rows.filter(isEligible);
|
|
78
95
|
const tableCounts = /* @__PURE__ */ new Map();
|
|
79
|
-
for (const row of eligible)
|
|
96
|
+
for (const row of eligible) {
|
|
97
|
+
if (row.projection) continue;
|
|
98
|
+
tableCounts.set(row.sourceTable, (tableCounts.get(row.sourceTable) ?? 0) + 1);
|
|
99
|
+
}
|
|
80
100
|
const used = /* @__PURE__ */ new Set();
|
|
81
101
|
const tableAnchor = /* @__PURE__ */ new Map();
|
|
82
102
|
const assigned = [];
|
|
83
|
-
|
|
103
|
+
const legacyRows = eligible.filter((row) => !row.projection);
|
|
104
|
+
const projectionRows = eligible.filter((row) => row.projection);
|
|
105
|
+
for (const row of legacyRows) {
|
|
84
106
|
const key = uniquify(preferredKey(row, tableCounts), used);
|
|
85
107
|
assigned.push({
|
|
86
108
|
row,
|
|
@@ -88,6 +110,10 @@ function mappingsToEntitiesConfig(rows) {
|
|
|
88
110
|
});
|
|
89
111
|
if ((row.role ?? DEFAULT_ROLE) === DEFAULT_ROLE || !tableAnchor.has(row.sourceTable)) tableAnchor.set(row.sourceTable, key);
|
|
90
112
|
}
|
|
113
|
+
for (const row of projectionRows) assigned.push({
|
|
114
|
+
row,
|
|
115
|
+
key: uniquify(row.projection?.entityKey ?? row.sourceTable, used)
|
|
116
|
+
});
|
|
91
117
|
const refIndex = /* @__PURE__ */ new Map();
|
|
92
118
|
for (const { key } of assigned) refIndex.set(key, key);
|
|
93
119
|
for (const [table, key] of tableAnchor) if (!refIndex.has(table)) refIndex.set(table, key);
|