clivly 0.16.0 → 0.17.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/{adapter-BMAUq4hf.d.mts → adapter-BpAfha3z.d.mts} +1 -3
- package/{adapter-IH3r_I8v.d.cts → adapter-BvSigBPG.d.cts} +1 -3
- package/{auth-adapter-CiEXcweZ.cjs → auth-adapter-CNVuxT9W.cjs} +1 -2
- package/{auth-adapter-Bt1GZiag.d.cts → auth-adapter-CsZE4ugg.d.cts} +1 -3
- package/{auth-adapter-CHy273qb.d.mts → auth-adapter-Q6CL2VHr.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 +2 -3
- package/core-entity-heuristics.d.cts +1 -1
- package/core-entity-heuristics.d.mts +1 -1
- 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-DcB7OfBp.cjs → drizzle-C0bfX-6a.cjs} +1 -2
- package/{drizzle-wbcuG-cy.mjs → drizzle-CZuOzIu4.mjs} +1 -2
- package/{drizzle-CiK37zJm.d.cts → drizzle-MUNZgh1l.d.cts} +1 -3
- package/{drizzle-ehVWLSrN.d.mts → drizzle-UJbPCzPJ.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-BF7pcXFB.d.cts +632 -0
- package/{entity-config-Ccfb2IL9.mjs → entity-config-DQVSprlG.mjs} +8 -11
- package/{entity-config-BI4RYNKL.cjs → entity-config-nWWgJXLw.cjs} +8 -11
- package/entity-config-pzamFSKw.d.mts +632 -0
- package/index.cjs +51 -98
- package/index.d.cts +1 -12
- package/index.d.mts +1 -12
- package/index.mjs +51 -98
- 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-C7NlPM3M.d.mts → internal-C-uvosSL.d.cts} +1 -17
- package/{internal-DsArcqkP.cjs → internal-CjJy-cy1.cjs} +42 -8
- package/{internal-CLvZdVj5.mjs → internal-DtLZyjf8.mjs} +37 -9
- package/{internal-D2J4VQWT.d.cts → internal-Gie7hCpK.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 +3 -4
- package/internal-entity-heuristics.d.cts +2 -4
- package/internal-entity-heuristics.d.mts +2 -4
- package/internal-entity-heuristics.mjs +3 -4
- 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-BpfON_ME.cjs → mapping-form-Bs6JQurC.cjs} +1 -2
- package/{mapping-form-XsLLCqW_.d.cts → mapping-form-BymksK7h.d.mts} +1 -3
- package/{mapping-form-DigkuvFc.mjs → mapping-form-C7kDMWzp.mjs} +1 -2
- package/{mapping-form-Btn-7gzv.d.mts → mapping-form-Cmf8y-1m.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-CwQNQ6bA.mjs → mappings-config-C7FPwrJT.mjs} +3 -4
- package/{mappings-config-BCsRLohT.cjs → mappings-config-DBG-KnYl.cjs} +3 -4
- package/{mappings-config-D6_oCi2Q.d.mts → mappings-config-Dsz6rcJb.d.cts} +1 -3
- package/{mappings-config-iJzbcUMp.d.cts → mappings-config-ktJhxmHm.d.mts} +1 -3
- package/{namespace-probe-DykR0kgh.d.mts → namespace-probe-By8SCnym.d.mts} +2 -8
- package/{namespace-probe-H7yWc0JV.d.cts → namespace-probe-CTkb35Ro.d.cts} +2 -8
- package/package.json +1 -1
- package/{projection-BELgANG2.cjs → projection-B8RtxuEq.cjs} +35 -38
- package/{projection-DvNewmI1.mjs → projection-DNi_2dVa.mjs} +30 -39
- package/{projection-sql-DweUaWRc.mjs → projection-sql-BYv40Hen.mjs} +2 -3
- package/{projection-sql-DuCtFE9t.cjs → projection-sql-SuhzhsMe.cjs} +2 -3
- package/schemas-DySv963y.d.cts +2098 -0
- package/schemas-DySv963y.d.mts +2098 -0
- package/{sdk-ZMy4C4VK.cjs → sdk-BJ3OkhCq.cjs} +27 -50
- package/{sdk-DLoVPlGB.mjs → sdk-CXrarwvs.mjs} +27 -50
- package/sdk.cjs +2 -2
- package/sdk.d.cts +2 -10
- package/sdk.d.mts +2 -10
- package/sdk.mjs +2 -2
- package/{sync-engine-DH058G3w.mjs → sync-engine-BTUoH82k.mjs} +2 -3
- package/{sync-engine-C_5TpvfX.d.mts → sync-engine-C_SwnFgF.d.mts} +2 -4
- package/{sync-engine-CYsWOujz.d.cts → sync-engine-D9ltfqkD.d.cts} +2 -4
- package/{sync-engine-BGVDsrOQ.cjs → sync-engine-DBlSP9r2.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-BtQCi_qP.d.cts} +30 -3
- package/{types-CpAtAtxd.d.mts → types-CTOl3pAX.d.mts} +30 -3
- package/{view-compiler-C-6RydKK.mjs → view-compiler-B8tJ5IGw.mjs} +3 -4
- package/{view-compiler-CwKVoK1w.d.mts → view-compiler-BZgZisTG.d.mts} +1 -3
- package/{view-compiler-xiwm5iar.cjs → view-compiler-Ce_QE3dh.cjs} +3 -4
- package/{view-compiler-Cq8apvZ4.d.cts → view-compiler-D7GLf1n8.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,5 +1,5 @@
|
|
|
1
|
-
import { a as _enum, c as literal, d as
|
|
2
|
-
|
|
1
|
+
import { a as _enum, c as literal, d as record, f as strictObject, i as projectionSchema, l as number, m as union, o as array, p as string, r as identityRefs, s as boolean, t as BASE_REF } from "./projection-DNi_2dVa.mjs";
|
|
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,5 +831,4 @@ function validateEntitiesConfig(config, schema) {
|
|
|
833
831
|
errors: validator.errors
|
|
834
832
|
};
|
|
835
833
|
}
|
|
836
|
-
//#endregion
|
|
837
834
|
export { hasRichMeta as C, coversUniqueKey as S, validateProjection as _, MATERIALIZING_CONCEPTS as a, joinFansOut as b, defineClivlyConfig as c, missingRequiredFields as d, projectionFields as f, validateEntitiesConfig as g, requiredFieldsFor as h, ClivlyConfigError as i, entitiesConfigSchema as l, relationshipsSchema as m, CRM_CONCEPTS as n, REQUIRED_FIELDS as o, relationshipSchema as p, CUSTOM_CONCEPT as r, customObjectDeclarations as s, CANONICAL_FIELDS as t, filterSchema as u, validateProjectionFilter as v, primaryKeyColumns as w, columnMetaFor as x, fanOutJoins as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_projection = require("./projection-
|
|
2
|
-
|
|
1
|
+
const require_projection = require("./projection-B8RtxuEq.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() {
|