@clivly/core 0.8.0 → 0.9.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 +182 -16
- package/dist/drizzle.cjs +82 -1
- package/dist/drizzle.d.cts +23 -2
- package/dist/drizzle.d.mts +23 -2
- package/dist/drizzle.mjs +81 -2
- package/dist/entity-config-8Fgr6IOH.mjs +666 -0
- package/dist/entity-config-CLxI8dVb.d.cts +556 -0
- package/dist/entity-config-CLxI8dVb.d.mts +556 -0
- package/dist/entity-config-Dh8aEcgj.cjs +779 -0
- package/dist/entity-config.cjs +13 -349
- package/dist/entity-config.d.cts +2 -295
- package/dist/entity-config.d.mts +2 -295
- package/dist/entity-config.mjs +2 -339
- package/dist/entity-heuristics.cjs +28 -8
- package/dist/entity-heuristics.d.cts +2 -12
- package/dist/entity-heuristics.d.mts +2 -12
- package/dist/entity-heuristics.mjs +28 -8
- package/dist/env-file.cjs +59 -0
- package/dist/env-file.d.cts +23 -0
- package/dist/env-file.d.mts +23 -0
- package/dist/env-file.mjs +55 -0
- package/dist/index.cjs +83 -2
- package/dist/index.d.cts +72 -2
- package/dist/index.d.mts +72 -2
- package/dist/index.mjs +69 -3
- package/dist/integration-state.cjs +242 -0
- package/dist/integration-state.d.cts +88 -0
- package/dist/integration-state.d.mts +88 -0
- package/dist/integration-state.mjs +232 -0
- package/dist/mapping-form.d.cts +1 -1
- package/dist/mapping-form.d.mts +1 -1
- package/dist/mappings-config.cjs +32 -6
- package/dist/mappings-config.d.cts +7 -1
- package/dist/mappings-config.d.mts +7 -1
- package/dist/mappings-config.mjs +32 -6
- package/dist/projection-BXBkh7qp.cjs +98 -0
- package/dist/projection-C_EMRmZ8.mjs +75 -0
- package/dist/sync-engine.cjs +9 -2
- package/dist/sync-engine.d.cts +1 -1
- package/dist/sync-engine.d.mts +1 -1
- package/dist/sync-engine.mjs +9 -2
- package/dist/view-compiler-BpNI8Ttw.cjs +299 -0
- package/dist/view-compiler-CcqsGxv4.mjs +270 -0
- package/dist/view-compiler.cjs +6 -188
- package/dist/view-compiler.d.cts +12 -2
- package/dist/view-compiler.d.mts +12 -2
- package/dist/view-compiler.mjs +2 -185
- package/package.json +21 -1
package/dist/entity-config.cjs
CHANGED
|
@@ -1,350 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* structural helper) and `validateEntitiesConfig` (semantic validation against
|
|
16
|
-
* the host's discovered schema). It performs NO DB access and generates no SQL —
|
|
17
|
-
* the view compiler (Phase 2) and sync engine (Phase 3) consume this contract.
|
|
18
|
-
*/
|
|
19
|
-
/** Canonical CRM concepts a host entity can map onto. */
|
|
20
|
-
const CRM_CONCEPTS = [
|
|
21
|
-
"contact",
|
|
22
|
-
"company",
|
|
23
|
-
"deal",
|
|
24
|
-
"activity",
|
|
25
|
-
"conversation",
|
|
26
|
-
"note"
|
|
27
|
-
];
|
|
28
|
-
/**
|
|
29
|
-
* The canonical `fields` keys the mirror actually persists, per concept — the
|
|
30
|
-
* crm_* columns the sync store writes. An entity's `fields` map keys must be one
|
|
31
|
-
* of these: a non-canonical key (e.g. `fullName` instead of `name`) validates
|
|
32
|
-
* structurally but has no destination column, so the store silently writes an
|
|
33
|
-
* empty value. `validateEntitiesConfig` flags those.
|
|
34
|
-
*
|
|
35
|
-
* This is the single source of truth — the Drizzle store imports it, so the
|
|
36
|
-
* two can't drift (the drift is what made the silent-data-loss trap possible).
|
|
37
|
-
* Concepts absent here aren't materialized yet, so their field keys are
|
|
38
|
-
* unconstrained.
|
|
39
|
-
*/
|
|
40
|
-
const CANONICAL_FIELDS = {
|
|
41
|
-
contact: [
|
|
42
|
-
"name",
|
|
43
|
-
"email",
|
|
44
|
-
"title",
|
|
45
|
-
"status"
|
|
46
|
-
],
|
|
47
|
-
company: [
|
|
48
|
-
"name",
|
|
49
|
-
"domain",
|
|
50
|
-
"industry",
|
|
51
|
-
"size"
|
|
52
|
-
],
|
|
53
|
-
deal: [
|
|
54
|
-
"name",
|
|
55
|
-
"value",
|
|
56
|
-
"stage"
|
|
57
|
-
]
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* The concepts the mapping→sync pipeline can actually materialize into `crm_*`
|
|
61
|
-
* tables. These are exactly the CANONICAL_FIELDS keys — the Drizzle sync store's
|
|
62
|
-
* `persist()` throws for any other concept, so offering one (in the mapping
|
|
63
|
-
* editor, in suggestions, or via the upsert API) is a broken affordance.
|
|
64
|
-
*
|
|
65
|
-
* The broader CRM_CONCEPTS set still validates structurally, so previously
|
|
66
|
-
* stored rows for not-yet-materialized concepts keep rendering. When a concept
|
|
67
|
-
* gains a sync-store path, add its canonical fields above and it joins this set
|
|
68
|
-
* automatically (guarded by the MATERIALIZING_CONCEPTS drift test).
|
|
69
|
-
*/
|
|
70
|
-
const MATERIALIZING_CONCEPTS = [
|
|
71
|
-
"contact",
|
|
72
|
-
"company",
|
|
73
|
-
"deal"
|
|
74
|
-
];
|
|
75
|
-
/**
|
|
76
|
-
* The org-defined custom-object target. Deliberately NOT a member of
|
|
77
|
-
* CRM_CONCEPTS / CANONICAL_FIELDS / MATERIALIZING_CONCEPTS — a custom object has
|
|
78
|
-
* no fixed canonical columns; its mapping's fieldMap keys ARE its properties.
|
|
79
|
-
* Handled as an explicit branch wherever concepts are switched on, so the
|
|
80
|
-
* canonical-concept invariants (and their drift test) stay intact.
|
|
81
|
-
*/
|
|
82
|
-
const CUSTOM_CONCEPT = "custom";
|
|
83
|
-
/**
|
|
84
|
-
* Operator forms for a single column predicate. All predicates on an entity are
|
|
85
|
-
* AND-ed together. `$raw` (see FilterExpr) is the escape hatch for anything the
|
|
86
|
-
* operators can't express.
|
|
87
|
-
*/
|
|
88
|
-
const filterOperatorsSchema = zod.z.union([
|
|
89
|
-
zod.z.strictObject({ eq: zod.z.union([
|
|
90
|
-
zod.z.string(),
|
|
91
|
-
zod.z.number(),
|
|
92
|
-
zod.z.boolean()
|
|
93
|
-
]) }),
|
|
94
|
-
zod.z.strictObject({ ne: zod.z.union([
|
|
95
|
-
zod.z.string(),
|
|
96
|
-
zod.z.number(),
|
|
97
|
-
zod.z.boolean()
|
|
98
|
-
]) }),
|
|
99
|
-
zod.z.strictObject({ in: zod.z.array(zod.z.union([
|
|
100
|
-
zod.z.string(),
|
|
101
|
-
zod.z.number(),
|
|
102
|
-
zod.z.boolean()
|
|
103
|
-
])).min(1) }),
|
|
104
|
-
zod.z.strictObject({ notIn: zod.z.array(zod.z.union([
|
|
105
|
-
zod.z.string(),
|
|
106
|
-
zod.z.number(),
|
|
107
|
-
zod.z.boolean()
|
|
108
|
-
])).min(1) }),
|
|
109
|
-
zod.z.strictObject({ isNull: zod.z.literal(true) }),
|
|
110
|
-
zod.z.strictObject({ isNotNull: zod.z.literal(true) })
|
|
111
|
-
]);
|
|
112
|
-
const filterValueSchema = zod.z.union([
|
|
113
|
-
zod.z.string(),
|
|
114
|
-
zod.z.number(),
|
|
115
|
-
zod.z.boolean(),
|
|
116
|
-
filterOperatorsSchema
|
|
117
|
-
]);
|
|
118
|
-
/**
|
|
119
|
-
* A raw SQL predicate fragment. Kept as a *string* (not a query-builder callback)
|
|
120
|
-
* so the whole config stays JSON-serializable — it can be persisted into
|
|
121
|
-
* `crm_entity_mappings` and shipped to the cloud unchanged. Embedded-only in
|
|
122
|
-
* practice; not validated against the schema.
|
|
123
|
-
*/
|
|
124
|
-
const rawFilterSchema = zod.z.strictObject({ $raw: zod.z.string().min(1) });
|
|
125
|
-
const columnFilterSchema = zod.z.record(zod.z.string(), filterValueSchema);
|
|
126
|
-
/** `$raw` is a reserved key; a column literally named `$raw` is not addressable. */
|
|
127
|
-
const filterSchema = zod.z.union([rawFilterSchema, columnFilterSchema]);
|
|
128
|
-
/**
|
|
129
|
-
* How the link between two entities is expressed in the host schema:
|
|
130
|
-
* - `fkOn: "company"` — FK lives on the company table (e.g. organizations.owner_id)
|
|
131
|
-
* - `fkOn: "contact"` — FK lives on the contact table (e.g. users.organization_id)
|
|
132
|
-
* - `through` — a join table sits between them (many-to-many, role often here)
|
|
133
|
-
* - `$raw` — opaque SQL join fragment (escape hatch; not schema-validated)
|
|
134
|
-
*
|
|
135
|
-
* `column` and the join-table keys are `table.column` or bare `column` strings.
|
|
136
|
-
*/
|
|
137
|
-
const relationshipViaSchema = zod.z.union([
|
|
138
|
-
zod.z.strictObject({
|
|
139
|
-
fkOn: zod.z.enum(["company", "contact"]),
|
|
140
|
-
column: zod.z.string().min(1)
|
|
141
|
-
}),
|
|
142
|
-
zod.z.strictObject({
|
|
143
|
-
through: zod.z.string().min(1),
|
|
144
|
-
localKey: zod.z.string().min(1),
|
|
145
|
-
foreignKey: zod.z.string().min(1)
|
|
146
|
-
}),
|
|
147
|
-
zod.z.strictObject({ $raw: zod.z.string().min(1) })
|
|
148
|
-
]);
|
|
149
|
-
const relationshipSchema = zod.z.strictObject({
|
|
150
|
-
/** Key of the related entity in the `entities` map. */
|
|
151
|
-
entity: zod.z.string().min(1),
|
|
152
|
-
via: relationshipViaSchema
|
|
153
|
-
});
|
|
154
|
-
/** A named map of relationships, as stored on an entity / in the mappings row. */
|
|
155
|
-
const relationshipsSchema = zod.z.record(zod.z.string(), relationshipSchema);
|
|
156
|
-
const entitySchema = zod.z.strictObject({
|
|
157
|
-
/** Which CRM concept this entity maps onto — a canonical concept or "custom". */
|
|
158
|
-
concept: zod.z.union([zod.z.enum(CRM_CONCEPTS), zod.z.literal(CUSTOM_CONCEPT)]),
|
|
159
|
-
/** Host table (or view) this entity is derived from. */
|
|
160
|
-
source: zod.z.string().min(1),
|
|
161
|
-
/**
|
|
162
|
-
* Distinguishes multiple entities backed by the same table (e.g. "primary"
|
|
163
|
-
* for owners, "secondary" for members). Free text; defaults to "primary".
|
|
164
|
-
*/
|
|
165
|
-
role: zod.z.string().min(1).optional(),
|
|
166
|
-
/** Predicate that narrows `source` into this entity's rows. Omit = whole table. */
|
|
167
|
-
filter: filterSchema.optional(),
|
|
168
|
-
/** clivlyField → sourceColumn. At least one field is required. */
|
|
169
|
-
fields: zod.z.record(zod.z.string(), zod.z.string()).refine((f) => Object.keys(f).length > 0, { message: "at least one field must be mapped" }),
|
|
170
|
-
/**
|
|
171
|
-
* Host-owned identity fields. Sync overwrites them; the CRM UI cannot edit
|
|
172
|
-
* them. Must be a subset of `fields` keys.
|
|
173
|
-
*/
|
|
174
|
-
readOnly: zod.z.array(zod.z.string()).optional(),
|
|
175
|
-
/** Named relationships to other entities in this config. */
|
|
176
|
-
relationships: zod.z.record(zod.z.string(), relationshipSchema).optional(),
|
|
177
|
-
/**
|
|
178
|
-
* For a "custom" entity, the crm_object_types row this materializes into.
|
|
179
|
-
* Required for custom (enforced at the API layer), unused for standard concepts.
|
|
180
|
-
*/
|
|
181
|
-
targetObjectTypeId: zod.z.string().min(1).optional()
|
|
182
|
-
});
|
|
183
|
-
const entitiesConfigSchema = zod.z.strictObject({ entities: zod.z.record(zod.z.string(), entitySchema).refine((e) => Object.keys(e).length > 0, { message: "at least one entity must be defined" }) });
|
|
184
|
-
/** Thrown by `defineClivlyConfig({ strict: true })` on non-canonical field keys. */
|
|
185
|
-
var ClivlyConfigError = class extends Error {
|
|
186
|
-
issues;
|
|
187
|
-
constructor(issues) {
|
|
188
|
-
super(`Clivly config has ${issues.length} non-canonical field mapping(s) that would write empty values at sync time:\n${issues.map((issue) => ` - ${issue.path}: ${issue.message}`).join("\n")}`);
|
|
189
|
-
this.name = "ClivlyConfigError";
|
|
190
|
-
this.issues = issues;
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
function nonCanonicalFieldKeys(entity) {
|
|
194
|
-
const canonical = CANONICAL_FIELDS[entity.concept];
|
|
195
|
-
if (!canonical) return [];
|
|
196
|
-
return Object.keys(entity.fields).filter((key) => !canonical.includes(key));
|
|
197
|
-
}
|
|
198
|
-
function nonCanonicalMessage(entity, field) {
|
|
199
|
-
const canonical = CANONICAL_FIELDS[entity.concept] ?? [];
|
|
200
|
-
return `"${field}" is not a canonical ${entity.concept} field (expected one of: ${canonical.join(", ")})`;
|
|
201
|
-
}
|
|
202
|
-
function canonicalFieldIssues(config) {
|
|
203
|
-
const issues = [];
|
|
204
|
-
for (const [key, entity] of Object.entries(config.entities)) for (const field of nonCanonicalFieldKeys(entity)) issues.push({
|
|
205
|
-
path: `entities.${key}.fields.${field}`,
|
|
206
|
-
message: nonCanonicalMessage(entity, field)
|
|
207
|
-
});
|
|
208
|
-
return issues;
|
|
209
|
-
}
|
|
210
|
-
function defaultWarn(message) {
|
|
211
|
-
console.warn(message);
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Structural helper for `clivly.config.ts`. Gives full type inference on the
|
|
215
|
-
* literal you pass and eagerly parses it, so shape errors surface at config
|
|
216
|
-
* load rather than at sync time.
|
|
217
|
-
*
|
|
218
|
-
* It also catches the silent-data-loss footgun: a non-canonical field key for a
|
|
219
|
-
* materialised concept (e.g. `fullName` instead of `name` on a `contact`) has no
|
|
220
|
-
* destination column, so the store would write an empty value. By default these
|
|
221
|
-
* are reported via `onWarn` (a `console.warn`); pass `{ strict: true }` to throw
|
|
222
|
-
* a `ClivlyConfigError` instead. Does NOT validate against the host schema — that
|
|
223
|
-
* needs the discovered schema; see `validateEntitiesConfig`.
|
|
224
|
-
*/
|
|
225
|
-
function defineClivlyConfig(config, options) {
|
|
226
|
-
const parsed = entitiesConfigSchema.parse(config);
|
|
227
|
-
const issues = canonicalFieldIssues(parsed);
|
|
228
|
-
if (issues.length > 0) {
|
|
229
|
-
if (options?.strict) throw new ClivlyConfigError(issues);
|
|
230
|
-
const warn = options?.onWarn ?? defaultWarn;
|
|
231
|
-
for (const issue of issues) warn(`⚠ Clivly config: ${issue.message} (${issue.path}) — this field would write an empty value at sync time. Pass { strict: true } to make this throw.`);
|
|
232
|
-
}
|
|
233
|
-
return parsed;
|
|
234
|
-
}
|
|
235
|
-
/** Split a `table.column` / bare `column` ref into its parts. */
|
|
236
|
-
function parseColumnRef(ref) {
|
|
237
|
-
const dot = ref.indexOf(".");
|
|
238
|
-
if (dot === -1) return { column: ref };
|
|
239
|
-
return {
|
|
240
|
-
table: ref.slice(0, dot),
|
|
241
|
-
column: ref.slice(dot + 1)
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
/** Shared lookup + error-collection state threaded through the validators. */
|
|
245
|
-
var SchemaValidator = class {
|
|
246
|
-
errors = [];
|
|
247
|
-
columnsByTable = /* @__PURE__ */ new Map();
|
|
248
|
-
constructor(schema) {
|
|
249
|
-
for (const table of schema) this.columnsByTable.set(table.name, new Set(table.columns));
|
|
250
|
-
}
|
|
251
|
-
tableExists(name) {
|
|
252
|
-
return this.columnsByTable.has(name);
|
|
253
|
-
}
|
|
254
|
-
columnExists(table, column) {
|
|
255
|
-
return this.columnsByTable.get(table)?.has(column) ?? false;
|
|
256
|
-
}
|
|
257
|
-
report(path, message) {
|
|
258
|
-
this.errors.push({
|
|
259
|
-
path,
|
|
260
|
-
message
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
/** Report if `column` is absent from `table`. Returns whether it existed. */
|
|
264
|
-
requireColumn(path, table, column) {
|
|
265
|
-
if (this.columnExists(table, column)) return true;
|
|
266
|
-
this.report(path, `column "${column}" does not exist on "${table}"`);
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
function validateFields(v, base, entity) {
|
|
271
|
-
for (const [field, column] of Object.entries(entity.fields)) v.requireColumn(`${base}.fields.${field}`, entity.source, column);
|
|
272
|
-
for (const field of nonCanonicalFieldKeys(entity)) v.report(`${base}.fields.${field}`, nonCanonicalMessage(entity, field));
|
|
273
|
-
}
|
|
274
|
-
function validateReadOnly(v, base, entity) {
|
|
275
|
-
for (const field of entity.readOnly ?? []) if (!(field in entity.fields)) v.report(`${base}.readOnly`, `"${field}" is not one of this entity's fields`);
|
|
276
|
-
}
|
|
277
|
-
function validateFilter(v, base, entity) {
|
|
278
|
-
if (!entity.filter || "$raw" in entity.filter) return;
|
|
279
|
-
for (const column of Object.keys(entity.filter)) v.requireColumn(`${base}.filter.${column}`, entity.source, column);
|
|
280
|
-
}
|
|
281
|
-
function validateFkVia(v, relBase, via, entity, related) {
|
|
282
|
-
const { table, column } = parseColumnRef(via.column);
|
|
283
|
-
const fkTable = table ?? (via.fkOn === "contact" ? entity.source : related?.source);
|
|
284
|
-
const path = `${relBase}.via.column`;
|
|
285
|
-
if (!fkTable) {
|
|
286
|
-
v.report(path, `cannot resolve table for FK column "${via.column}"`);
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
if (!v.tableExists(fkTable)) {
|
|
290
|
-
v.report(path, `table "${fkTable}" is not in the discovered schema`);
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
v.requireColumn(path, fkTable, column);
|
|
294
|
-
}
|
|
295
|
-
function validateThroughVia(v, relBase, via) {
|
|
296
|
-
if (!v.tableExists(via.through)) {
|
|
297
|
-
v.report(`${relBase}.via.through`, `join table "${via.through}" is not in the discovered schema`);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
v.requireColumn(`${relBase}.via.localKey`, via.through, via.localKey);
|
|
301
|
-
v.requireColumn(`${relBase}.via.foreignKey`, via.through, via.foreignKey);
|
|
302
|
-
}
|
|
303
|
-
function validateRelationship(v, base, config, entity, relName, rel) {
|
|
304
|
-
const relBase = `${base}.relationships.${relName}`;
|
|
305
|
-
const related = config.entities[rel.entity];
|
|
306
|
-
if (!related) v.report(`${relBase}.entity`, `"${rel.entity}" is not a defined entity`);
|
|
307
|
-
const { via } = rel;
|
|
308
|
-
if ("fkOn" in via) validateFkVia(v, relBase, via, entity, related);
|
|
309
|
-
else if ("through" in via) validateThroughVia(v, relBase, via);
|
|
310
|
-
}
|
|
311
|
-
function validateEntity(v, config, key, entity) {
|
|
312
|
-
const base = `entities.${key}`;
|
|
313
|
-
if (!v.tableExists(entity.source)) {
|
|
314
|
-
v.report(`${base}.source`, `table "${entity.source}" is not in the discovered schema`);
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
validateFields(v, base, entity);
|
|
318
|
-
validateReadOnly(v, base, entity);
|
|
319
|
-
validateFilter(v, base, entity);
|
|
320
|
-
for (const [relName, rel] of Object.entries(entity.relationships ?? {})) validateRelationship(v, base, config, entity, relName, rel);
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Validate a (structurally valid) config against the host's discovered schema:
|
|
324
|
-
* source tables exist, mapped columns exist, `readOnly` ⊆ `fields`, filter
|
|
325
|
-
* columns exist, and relationships point at real entities/tables/columns.
|
|
326
|
-
*
|
|
327
|
-
* `$raw` filters and `$raw` relationship joins are opaque and skipped. Returns
|
|
328
|
-
* every error found (not just the first) so a mapping UI or CLI can show them
|
|
329
|
-
* all at once.
|
|
330
|
-
*/
|
|
331
|
-
function validateEntitiesConfig(config, schema) {
|
|
332
|
-
const validator = new SchemaValidator(schema);
|
|
333
|
-
for (const [key, entity] of Object.entries(config.entities)) validateEntity(validator, config, key, entity);
|
|
334
|
-
return {
|
|
335
|
-
valid: validator.errors.length === 0,
|
|
336
|
-
errors: validator.errors
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
//#endregion
|
|
340
|
-
exports.CANONICAL_FIELDS = CANONICAL_FIELDS;
|
|
341
|
-
exports.CRM_CONCEPTS = CRM_CONCEPTS;
|
|
342
|
-
exports.CUSTOM_CONCEPT = CUSTOM_CONCEPT;
|
|
343
|
-
exports.ClivlyConfigError = ClivlyConfigError;
|
|
344
|
-
exports.MATERIALIZING_CONCEPTS = MATERIALIZING_CONCEPTS;
|
|
345
|
-
exports.defineClivlyConfig = defineClivlyConfig;
|
|
346
|
-
exports.entitiesConfigSchema = entitiesConfigSchema;
|
|
347
|
-
exports.filterSchema = filterSchema;
|
|
348
|
-
exports.relationshipSchema = relationshipSchema;
|
|
349
|
-
exports.relationshipsSchema = relationshipsSchema;
|
|
350
|
-
exports.validateEntitiesConfig = validateEntitiesConfig;
|
|
2
|
+
const require_entity_config = require("./entity-config-Dh8aEcgj.cjs");
|
|
3
|
+
exports.CANONICAL_FIELDS = require_entity_config.CANONICAL_FIELDS;
|
|
4
|
+
exports.CRM_CONCEPTS = require_entity_config.CRM_CONCEPTS;
|
|
5
|
+
exports.CUSTOM_CONCEPT = require_entity_config.CUSTOM_CONCEPT;
|
|
6
|
+
exports.ClivlyConfigError = require_entity_config.ClivlyConfigError;
|
|
7
|
+
exports.MATERIALIZING_CONCEPTS = require_entity_config.MATERIALIZING_CONCEPTS;
|
|
8
|
+
exports.defineClivlyConfig = require_entity_config.defineClivlyConfig;
|
|
9
|
+
exports.entitiesConfigSchema = require_entity_config.entitiesConfigSchema;
|
|
10
|
+
exports.filterSchema = require_entity_config.filterSchema;
|
|
11
|
+
exports.projectionFields = require_entity_config.projectionFields;
|
|
12
|
+
exports.relationshipSchema = require_entity_config.relationshipSchema;
|
|
13
|
+
exports.relationshipsSchema = require_entity_config.relationshipsSchema;
|
|
14
|
+
exports.validateEntitiesConfig = require_entity_config.validateEntitiesConfig;
|
package/dist/entity-config.d.cts
CHANGED
|
@@ -1,295 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Entity Config v2 — the declarative contract that turns Clivly's "schema-aware"
|
|
5
|
-
* promise into a real capability.
|
|
6
|
-
*
|
|
7
|
-
* A CRM entity is no longer a flat table name. It is a *derived entity*: a
|
|
8
|
-
* filtered slice of a host table (`source` + `filter`), a column allowlist
|
|
9
|
-
* (`fields` + `readOnly`), and declared `relationships` to other entities. The
|
|
10
|
-
* same host table can back several entities (e.g. `users` → owners + members)
|
|
11
|
-
* distinguished by `role`.
|
|
12
|
-
*
|
|
13
|
-
* This module is the Phase 1 slice: types, schema, `defineClivlyConfig` (a
|
|
14
|
-
* structural helper) and `validateEntitiesConfig` (semantic validation against
|
|
15
|
-
* the host's discovered schema). It performs NO DB access and generates no SQL —
|
|
16
|
-
* the view compiler (Phase 2) and sync engine (Phase 3) consume this contract.
|
|
17
|
-
*/
|
|
18
|
-
/** Canonical CRM concepts a host entity can map onto. */
|
|
19
|
-
declare const CRM_CONCEPTS: readonly ["contact", "company", "deal", "activity", "conversation", "note"];
|
|
20
|
-
type CrmConcept = (typeof CRM_CONCEPTS)[number];
|
|
21
|
-
/**
|
|
22
|
-
* The canonical `fields` keys the mirror actually persists, per concept — the
|
|
23
|
-
* crm_* columns the sync store writes. An entity's `fields` map keys must be one
|
|
24
|
-
* of these: a non-canonical key (e.g. `fullName` instead of `name`) validates
|
|
25
|
-
* structurally but has no destination column, so the store silently writes an
|
|
26
|
-
* empty value. `validateEntitiesConfig` flags those.
|
|
27
|
-
*
|
|
28
|
-
* This is the single source of truth — the Drizzle store imports it, so the
|
|
29
|
-
* two can't drift (the drift is what made the silent-data-loss trap possible).
|
|
30
|
-
* Concepts absent here aren't materialized yet, so their field keys are
|
|
31
|
-
* unconstrained.
|
|
32
|
-
*/
|
|
33
|
-
declare const CANONICAL_FIELDS: {
|
|
34
|
-
readonly contact: readonly ["name", "email", "title", "status"];
|
|
35
|
-
readonly company: readonly ["name", "domain", "industry", "size"];
|
|
36
|
-
readonly deal: readonly ["name", "value", "stage"];
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* The concepts the mapping→sync pipeline can actually materialize into `crm_*`
|
|
40
|
-
* tables. These are exactly the CANONICAL_FIELDS keys — the Drizzle sync store's
|
|
41
|
-
* `persist()` throws for any other concept, so offering one (in the mapping
|
|
42
|
-
* editor, in suggestions, or via the upsert API) is a broken affordance.
|
|
43
|
-
*
|
|
44
|
-
* The broader CRM_CONCEPTS set still validates structurally, so previously
|
|
45
|
-
* stored rows for not-yet-materialized concepts keep rendering. When a concept
|
|
46
|
-
* gains a sync-store path, add its canonical fields above and it joins this set
|
|
47
|
-
* automatically (guarded by the MATERIALIZING_CONCEPTS drift test).
|
|
48
|
-
*/
|
|
49
|
-
declare const MATERIALIZING_CONCEPTS: readonly ["contact", "company", "deal"];
|
|
50
|
-
type MaterializingConcept = (typeof MATERIALIZING_CONCEPTS)[number];
|
|
51
|
-
/**
|
|
52
|
-
* The org-defined custom-object target. Deliberately NOT a member of
|
|
53
|
-
* CRM_CONCEPTS / CANONICAL_FIELDS / MATERIALIZING_CONCEPTS — a custom object has
|
|
54
|
-
* no fixed canonical columns; its mapping's fieldMap keys ARE its properties.
|
|
55
|
-
* Handled as an explicit branch wherever concepts are switched on, so the
|
|
56
|
-
* canonical-concept invariants (and their drift test) stay intact.
|
|
57
|
-
*/
|
|
58
|
-
declare const CUSTOM_CONCEPT: "custom";
|
|
59
|
-
declare const filterValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
60
|
-
eq: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
61
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
62
|
-
ne: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
63
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
-
in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
65
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
66
|
-
notIn: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
67
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
68
|
-
isNull: z.ZodLiteral<true>;
|
|
69
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
70
|
-
isNotNull: z.ZodLiteral<true>;
|
|
71
|
-
}, z.core.$strict>]>]>;
|
|
72
|
-
/** `$raw` is a reserved key; a column literally named `$raw` is not addressable. */
|
|
73
|
-
declare const filterSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
74
|
-
$raw: z.ZodString;
|
|
75
|
-
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
76
|
-
eq: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
77
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
78
|
-
ne: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
79
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
80
|
-
in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
81
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
82
|
-
notIn: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
83
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
84
|
-
isNull: z.ZodLiteral<true>;
|
|
85
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
86
|
-
isNotNull: z.ZodLiteral<true>;
|
|
87
|
-
}, z.core.$strict>]>]>>]>;
|
|
88
|
-
type FilterExpr = z.infer<typeof filterSchema>;
|
|
89
|
-
/** A single column predicate value (scalar shorthand or operator object). */
|
|
90
|
-
type FilterValue = z.infer<typeof filterValueSchema>;
|
|
91
|
-
/**
|
|
92
|
-
* How the link between two entities is expressed in the host schema:
|
|
93
|
-
* - `fkOn: "company"` — FK lives on the company table (e.g. organizations.owner_id)
|
|
94
|
-
* - `fkOn: "contact"` — FK lives on the contact table (e.g. users.organization_id)
|
|
95
|
-
* - `through` — a join table sits between them (many-to-many, role often here)
|
|
96
|
-
* - `$raw` — opaque SQL join fragment (escape hatch; not schema-validated)
|
|
97
|
-
*
|
|
98
|
-
* `column` and the join-table keys are `table.column` or bare `column` strings.
|
|
99
|
-
*/
|
|
100
|
-
declare const relationshipViaSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
101
|
-
fkOn: z.ZodEnum<{
|
|
102
|
-
contact: "contact";
|
|
103
|
-
company: "company";
|
|
104
|
-
}>;
|
|
105
|
-
column: z.ZodString;
|
|
106
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
107
|
-
through: z.ZodString;
|
|
108
|
-
localKey: z.ZodString;
|
|
109
|
-
foreignKey: z.ZodString;
|
|
110
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
111
|
-
$raw: z.ZodString;
|
|
112
|
-
}, z.core.$strict>]>;
|
|
113
|
-
type RelationshipVia = z.infer<typeof relationshipViaSchema>;
|
|
114
|
-
declare const relationshipSchema: z.ZodObject<{
|
|
115
|
-
entity: z.ZodString;
|
|
116
|
-
via: z.ZodUnion<readonly [z.ZodObject<{
|
|
117
|
-
fkOn: z.ZodEnum<{
|
|
118
|
-
contact: "contact";
|
|
119
|
-
company: "company";
|
|
120
|
-
}>;
|
|
121
|
-
column: z.ZodString;
|
|
122
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
123
|
-
through: z.ZodString;
|
|
124
|
-
localKey: z.ZodString;
|
|
125
|
-
foreignKey: z.ZodString;
|
|
126
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
127
|
-
$raw: z.ZodString;
|
|
128
|
-
}, z.core.$strict>]>;
|
|
129
|
-
}, z.core.$strict>;
|
|
130
|
-
type RelationshipSpec = z.infer<typeof relationshipSchema>;
|
|
131
|
-
/** A named map of relationships, as stored on an entity / in the mappings row. */
|
|
132
|
-
declare const relationshipsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
133
|
-
entity: z.ZodString;
|
|
134
|
-
via: z.ZodUnion<readonly [z.ZodObject<{
|
|
135
|
-
fkOn: z.ZodEnum<{
|
|
136
|
-
contact: "contact";
|
|
137
|
-
company: "company";
|
|
138
|
-
}>;
|
|
139
|
-
column: z.ZodString;
|
|
140
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
141
|
-
through: z.ZodString;
|
|
142
|
-
localKey: z.ZodString;
|
|
143
|
-
foreignKey: z.ZodString;
|
|
144
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
145
|
-
$raw: z.ZodString;
|
|
146
|
-
}, z.core.$strict>]>;
|
|
147
|
-
}, z.core.$strict>>;
|
|
148
|
-
type RelationshipsMap = z.infer<typeof relationshipsSchema>;
|
|
149
|
-
declare const entitySchema: z.ZodObject<{
|
|
150
|
-
concept: z.ZodUnion<readonly [z.ZodEnum<{
|
|
151
|
-
contact: "contact";
|
|
152
|
-
company: "company";
|
|
153
|
-
deal: "deal";
|
|
154
|
-
activity: "activity";
|
|
155
|
-
conversation: "conversation";
|
|
156
|
-
note: "note";
|
|
157
|
-
}>, z.ZodLiteral<"custom">]>;
|
|
158
|
-
source: z.ZodString;
|
|
159
|
-
role: z.ZodOptional<z.ZodString>;
|
|
160
|
-
filter: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
161
|
-
$raw: z.ZodString;
|
|
162
|
-
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
163
|
-
eq: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
164
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
165
|
-
ne: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
166
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
167
|
-
in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
168
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
169
|
-
notIn: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
170
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
171
|
-
isNull: z.ZodLiteral<true>;
|
|
172
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
173
|
-
isNotNull: z.ZodLiteral<true>;
|
|
174
|
-
}, z.core.$strict>]>]>>]>>;
|
|
175
|
-
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
176
|
-
readOnly: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
177
|
-
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
178
|
-
entity: z.ZodString;
|
|
179
|
-
via: z.ZodUnion<readonly [z.ZodObject<{
|
|
180
|
-
fkOn: z.ZodEnum<{
|
|
181
|
-
contact: "contact";
|
|
182
|
-
company: "company";
|
|
183
|
-
}>;
|
|
184
|
-
column: z.ZodString;
|
|
185
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
186
|
-
through: z.ZodString;
|
|
187
|
-
localKey: z.ZodString;
|
|
188
|
-
foreignKey: z.ZodString;
|
|
189
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
190
|
-
$raw: z.ZodString;
|
|
191
|
-
}, z.core.$strict>]>;
|
|
192
|
-
}, z.core.$strict>>>;
|
|
193
|
-
targetObjectTypeId: z.ZodOptional<z.ZodString>;
|
|
194
|
-
}, z.core.$strict>;
|
|
195
|
-
type ClivlyEntityConfig = z.infer<typeof entitySchema>;
|
|
196
|
-
declare const entitiesConfigSchema: z.ZodObject<{
|
|
197
|
-
entities: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
198
|
-
concept: z.ZodUnion<readonly [z.ZodEnum<{
|
|
199
|
-
contact: "contact";
|
|
200
|
-
company: "company";
|
|
201
|
-
deal: "deal";
|
|
202
|
-
activity: "activity";
|
|
203
|
-
conversation: "conversation";
|
|
204
|
-
note: "note";
|
|
205
|
-
}>, z.ZodLiteral<"custom">]>;
|
|
206
|
-
source: z.ZodString;
|
|
207
|
-
role: z.ZodOptional<z.ZodString>;
|
|
208
|
-
filter: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
209
|
-
$raw: z.ZodString;
|
|
210
|
-
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
211
|
-
eq: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
212
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
213
|
-
ne: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
214
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
215
|
-
in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
216
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
217
|
-
notIn: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
218
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
219
|
-
isNull: z.ZodLiteral<true>;
|
|
220
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
221
|
-
isNotNull: z.ZodLiteral<true>;
|
|
222
|
-
}, z.core.$strict>]>]>>]>>;
|
|
223
|
-
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
224
|
-
readOnly: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
225
|
-
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
226
|
-
entity: z.ZodString;
|
|
227
|
-
via: z.ZodUnion<readonly [z.ZodObject<{
|
|
228
|
-
fkOn: z.ZodEnum<{
|
|
229
|
-
contact: "contact";
|
|
230
|
-
company: "company";
|
|
231
|
-
}>;
|
|
232
|
-
column: z.ZodString;
|
|
233
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
234
|
-
through: z.ZodString;
|
|
235
|
-
localKey: z.ZodString;
|
|
236
|
-
foreignKey: z.ZodString;
|
|
237
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
238
|
-
$raw: z.ZodString;
|
|
239
|
-
}, z.core.$strict>]>;
|
|
240
|
-
}, z.core.$strict>>>;
|
|
241
|
-
targetObjectTypeId: z.ZodOptional<z.ZodString>;
|
|
242
|
-
}, z.core.$strict>>;
|
|
243
|
-
}, z.core.$strict>;
|
|
244
|
-
type ClivlyEntitiesConfig = z.infer<typeof entitiesConfigSchema>;
|
|
245
|
-
/** Thrown by `defineClivlyConfig({ strict: true })` on non-canonical field keys. */
|
|
246
|
-
declare class ClivlyConfigError extends Error {
|
|
247
|
-
readonly issues: ConfigValidationError[];
|
|
248
|
-
constructor(issues: ConfigValidationError[]);
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Structural helper for `clivly.config.ts`. Gives full type inference on the
|
|
252
|
-
* literal you pass and eagerly parses it, so shape errors surface at config
|
|
253
|
-
* load rather than at sync time.
|
|
254
|
-
*
|
|
255
|
-
* It also catches the silent-data-loss footgun: a non-canonical field key for a
|
|
256
|
-
* materialised concept (e.g. `fullName` instead of `name` on a `contact`) has no
|
|
257
|
-
* destination column, so the store would write an empty value. By default these
|
|
258
|
-
* are reported via `onWarn` (a `console.warn`); pass `{ strict: true }` to throw
|
|
259
|
-
* a `ClivlyConfigError` instead. Does NOT validate against the host schema — that
|
|
260
|
-
* needs the discovered schema; see `validateEntitiesConfig`.
|
|
261
|
-
*/
|
|
262
|
-
declare function defineClivlyConfig(config: ClivlyEntitiesConfig, options?: {
|
|
263
|
-
strict?: boolean;
|
|
264
|
-
onWarn?: (message: string) => void;
|
|
265
|
-
}): ClivlyEntitiesConfig;
|
|
266
|
-
/**
|
|
267
|
-
* A host table the SDK reported for discovery. Structurally identical to the
|
|
268
|
-
* SDK's `DiscoveredTable`; duplicated here to keep `@clivly/core` free of an
|
|
269
|
-
* SDK dependency (core is the base contract SDK builds on).
|
|
270
|
-
*/
|
|
271
|
-
interface DiscoveredSchemaTable {
|
|
272
|
-
columns: string[];
|
|
273
|
-
name: string;
|
|
274
|
-
}
|
|
275
|
-
interface ConfigValidationError {
|
|
276
|
-
message: string;
|
|
277
|
-
/** Dotted path into the config, e.g. `entities.owner.fields.email`. */
|
|
278
|
-
path: string;
|
|
279
|
-
}
|
|
280
|
-
interface ConfigValidationResult {
|
|
281
|
-
errors: ConfigValidationError[];
|
|
282
|
-
valid: boolean;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Validate a (structurally valid) config against the host's discovered schema:
|
|
286
|
-
* source tables exist, mapped columns exist, `readOnly` ⊆ `fields`, filter
|
|
287
|
-
* columns exist, and relationships point at real entities/tables/columns.
|
|
288
|
-
*
|
|
289
|
-
* `$raw` filters and `$raw` relationship joins are opaque and skipped. Returns
|
|
290
|
-
* every error found (not just the first) so a mapping UI or CLI can show them
|
|
291
|
-
* all at once.
|
|
292
|
-
*/
|
|
293
|
-
declare function validateEntitiesConfig(config: ClivlyEntitiesConfig, schema: DiscoveredSchemaTable[]): ConfigValidationResult;
|
|
294
|
-
//#endregion
|
|
295
|
-
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 filterSchema, D as validateEntitiesConfig, E as relationshipsSchema, S as entitiesConfigSchema, T as relationshipSchema, _ as MaterializingConcept, a as ClivlyEntitiesConfig, b as RelationshipsMap, c as ClivlyEntityConfigInput, d as CrmConcept, f as DiscoveredColumnMeta, g as MATERIALIZING_CONCEPTS, h as FilterValue, i as ClivlyConfigError, l as ConfigValidationError, m as FilterExpr, n as CRM_CONCEPTS, o as ClivlyEntitiesConfigInput, p as DiscoveredSchemaTable, r as CUSTOM_CONCEPT, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as RelationshipSpec, w as projectionFields, x as defineClivlyConfig, y as RelationshipVia } from "./entity-config-CLxI8dVb.cjs";
|
|
2
|
+
export { CANONICAL_FIELDS, CRM_CONCEPTS, CUSTOM_CONCEPT, ClivlyConfigError, ClivlyEntitiesConfig, ClivlyEntitiesConfigInput, ClivlyEntityConfig, ClivlyEntityConfigInput, ConfigValidationError, ConfigValidationResult, CrmConcept, DiscoveredColumnMeta, DiscoveredSchemaTable, FilterExpr, FilterValue, MATERIALIZING_CONCEPTS, MaterializingConcept, RelationshipSpec, RelationshipVia, RelationshipsMap, defineClivlyConfig, entitiesConfigSchema, filterSchema, projectionFields, relationshipSchema, relationshipsSchema, validateEntitiesConfig };
|