clivly 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -27
- package/{adapter-BMAUq4hf.d.mts → adapter-C63F9VZL.d.mts} +1 -3
- package/{adapter-IH3r_I8v.d.cts → adapter-OO5g17qF.d.cts} +1 -3
- package/{auth-adapter-CiEXcweZ.cjs → auth-adapter-CNVuxT9W.cjs} +1 -2
- package/{auth-adapter-Bt1GZiag.d.cts → auth-adapter-COMP0Fud.d.cts} +1 -3
- package/{auth-adapter-CHy273qb.d.mts → auth-adapter-ZlhllVpm.d.mts} +1 -3
- package/{auth-adapter-gfVDxf3d.mjs → auth-adapter-u91PByaw.mjs} +1 -2
- package/auth-better-auth.cjs +2 -4
- package/auth-better-auth.d.cts +1 -5
- package/auth-better-auth.d.mts +1 -5
- package/auth-better-auth.mjs +2 -4
- package/auth-clerk.cjs +2 -4
- package/auth-clerk.d.cts +1 -5
- package/auth-clerk.d.mts +1 -5
- package/auth-clerk.mjs +2 -4
- package/auth-workos.cjs +2 -4
- package/auth-workos.d.cts +1 -5
- package/auth-workos.d.mts +1 -5
- package/auth-workos.mjs +2 -4
- package/core-adapter.cjs +2 -3
- package/core-adapter.d.cts +1 -1
- package/core-adapter.d.mts +1 -1
- package/core-adapter.mjs +2 -3
- package/core-auth-adapter.cjs +3 -4
- package/core-auth-adapter.d.cts +1 -1
- package/core-auth-adapter.d.mts +1 -1
- package/core-auth-adapter.mjs +3 -5
- package/core-drizzle.cjs +3 -4
- package/core-drizzle.d.cts +1 -1
- package/core-drizzle.d.mts +1 -1
- package/core-drizzle.mjs +3 -5
- package/core-entity-config.cjs +3 -4
- package/core-entity-config.d.cts +1 -1
- package/core-entity-config.d.mts +1 -1
- package/core-entity-config.mjs +3 -5
- package/core-entity-heuristics.cjs +18 -18
- package/core-entity-heuristics.d.cts +3 -3
- package/core-entity-heuristics.d.mts +3 -3
- package/core-entity-heuristics.mjs +3 -5
- package/core-mapping-form.cjs +3 -4
- package/core-mapping-form.d.cts +1 -1
- package/core-mapping-form.d.mts +1 -1
- package/core-mapping-form.mjs +3 -5
- package/core-mapping-score.cjs +3 -4
- package/core-mapping-score.d.cts +1 -1
- package/core-mapping-score.d.mts +1 -1
- package/core-mapping-score.mjs +3 -5
- package/core-mappings-config.cjs +3 -4
- package/core-mappings-config.d.cts +1 -1
- package/core-mappings-config.d.mts +1 -1
- package/core-mappings-config.mjs +3 -5
- package/core-sync-engine.cjs +3 -4
- package/core-sync-engine.d.cts +1 -1
- package/core-sync-engine.d.mts +1 -1
- package/core-sync-engine.mjs +3 -5
- package/core-types.cjs +3 -4
- package/core-types.d.cts +1 -1
- package/core-types.d.mts +1 -1
- package/core-types.mjs +3 -5
- package/core-view-compiler.cjs +3 -4
- package/core-view-compiler.d.cts +1 -1
- package/core-view-compiler.d.mts +1 -1
- package/core-view-compiler.mjs +3 -5
- package/core.cjs +13 -13
- package/core.d.cts +11 -11
- package/core.d.mts +11 -11
- package/core.mjs +13 -14
- package/{deprecate-subpath-CmvZtCpE.mjs → deprecate-subpath-CK37DKXH.mjs} +1 -2
- package/{deprecate-subpath-B9ngvizt.cjs → deprecate-subpath-dGwDiHKV.cjs} +1 -2
- package/{drizzle-CiK37zJm.d.cts → drizzle-B9cjBavj.d.cts} +1 -3
- package/{drizzle-DcB7OfBp.cjs → drizzle-C0bfX-6a.cjs} +1 -2
- package/{drizzle-wbcuG-cy.mjs → drizzle-CZuOzIu4.mjs} +1 -2
- package/{drizzle-ehVWLSrN.d.mts → drizzle-L5FOGe_-.d.mts} +1 -3
- package/{drizzle-meta-Bb1JWYqf.cjs → drizzle-meta-BPnRLpsB.cjs} +1 -2
- package/{drizzle-meta-D-5k3n0i.mjs → drizzle-meta-D00lFvAk.mjs} +1 -2
- package/drizzle.cjs +7 -10
- package/drizzle.d.cts +3 -7
- package/drizzle.d.mts +3 -7
- package/drizzle.mjs +7 -10
- package/{entity-config-BI4RYNKL.cjs → entity-config-DiCJ6mhI.cjs} +8 -11
- package/entity-config-X-KlnYXX.d.mts +632 -0
- package/entity-config-dNclLyBM.d.cts +632 -0
- package/{entity-config-Ccfb2IL9.mjs → entity-config-g_oMPXlN.mjs} +8 -11
- package/entity-heuristics-CIParuQe.cjs +655 -0
- package/entity-heuristics-DE5ujoHw.mjs +566 -0
- package/index.cjs +65 -111
- package/index.d.cts +1 -12
- package/index.d.mts +1 -12
- package/index.mjs +53 -99
- package/{integration-state-BA4c0RbD.d.mts → integration-state-xK4PLm5T.d.cts} +0 -2
- package/{integration-state-BA4c0RbD.d.cts → integration-state-xK4PLm5T.d.mts} +0 -2
- package/{internal-CLvZdVj5.mjs → internal-9oDwwbNg.mjs} +37 -9
- package/{internal-DsArcqkP.cjs → internal-BKYt5j0l.cjs} +42 -8
- package/{internal-C7NlPM3M.d.mts → internal-COALpgov.d.cts} +1 -17
- package/{internal-D2J4VQWT.d.cts → internal-D3q4FPcA.d.mts} +1 -17
- package/internal-adapter.d.cts +1 -1
- package/internal-adapter.d.mts +1 -1
- package/internal-auth-adapter.cjs +1 -1
- package/internal-auth-adapter.d.cts +1 -1
- package/internal-auth-adapter.d.mts +1 -1
- package/internal-auth-adapter.mjs +1 -2
- package/internal-drizzle.cjs +1 -1
- package/internal-drizzle.d.cts +1 -1
- package/internal-drizzle.d.mts +1 -1
- package/internal-drizzle.mjs +1 -2
- package/internal-entity-config.cjs +1 -1
- package/internal-entity-config.d.cts +1 -1
- package/internal-entity-config.d.mts +1 -1
- package/internal-entity-config.mjs +1 -2
- package/internal-entity-heuristics.cjs +16 -576
- package/internal-entity-heuristics.d.cts +4 -4
- package/internal-entity-heuristics.d.mts +4 -4
- package/internal-entity-heuristics.mjs +1 -563
- package/internal-mapping-form.cjs +1 -1
- package/internal-mapping-form.d.cts +1 -1
- package/internal-mapping-form.d.mts +1 -1
- package/internal-mapping-form.mjs +1 -2
- package/internal-mapping-score.cjs +1 -1
- package/internal-mapping-score.d.cts +1 -1
- package/internal-mapping-score.d.mts +1 -1
- package/internal-mapping-score.mjs +1 -2
- 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 -2
- 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 -2
- package/internal-types.cjs +1 -1
- package/internal-types.d.cts +1 -1
- package/internal-types.d.mts +1 -1
- package/internal-types.mjs +1 -2
- 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 -2
- package/internal.cjs +11 -10
- package/internal.d.cts +11 -11
- package/internal.d.mts +11 -11
- package/internal.mjs +11 -11
- package/{mapping-form-XsLLCqW_.d.cts → mapping-form-Bpvgf5b8.d.mts} +1 -3
- package/{mapping-form-BpfON_ME.cjs → mapping-form-Bs6JQurC.cjs} +1 -2
- package/{mapping-form-DigkuvFc.mjs → mapping-form-C7kDMWzp.mjs} +1 -2
- package/{mapping-form-Btn-7gzv.d.mts → mapping-form-CV7y6qox.d.cts} +1 -3
- package/{mapping-score-D7Gzg7Ii.d.cts → mapping-score-BKrxddz0.d.cts} +0 -2
- package/{mapping-score-D7Gzg7Ii.d.mts → mapping-score-BKrxddz0.d.mts} +0 -2
- package/{mapping-score-C68uAqGB.mjs → mapping-score-CS-MTDL9.mjs} +1 -2
- package/{mapping-score-CaB3F4Uu.cjs → mapping-score-D2TCQiOr.cjs} +1 -2
- package/{mappings-config-D6_oCi2Q.d.mts → mappings-config-BBppW9fp.d.cts} +1 -3
- package/{mappings-config-BCsRLohT.cjs → mappings-config-CNxBrbt9.cjs} +3 -4
- package/{mappings-config-CwQNQ6bA.mjs → mappings-config-D_g20PyS.mjs} +3 -4
- package/{mappings-config-iJzbcUMp.d.cts → mappings-config-Dmm0H6p_.d.mts} +1 -3
- package/{namespace-probe-DykR0kgh.d.mts → namespace-probe-BHk3NcyI.d.cts} +32 -9
- package/{namespace-probe-H7yWc0JV.d.cts → namespace-probe-Dt_HXcI-.d.mts} +32 -9
- package/package.json +1 -7
- package/{projection-DvNewmI1.mjs → projection-BkYXvjTr.mjs} +2444 -1166
- package/{projection-BELgANG2.cjs → projection-By63gMC-.cjs} +2447 -1163
- package/{projection-sql-DweUaWRc.mjs → projection-sql-C3gZE3GS.mjs} +2 -3
- package/{projection-sql-DuCtFE9t.cjs → projection-sql-CHz7KzNS.cjs} +2 -3
- package/schemas-BSuo_eZQ.d.cts +2160 -0
- package/schemas-BSuo_eZQ.d.mts +2160 -0
- package/{sdk-ZMy4C4VK.cjs → sdk-BZSTXPyK.cjs} +185 -74
- package/{sdk-DLoVPlGB.mjs → sdk-KzHpSf7F.mjs} +185 -74
- package/sdk.cjs +2 -2
- package/sdk.d.cts +4 -12
- package/sdk.d.mts +4 -12
- package/sdk.mjs +2 -2
- package/{sync-engine-C_5TpvfX.d.mts → sync-engine-C7W0Gkq0.d.cts} +2 -4
- package/{sync-engine-CYsWOujz.d.cts → sync-engine-C9Q2FkR9.d.mts} +2 -4
- package/{sync-engine-DH058G3w.mjs → sync-engine-CwdLkmch.mjs} +2 -3
- package/{sync-engine-BGVDsrOQ.cjs → sync-engine-Di-vF26b.cjs} +2 -3
- package/{types-YJTkXKzU.mjs → types-8KSw2AWg.mjs} +1 -2
- package/{types-Cq5gHCTq.cjs → types-B8m39L1s.cjs} +1 -2
- package/{types-CpAtAtxd.d.cts → types-C9_2vW5a.d.mts} +30 -3
- package/{types-CpAtAtxd.d.mts → types-CQ2DgEH7.d.cts} +30 -3
- package/{view-compiler-C-6RydKK.mjs → view-compiler-CLTi1VL-.mjs} +3 -4
- package/{view-compiler-xiwm5iar.cjs → view-compiler-DaOz5QVl.cjs} +3 -4
- package/{view-compiler-CwKVoK1w.d.mts → view-compiler-M23WiVGG.d.mts} +1 -3
- package/{view-compiler-Cq8apvZ4.d.cts → view-compiler-cXqt4X-c.d.cts} +1 -3
- package/vite.cjs +1 -2
- package/vite.d.cts +2 -4
- package/vite.d.mts +2 -4
- package/vite.mjs +1 -2
- package/entity-config-ApnT5j3X.d.cts +0 -4472
- package/entity-config-CKcj4-M_.d.mts +0 -4473
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { m as DiscoveredSchemaTable, p as DiscoveredColumnMeta } from "./entity-config-
|
|
1
|
+
import { m as DiscoveredSchemaTable, p as DiscoveredColumnMeta } from "./entity-config-X-KlnYXX.mjs";
|
|
2
2
|
import { Table } from "drizzle-orm";
|
|
3
|
-
//#region ../core/src/drizzle.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Every unique key on a table, as DB column-name tuples. Primary keys count —
|
|
6
5
|
* fan-out detection asks "do these join columns cover a unique key?", and a PK
|
|
@@ -39,5 +38,4 @@ declare function buildColumnsMeta(table: Table): DiscoveredColumnMeta[];
|
|
|
39
38
|
declare function discoverFromDrizzle(schema: Record<string, unknown>, options?: {
|
|
40
39
|
allowEmpty?: boolean;
|
|
41
40
|
}): DiscoveredSchemaTable[];
|
|
42
|
-
//#endregion
|
|
43
41
|
export { buildUniqueConstraints as n, discoverFromDrizzle as r, buildColumnsMeta as t };
|
package/drizzle.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_projection = require("./projection-
|
|
3
|
-
const require_drizzle_meta = require("./drizzle-meta-
|
|
4
|
-
const require_projection_sql = require("./projection-sql-
|
|
5
|
-
const require_drizzle = require("./drizzle-
|
|
2
|
+
const require_projection = require("./projection-By63gMC-.cjs");
|
|
3
|
+
const require_drizzle_meta = require("./drizzle-meta-BPnRLpsB.cjs");
|
|
4
|
+
const require_projection_sql = require("./projection-sql-CHz7KzNS.cjs");
|
|
5
|
+
const require_drizzle = require("./drizzle-C0bfX-6a.cjs");
|
|
6
6
|
let drizzle_orm = require("drizzle-orm");
|
|
7
|
-
|
|
7
|
+
// ../sdk/src/drizzle-projection.ts
|
|
8
8
|
/** `<ref>.<column>` — the token `fields` carries and cloud-ingest reads. */
|
|
9
9
|
function refToken(ref) {
|
|
10
10
|
return `${ref.table}.${ref.column}`;
|
|
@@ -101,8 +101,7 @@ function fromDrizzleProjectionByIdentity(client, projection, identityExpr, fromC
|
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
//#region ../sdk/src/projection-preview.ts
|
|
104
|
+
// ../sdk/src/projection-preview.ts
|
|
106
105
|
/** `db.execute` returns either an array or `{ rows }`, depending on driver. */
|
|
107
106
|
function rowsOf(result) {
|
|
108
107
|
if (Array.isArray(result)) return result;
|
|
@@ -115,8 +114,7 @@ async function previewProjection(db, projection, opts) {
|
|
|
115
114
|
const { sql } = await import("drizzle-orm");
|
|
116
115
|
return rowsOf(await client.execute(sql.raw(require_projection_sql.compileProjectionPreview(projection, opts.limit))));
|
|
117
116
|
}
|
|
118
|
-
|
|
119
|
-
//#region ../sdk/src/drizzle.ts
|
|
117
|
+
// ../sdk/src/drizzle.ts
|
|
120
118
|
function inferIdField(table) {
|
|
121
119
|
const columns = (0, drizzle_orm.getTableColumns)(table);
|
|
122
120
|
const primaryKeys = Object.entries(columns).filter(([, column]) => column.primary);
|
|
@@ -255,7 +253,6 @@ function drizzleIntrospector(db) {
|
|
|
255
253
|
}
|
|
256
254
|
};
|
|
257
255
|
}
|
|
258
|
-
//#endregion
|
|
259
256
|
exports.buildUniqueConstraints = require_drizzle.buildUniqueConstraints;
|
|
260
257
|
exports.discoverFromDrizzle = require_drizzle.discoverFromDrizzle;
|
|
261
258
|
exports.drizzleIntrospector = drizzleIntrospector;
|
package/drizzle.d.cts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-
|
|
2
|
-
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-
|
|
3
|
-
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-
|
|
1
|
+
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-dNclLyBM.cjs";
|
|
2
|
+
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-B9cjBavj.cjs";
|
|
3
|
+
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-BHk3NcyI.cjs";
|
|
4
4
|
import { Table } from "drizzle-orm";
|
|
5
|
-
//#region ../sdk/src/drizzle-projection.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Build a `SyncSource` that actually executes a projection's joins.
|
|
8
7
|
*
|
|
@@ -60,8 +59,6 @@ export declare function fromDrizzleProjection(db: unknown, projection: Projectio
|
|
|
60
59
|
objectType: string;
|
|
61
60
|
};
|
|
62
61
|
export declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions): SyncSource;
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region ../sdk/src/drizzle.d.ts
|
|
65
62
|
interface DrizzleDb {
|
|
66
63
|
select: (...args: any[]) => any;
|
|
67
64
|
}
|
|
@@ -171,5 +168,4 @@ export declare function insertAndPush(clivly: PushOneCapable, db: unknown, table
|
|
|
171
168
|
* (`current_schema()`), so it reports exactly the tables the app can reach.
|
|
172
169
|
*/
|
|
173
170
|
export declare function drizzleIntrospector(db: unknown): NamespaceIntrospector;
|
|
174
|
-
//#endregion
|
|
175
171
|
export { type FromDrizzleProjectionOptions, buildUniqueConstraints, discoverFromDrizzle };
|
package/drizzle.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-
|
|
2
|
-
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-
|
|
3
|
-
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-
|
|
1
|
+
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-X-KlnYXX.mjs";
|
|
2
|
+
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-L5FOGe_-.mjs";
|
|
3
|
+
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-Dt_HXcI-.mjs";
|
|
4
4
|
import { Table } from "drizzle-orm";
|
|
5
|
-
//#region ../sdk/src/drizzle-projection.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Build a `SyncSource` that actually executes a projection's joins.
|
|
8
7
|
*
|
|
@@ -60,8 +59,6 @@ export declare function fromDrizzleProjection(db: unknown, projection: Projectio
|
|
|
60
59
|
objectType: string;
|
|
61
60
|
};
|
|
62
61
|
export declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions): SyncSource;
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region ../sdk/src/drizzle.d.ts
|
|
65
62
|
interface DrizzleDb {
|
|
66
63
|
select: (...args: any[]) => any;
|
|
67
64
|
}
|
|
@@ -171,5 +168,4 @@ export declare function insertAndPush(clivly: PushOneCapable, db: unknown, table
|
|
|
171
168
|
* (`current_schema()`), so it reports exactly the tables the app can reach.
|
|
172
169
|
*/
|
|
173
170
|
export declare function drizzleIntrospector(db: unknown): NamespaceIntrospector;
|
|
174
|
-
//#endregion
|
|
175
171
|
export { type FromDrizzleProjectionOptions, buildUniqueConstraints, discoverFromDrizzle };
|
package/drizzle.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as BASE_REF } from "./projection-
|
|
2
|
-
import { t as DRIZZLE_META } from "./drizzle-meta-
|
|
3
|
-
import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, r as compileProjectionIdentity, s as quoteIdent } from "./projection-sql-
|
|
4
|
-
import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-
|
|
1
|
+
import { t as BASE_REF } from "./projection-BkYXvjTr.mjs";
|
|
2
|
+
import { t as DRIZZLE_META } from "./drizzle-meta-D00lFvAk.mjs";
|
|
3
|
+
import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, r as compileProjectionIdentity, s as quoteIdent } from "./projection-sql-C3gZE3GS.mjs";
|
|
4
|
+
import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-CZuOzIu4.mjs";
|
|
5
5
|
import { asc, getTableColumns, getTableName, sql } from "drizzle-orm";
|
|
6
|
-
|
|
6
|
+
// ../sdk/src/drizzle-projection.ts
|
|
7
7
|
/** `<ref>.<column>` — the token `fields` carries and cloud-ingest reads. */
|
|
8
8
|
function refToken(ref) {
|
|
9
9
|
return `${ref.table}.${ref.column}`;
|
|
@@ -100,8 +100,7 @@ function fromDrizzleProjectionByIdentity(client, projection, identityExpr, fromC
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
//#region ../sdk/src/projection-preview.ts
|
|
103
|
+
// ../sdk/src/projection-preview.ts
|
|
105
104
|
/** `db.execute` returns either an array or `{ rows }`, depending on driver. */
|
|
106
105
|
function rowsOf(result) {
|
|
107
106
|
if (Array.isArray(result)) return result;
|
|
@@ -114,8 +113,7 @@ async function previewProjection(db, projection, opts) {
|
|
|
114
113
|
const { sql } = await import("drizzle-orm");
|
|
115
114
|
return rowsOf(await client.execute(sql.raw(compileProjectionPreview(projection, opts.limit))));
|
|
116
115
|
}
|
|
117
|
-
|
|
118
|
-
//#region ../sdk/src/drizzle.ts
|
|
116
|
+
// ../sdk/src/drizzle.ts
|
|
119
117
|
function inferIdField(table) {
|
|
120
118
|
const columns = getTableColumns(table);
|
|
121
119
|
const primaryKeys = Object.entries(columns).filter(([, column]) => column.primary);
|
|
@@ -254,5 +252,4 @@ function drizzleIntrospector(db) {
|
|
|
254
252
|
}
|
|
255
253
|
};
|
|
256
254
|
}
|
|
257
|
-
//#endregion
|
|
258
255
|
export { buildUniqueConstraints, discoverFromDrizzle, drizzleIntrospector, fromDrizzle, fromDrizzleProjection, insertAndPush, toColumnKeyedRow };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_projection = require("./projection-
|
|
2
|
-
|
|
1
|
+
const require_projection = require("./projection-By63gMC-.cjs");
|
|
2
|
+
// ../core/src/schema-meta.ts
|
|
3
3
|
/**
|
|
4
4
|
* Accessors over a discovered table's schema-v2 metadata.
|
|
5
5
|
*
|
|
@@ -43,8 +43,7 @@ function coversUniqueKey(table, columns) {
|
|
|
43
43
|
function hasRichMeta(table) {
|
|
44
44
|
return Boolean(table.columnsMeta && table.uniqueConstraints);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
//#region ../core/src/projection-cardinality.ts
|
|
46
|
+
// ../core/src/projection-cardinality.ts
|
|
48
47
|
/**
|
|
49
48
|
* Cardinality analysis for projection joins.
|
|
50
49
|
*
|
|
@@ -73,8 +72,7 @@ function fanOutJoins(projection, tablesByName) {
|
|
|
73
72
|
return table ? joinFansOut(join, table) : true;
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
|
-
|
|
77
|
-
//#region ../core/src/projection-validate.ts
|
|
75
|
+
// ../core/src/projection-validate.ts
|
|
78
76
|
/**
|
|
79
77
|
* Semantic validation for a projection mapping, against the host's discovered
|
|
80
78
|
* schema.
|
|
@@ -357,8 +355,7 @@ function validateProjection(projection, schema, base) {
|
|
|
357
355
|
checkFanOut(errors, projection, resolver, base, basePk);
|
|
358
356
|
return errors;
|
|
359
357
|
}
|
|
360
|
-
|
|
361
|
-
//#region ../core/src/entity-config.ts
|
|
358
|
+
// ../core/src/entity-config.ts
|
|
362
359
|
/**
|
|
363
360
|
* Entity Config v2 — the declarative contract that turns Clivly's "schema-aware"
|
|
364
361
|
* promise into a real capability.
|
|
@@ -388,7 +385,8 @@ const CRM_CONCEPTS = [
|
|
|
388
385
|
* crm_* columns the sync store writes. An entity's `fields` map keys must be one
|
|
389
386
|
* of these: a non-canonical key (e.g. `fullName` instead of `name`) validates
|
|
390
387
|
* structurally but has no destination column, so the store silently writes an
|
|
391
|
-
* empty value. `validateEntitiesConfig` flags those.
|
|
388
|
+
* empty value. `validateEntitiesConfig` flags those. Contact keys prefixed
|
|
389
|
+
* `synced.` are an explicit exception: retained as JSON properties for segments.
|
|
392
390
|
*
|
|
393
391
|
* This is the single source of truth — the Drizzle store imports it, so the
|
|
394
392
|
* two can't drift (the drift is what made the silent-data-loss trap possible).
|
|
@@ -622,7 +620,7 @@ var ClivlyConfigError = class extends Error {
|
|
|
622
620
|
function nonCanonicalFieldKeys(entity) {
|
|
623
621
|
const canonical = CANONICAL_FIELDS[entity.concept];
|
|
624
622
|
if (!canonical) return [];
|
|
625
|
-
return Object.keys(entity.fields).filter((key) => !canonical.includes(key));
|
|
623
|
+
return Object.keys(entity.fields).filter((key) => !(canonical.includes(key) || entity.concept === "contact" && key.startsWith("synced.") && key.length > 7));
|
|
626
624
|
}
|
|
627
625
|
function nonCanonicalMessage(entity, field) {
|
|
628
626
|
const canonical = CANONICAL_FIELDS[entity.concept] ?? [];
|
|
@@ -833,7 +831,6 @@ function validateEntitiesConfig(config, schema) {
|
|
|
833
831
|
errors: validator.errors
|
|
834
832
|
};
|
|
835
833
|
}
|
|
836
|
-
//#endregion
|
|
837
834
|
Object.defineProperty(exports, "CANONICAL_FIELDS", {
|
|
838
835
|
enumerable: true,
|
|
839
836
|
get: function() {
|