clivly 0.15.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.
Files changed (183) hide show
  1. package/{adapter-BMAUq4hf.d.mts → adapter-BpAfha3z.d.mts} +1 -3
  2. package/{adapter-IH3r_I8v.d.cts → adapter-BvSigBPG.d.cts} +1 -3
  3. package/{auth-adapter-CiEXcweZ.cjs → auth-adapter-CNVuxT9W.cjs} +1 -2
  4. package/{auth-adapter-Bt1GZiag.d.cts → auth-adapter-CsZE4ugg.d.cts} +1 -3
  5. package/{auth-adapter-CHy273qb.d.mts → auth-adapter-Q6CL2VHr.d.mts} +1 -3
  6. package/{auth-adapter-gfVDxf3d.mjs → auth-adapter-u91PByaw.mjs} +1 -2
  7. package/auth-better-auth.cjs +2 -4
  8. package/auth-better-auth.d.cts +1 -5
  9. package/auth-better-auth.d.mts +1 -5
  10. package/auth-better-auth.mjs +2 -4
  11. package/auth-clerk.cjs +2 -4
  12. package/auth-clerk.d.cts +1 -5
  13. package/auth-clerk.d.mts +1 -5
  14. package/auth-clerk.mjs +2 -4
  15. package/auth-workos.cjs +2 -4
  16. package/auth-workos.d.cts +1 -5
  17. package/auth-workos.d.mts +1 -5
  18. package/auth-workos.mjs +2 -4
  19. package/core-adapter.cjs +2 -3
  20. package/core-adapter.d.cts +1 -1
  21. package/core-adapter.d.mts +1 -1
  22. package/core-adapter.mjs +2 -3
  23. package/core-auth-adapter.cjs +3 -4
  24. package/core-auth-adapter.d.cts +1 -1
  25. package/core-auth-adapter.d.mts +1 -1
  26. package/core-auth-adapter.mjs +3 -5
  27. package/core-drizzle.cjs +3 -4
  28. package/core-drizzle.d.cts +1 -1
  29. package/core-drizzle.d.mts +1 -1
  30. package/core-drizzle.mjs +3 -5
  31. package/core-entity-config.cjs +3 -4
  32. package/core-entity-config.d.cts +1 -1
  33. package/core-entity-config.d.mts +1 -1
  34. package/core-entity-config.mjs +3 -5
  35. package/core-entity-heuristics.cjs +2 -3
  36. package/core-entity-heuristics.d.cts +1 -1
  37. package/core-entity-heuristics.d.mts +1 -1
  38. package/core-entity-heuristics.mjs +3 -5
  39. package/core-mapping-form.cjs +3 -4
  40. package/core-mapping-form.d.cts +1 -1
  41. package/core-mapping-form.d.mts +1 -1
  42. package/core-mapping-form.mjs +3 -5
  43. package/core-mapping-score.cjs +3 -4
  44. package/core-mapping-score.d.cts +1 -1
  45. package/core-mapping-score.d.mts +1 -1
  46. package/core-mapping-score.mjs +3 -5
  47. package/core-mappings-config.cjs +3 -4
  48. package/core-mappings-config.d.cts +1 -1
  49. package/core-mappings-config.d.mts +1 -1
  50. package/core-mappings-config.mjs +3 -5
  51. package/core-sync-engine.cjs +3 -4
  52. package/core-sync-engine.d.cts +1 -1
  53. package/core-sync-engine.d.mts +1 -1
  54. package/core-sync-engine.mjs +3 -5
  55. package/core-types.cjs +3 -4
  56. package/core-types.d.cts +1 -1
  57. package/core-types.d.mts +1 -1
  58. package/core-types.mjs +3 -5
  59. package/core-view-compiler.cjs +3 -4
  60. package/core-view-compiler.d.cts +1 -1
  61. package/core-view-compiler.d.mts +1 -1
  62. package/core-view-compiler.mjs +3 -5
  63. package/core.cjs +13 -13
  64. package/core.d.cts +11 -11
  65. package/core.d.mts +11 -11
  66. package/core.mjs +13 -14
  67. package/{deprecate-subpath-CmvZtCpE.mjs → deprecate-subpath-CK37DKXH.mjs} +1 -2
  68. package/{deprecate-subpath-B9ngvizt.cjs → deprecate-subpath-dGwDiHKV.cjs} +1 -2
  69. package/{drizzle-DcB7OfBp.cjs → drizzle-C0bfX-6a.cjs} +1 -2
  70. package/{drizzle-wbcuG-cy.mjs → drizzle-CZuOzIu4.mjs} +1 -2
  71. package/{drizzle-CiK37zJm.d.cts → drizzle-MUNZgh1l.d.cts} +1 -3
  72. package/{drizzle-ehVWLSrN.d.mts → drizzle-UJbPCzPJ.d.mts} +1 -3
  73. package/{drizzle-meta-Bb1JWYqf.cjs → drizzle-meta-BPnRLpsB.cjs} +1 -2
  74. package/{drizzle-meta-D-5k3n0i.mjs → drizzle-meta-D00lFvAk.mjs} +1 -2
  75. package/drizzle.cjs +7 -10
  76. package/drizzle.d.cts +3 -7
  77. package/drizzle.d.mts +3 -7
  78. package/drizzle.mjs +7 -10
  79. package/entity-config-BF7pcXFB.d.cts +632 -0
  80. package/{entity-config-Ccfb2IL9.mjs → entity-config-DQVSprlG.mjs} +8 -11
  81. package/{entity-config-BI4RYNKL.cjs → entity-config-nWWgJXLw.cjs} +8 -11
  82. package/entity-config-pzamFSKw.d.mts +632 -0
  83. package/index.cjs +51 -98
  84. package/index.d.cts +1 -12
  85. package/index.d.mts +1 -12
  86. package/index.mjs +51 -98
  87. package/{integration-state-BA4c0RbD.d.mts → integration-state-xK4PLm5T.d.cts} +0 -2
  88. package/{integration-state-BA4c0RbD.d.cts → integration-state-xK4PLm5T.d.mts} +0 -2
  89. package/{internal-C7NlPM3M.d.mts → internal-C-uvosSL.d.cts} +1 -17
  90. package/{internal-DsArcqkP.cjs → internal-CjJy-cy1.cjs} +42 -8
  91. package/{internal-CLvZdVj5.mjs → internal-DtLZyjf8.mjs} +37 -9
  92. package/{internal-D2J4VQWT.d.cts → internal-Gie7hCpK.d.mts} +1 -17
  93. package/internal-adapter.d.cts +1 -1
  94. package/internal-adapter.d.mts +1 -1
  95. package/internal-auth-adapter.cjs +1 -1
  96. package/internal-auth-adapter.d.cts +1 -1
  97. package/internal-auth-adapter.d.mts +1 -1
  98. package/internal-auth-adapter.mjs +1 -2
  99. package/internal-drizzle.cjs +1 -1
  100. package/internal-drizzle.d.cts +1 -1
  101. package/internal-drizzle.d.mts +1 -1
  102. package/internal-drizzle.mjs +1 -2
  103. package/internal-entity-config.cjs +1 -1
  104. package/internal-entity-config.d.cts +1 -1
  105. package/internal-entity-config.d.mts +1 -1
  106. package/internal-entity-config.mjs +1 -2
  107. package/internal-entity-heuristics.cjs +3 -4
  108. package/internal-entity-heuristics.d.cts +2 -4
  109. package/internal-entity-heuristics.d.mts +2 -4
  110. package/internal-entity-heuristics.mjs +3 -4
  111. package/internal-mapping-form.cjs +1 -1
  112. package/internal-mapping-form.d.cts +1 -1
  113. package/internal-mapping-form.d.mts +1 -1
  114. package/internal-mapping-form.mjs +1 -2
  115. package/internal-mapping-score.cjs +1 -1
  116. package/internal-mapping-score.d.cts +1 -1
  117. package/internal-mapping-score.d.mts +1 -1
  118. package/internal-mapping-score.mjs +1 -2
  119. package/internal-mappings-config.cjs +1 -1
  120. package/internal-mappings-config.d.cts +1 -1
  121. package/internal-mappings-config.d.mts +1 -1
  122. package/internal-mappings-config.mjs +1 -2
  123. package/internal-sync-engine.cjs +1 -1
  124. package/internal-sync-engine.d.cts +1 -1
  125. package/internal-sync-engine.d.mts +1 -1
  126. package/internal-sync-engine.mjs +1 -2
  127. package/internal-types.cjs +1 -1
  128. package/internal-types.d.cts +1 -1
  129. package/internal-types.d.mts +1 -1
  130. package/internal-types.mjs +1 -2
  131. package/internal-view-compiler.cjs +1 -1
  132. package/internal-view-compiler.d.cts +1 -1
  133. package/internal-view-compiler.d.mts +1 -1
  134. package/internal-view-compiler.mjs +1 -2
  135. package/internal.cjs +11 -10
  136. package/internal.d.cts +11 -11
  137. package/internal.d.mts +11 -11
  138. package/internal.mjs +11 -11
  139. package/{mapping-form-BpfON_ME.cjs → mapping-form-Bs6JQurC.cjs} +1 -2
  140. package/{mapping-form-XsLLCqW_.d.cts → mapping-form-BymksK7h.d.mts} +1 -3
  141. package/{mapping-form-DigkuvFc.mjs → mapping-form-C7kDMWzp.mjs} +1 -2
  142. package/{mapping-form-Btn-7gzv.d.mts → mapping-form-Cmf8y-1m.d.cts} +1 -3
  143. package/{mapping-score-D7Gzg7Ii.d.cts → mapping-score-BKrxddz0.d.cts} +0 -2
  144. package/{mapping-score-D7Gzg7Ii.d.mts → mapping-score-BKrxddz0.d.mts} +0 -2
  145. package/{mapping-score-C68uAqGB.mjs → mapping-score-CS-MTDL9.mjs} +1 -2
  146. package/{mapping-score-CaB3F4Uu.cjs → mapping-score-D2TCQiOr.cjs} +1 -2
  147. package/{mappings-config-CwQNQ6bA.mjs → mappings-config-C7FPwrJT.mjs} +3 -4
  148. package/{mappings-config-BCsRLohT.cjs → mappings-config-DBG-KnYl.cjs} +3 -4
  149. package/{mappings-config-D6_oCi2Q.d.mts → mappings-config-Dsz6rcJb.d.cts} +1 -3
  150. package/{mappings-config-iJzbcUMp.d.cts → mappings-config-ktJhxmHm.d.mts} +1 -3
  151. package/{namespace-probe-DykR0kgh.d.mts → namespace-probe-By8SCnym.d.mts} +2 -8
  152. package/{namespace-probe-H7yWc0JV.d.cts → namespace-probe-CTkb35Ro.d.cts} +2 -8
  153. package/package.json +1 -1
  154. package/{projection-BELgANG2.cjs → projection-B8RtxuEq.cjs} +35 -38
  155. package/{projection-DvNewmI1.mjs → projection-DNi_2dVa.mjs} +30 -39
  156. package/{projection-sql-DweUaWRc.mjs → projection-sql-BYv40Hen.mjs} +2 -3
  157. package/{projection-sql-DuCtFE9t.cjs → projection-sql-SuhzhsMe.cjs} +2 -3
  158. package/schemas-DySv963y.d.cts +2098 -0
  159. package/schemas-DySv963y.d.mts +2098 -0
  160. package/{sdk-ZMy4C4VK.cjs → sdk-BJ3OkhCq.cjs} +27 -50
  161. package/{sdk-DLoVPlGB.mjs → sdk-CXrarwvs.mjs} +27 -50
  162. package/sdk.cjs +2 -2
  163. package/sdk.d.cts +2 -10
  164. package/sdk.d.mts +2 -10
  165. package/sdk.mjs +2 -2
  166. package/{sync-engine-DH058G3w.mjs → sync-engine-BTUoH82k.mjs} +2 -3
  167. package/{sync-engine-C_5TpvfX.d.mts → sync-engine-C_SwnFgF.d.mts} +2 -4
  168. package/{sync-engine-CYsWOujz.d.cts → sync-engine-D9ltfqkD.d.cts} +2 -4
  169. package/{sync-engine-BGVDsrOQ.cjs → sync-engine-DBlSP9r2.cjs} +2 -3
  170. package/{types-YJTkXKzU.mjs → types-8KSw2AWg.mjs} +1 -2
  171. package/{types-Cq5gHCTq.cjs → types-B8m39L1s.cjs} +1 -2
  172. package/{types-CpAtAtxd.d.cts → types-BtQCi_qP.d.cts} +30 -3
  173. package/{types-CpAtAtxd.d.mts → types-CTOl3pAX.d.mts} +30 -3
  174. package/{view-compiler-C-6RydKK.mjs → view-compiler-B8tJ5IGw.mjs} +3 -4
  175. package/{view-compiler-CwKVoK1w.d.mts → view-compiler-BZgZisTG.d.mts} +1 -3
  176. package/{view-compiler-xiwm5iar.cjs → view-compiler-Ce_QE3dh.cjs} +3 -4
  177. package/{view-compiler-Cq8apvZ4.d.cts → view-compiler-D7GLf1n8.d.cts} +1 -3
  178. package/vite.cjs +1 -2
  179. package/vite.d.cts +2 -4
  180. package/vite.d.mts +2 -4
  181. package/vite.mjs +1 -2
  182. package/entity-config-ApnT5j3X.d.cts +0 -4472
  183. package/entity-config-CKcj4-M_.d.mts +0 -4473
@@ -1,5 +1,5 @@
1
- import { a as _enum, c as literal, d as strictObject, f as string, i as projectionSchema, l as number, o as array, p as union, r as identityRefs, s as boolean, t as BASE_REF, u as record } from "./projection-DvNewmI1.mjs";
2
- //#region ../core/src/schema-meta.ts
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
- //#endregion
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
- //#endregion
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
- //#endregion
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-BELgANG2.cjs");
2
- //#region ../core/src/schema-meta.ts
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
- //#endregion
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
- //#endregion
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
- //#endregion
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() {