clivly 0.7.4 → 0.9.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.
- 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 +1 -1
- package/core-entity-config.d.cts +2 -2
- package/core-entity-config.d.mts +2 -2
- package/core-entity-config.mjs +1 -1
- 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 +1 -1
- package/core-view-compiler.d.cts +1 -1
- package/core-view-compiler.d.mts +1 -1
- package/core-view-compiler.mjs +1 -1
- 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-BhN5M9zt.d.cts +41 -0
- package/drizzle-bfjVzYR6.cjs +127 -0
- package/drizzle-kBULBAOa.d.mts +41 -0
- package/drizzle.cjs +5 -37
- package/drizzle.d.cts +3 -3
- package/drizzle.d.mts +3 -3
- package/drizzle.mjs +5 -38
- package/{entity-config-DoUCXtq5.d.cts → entity-config-C4Yf_fPj.d.cts} +120 -1
- package/{entity-config-DoUCXtq5.d.mts → entity-config-C4Yf_fPj.d.mts} +120 -1
- package/entity-config-CsLl-ftC.cjs +727 -0
- package/entity-config-D3LmzgLb.mjs +612 -0
- package/index.cjs +28 -2
- package/index.d.cts +6 -0
- package/index.d.mts +6 -0
- package/index.mjs +28 -2
- package/internal-B8ydhsKd.d.cts +73 -0
- package/internal-BARjyN4n.cjs +97 -0
- package/internal-DMySVbM0.mjs +68 -0
- package/internal-MBkNo3bw.d.mts +73 -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 +1 -1
- package/internal-entity-config.d.cts +2 -2
- package/internal-entity-config.d.mts +2 -2
- package/internal-entity-config.mjs +1 -1
- package/internal-entity-heuristics.cjs +1 -1
- package/internal-entity-heuristics.d.cts +2 -12
- package/internal-entity-heuristics.d.mts +2 -12
- package/internal-entity-heuristics.mjs +1 -1
- 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 +1 -1
- package/internal-view-compiler.d.cts +1 -1
- package/internal-view-compiler.d.mts +1 -1
- package/internal-view-compiler.mjs +1 -1
- 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-43bwOTat.d.cts} +1 -1
- package/{mapping-form-lfyEE7EJ.d.cts → mapping-form-DUvWUYCo.d.mts} +1 -1
- package/{mappings-config-BsRADNRv.cjs → mappings-config-BSSwdHiq.cjs} +32 -6
- package/mappings-config-BpcR8bBo.d.mts +167 -0
- package/{mappings-config-Dbgxx3Nv.mjs → mappings-config-bJQT_gSa.mjs} +32 -6
- package/mappings-config-xsLMn3I-.d.cts +167 -0
- package/{namespace-probe-B4WE45TH.d.mts → namespace-probe-BSH_p9TK.d.cts} +10 -1
- package/{namespace-probe-DRzOtaRT.d.cts → namespace-probe-Dsp5uNkS.d.mts} +10 -1
- 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.cjs +1 -1
- package/sdk.d.cts +2 -2
- package/sdk.d.mts +2 -2
- package/sdk.mjs +1 -1
- package/{sync-engine-Do5ru3WF.mjs → sync-engine-Bg6-SznL.mjs} +9 -2
- package/{sync-engine-CzEbpQGv.cjs → sync-engine-DEJvKw6E.cjs} +9 -2
- package/{sync-engine-DGk_AeHJ.d.mts → sync-engine-GNqRB8eS.d.cts} +2 -2
- package/{sync-engine-B7QIbXro.d.cts → sync-engine-ZsusW-q_.d.mts} +2 -2
- package/{view-compiler-BWz0sGdm.d.cts → view-compiler-Cin0neDO.d.mts} +1 -1
- package/{view-compiler-ChWr_Lml.mjs → view-compiler-DlTpOfZi.mjs} +81 -12
- package/{view-compiler-BIwvm-o2.cjs → view-compiler-DplczSjF.cjs} +81 -12
- package/{view-compiler-Bn_EJJMO.d.mts → view-compiler-Ll9cbIJz.d.cts} +1 -1
- 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/mappings-config-DsUa7-1w.d.mts +0 -41
- package/mappings-config-XmzB4dag.d.cts +0 -41
package/core-drizzle.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_deprecate_subpath = require("./deprecate-subpath-B9ngvizt.cjs");
|
|
3
|
-
const require_drizzle = require("./drizzle-
|
|
3
|
+
const require_drizzle = require("./drizzle-bfjVzYR6.cjs");
|
|
4
4
|
require("./internal-drizzle.cjs");
|
|
5
5
|
//#region src/core-drizzle.ts
|
|
6
6
|
require_deprecate_subpath.warnDeprecatedSubpath("clivly/core/drizzle", "clivly/internal/drizzle");
|
|
7
7
|
//#endregion
|
|
8
|
+
exports.buildColumnsMeta = require_drizzle.buildColumnsMeta;
|
|
9
|
+
exports.buildUniqueConstraints = require_drizzle.buildUniqueConstraints;
|
|
8
10
|
exports.discoverFromDrizzle = require_drizzle.discoverFromDrizzle;
|
package/core-drizzle.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-BhN5M9zt.cjs";
|
|
2
|
+
import "./internal-drizzle.cjs";
|
|
3
|
+
export { buildColumnsMeta, buildUniqueConstraints, discoverFromDrizzle };
|
package/core-drizzle.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-kBULBAOa.mjs";
|
|
2
|
+
import "./internal-drizzle.mjs";
|
|
3
|
+
export { buildColumnsMeta, buildUniqueConstraints, discoverFromDrizzle };
|
package/core-drizzle.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-3kvhkwO7.mjs";
|
|
3
3
|
import "./internal-drizzle.mjs";
|
|
4
4
|
//#region src/core-drizzle.ts
|
|
5
5
|
warnDeprecatedSubpath("clivly/core/drizzle", "clivly/internal/drizzle");
|
|
6
6
|
//#endregion
|
|
7
|
-
export { discoverFromDrizzle };
|
|
7
|
+
export { buildColumnsMeta, buildUniqueConstraints, discoverFromDrizzle };
|
package/core-entity-config.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_entity_config = require("./entity-config-
|
|
2
|
+
const require_entity_config = require("./entity-config-CsLl-ftC.cjs");
|
|
3
3
|
//#region src/core-entity-config.ts
|
|
4
4
|
require("./deprecate-subpath-B9ngvizt.cjs").warnDeprecatedSubpath("clivly/core/entity-config", "clivly/internal/entity-config");
|
|
5
5
|
//#endregion
|
package/core-entity-config.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { CANONICAL_FIELDS, CRM_CONCEPTS, CUSTOM_CONCEPT, ClivlyConfigError, ClivlyEntitiesConfig, ClivlyEntityConfig, ConfigValidationError, ConfigValidationResult, CrmConcept, DiscoveredSchemaTable, FilterExpr, FilterValue, MATERIALIZING_CONCEPTS, MaterializingConcept, RelationshipSpec, RelationshipVia, RelationshipsMap, defineClivlyConfig, entitiesConfigSchema, filterSchema, relationshipSchema, relationshipsSchema, validateEntitiesConfig };
|
|
1
|
+
import { C as relationshipsSchema, S as relationshipSchema, _ as RelationshipVia, a as ClivlyEntitiesConfig, b as entitiesConfigSchema, c as ConfigValidationResult, d as DiscoveredSchemaTable, f as FilterExpr, g as RelationshipSpec, h as MaterializingConcept, i as ClivlyConfigError, l as CrmConcept, m as MATERIALIZING_CONCEPTS, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as FilterValue, r as CUSTOM_CONCEPT, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredColumnMeta, v as RelationshipsMap, w as validateEntitiesConfig, x as filterSchema, y as defineClivlyConfig } from "./entity-config-C4Yf_fPj.cjs";
|
|
2
|
+
export { CANONICAL_FIELDS, CRM_CONCEPTS, CUSTOM_CONCEPT, ClivlyConfigError, ClivlyEntitiesConfig, ClivlyEntityConfig, ConfigValidationError, ConfigValidationResult, CrmConcept, DiscoveredColumnMeta, DiscoveredSchemaTable, FilterExpr, FilterValue, MATERIALIZING_CONCEPTS, MaterializingConcept, RelationshipSpec, RelationshipVia, RelationshipsMap, defineClivlyConfig, entitiesConfigSchema, filterSchema, relationshipSchema, relationshipsSchema, validateEntitiesConfig };
|
package/core-entity-config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { CANONICAL_FIELDS, CRM_CONCEPTS, CUSTOM_CONCEPT, ClivlyConfigError, ClivlyEntitiesConfig, ClivlyEntityConfig, ConfigValidationError, ConfigValidationResult, CrmConcept, DiscoveredSchemaTable, FilterExpr, FilterValue, MATERIALIZING_CONCEPTS, MaterializingConcept, RelationshipSpec, RelationshipVia, RelationshipsMap, defineClivlyConfig, entitiesConfigSchema, filterSchema, relationshipSchema, relationshipsSchema, validateEntitiesConfig };
|
|
1
|
+
import { C as relationshipsSchema, S as relationshipSchema, _ as RelationshipVia, a as ClivlyEntitiesConfig, b as entitiesConfigSchema, c as ConfigValidationResult, d as DiscoveredSchemaTable, f as FilterExpr, g as RelationshipSpec, h as MaterializingConcept, i as ClivlyConfigError, l as CrmConcept, m as MATERIALIZING_CONCEPTS, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as FilterValue, r as CUSTOM_CONCEPT, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredColumnMeta, v as RelationshipsMap, w as validateEntitiesConfig, x as filterSchema, y as defineClivlyConfig } from "./entity-config-C4Yf_fPj.mjs";
|
|
2
|
+
export { CANONICAL_FIELDS, CRM_CONCEPTS, CUSTOM_CONCEPT, ClivlyConfigError, ClivlyEntitiesConfig, ClivlyEntityConfig, ConfigValidationError, ConfigValidationResult, CrmConcept, DiscoveredColumnMeta, DiscoveredSchemaTable, FilterExpr, FilterValue, MATERIALIZING_CONCEPTS, MaterializingConcept, RelationshipSpec, RelationshipVia, RelationshipsMap, defineClivlyConfig, entitiesConfigSchema, filterSchema, relationshipSchema, relationshipsSchema, validateEntitiesConfig };
|
package/core-entity-config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as MATERIALIZING_CONCEPTS, c as filterSchema, d as validateEntitiesConfig, i as ClivlyConfigError, l as relationshipSchema, n as CRM_CONCEPTS, o as defineClivlyConfig, r as CUSTOM_CONCEPT, s as entitiesConfigSchema, t as CANONICAL_FIELDS, u as relationshipsSchema } from "./entity-config-
|
|
1
|
+
import { a as MATERIALIZING_CONCEPTS, c as filterSchema, d as validateEntitiesConfig, i as ClivlyConfigError, l as relationshipSchema, n as CRM_CONCEPTS, o as defineClivlyConfig, r as CUSTOM_CONCEPT, s as entitiesConfigSchema, t as CANONICAL_FIELDS, u as relationshipsSchema } from "./entity-config-D3LmzgLb.mjs";
|
|
2
2
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
3
3
|
//#region src/core-entity-config.ts
|
|
4
4
|
warnDeprecatedSubpath("clivly/core/entity-config", "clivly/internal/entity-config");
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as DiscoveredColumnMeta } from "./entity-config-C4Yf_fPj.cjs";
|
|
2
|
+
import { FieldSuggestion, RelationshipSuggestion, ScoredTable, SuggestedVia, TARGET_CONCEPTS, TargetConcept, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping } from "./internal-entity-heuristics.cjs";
|
|
3
|
+
export { type DiscoveredColumnMeta, FieldSuggestion, RelationshipSuggestion, ScoredTable, SuggestedVia, TARGET_CONCEPTS, TargetConcept, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as DiscoveredColumnMeta } from "./entity-config-C4Yf_fPj.mjs";
|
|
2
|
+
import { FieldSuggestion, RelationshipSuggestion, ScoredTable, SuggestedVia, TARGET_CONCEPTS, TargetConcept, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping } from "./internal-entity-heuristics.mjs";
|
|
3
|
+
export { type DiscoveredColumnMeta, FieldSuggestion, RelationshipSuggestion, ScoredTable, SuggestedVia, TARGET_CONCEPTS, TargetConcept, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping };
|
package/core-mapping-form.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-
|
|
1
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-43bwOTat.cjs";
|
|
2
2
|
export { RelationshipCandidate, buildFilterFromDiscriminator, buildRelationships, relationshipViaSignature };
|
package/core-mapping-form.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-
|
|
1
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-DUvWUYCo.mjs";
|
|
2
2
|
export { RelationshipCandidate, buildFilterFromDiscriminator, buildRelationships, relationshipViaSignature };
|
package/core-mappings-config.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_deprecate_subpath = require("./deprecate-subpath-B9ngvizt.cjs");
|
|
3
|
-
const require_mappings_config = require("./mappings-config-
|
|
3
|
+
const require_mappings_config = require("./mappings-config-BSSwdHiq.cjs");
|
|
4
4
|
require("./internal-mappings-config.cjs");
|
|
5
5
|
//#region src/core-mappings-config.ts
|
|
6
6
|
require_deprecate_subpath.warnDeprecatedSubpath("clivly/core/mappings-config", "clivly/internal/mappings-config");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-
|
|
1
|
+
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-xsLMn3I-.cjs";
|
|
2
2
|
export { EntityMappingRow, mappingsToEntitiesConfig };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-
|
|
1
|
+
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-BpcR8bBo.mjs";
|
|
2
2
|
export { EntityMappingRow, mappingsToEntitiesConfig };
|
package/core-mappings-config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
2
|
-
import { t as mappingsToEntitiesConfig } from "./mappings-config-
|
|
2
|
+
import { t as mappingsToEntitiesConfig } from "./mappings-config-bJQT_gSa.mjs";
|
|
3
3
|
import "./internal-mappings-config.mjs";
|
|
4
4
|
//#region src/core-mappings-config.ts
|
|
5
5
|
warnDeprecatedSubpath("clivly/core/mappings-config", "clivly/internal/mappings-config");
|
package/core-sync-engine.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_deprecate_subpath = require("./deprecate-subpath-B9ngvizt.cjs");
|
|
3
|
-
const require_sync_engine = require("./sync-engine-
|
|
3
|
+
const require_sync_engine = require("./sync-engine-DEJvKw6E.cjs");
|
|
4
4
|
require("./internal-sync-engine.cjs");
|
|
5
5
|
//#region src/core-sync-engine.ts
|
|
6
6
|
require_deprecate_subpath.warnDeprecatedSubpath("clivly/core/sync-engine", "clivly/internal/sync-engine");
|
package/core-sync-engine.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PreviewWarning, c as SyncResult, d as previewSync, f as reconcile, i as PreviewResult, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult, u as computeSampleWarnings } from "./sync-engine-
|
|
1
|
+
import { a as PreviewWarning, c as SyncResult, d as previewSync, f as reconcile, i as PreviewResult, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult, u as computeSampleWarnings } from "./sync-engine-GNqRB8eS.cjs";
|
|
2
2
|
export { EntitySyncResult, MirrorRecord, PersistAction, PreviewResult, PreviewWarning, SourceRow, SyncAction, SyncResult, SyncStore, computeSampleWarnings, previewSync, reconcile, runSync };
|
package/core-sync-engine.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PreviewWarning, c as SyncResult, d as previewSync, f as reconcile, i as PreviewResult, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult, u as computeSampleWarnings } from "./sync-engine-
|
|
1
|
+
import { a as PreviewWarning, c as SyncResult, d as previewSync, f as reconcile, i as PreviewResult, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult, u as computeSampleWarnings } from "./sync-engine-ZsusW-q_.mjs";
|
|
2
2
|
export { EntitySyncResult, MirrorRecord, PersistAction, PreviewResult, PreviewWarning, SourceRow, SyncAction, SyncResult, SyncStore, computeSampleWarnings, previewSync, reconcile, runSync };
|
package/core-sync-engine.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
2
|
-
import { i as runSync, n as previewSync, r as reconcile, t as computeSampleWarnings } from "./sync-engine-
|
|
2
|
+
import { i as runSync, n as previewSync, r as reconcile, t as computeSampleWarnings } from "./sync-engine-Bg6-SznL.mjs";
|
|
3
3
|
import "./internal-sync-engine.mjs";
|
|
4
4
|
//#region src/core-sync-engine.ts
|
|
5
5
|
warnDeprecatedSubpath("clivly/core/sync-engine", "clivly/internal/sync-engine");
|
package/core-view-compiler.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_deprecate_subpath = require("./deprecate-subpath-B9ngvizt.cjs");
|
|
3
|
-
const require_view_compiler = require("./view-compiler-
|
|
3
|
+
const require_view_compiler = require("./view-compiler-DplczSjF.cjs");
|
|
4
4
|
require("./internal-view-compiler.cjs");
|
|
5
5
|
//#region src/core-view-compiler.ts
|
|
6
6
|
require_deprecate_subpath.warnDeprecatedSubpath("clivly/core/view-compiler", "clivly/internal/view-compiler");
|
package/core-view-compiler.d.cts
CHANGED
|
@@ -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-
|
|
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-Ll9cbIJz.cjs";
|
|
2
2
|
export { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig };
|
package/core-view-compiler.d.mts
CHANGED
|
@@ -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-
|
|
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-Cin0neDO.mjs";
|
|
2
2
|
export { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig };
|
package/core-view-compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
2
|
-
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-
|
|
2
|
+
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-DlTpOfZi.mjs";
|
|
3
3
|
import "./internal-view-compiler.mjs";
|
|
4
4
|
//#region src/core-view-compiler.ts
|
|
5
5
|
warnDeprecatedSubpath("clivly/core/view-compiler", "clivly/internal/view-compiler");
|
package/core.cjs
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
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-CsLl-ftC.cjs");
|
|
3
4
|
const require_deprecate_subpath = require("./deprecate-subpath-B9ngvizt.cjs");
|
|
4
5
|
const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
|
|
5
6
|
const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
|
|
6
|
-
const require_mappings_config = require("./mappings-config-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
require("./
|
|
7
|
+
const require_mappings_config = require("./mappings-config-BSSwdHiq.cjs");
|
|
8
|
+
const require_internal = require("./internal-BARjyN4n.cjs");
|
|
9
|
+
const require_view_compiler = require("./view-compiler-DplczSjF.cjs");
|
|
10
|
+
const require_sync_engine = require("./sync-engine-DEJvKw6E.cjs");
|
|
10
11
|
//#region src/core.ts
|
|
11
12
|
require_deprecate_subpath.warnDeprecatedSubpath("clivly/core", "clivly/sdk", "Import \"defineClivlyConfig\" and its config types from \"clivly/sdk\"; import everything else from \"clivly/internal\" (no stability guarantee — see STABILITY.md).");
|
|
12
13
|
//#endregion
|
|
14
|
+
exports.BASE_REF = require_projection.BASE_REF;
|
|
13
15
|
exports.CANONICAL_FIELDS = require_entity_config.CANONICAL_FIELDS;
|
|
14
16
|
exports.CRM_CONCEPTS = require_entity_config.CRM_CONCEPTS;
|
|
15
17
|
exports.ClivlyConfigError = require_entity_config.ClivlyConfigError;
|
|
@@ -18,16 +20,30 @@ exports.MATERIALIZING_CONCEPTS = require_entity_config.MATERIALIZING_CONCEPTS;
|
|
|
18
20
|
exports.authCustom = require_auth_adapter.authCustom;
|
|
19
21
|
exports.buildFilterFromDiscriminator = require_mapping_form.buildFilterFromDiscriminator;
|
|
20
22
|
exports.buildRelationships = require_mapping_form.buildRelationships;
|
|
23
|
+
exports.columnMetaFor = require_entity_config.columnMetaFor;
|
|
21
24
|
exports.compileEntityView = require_view_compiler.compileEntityView;
|
|
22
25
|
exports.compileEntityViews = require_view_compiler.compileEntityViews;
|
|
26
|
+
exports.coversUniqueKey = require_entity_config.coversUniqueKey;
|
|
23
27
|
exports.defineClivlyConfig = require_entity_config.defineClivlyConfig;
|
|
28
|
+
exports.describeCardinality = require_internal.describeCardinality;
|
|
29
|
+
exports.draftErrors = require_internal.draftErrors;
|
|
30
|
+
exports.draftToProjection = require_internal.draftToProjection;
|
|
31
|
+
exports.emptyProjectionDraft = require_internal.emptyProjectionDraft;
|
|
24
32
|
exports.entitiesConfigSchema = require_entity_config.entitiesConfigSchema;
|
|
25
33
|
exports.explainEntitiesConfig = require_view_compiler.explainEntitiesConfig;
|
|
34
|
+
exports.fanOutJoins = require_entity_config.fanOutJoins;
|
|
26
35
|
exports.filterSchema = require_entity_config.filterSchema;
|
|
36
|
+
exports.hasRichMeta = require_entity_config.hasRichMeta;
|
|
37
|
+
exports.identityRefs = require_projection.identityRefs;
|
|
38
|
+
exports.joinFansOut = require_entity_config.joinFansOut;
|
|
27
39
|
exports.mappingsToEntitiesConfig = require_mappings_config.mappingsToEntitiesConfig;
|
|
40
|
+
exports.primaryKeyColumns = require_entity_config.primaryKeyColumns;
|
|
41
|
+
exports.projectionSchema = require_projection.projectionSchema;
|
|
28
42
|
exports.reconcile = require_sync_engine.reconcile;
|
|
29
43
|
exports.relationshipSchema = require_entity_config.relationshipSchema;
|
|
30
44
|
exports.relationshipViaSignature = require_mapping_form.relationshipViaSignature;
|
|
31
45
|
exports.relationshipsSchema = require_entity_config.relationshipsSchema;
|
|
32
46
|
exports.runSync = require_sync_engine.runSync;
|
|
47
|
+
exports.suggestJoinConditions = require_internal.suggestJoinConditions;
|
|
33
48
|
exports.validateEntitiesConfig = require_entity_config.validateEntitiesConfig;
|
|
49
|
+
exports.validateProjection = require_entity_config.validateProjection;
|
package/core.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
|
|
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 { C as relationshipsSchema, S as relationshipSchema, _ as RelationshipVia, a as ClivlyEntitiesConfig, b as entitiesConfigSchema, c as ConfigValidationResult, d as DiscoveredSchemaTable, f as FilterExpr, g as RelationshipSpec, h as MaterializingConcept, i as ClivlyConfigError, l as CrmConcept, m as MATERIALIZING_CONCEPTS, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as FilterValue, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredColumnMeta, v as RelationshipsMap, w as validateEntitiesConfig, x as filterSchema, y as defineClivlyConfig } from "./entity-config-C4Yf_fPj.cjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-43bwOTat.cjs";
|
|
6
|
+
import { a as ProjectionIdentity, c as ProjectionRef, i as ProjectionFieldBinding, l as identityRefs, n as mappingsToEntitiesConfig, o as ProjectionJoin, r as BASE_REF, s as ProjectionMapping, t as EntityMappingRow, u as projectionSchema } from "./mappings-config-xsLMn3I-.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-Ll9cbIJz.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-GNqRB8eS.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-B8ydhsKd.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/core.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
|
|
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 { C as relationshipsSchema, S as relationshipSchema, _ as RelationshipVia, a as ClivlyEntitiesConfig, b as entitiesConfigSchema, c as ConfigValidationResult, d as DiscoveredSchemaTable, f as FilterExpr, g as RelationshipSpec, h as MaterializingConcept, i as ClivlyConfigError, l as CrmConcept, m as MATERIALIZING_CONCEPTS, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as FilterValue, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredColumnMeta, v as RelationshipsMap, w as validateEntitiesConfig, x as filterSchema, y as defineClivlyConfig } from "./entity-config-C4Yf_fPj.mjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-DUvWUYCo.mjs";
|
|
6
|
+
import { a as ProjectionIdentity, c as ProjectionRef, i as ProjectionFieldBinding, l as identityRefs, n as mappingsToEntitiesConfig, o as ProjectionJoin, r as BASE_REF, s as ProjectionMapping, t as EntityMappingRow, u as projectionSchema } from "./mappings-config-BpcR8bBo.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-Cin0neDO.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-ZsusW-q_.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-MBkNo3bw.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/core.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as projectionSchema, r as identityRefs, t as BASE_REF } from "./projection-D7xmQP4S.mjs";
|
|
2
|
+
import { _ as hasRichMeta, a as MATERIALIZING_CONCEPTS, c as filterSchema, d as validateEntitiesConfig, f as validateProjection, g as coversUniqueKey, h as columnMetaFor, i as ClivlyConfigError, l as relationshipSchema, m as joinFansOut, n as CRM_CONCEPTS, o as defineClivlyConfig, p as fanOutJoins, s as entitiesConfigSchema, t as CANONICAL_FIELDS, u as relationshipsSchema, v as primaryKeyColumns } from "./entity-config-D3LmzgLb.mjs";
|
|
2
3
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
3
4
|
import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
|
|
4
5
|
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
|
|
5
|
-
import { t as mappingsToEntitiesConfig } from "./mappings-config-
|
|
6
|
-
import { i as
|
|
7
|
-
import { i as
|
|
8
|
-
import "./
|
|
6
|
+
import { t as mappingsToEntitiesConfig } from "./mappings-config-bJQT_gSa.mjs";
|
|
7
|
+
import { a as suggestJoinConditions, i as emptyProjectionDraft, n as draftErrors, r as draftToProjection, t as describeCardinality } from "./internal-DMySVbM0.mjs";
|
|
8
|
+
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-DlTpOfZi.mjs";
|
|
9
|
+
import { i as runSync, r as reconcile } from "./sync-engine-Bg6-SznL.mjs";
|
|
9
10
|
//#region src/core.ts
|
|
10
11
|
warnDeprecatedSubpath("clivly/core", "clivly/sdk", "Import \"defineClivlyConfig\" and its config types from \"clivly/sdk\"; import everything else from \"clivly/internal\" (no stability guarantee — see STABILITY.md).");
|
|
11
12
|
//#endregion
|
|
12
|
-
export { CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
|
|
13
|
+
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 };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Table, getTableColumns, getTableName, is } from "drizzle-orm";
|
|
2
|
+
import { getTableConfig } from "drizzle-orm/pg-core";
|
|
3
|
+
//#region ../core/src/drizzle.ts
|
|
4
|
+
/**
|
|
5
|
+
* Every unique key on a table, as DB column-name tuples. Primary keys count —
|
|
6
|
+
* fan-out detection asks "do these join columns cover a unique key?", and a PK
|
|
7
|
+
* answers that as well as any explicit unique constraint.
|
|
8
|
+
*
|
|
9
|
+
* Returns `undefined` if reflection fails (non-pg table, or a drizzle version
|
|
10
|
+
* without config access), meaning "unknown, cannot determine". Returns `[]`
|
|
11
|
+
* when reflection succeeds and the table genuinely has none. That distinction
|
|
12
|
+
* is load-bearing: `hasRichMeta` uses it to tell "metadata unavailable" from
|
|
13
|
+
* "confirmed no constraints", and projection validation fails closed on the
|
|
14
|
+
* former.
|
|
15
|
+
*/
|
|
16
|
+
function buildUniqueConstraints(table) {
|
|
17
|
+
const keys = [];
|
|
18
|
+
try {
|
|
19
|
+
const config = getTableConfig(table);
|
|
20
|
+
for (const column of config.columns ?? []) if (column.isUnique || column.primary) keys.push([column.name]);
|
|
21
|
+
for (const pk of config.primaryKeys ?? []) keys.push(pk.columns.map((c) => c.name));
|
|
22
|
+
for (const constraint of config.uniqueConstraints ?? []) keys.push(constraint.columns.map((c) => c.name));
|
|
23
|
+
for (const index of config.indexes ?? []) {
|
|
24
|
+
if (!index.config?.unique) continue;
|
|
25
|
+
const columns = (index.config.columns ?? []).map((c) => c?.name).filter((name) => Boolean(name));
|
|
26
|
+
if (columns.length > 0) keys.push(columns);
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const seen = /* @__PURE__ */ new Set();
|
|
32
|
+
return keys.filter((key) => {
|
|
33
|
+
const id = [...key].sort().join("\0");
|
|
34
|
+
if (seen.has(id) || key.length === 0) return false;
|
|
35
|
+
seen.add(id);
|
|
36
|
+
return true;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Per-column metadata (type, PK, nullability, FK edges) for a Drizzle table.
|
|
41
|
+
* Structural only — no DB round-trip, so it is safe to recompute on every
|
|
42
|
+
* heartbeat. FK reflection is best-effort; a non-Postgres table still gets
|
|
43
|
+
* name/type/PK/nullable.
|
|
44
|
+
*/
|
|
45
|
+
function buildColumnsMeta(table) {
|
|
46
|
+
const columns = getTableColumns(table);
|
|
47
|
+
const fkByColumn = /* @__PURE__ */ new Map();
|
|
48
|
+
try {
|
|
49
|
+
for (const fk of getTableConfig(table).foreignKeys) {
|
|
50
|
+
const ref = fk.reference();
|
|
51
|
+
const foreignTable = getTableName(ref.foreignTable);
|
|
52
|
+
ref.columns.forEach((col, index) => {
|
|
53
|
+
const foreignCol = ref.foreignColumns[index];
|
|
54
|
+
if (foreignCol) fkByColumn.set(col.name, {
|
|
55
|
+
table: foreignTable,
|
|
56
|
+
column: foreignCol.name
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
} catch {}
|
|
61
|
+
return Object.values(columns).map((col) => {
|
|
62
|
+
const references = fkByColumn.get(col.name);
|
|
63
|
+
let type;
|
|
64
|
+
try {
|
|
65
|
+
type = col.getSQLType();
|
|
66
|
+
} catch {
|
|
67
|
+
type = void 0;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
name: col.name,
|
|
71
|
+
type,
|
|
72
|
+
nullable: !col.notNull,
|
|
73
|
+
isPrimaryKey: Boolean(col.primary),
|
|
74
|
+
isForeignKey: references !== void 0,
|
|
75
|
+
...references ? { references } : {}
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Derive Clivly's discovery shape (table + column names) from a Drizzle schema
|
|
81
|
+
* object — the `* as schema` you pass to `drizzle(client, { schema })`. This
|
|
82
|
+
* delivers the "reads your schema" promise for Drizzle hosts: no hand-authored
|
|
83
|
+
* `DiscoveredTable[]`. Feed the result to the SDK's `schema` option, or diff it
|
|
84
|
+
* against your entity config.
|
|
85
|
+
*
|
|
86
|
+
* Column names are the real database column names (e.g. `full_name`), not the
|
|
87
|
+
* Drizzle property keys (`fullName`). Non-table values in the schema object
|
|
88
|
+
* (relations, enums, helpers) are ignored.
|
|
89
|
+
*
|
|
90
|
+
* `drizzle-orm` is an **optional peer dependency** — you only need it installed
|
|
91
|
+
* when you import this entry (`@clivly/core/drizzle`); the rest of `@clivly/core`
|
|
92
|
+
* stays dependency-free.
|
|
93
|
+
*/
|
|
94
|
+
function discoverFromDrizzle(schema) {
|
|
95
|
+
const tables = [];
|
|
96
|
+
for (const value of Object.values(schema)) {
|
|
97
|
+
if (!is(value, Table)) continue;
|
|
98
|
+
const columns = getTableColumns(value);
|
|
99
|
+
const uniqueConstraints = buildUniqueConstraints(value);
|
|
100
|
+
tables.push({
|
|
101
|
+
name: getTableName(value),
|
|
102
|
+
columns: Object.values(columns).map((column) => column.name),
|
|
103
|
+
columnsMeta: buildColumnsMeta(value),
|
|
104
|
+
...uniqueConstraints === void 0 ? {} : { uniqueConstraints }
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return tables;
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { buildUniqueConstraints as n, discoverFromDrizzle as r, buildColumnsMeta as t };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { d as DiscoveredSchemaTable, u as DiscoveredColumnMeta } from "./entity-config-C4Yf_fPj.cjs";
|
|
2
|
+
import { Table } from "drizzle-orm";
|
|
3
|
+
//#region ../core/src/drizzle.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Every unique key on a table, as DB column-name tuples. Primary keys count —
|
|
6
|
+
* fan-out detection asks "do these join columns cover a unique key?", and a PK
|
|
7
|
+
* answers that as well as any explicit unique constraint.
|
|
8
|
+
*
|
|
9
|
+
* Returns `undefined` if reflection fails (non-pg table, or a drizzle version
|
|
10
|
+
* without config access), meaning "unknown, cannot determine". Returns `[]`
|
|
11
|
+
* when reflection succeeds and the table genuinely has none. That distinction
|
|
12
|
+
* is load-bearing: `hasRichMeta` uses it to tell "metadata unavailable" from
|
|
13
|
+
* "confirmed no constraints", and projection validation fails closed on the
|
|
14
|
+
* former.
|
|
15
|
+
*/
|
|
16
|
+
declare function buildUniqueConstraints(table: unknown): string[][] | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Per-column metadata (type, PK, nullability, FK edges) for a Drizzle table.
|
|
19
|
+
* Structural only — no DB round-trip, so it is safe to recompute on every
|
|
20
|
+
* heartbeat. FK reflection is best-effort; a non-Postgres table still gets
|
|
21
|
+
* name/type/PK/nullable.
|
|
22
|
+
*/
|
|
23
|
+
declare function buildColumnsMeta(table: Table): DiscoveredColumnMeta[];
|
|
24
|
+
/**
|
|
25
|
+
* Derive Clivly's discovery shape (table + column names) from a Drizzle schema
|
|
26
|
+
* object — the `* as schema` you pass to `drizzle(client, { schema })`. This
|
|
27
|
+
* delivers the "reads your schema" promise for Drizzle hosts: no hand-authored
|
|
28
|
+
* `DiscoveredTable[]`. Feed the result to the SDK's `schema` option, or diff it
|
|
29
|
+
* against your entity config.
|
|
30
|
+
*
|
|
31
|
+
* Column names are the real database column names (e.g. `full_name`), not the
|
|
32
|
+
* Drizzle property keys (`fullName`). Non-table values in the schema object
|
|
33
|
+
* (relations, enums, helpers) are ignored.
|
|
34
|
+
*
|
|
35
|
+
* `drizzle-orm` is an **optional peer dependency** — you only need it installed
|
|
36
|
+
* when you import this entry (`@clivly/core/drizzle`); the rest of `@clivly/core`
|
|
37
|
+
* stays dependency-free.
|
|
38
|
+
*/
|
|
39
|
+
declare function discoverFromDrizzle(schema: Record<string, unknown>): DiscoveredSchemaTable[];
|
|
40
|
+
//#endregion
|
|
41
|
+
export { buildUniqueConstraints as n, discoverFromDrizzle as r, buildColumnsMeta as t };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
let drizzle_orm = require("drizzle-orm");
|
|
2
|
+
let drizzle_orm_pg_core = require("drizzle-orm/pg-core");
|
|
3
|
+
//#region ../core/src/drizzle.ts
|
|
4
|
+
/**
|
|
5
|
+
* Every unique key on a table, as DB column-name tuples. Primary keys count —
|
|
6
|
+
* fan-out detection asks "do these join columns cover a unique key?", and a PK
|
|
7
|
+
* answers that as well as any explicit unique constraint.
|
|
8
|
+
*
|
|
9
|
+
* Returns `undefined` if reflection fails (non-pg table, or a drizzle version
|
|
10
|
+
* without config access), meaning "unknown, cannot determine". Returns `[]`
|
|
11
|
+
* when reflection succeeds and the table genuinely has none. That distinction
|
|
12
|
+
* is load-bearing: `hasRichMeta` uses it to tell "metadata unavailable" from
|
|
13
|
+
* "confirmed no constraints", and projection validation fails closed on the
|
|
14
|
+
* former.
|
|
15
|
+
*/
|
|
16
|
+
function buildUniqueConstraints(table) {
|
|
17
|
+
const keys = [];
|
|
18
|
+
try {
|
|
19
|
+
const config = (0, drizzle_orm_pg_core.getTableConfig)(table);
|
|
20
|
+
for (const column of config.columns ?? []) if (column.isUnique || column.primary) keys.push([column.name]);
|
|
21
|
+
for (const pk of config.primaryKeys ?? []) keys.push(pk.columns.map((c) => c.name));
|
|
22
|
+
for (const constraint of config.uniqueConstraints ?? []) keys.push(constraint.columns.map((c) => c.name));
|
|
23
|
+
for (const index of config.indexes ?? []) {
|
|
24
|
+
if (!index.config?.unique) continue;
|
|
25
|
+
const columns = (index.config.columns ?? []).map((c) => c?.name).filter((name) => Boolean(name));
|
|
26
|
+
if (columns.length > 0) keys.push(columns);
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const seen = /* @__PURE__ */ new Set();
|
|
32
|
+
return keys.filter((key) => {
|
|
33
|
+
const id = [...key].sort().join("\0");
|
|
34
|
+
if (seen.has(id) || key.length === 0) return false;
|
|
35
|
+
seen.add(id);
|
|
36
|
+
return true;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Per-column metadata (type, PK, nullability, FK edges) for a Drizzle table.
|
|
41
|
+
* Structural only — no DB round-trip, so it is safe to recompute on every
|
|
42
|
+
* heartbeat. FK reflection is best-effort; a non-Postgres table still gets
|
|
43
|
+
* name/type/PK/nullable.
|
|
44
|
+
*/
|
|
45
|
+
function buildColumnsMeta(table) {
|
|
46
|
+
const columns = (0, drizzle_orm.getTableColumns)(table);
|
|
47
|
+
const fkByColumn = /* @__PURE__ */ new Map();
|
|
48
|
+
try {
|
|
49
|
+
for (const fk of (0, drizzle_orm_pg_core.getTableConfig)(table).foreignKeys) {
|
|
50
|
+
const ref = fk.reference();
|
|
51
|
+
const foreignTable = (0, drizzle_orm.getTableName)(ref.foreignTable);
|
|
52
|
+
ref.columns.forEach((col, index) => {
|
|
53
|
+
const foreignCol = ref.foreignColumns[index];
|
|
54
|
+
if (foreignCol) fkByColumn.set(col.name, {
|
|
55
|
+
table: foreignTable,
|
|
56
|
+
column: foreignCol.name
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
} catch {}
|
|
61
|
+
return Object.values(columns).map((col) => {
|
|
62
|
+
const references = fkByColumn.get(col.name);
|
|
63
|
+
let type;
|
|
64
|
+
try {
|
|
65
|
+
type = col.getSQLType();
|
|
66
|
+
} catch {
|
|
67
|
+
type = void 0;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
name: col.name,
|
|
71
|
+
type,
|
|
72
|
+
nullable: !col.notNull,
|
|
73
|
+
isPrimaryKey: Boolean(col.primary),
|
|
74
|
+
isForeignKey: references !== void 0,
|
|
75
|
+
...references ? { references } : {}
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Derive Clivly's discovery shape (table + column names) from a Drizzle schema
|
|
81
|
+
* object — the `* as schema` you pass to `drizzle(client, { schema })`. This
|
|
82
|
+
* delivers the "reads your schema" promise for Drizzle hosts: no hand-authored
|
|
83
|
+
* `DiscoveredTable[]`. Feed the result to the SDK's `schema` option, or diff it
|
|
84
|
+
* against your entity config.
|
|
85
|
+
*
|
|
86
|
+
* Column names are the real database column names (e.g. `full_name`), not the
|
|
87
|
+
* Drizzle property keys (`fullName`). Non-table values in the schema object
|
|
88
|
+
* (relations, enums, helpers) are ignored.
|
|
89
|
+
*
|
|
90
|
+
* `drizzle-orm` is an **optional peer dependency** — you only need it installed
|
|
91
|
+
* when you import this entry (`@clivly/core/drizzle`); the rest of `@clivly/core`
|
|
92
|
+
* stays dependency-free.
|
|
93
|
+
*/
|
|
94
|
+
function discoverFromDrizzle(schema) {
|
|
95
|
+
const tables = [];
|
|
96
|
+
for (const value of Object.values(schema)) {
|
|
97
|
+
if (!(0, drizzle_orm.is)(value, drizzle_orm.Table)) continue;
|
|
98
|
+
const columns = (0, drizzle_orm.getTableColumns)(value);
|
|
99
|
+
const uniqueConstraints = buildUniqueConstraints(value);
|
|
100
|
+
tables.push({
|
|
101
|
+
name: (0, drizzle_orm.getTableName)(value),
|
|
102
|
+
columns: Object.values(columns).map((column) => column.name),
|
|
103
|
+
columnsMeta: buildColumnsMeta(value),
|
|
104
|
+
...uniqueConstraints === void 0 ? {} : { uniqueConstraints }
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return tables;
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
Object.defineProperty(exports, "buildColumnsMeta", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function() {
|
|
113
|
+
return buildColumnsMeta;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(exports, "buildUniqueConstraints", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function() {
|
|
119
|
+
return buildUniqueConstraints;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, "discoverFromDrizzle", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function() {
|
|
125
|
+
return discoverFromDrizzle;
|
|
126
|
+
}
|
|
127
|
+
});
|