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.
Files changed (109) hide show
  1. package/core-drizzle.cjs +3 -1
  2. package/core-drizzle.d.cts +3 -2
  3. package/core-drizzle.d.mts +3 -2
  4. package/core-drizzle.mjs +2 -2
  5. package/core-entity-config.cjs +1 -1
  6. package/core-entity-config.d.cts +2 -2
  7. package/core-entity-config.d.mts +2 -2
  8. package/core-entity-config.mjs +1 -1
  9. package/core-entity-heuristics.d.cts +3 -2
  10. package/core-entity-heuristics.d.mts +3 -2
  11. package/core-mapping-form.d.cts +1 -1
  12. package/core-mapping-form.d.mts +1 -1
  13. package/core-mappings-config.cjs +1 -1
  14. package/core-mappings-config.d.cts +1 -1
  15. package/core-mappings-config.d.mts +1 -1
  16. package/core-mappings-config.mjs +1 -1
  17. package/core-sync-engine.cjs +1 -1
  18. package/core-sync-engine.d.cts +1 -1
  19. package/core-sync-engine.d.mts +1 -1
  20. package/core-sync-engine.mjs +1 -1
  21. package/core-view-compiler.cjs +1 -1
  22. package/core-view-compiler.d.cts +1 -1
  23. package/core-view-compiler.d.mts +1 -1
  24. package/core-view-compiler.mjs +1 -1
  25. package/core.cjs +21 -5
  26. package/core.d.cts +7 -6
  27. package/core.d.mts +7 -6
  28. package/core.mjs +7 -6
  29. package/drizzle-3kvhkwO7.mjs +110 -0
  30. package/drizzle-BhN5M9zt.d.cts +41 -0
  31. package/drizzle-bfjVzYR6.cjs +127 -0
  32. package/drizzle-kBULBAOa.d.mts +41 -0
  33. package/drizzle.cjs +5 -37
  34. package/drizzle.d.cts +3 -3
  35. package/drizzle.d.mts +3 -3
  36. package/drizzle.mjs +5 -38
  37. package/{entity-config-DoUCXtq5.d.cts → entity-config-C4Yf_fPj.d.cts} +120 -1
  38. package/{entity-config-DoUCXtq5.d.mts → entity-config-C4Yf_fPj.d.mts} +120 -1
  39. package/entity-config-CsLl-ftC.cjs +727 -0
  40. package/entity-config-D3LmzgLb.mjs +612 -0
  41. package/index.cjs +28 -2
  42. package/index.d.cts +6 -0
  43. package/index.d.mts +6 -0
  44. package/index.mjs +28 -2
  45. package/internal-B8ydhsKd.d.cts +73 -0
  46. package/internal-BARjyN4n.cjs +97 -0
  47. package/internal-DMySVbM0.mjs +68 -0
  48. package/internal-MBkNo3bw.d.mts +73 -0
  49. package/internal-drizzle.cjs +3 -1
  50. package/internal-drizzle.d.cts +2 -2
  51. package/internal-drizzle.d.mts +2 -2
  52. package/internal-drizzle.mjs +2 -2
  53. package/internal-entity-config.cjs +1 -1
  54. package/internal-entity-config.d.cts +2 -2
  55. package/internal-entity-config.d.mts +2 -2
  56. package/internal-entity-config.mjs +1 -1
  57. package/internal-entity-heuristics.cjs +1 -1
  58. package/internal-entity-heuristics.d.cts +2 -12
  59. package/internal-entity-heuristics.d.mts +2 -12
  60. package/internal-entity-heuristics.mjs +1 -1
  61. package/internal-mapping-form.d.cts +1 -1
  62. package/internal-mapping-form.d.mts +1 -1
  63. package/internal-mappings-config.cjs +1 -1
  64. package/internal-mappings-config.d.cts +1 -1
  65. package/internal-mappings-config.d.mts +1 -1
  66. package/internal-mappings-config.mjs +1 -1
  67. package/internal-sync-engine.cjs +1 -1
  68. package/internal-sync-engine.d.cts +1 -1
  69. package/internal-sync-engine.d.mts +1 -1
  70. package/internal-sync-engine.mjs +1 -1
  71. package/internal-view-compiler.cjs +1 -1
  72. package/internal-view-compiler.d.cts +1 -1
  73. package/internal-view-compiler.d.mts +1 -1
  74. package/internal-view-compiler.mjs +1 -1
  75. package/internal.cjs +21 -4
  76. package/internal.d.cts +7 -6
  77. package/internal.d.mts +7 -6
  78. package/internal.mjs +7 -5
  79. package/{mapping-form-D93lhHEc.d.mts → mapping-form-43bwOTat.d.cts} +1 -1
  80. package/{mapping-form-lfyEE7EJ.d.cts → mapping-form-DUvWUYCo.d.mts} +1 -1
  81. package/{mappings-config-BsRADNRv.cjs → mappings-config-BSSwdHiq.cjs} +32 -6
  82. package/mappings-config-BpcR8bBo.d.mts +167 -0
  83. package/{mappings-config-Dbgxx3Nv.mjs → mappings-config-bJQT_gSa.mjs} +32 -6
  84. package/mappings-config-xsLMn3I-.d.cts +167 -0
  85. package/{namespace-probe-B4WE45TH.d.mts → namespace-probe-BSH_p9TK.d.cts} +10 -1
  86. package/{namespace-probe-DRzOtaRT.d.cts → namespace-probe-Dsp5uNkS.d.mts} +10 -1
  87. package/package.json +1 -1
  88. package/{entity-config-va2bkH5o.mjs → projection-C5244vGa.cjs} +130 -309
  89. package/{entity-config-D87rV-tE.cjs → projection-D7xmQP4S.mjs} +60 -381
  90. package/sdk.cjs +1 -1
  91. package/sdk.d.cts +2 -2
  92. package/sdk.d.mts +2 -2
  93. package/sdk.mjs +1 -1
  94. package/{sync-engine-Do5ru3WF.mjs → sync-engine-Bg6-SznL.mjs} +9 -2
  95. package/{sync-engine-CzEbpQGv.cjs → sync-engine-DEJvKw6E.cjs} +9 -2
  96. package/{sync-engine-DGk_AeHJ.d.mts → sync-engine-GNqRB8eS.d.cts} +2 -2
  97. package/{sync-engine-B7QIbXro.d.cts → sync-engine-ZsusW-q_.d.mts} +2 -2
  98. package/{view-compiler-BWz0sGdm.d.cts → view-compiler-Cin0neDO.d.mts} +1 -1
  99. package/{view-compiler-ChWr_Lml.mjs → view-compiler-DlTpOfZi.mjs} +81 -12
  100. package/{view-compiler-BIwvm-o2.cjs → view-compiler-DplczSjF.cjs} +81 -12
  101. package/{view-compiler-Bn_EJJMO.d.mts → view-compiler-Ll9cbIJz.d.cts} +1 -1
  102. package/vite.d.cts +1 -1
  103. package/vite.d.mts +1 -1
  104. package/drizzle-B89tLo4T.mjs +0 -31
  105. package/drizzle-CFOr9dU9.d.mts +0 -20
  106. package/drizzle-DiReZf6d.cjs +0 -36
  107. package/drizzle-DmeKSqeF.d.cts +0 -20
  108. package/mappings-config-DsUa7-1w.d.mts +0 -41
  109. package/mappings-config-XmzB4dag.d.cts +0 -41
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as CANONICAL_FIELDS } from "./entity-config-va2bkH5o.mjs";
2
+ import { t as CANONICAL_FIELDS } from "./entity-config-D3LmzgLb.mjs";
3
3
  import "./mapping-score-C68uAqGB.mjs";
4
4
  import { matchesConcept, requiredFieldsFor, scoreFieldMap, scoreRelationships, suggestCursorField, toFieldMap } from "./internal-entity-heuristics.mjs";
5
5
  import { t as createClivlySDK } from "./sdk-BvRD2jAp.mjs";
@@ -781,6 +781,30 @@ function buildFkByColumn(pgCore, drizzle, table) {
781
781
  } catch {}
782
782
  return fkByColumn;
783
783
  }
784
+ function buildUniqueConstraints(pgCore, table) {
785
+ if (!pgCore) return;
786
+ const keys = [];
787
+ try {
788
+ const config = pgCore.getTableConfig(table);
789
+ for (const column of config.columns ?? []) if (column.isUnique || column.primary) keys.push([column.name]);
790
+ for (const pk of config.primaryKeys ?? []) keys.push(pk.columns.map((c) => c.name));
791
+ for (const constraint of config.uniqueConstraints ?? []) keys.push(constraint.columns.map((c) => c.name));
792
+ for (const index of config.indexes ?? []) {
793
+ if (!index.config?.unique) continue;
794
+ const columns = (index.config.columns ?? []).map((c) => c?.name).filter((name) => Boolean(name));
795
+ if (columns.length > 0) keys.push(columns);
796
+ }
797
+ } catch {
798
+ return;
799
+ }
800
+ const seen = /* @__PURE__ */ new Set();
801
+ return keys.filter((key) => {
802
+ const id = [...key].sort().join("\0");
803
+ if (seen.has(id) || key.length === 0) return false;
804
+ seen.add(id);
805
+ return true;
806
+ });
807
+ }
784
808
  function toDiscoveredColumn(key, col, fkByColumn) {
785
809
  let type;
786
810
  try {
@@ -828,10 +852,12 @@ async function discoverSchema(opts) {
828
852
  if (drizzle.is(value, drizzle.Table)) {
829
853
  const fkByColumn = buildFkByColumn(pgCore, drizzle, value);
830
854
  const columns = Object.entries(drizzle.getTableColumns(value)).map(([key, col]) => toDiscoveredColumn(key, col, fkByColumn));
855
+ const uniqueConstraints = buildUniqueConstraints(pgCore, value);
831
856
  tables.push({
832
857
  moduleKey,
833
858
  tableName: drizzle.getTableName(value),
834
- columns
859
+ columns,
860
+ ...uniqueConstraints === void 0 ? {} : { uniqueConstraints }
835
861
  });
836
862
  continue;
837
863
  }
@@ -0,0 +1,73 @@
1
+ import { d as DiscoveredSchemaTable, s as ConfigValidationError, u as DiscoveredColumnMeta } from "./entity-config-C4Yf_fPj.cjs";
2
+ import { a as ProjectionIdentity, i as ProjectionFieldBinding, o as ProjectionJoin, s as ProjectionMapping } from "./mappings-config-xsLMn3I-.cjs";
3
+ //#region ../core/src/projection-cardinality.d.ts
4
+ declare function joinFansOut(join: ProjectionJoin, joinTable: DiscoveredSchemaTable): boolean;
5
+ /** Every join in the projection that can multiply rows. */
6
+ declare function fanOutJoins(projection: ProjectionMapping, tablesByName: Map<string, DiscoveredSchemaTable>): ProjectionJoin[];
7
+ //#endregion
8
+ //#region ../core/src/projection-draft.d.ts
9
+ /**
10
+ * The builder's in-progress shape.
11
+ *
12
+ * A draft is deliberately looser than a `ProjectionMapping`: it exists while
13
+ * the user is still choosing things, so every field can be empty. All of the
14
+ * builder's rules live here as pure functions, which keeps the React components
15
+ * presentational and lets the rules be tested without a DOM.
16
+ */
17
+ interface ProjectionDraft {
18
+ baseTable: string;
19
+ entityKey: string;
20
+ fieldBindings: Record<string, ProjectionFieldBinding>;
21
+ identity: ProjectionIdentity;
22
+ joins: ProjectionJoin[];
23
+ }
24
+ declare function emptyProjectionDraft(baseTable: string): ProjectionDraft;
25
+ /**
26
+ * The ON conditions implied by a foreign key between the two tables, so the
27
+ * builder can pre-fill a join instead of making the user hand-pick columns.
28
+ * Returns [] when no FK relates them — the user then picks manually.
29
+ */
30
+ declare function suggestJoinConditions(baseTable: string, joinTable: string, schema: DiscoveredSchemaTable[], joinKey: string): ProjectionJoin["on"];
31
+ /** A draft becomes a projection once it has a valid key and ≥1 binding. */
32
+ declare function draftToProjection(draft: ProjectionDraft): ProjectionMapping | null;
33
+ declare function draftErrors(draft: ProjectionDraft, schema: DiscoveredSchemaTable[]): ConfigValidationError[];
34
+ /** Per-join fan-out, for the builder's inline cardinality hints. */
35
+ declare function describeCardinality(draft: ProjectionDraft, schema: DiscoveredSchemaTable[]): Array<{
36
+ fansOut: boolean;
37
+ joinKey: string;
38
+ }>;
39
+ //#endregion
40
+ //#region ../core/src/projection-validate.d.ts
41
+ /**
42
+ * Validate a projection against the discovered schema. Returns every error
43
+ * found (not just the first) so a builder UI can show them all at once.
44
+ */
45
+ declare function validateProjection(projection: ProjectionMapping, schema: DiscoveredSchemaTable[], base: string): ConfigValidationError[];
46
+ //#endregion
47
+ //#region ../core/src/schema-meta.d.ts
48
+ /**
49
+ * Accessors over a discovered table's schema-v2 metadata.
50
+ *
51
+ * Every helper treats *absent* metadata as **unknown**, never as a negative
52
+ * fact. `coversUniqueKey` returning false on a v1 payload is what makes
53
+ * projection validation fail closed: we cannot prove a join is many-to-one, so
54
+ * we refuse to compile it rather than guess.
55
+ */
56
+ declare function columnMetaFor(table: DiscoveredSchemaTable, column: string): DiscoveredColumnMeta | undefined;
57
+ /**
58
+ * Every primary-key column. More than one entry means a composite PK, which is
59
+ * why `base_pk` identity is rejected for such tables.
60
+ */
61
+ declare function primaryKeyColumns(table: DiscoveredSchemaTable): string[];
62
+ /**
63
+ * Do `columns` contain every column of at least one unique key on `table`?
64
+ *
65
+ * This is the fan-out test. A join whose ON columns cover a unique key of the
66
+ * joined table matches at most one row per base row; one that does not can
67
+ * match many.
68
+ */
69
+ declare function coversUniqueKey(table: DiscoveredSchemaTable, columns: string[]): boolean;
70
+ /** Is this table's payload rich enough to validate a projection against? */
71
+ declare function hasRichMeta(table: DiscoveredSchemaTable): boolean;
72
+ //#endregion
73
+ export { validateProjection as a, draftErrors as c, suggestJoinConditions as d, fanOutJoins as f, primaryKeyColumns as i, draftToProjection as l, coversUniqueKey as n, ProjectionDraft as o, joinFansOut as p, hasRichMeta as r, describeCardinality as s, columnMetaFor as t, emptyProjectionDraft as u };
@@ -0,0 +1,97 @@
1
+ const require_projection = require("./projection-C5244vGa.cjs");
2
+ const require_entity_config = require("./entity-config-CsLl-ftC.cjs");
3
+ //#region ../core/src/projection-draft.ts
4
+ function emptyProjectionDraft(baseTable) {
5
+ return {
6
+ baseTable,
7
+ entityKey: "",
8
+ fieldBindings: {},
9
+ identity: { kind: "base_pk" },
10
+ joins: []
11
+ };
12
+ }
13
+ /**
14
+ * The ON conditions implied by a foreign key between the two tables, so the
15
+ * builder can pre-fill a join instead of making the user hand-pick columns.
16
+ * Returns [] when no FK relates them — the user then picks manually.
17
+ */
18
+ function suggestJoinConditions(baseTable, joinTable, schema, joinKey) {
19
+ const join = schema.find((t) => t.name === joinTable);
20
+ const conditions = [];
21
+ for (const column of join?.columnsMeta ?? []) if (column.references?.table === baseTable) conditions.push({
22
+ left: {
23
+ table: joinKey,
24
+ column: column.name
25
+ },
26
+ op: "eq",
27
+ right: {
28
+ table: require_projection.BASE_REF,
29
+ column: column.references.column
30
+ }
31
+ });
32
+ return conditions;
33
+ }
34
+ /** A draft becomes a projection once it has a valid key and ≥1 binding. */
35
+ function draftToProjection(draft) {
36
+ if (!require_projection.PROJECTION_KEY_PATTERN.test(draft.entityKey)) return null;
37
+ if (Object.keys(draft.fieldBindings).length === 0) return null;
38
+ return {
39
+ version: 1,
40
+ kind: "projection",
41
+ entityKey: draft.entityKey,
42
+ baseTable: draft.baseTable,
43
+ joins: draft.joins,
44
+ fieldBindings: draft.fieldBindings,
45
+ identity: draft.identity
46
+ };
47
+ }
48
+ function draftErrors(draft, schema) {
49
+ const projection = draftToProjection(draft);
50
+ if (!projection) return [{
51
+ path: "projection",
52
+ message: "Name the object and map a field."
53
+ }];
54
+ return require_entity_config.validateProjection(projection, schema, "projection");
55
+ }
56
+ /** Per-join fan-out, for the builder's inline cardinality hints. */
57
+ function describeCardinality(draft, schema) {
58
+ const projection = draftToProjection(draft);
59
+ if (!projection) return [];
60
+ const tablesByName = new Map(schema.map((t) => [t.name, t]));
61
+ const fanning = new Set(require_entity_config.fanOutJoins(projection, tablesByName).map((j) => j.key));
62
+ return projection.joins.map((join) => ({
63
+ joinKey: join.key,
64
+ fansOut: fanning.has(join.key)
65
+ }));
66
+ }
67
+ //#endregion
68
+ Object.defineProperty(exports, "describeCardinality", {
69
+ enumerable: true,
70
+ get: function() {
71
+ return describeCardinality;
72
+ }
73
+ });
74
+ Object.defineProperty(exports, "draftErrors", {
75
+ enumerable: true,
76
+ get: function() {
77
+ return draftErrors;
78
+ }
79
+ });
80
+ Object.defineProperty(exports, "draftToProjection", {
81
+ enumerable: true,
82
+ get: function() {
83
+ return draftToProjection;
84
+ }
85
+ });
86
+ Object.defineProperty(exports, "emptyProjectionDraft", {
87
+ enumerable: true,
88
+ get: function() {
89
+ return emptyProjectionDraft;
90
+ }
91
+ });
92
+ Object.defineProperty(exports, "suggestJoinConditions", {
93
+ enumerable: true,
94
+ get: function() {
95
+ return suggestJoinConditions;
96
+ }
97
+ });
@@ -0,0 +1,68 @@
1
+ import { n as PROJECTION_KEY_PATTERN, t as BASE_REF } from "./projection-D7xmQP4S.mjs";
2
+ import { f as validateProjection, p as fanOutJoins } from "./entity-config-D3LmzgLb.mjs";
3
+ //#region ../core/src/projection-draft.ts
4
+ function emptyProjectionDraft(baseTable) {
5
+ return {
6
+ baseTable,
7
+ entityKey: "",
8
+ fieldBindings: {},
9
+ identity: { kind: "base_pk" },
10
+ joins: []
11
+ };
12
+ }
13
+ /**
14
+ * The ON conditions implied by a foreign key between the two tables, so the
15
+ * builder can pre-fill a join instead of making the user hand-pick columns.
16
+ * Returns [] when no FK relates them — the user then picks manually.
17
+ */
18
+ function suggestJoinConditions(baseTable, joinTable, schema, joinKey) {
19
+ const join = schema.find((t) => t.name === joinTable);
20
+ const conditions = [];
21
+ for (const column of join?.columnsMeta ?? []) if (column.references?.table === baseTable) conditions.push({
22
+ left: {
23
+ table: joinKey,
24
+ column: column.name
25
+ },
26
+ op: "eq",
27
+ right: {
28
+ table: BASE_REF,
29
+ column: column.references.column
30
+ }
31
+ });
32
+ return conditions;
33
+ }
34
+ /** A draft becomes a projection once it has a valid key and ≥1 binding. */
35
+ function draftToProjection(draft) {
36
+ if (!PROJECTION_KEY_PATTERN.test(draft.entityKey)) return null;
37
+ if (Object.keys(draft.fieldBindings).length === 0) return null;
38
+ return {
39
+ version: 1,
40
+ kind: "projection",
41
+ entityKey: draft.entityKey,
42
+ baseTable: draft.baseTable,
43
+ joins: draft.joins,
44
+ fieldBindings: draft.fieldBindings,
45
+ identity: draft.identity
46
+ };
47
+ }
48
+ function draftErrors(draft, schema) {
49
+ const projection = draftToProjection(draft);
50
+ if (!projection) return [{
51
+ path: "projection",
52
+ message: "Name the object and map a field."
53
+ }];
54
+ return validateProjection(projection, schema, "projection");
55
+ }
56
+ /** Per-join fan-out, for the builder's inline cardinality hints. */
57
+ function describeCardinality(draft, schema) {
58
+ const projection = draftToProjection(draft);
59
+ if (!projection) return [];
60
+ const tablesByName = new Map(schema.map((t) => [t.name, t]));
61
+ const fanning = new Set(fanOutJoins(projection, tablesByName).map((j) => j.key));
62
+ return projection.joins.map((join) => ({
63
+ joinKey: join.key,
64
+ fansOut: fanning.has(join.key)
65
+ }));
66
+ }
67
+ //#endregion
68
+ export { suggestJoinConditions as a, emptyProjectionDraft as i, draftErrors as n, draftToProjection as r, describeCardinality as t };
@@ -0,0 +1,73 @@
1
+ import { d as DiscoveredSchemaTable, s as ConfigValidationError, u as DiscoveredColumnMeta } from "./entity-config-C4Yf_fPj.mjs";
2
+ import { a as ProjectionIdentity, i as ProjectionFieldBinding, o as ProjectionJoin, s as ProjectionMapping } from "./mappings-config-BpcR8bBo.mjs";
3
+ //#region ../core/src/projection-cardinality.d.ts
4
+ declare function joinFansOut(join: ProjectionJoin, joinTable: DiscoveredSchemaTable): boolean;
5
+ /** Every join in the projection that can multiply rows. */
6
+ declare function fanOutJoins(projection: ProjectionMapping, tablesByName: Map<string, DiscoveredSchemaTable>): ProjectionJoin[];
7
+ //#endregion
8
+ //#region ../core/src/projection-draft.d.ts
9
+ /**
10
+ * The builder's in-progress shape.
11
+ *
12
+ * A draft is deliberately looser than a `ProjectionMapping`: it exists while
13
+ * the user is still choosing things, so every field can be empty. All of the
14
+ * builder's rules live here as pure functions, which keeps the React components
15
+ * presentational and lets the rules be tested without a DOM.
16
+ */
17
+ interface ProjectionDraft {
18
+ baseTable: string;
19
+ entityKey: string;
20
+ fieldBindings: Record<string, ProjectionFieldBinding>;
21
+ identity: ProjectionIdentity;
22
+ joins: ProjectionJoin[];
23
+ }
24
+ declare function emptyProjectionDraft(baseTable: string): ProjectionDraft;
25
+ /**
26
+ * The ON conditions implied by a foreign key between the two tables, so the
27
+ * builder can pre-fill a join instead of making the user hand-pick columns.
28
+ * Returns [] when no FK relates them — the user then picks manually.
29
+ */
30
+ declare function suggestJoinConditions(baseTable: string, joinTable: string, schema: DiscoveredSchemaTable[], joinKey: string): ProjectionJoin["on"];
31
+ /** A draft becomes a projection once it has a valid key and ≥1 binding. */
32
+ declare function draftToProjection(draft: ProjectionDraft): ProjectionMapping | null;
33
+ declare function draftErrors(draft: ProjectionDraft, schema: DiscoveredSchemaTable[]): ConfigValidationError[];
34
+ /** Per-join fan-out, for the builder's inline cardinality hints. */
35
+ declare function describeCardinality(draft: ProjectionDraft, schema: DiscoveredSchemaTable[]): Array<{
36
+ fansOut: boolean;
37
+ joinKey: string;
38
+ }>;
39
+ //#endregion
40
+ //#region ../core/src/projection-validate.d.ts
41
+ /**
42
+ * Validate a projection against the discovered schema. Returns every error
43
+ * found (not just the first) so a builder UI can show them all at once.
44
+ */
45
+ declare function validateProjection(projection: ProjectionMapping, schema: DiscoveredSchemaTable[], base: string): ConfigValidationError[];
46
+ //#endregion
47
+ //#region ../core/src/schema-meta.d.ts
48
+ /**
49
+ * Accessors over a discovered table's schema-v2 metadata.
50
+ *
51
+ * Every helper treats *absent* metadata as **unknown**, never as a negative
52
+ * fact. `coversUniqueKey` returning false on a v1 payload is what makes
53
+ * projection validation fail closed: we cannot prove a join is many-to-one, so
54
+ * we refuse to compile it rather than guess.
55
+ */
56
+ declare function columnMetaFor(table: DiscoveredSchemaTable, column: string): DiscoveredColumnMeta | undefined;
57
+ /**
58
+ * Every primary-key column. More than one entry means a composite PK, which is
59
+ * why `base_pk` identity is rejected for such tables.
60
+ */
61
+ declare function primaryKeyColumns(table: DiscoveredSchemaTable): string[];
62
+ /**
63
+ * Do `columns` contain every column of at least one unique key on `table`?
64
+ *
65
+ * This is the fan-out test. A join whose ON columns cover a unique key of the
66
+ * joined table matches at most one row per base row; one that does not can
67
+ * match many.
68
+ */
69
+ declare function coversUniqueKey(table: DiscoveredSchemaTable, columns: string[]): boolean;
70
+ /** Is this table's payload rich enough to validate a projection against? */
71
+ declare function hasRichMeta(table: DiscoveredSchemaTable): boolean;
72
+ //#endregion
73
+ export { validateProjection as a, draftErrors as c, suggestJoinConditions as d, fanOutJoins as f, primaryKeyColumns as i, draftToProjection as l, coversUniqueKey as n, ProjectionDraft as o, joinFansOut as p, hasRichMeta as r, describeCardinality as s, columnMetaFor as t, emptyProjectionDraft as u };
@@ -1,3 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_drizzle = require("./drizzle-DiReZf6d.cjs");
2
+ const require_drizzle = require("./drizzle-bfjVzYR6.cjs");
3
+ exports.buildColumnsMeta = require_drizzle.buildColumnsMeta;
4
+ exports.buildUniqueConstraints = require_drizzle.buildUniqueConstraints;
3
5
  exports.discoverFromDrizzle = require_drizzle.discoverFromDrizzle;
@@ -1,2 +1,2 @@
1
- import { t as discoverFromDrizzle } from "./drizzle-DmeKSqeF.cjs";
2
- export { discoverFromDrizzle };
1
+ import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-BhN5M9zt.cjs";
2
+ export { buildColumnsMeta, buildUniqueConstraints, discoverFromDrizzle };
@@ -1,2 +1,2 @@
1
- import { t as discoverFromDrizzle } from "./drizzle-CFOr9dU9.mjs";
2
- export { discoverFromDrizzle };
1
+ import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-kBULBAOa.mjs";
2
+ export { buildColumnsMeta, buildUniqueConstraints, discoverFromDrizzle };
@@ -1,2 +1,2 @@
1
- import { t as discoverFromDrizzle } from "./drizzle-B89tLo4T.mjs";
2
- export { discoverFromDrizzle };
1
+ import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-3kvhkwO7.mjs";
2
+ export { buildColumnsMeta, buildUniqueConstraints, discoverFromDrizzle };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_entity_config = require("./entity-config-D87rV-tE.cjs");
2
+ const require_entity_config = require("./entity-config-CsLl-ftC.cjs");
3
3
  exports.CANONICAL_FIELDS = require_entity_config.CANONICAL_FIELDS;
4
4
  exports.CRM_CONCEPTS = require_entity_config.CRM_CONCEPTS;
5
5
  exports.CUSTOM_CONCEPT = require_entity_config.CUSTOM_CONCEPT;
@@ -1,2 +1,2 @@
1
- import { C as validateEntitiesConfig, S as relationshipsSchema, _ as RelationshipsMap, a as ClivlyEntitiesConfig, b as filterSchema, c as ConfigValidationResult, d as FilterExpr, f as FilterValue, g as RelationshipVia, h as RelationshipSpec, i as ClivlyConfigError, l as CrmConcept, m as MaterializingConcept, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as MATERIALIZING_CONCEPTS, r as CUSTOM_CONCEPT, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredSchemaTable, v as defineClivlyConfig, x as relationshipSchema, y as entitiesConfigSchema } from "./entity-config-DoUCXtq5.cjs";
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 };
@@ -1,2 +1,2 @@
1
- import { C as validateEntitiesConfig, S as relationshipsSchema, _ as RelationshipsMap, a as ClivlyEntitiesConfig, b as filterSchema, c as ConfigValidationResult, d as FilterExpr, f as FilterValue, g as RelationshipVia, h as RelationshipSpec, i as ClivlyConfigError, l as CrmConcept, m as MaterializingConcept, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as MATERIALIZING_CONCEPTS, r as CUSTOM_CONCEPT, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredSchemaTable, v as defineClivlyConfig, x as relationshipSchema, y as entitiesConfigSchema } from "./entity-config-DoUCXtq5.mjs";
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 };
@@ -1,2 +1,2 @@
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-va2bkH5o.mjs";
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
  export { CANONICAL_FIELDS, CRM_CONCEPTS, CUSTOM_CONCEPT, ClivlyConfigError, MATERIALIZING_CONCEPTS, defineClivlyConfig, entitiesConfigSchema, filterSchema, relationshipSchema, relationshipsSchema, validateEntitiesConfig };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_entity_config = require("./entity-config-D87rV-tE.cjs");
2
+ const require_entity_config = require("./entity-config-CsLl-ftC.cjs");
3
3
  const require_mapping_score = require("./mapping-score-CaB3F4Uu.cjs");
4
4
  //#region ../core/src/entity-heuristics.ts
5
5
  const TARGET_CONCEPTS = [
@@ -1,3 +1,4 @@
1
+ import { u as DiscoveredColumnMeta } from "./entity-config-C4Yf_fPj.cjs";
1
2
  import { a as Scored } from "./mapping-score-D7Gzg7Ii.cjs";
2
3
  //#region ../core/src/entity-heuristics.d.ts
3
4
  declare const TARGET_CONCEPTS: readonly ["contact", "company", "deal", "activity", "conversation", "note"];
@@ -6,17 +7,6 @@ declare function suggestCursorField(columnKeys: string[]): string | null;
6
7
  declare function matchesConcept(tableName: string, concept: TargetConcept): {
7
8
  exact: boolean;
8
9
  } | null;
9
- interface DiscoveredColumnMeta {
10
- isForeignKey?: boolean;
11
- isPrimaryKey?: boolean;
12
- name: string;
13
- nullable?: boolean;
14
- references?: {
15
- table: string;
16
- column: string;
17
- };
18
- type?: string;
19
- }
20
10
  interface ScoredTable {
21
11
  columns: string[];
22
12
  columnsMeta?: DiscoveredColumnMeta[];
@@ -64,4 +54,4 @@ interface FieldSuggestion {
64
54
  declare function scoreFieldMap(concept: TargetConcept, table: ScoredTable): Scored<FieldSuggestion>[];
65
55
  declare function toFieldMap(scored: Scored<FieldSuggestion>[]): Record<string, string>;
66
56
  //#endregion
67
- export { DiscoveredColumnMeta, FieldSuggestion, RelationshipSuggestion, ScoredTable, SuggestedVia, TARGET_CONCEPTS, TargetConcept, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping };
57
+ export { type DiscoveredColumnMeta, FieldSuggestion, RelationshipSuggestion, ScoredTable, SuggestedVia, TARGET_CONCEPTS, TargetConcept, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping };
@@ -1,3 +1,4 @@
1
+ import { u as DiscoveredColumnMeta } from "./entity-config-C4Yf_fPj.mjs";
1
2
  import { a as Scored } from "./mapping-score-D7Gzg7Ii.mjs";
2
3
  //#region ../core/src/entity-heuristics.d.ts
3
4
  declare const TARGET_CONCEPTS: readonly ["contact", "company", "deal", "activity", "conversation", "note"];
@@ -6,17 +7,6 @@ declare function suggestCursorField(columnKeys: string[]): string | null;
6
7
  declare function matchesConcept(tableName: string, concept: TargetConcept): {
7
8
  exact: boolean;
8
9
  } | null;
9
- interface DiscoveredColumnMeta {
10
- isForeignKey?: boolean;
11
- isPrimaryKey?: boolean;
12
- name: string;
13
- nullable?: boolean;
14
- references?: {
15
- table: string;
16
- column: string;
17
- };
18
- type?: string;
19
- }
20
10
  interface ScoredTable {
21
11
  columns: string[];
22
12
  columnsMeta?: DiscoveredColumnMeta[];
@@ -64,4 +54,4 @@ interface FieldSuggestion {
64
54
  declare function scoreFieldMap(concept: TargetConcept, table: ScoredTable): Scored<FieldSuggestion>[];
65
55
  declare function toFieldMap(scored: Scored<FieldSuggestion>[]): Record<string, string>;
66
56
  //#endregion
67
- export { DiscoveredColumnMeta, FieldSuggestion, RelationshipSuggestion, ScoredTable, SuggestedVia, TARGET_CONCEPTS, TargetConcept, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping };
57
+ export { type DiscoveredColumnMeta, FieldSuggestion, RelationshipSuggestion, ScoredTable, SuggestedVia, TARGET_CONCEPTS, TargetConcept, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping };
@@ -1,4 +1,4 @@
1
- import { a as MATERIALIZING_CONCEPTS } from "./entity-config-va2bkH5o.mjs";
1
+ import { a as MATERIALIZING_CONCEPTS } from "./entity-config-D3LmzgLb.mjs";
2
2
  import { a as W, c as isTextLike, i as RELATIONSHIP_TIERS, l as isTimestampLike, n as CONCEPT_TIERS, o as isAmbiguous, r as FIELD_TIERS, s as isNumericLike, u as tierFor } from "./mapping-score-C68uAqGB.mjs";
3
3
  //#region ../core/src/entity-heuristics.ts
4
4
  const TARGET_CONCEPTS = [
@@ -1,2 +1,2 @@
1
- import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-lfyEE7EJ.cjs";
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 };
@@ -1,2 +1,2 @@
1
- import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-D93lhHEc.mjs";
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 };
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_mappings_config = require("./mappings-config-BsRADNRv.cjs");
2
+ const require_mappings_config = require("./mappings-config-BSSwdHiq.cjs");
3
3
  exports.mappingsToEntitiesConfig = require_mappings_config.mappingsToEntitiesConfig;
@@ -1,2 +1,2 @@
1
- import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-XmzB4dag.cjs";
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-DsUa7-1w.mjs";
1
+ import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-BpcR8bBo.mjs";
2
2
  export { EntityMappingRow, mappingsToEntitiesConfig };
@@ -1,2 +1,2 @@
1
- import { t as mappingsToEntitiesConfig } from "./mappings-config-Dbgxx3Nv.mjs";
1
+ import { t as mappingsToEntitiesConfig } from "./mappings-config-bJQT_gSa.mjs";
2
2
  export { mappingsToEntitiesConfig };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sync_engine = require("./sync-engine-CzEbpQGv.cjs");
2
+ const require_sync_engine = require("./sync-engine-DEJvKw6E.cjs");
3
3
  exports.computeSampleWarnings = require_sync_engine.computeSampleWarnings;
4
4
  exports.previewSync = require_sync_engine.previewSync;
5
5
  exports.reconcile = require_sync_engine.reconcile;
@@ -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-B7QIbXro.cjs";
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 };
@@ -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-DGk_AeHJ.mjs";
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 };
@@ -1,2 +1,2 @@
1
- import { i as runSync, n as previewSync, r as reconcile, t as computeSampleWarnings } from "./sync-engine-Do5ru3WF.mjs";
1
+ import { i as runSync, n as previewSync, r as reconcile, t as computeSampleWarnings } from "./sync-engine-Bg6-SznL.mjs";
2
2
  export { computeSampleWarnings, previewSync, reconcile, runSync };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_view_compiler = require("./view-compiler-BIwvm-o2.cjs");
2
+ const require_view_compiler = require("./view-compiler-DplczSjF.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;
@@ -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-BWz0sGdm.cjs";
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 };
@@ -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-Bn_EJJMO.mjs";
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 };
@@ -1,2 +1,2 @@
1
- import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-ChWr_Lml.mjs";
1
+ import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-DlTpOfZi.mjs";
2
2
  export { DEFAULT_VIEW_PREFIX, compileEntityView, compileEntityViews, explainEntitiesConfig };
package/internal.cjs CHANGED
@@ -1,10 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_entity_config = require("./entity-config-D87rV-tE.cjs");
2
+ const require_projection = require("./projection-C5244vGa.cjs");
3
+ const require_entity_config = require("./entity-config-CsLl-ftC.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-BsRADNRv.cjs");
6
- const require_view_compiler = require("./view-compiler-BIwvm-o2.cjs");
7
- const require_sync_engine = require("./sync-engine-CzEbpQGv.cjs");
6
+ const require_mappings_config = require("./mappings-config-BSSwdHiq.cjs");
7
+ const require_internal = require("./internal-BARjyN4n.cjs");
8
+ const require_view_compiler = require("./view-compiler-DplczSjF.cjs");
9
+ const require_sync_engine = require("./sync-engine-DEJvKw6E.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;