clivly 0.4.1 → 0.7.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/README.md +83 -3
- package/{adapter-CXr12l4K.d.cts → adapter-C2eRbBfo.d.cts} +1 -2
- package/{adapter-CvNBD_3y.d.mts → adapter-D5LRa-NA.d.mts} +1 -2
- package/{auth-adapter-CdLODn2p.d.cts → auth-adapter-Bjgo8LhN.d.mts} +1 -2
- package/{auth-adapter-CRBW4elj.d.mts → auth-adapter-DWzgl5Yq.d.cts} +1 -2
- package/auth-better-auth.d.cts +1 -2
- package/auth-better-auth.d.mts +1 -2
- package/auth-clerk.d.cts +1 -2
- package/auth-clerk.d.mts +1 -2
- package/auth-workos.d.cts +1 -2
- package/auth-workos.d.mts +1 -2
- package/core-adapter.cjs +5 -0
- package/core-adapter.d.cts +1 -1
- package/core-adapter.d.mts +1 -1
- package/core-adapter.mjs +5 -0
- package/core-auth-adapter.cjs +6 -1
- package/core-auth-adapter.d.cts +1 -1
- package/core-auth-adapter.d.mts +1 -1
- package/core-auth-adapter.mjs +6 -1
- package/core-drizzle.cjs +6 -30
- package/core-drizzle.d.cts +1 -20
- package/core-drizzle.d.mts +1 -20
- package/core-drizzle.mjs +5 -29
- package/core-entity-config.cjs +5 -1
- package/core-entity-config.d.cts +1 -1
- package/core-entity-config.d.mts +1 -1
- package/core-entity-config.mjs +5 -1
- package/core-entity-heuristics.cjs +15 -453
- package/core-entity-heuristics.d.cts +1 -67
- package/core-entity-heuristics.d.mts +1 -67
- package/core-entity-heuristics.mjs +4 -442
- package/core-mapping-form.cjs +6 -1
- package/core-mapping-form.d.cts +1 -1
- package/core-mapping-form.d.mts +1 -1
- package/core-mapping-form.mjs +6 -1
- package/core-mapping-score.cjs +5 -1
- package/core-mapping-score.d.cts +1 -1
- package/core-mapping-score.d.mts +1 -1
- package/core-mapping-score.mjs +5 -1
- package/core-mappings-config.cjs +6 -1
- package/core-mappings-config.d.cts +1 -1
- package/core-mappings-config.d.mts +1 -1
- package/core-mappings-config.mjs +6 -1
- package/core-sync-engine.cjs +6 -1
- package/core-sync-engine.d.cts +1 -1
- package/core-sync-engine.d.mts +1 -1
- package/core-sync-engine.mjs +6 -1
- package/core-types.cjs +5 -0
- package/core-types.d.cts +1 -1
- package/core-types.d.mts +1 -1
- package/core-types.mjs +5 -0
- package/core-view-compiler.cjs +6 -1
- package/core-view-compiler.d.cts +1 -1
- package/core-view-compiler.d.mts +1 -1
- package/core-view-compiler.mjs +6 -1
- package/core.cjs +11 -6
- package/core.d.cts +9 -9
- package/core.d.mts +9 -9
- package/core.mjs +11 -6
- package/deprecate-subpath-B9ngvizt.cjs +30 -0
- package/deprecate-subpath-CmvZtCpE.mjs +25 -0
- package/drizzle-B89tLo4T.mjs +31 -0
- package/drizzle-CFOr9dU9.d.mts +20 -0
- package/drizzle-DiReZf6d.cjs +36 -0
- package/drizzle-DmeKSqeF.d.cts +20 -0
- package/drizzle.cjs +3 -1
- package/drizzle.d.cts +11 -3
- package/drizzle.d.mts +11 -3
- package/drizzle.mjs +3 -2
- package/{entity-config-DMuZpchz.cjs → entity-config-D87rV-tE.cjs} +194 -192
- package/{entity-config-D1DFyeUp.d.mts → entity-config-DoUCXtq5.d.cts} +48 -35
- package/{entity-config-GczjD3y8.d.cts → entity-config-DoUCXtq5.d.mts} +48 -35
- package/{entity-config-D3YpQB0z.mjs → entity-config-va2bkH5o.mjs} +194 -192
- package/index.cjs +896 -228
- package/index.d.cts +30 -2
- package/index.d.mts +30 -2
- package/index.mjs +886 -220
- package/internal-adapter.cjs +0 -0
- package/internal-adapter.d.cts +2 -0
- package/internal-adapter.d.mts +2 -0
- package/internal-adapter.mjs +1 -0
- package/internal-auth-adapter.cjs +3 -0
- package/internal-auth-adapter.d.cts +2 -0
- package/internal-auth-adapter.d.mts +2 -0
- package/internal-auth-adapter.mjs +2 -0
- package/internal-drizzle.cjs +3 -0
- package/internal-drizzle.d.cts +2 -0
- package/internal-drizzle.d.mts +2 -0
- package/internal-drizzle.mjs +2 -0
- package/internal-entity-config.cjs +13 -0
- package/internal-entity-config.d.cts +2 -0
- package/internal-entity-config.d.mts +2 -0
- package/internal-entity-config.mjs +2 -0
- package/internal-entity-heuristics.cjs +455 -0
- package/internal-entity-heuristics.d.cts +67 -0
- package/internal-entity-heuristics.d.mts +67 -0
- package/internal-entity-heuristics.mjs +444 -0
- package/internal-mapping-form.cjs +5 -0
- package/internal-mapping-form.d.cts +2 -0
- package/internal-mapping-form.d.mts +2 -0
- package/internal-mapping-form.mjs +2 -0
- package/internal-mapping-score.cjs +12 -0
- package/internal-mapping-score.d.cts +2 -0
- package/internal-mapping-score.d.mts +2 -0
- package/internal-mapping-score.mjs +2 -0
- package/internal-mappings-config.cjs +3 -0
- package/internal-mappings-config.d.cts +2 -0
- package/internal-mappings-config.d.mts +2 -0
- package/internal-mappings-config.mjs +2 -0
- package/internal-sync-engine.cjs +6 -0
- package/internal-sync-engine.d.cts +2 -0
- package/internal-sync-engine.d.mts +2 -0
- package/internal-sync-engine.mjs +2 -0
- package/internal-types.cjs +0 -0
- package/internal-types.d.cts +2 -0
- package/internal-types.d.mts +2 -0
- package/internal-types.mjs +1 -0
- package/internal-view-compiler.cjs +6 -0
- package/internal-view-compiler.d.cts +2 -0
- package/internal-view-compiler.d.mts +2 -0
- package/internal-view-compiler.mjs +2 -0
- package/internal.cjs +28 -0
- package/internal.d.cts +9 -0
- package/internal.d.mts +9 -0
- package/internal.mjs +7 -0
- package/{mapping-form-CUlFVfG8.d.cts → mapping-form-D93lhHEc.d.mts} +1 -2
- package/{mapping-form-kjSiJaCX.d.mts → mapping-form-lfyEE7EJ.d.cts} +1 -2
- package/{mappings-config-DYZ_uOOB.cjs → mappings-config-BsRADNRv.cjs} +1 -1
- package/{mappings-config-CNTZRD4g.mjs → mappings-config-Dbgxx3Nv.mjs} +1 -1
- package/{mappings-config-DjRLCb2Q.d.cts → mappings-config-DsUa7-1w.d.mts} +1 -2
- package/{mappings-config-GxiYsSBQ.d.mts → mappings-config-XmzB4dag.d.cts} +1 -2
- package/package.json +150 -2
- package/{sdk-DdzBxgMx.mjs → sdk-C_1sGiH8.mjs} +15 -11
- package/{sdk-D1BHQDf5.cjs → sdk-CzOf596t.cjs} +15 -11
- package/sdk.cjs +3 -1
- package/sdk.d.cts +1 -41
- package/sdk.d.mts +1 -41
- package/sdk.mjs +3 -2
- package/{sync-engine-DIVMG9EV.d.cts → sync-engine-B7QIbXro.d.cts} +6 -5
- package/{sync-engine-BtzkzKmY.cjs → sync-engine-CzEbpQGv.cjs} +1 -1
- package/{sync-engine-DLx243iw.d.mts → sync-engine-DGk_AeHJ.d.mts} +6 -5
- package/{sync-engine-D9vghQab.mjs → sync-engine-Do5ru3WF.mjs} +1 -1
- package/types-CsL0rFYh.d.cts +155 -0
- package/types-CsL0rFYh.d.mts +155 -0
- package/{view-compiler-4HsRUTWH.d.cts → view-compiler-BWz0sGdm.d.cts} +1 -2
- package/{view-compiler-BpIDExjd.d.mts → view-compiler-Bn_EJJMO.d.mts} +1 -2
- package/vite.d.cts +1 -2
- package/vite.d.mts +1 -2
- package/namespace-probe-CA4Vj40g.d.mts +0 -331
- package/namespace-probe-CkHCj9tQ.d.cts +0 -331
- /package/{auth-adapter-CBOKDhlc.cjs → auth-adapter-CiEXcweZ.cjs} +0 -0
- /package/{auth-adapter-wqnnEjo3.mjs → auth-adapter-gfVDxf3d.mjs} +0 -0
- /package/{drizzle-meta-BVR1qiyu.cjs → drizzle-meta-Bb1JWYqf.cjs} +0 -0
- /package/{drizzle-meta-DpMKataU.mjs → drizzle-meta-D-5k3n0i.mjs} +0 -0
- /package/{mapping-form-DdmDebC3.cjs → mapping-form-BpfON_ME.cjs} +0 -0
- /package/{mapping-form-BHtPexzI.mjs → mapping-form-DigkuvFc.mjs} +0 -0
- /package/{mapping-score-CPPvwoZC.mjs → mapping-score-C68uAqGB.mjs} +0 -0
- /package/{mapping-score-i3p8LWDF.cjs → mapping-score-CaB3F4Uu.cjs} +0 -0
- /package/{mapping-score-A2lRnlpk.d.mts → mapping-score-D7Gzg7Ii.d.cts} +0 -0
- /package/{mapping-score-BcjC0ZQs.d.cts → mapping-score-D7Gzg7Ii.d.mts} +0 -0
- /package/{types-BpsKVccL.d.cts → types-B1oRXdNP.d.cts} +0 -0
- /package/{types-_qbJXMt_.d.mts → types-B1oRXdNP.d.mts} +0 -0
- /package/{view-compiler-BcgJINr7.cjs → view-compiler-BIwvm-o2.cjs} +0 -0
- /package/{view-compiler-DeZzx_jn.mjs → view-compiler-ChWr_Lml.mjs} +0 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { a as MATERIALIZING_CONCEPTS } from "./entity-config-va2bkH5o.mjs";
|
|
2
|
+
import { a as W, c as isTextLike, i as RELATIONSHIP_TIERS, l as isTimestampLike, n as CONCEPT_TIERS, o as isAmbiguous, r as FIELD_TIERS, s as isNumericLike, u as tierFor } from "./mapping-score-C68uAqGB.mjs";
|
|
3
|
+
//#region ../core/src/entity-heuristics.ts
|
|
4
|
+
const TARGET_CONCEPTS = [
|
|
5
|
+
"contact",
|
|
6
|
+
"company",
|
|
7
|
+
"deal",
|
|
8
|
+
"activity",
|
|
9
|
+
"conversation",
|
|
10
|
+
"note"
|
|
11
|
+
];
|
|
12
|
+
const TABLE_PATTERNS = [
|
|
13
|
+
{
|
|
14
|
+
concept: "contact",
|
|
15
|
+
names: [
|
|
16
|
+
"users",
|
|
17
|
+
"customers",
|
|
18
|
+
"clients",
|
|
19
|
+
"accounts",
|
|
20
|
+
"participants",
|
|
21
|
+
"attendees",
|
|
22
|
+
"people",
|
|
23
|
+
"members",
|
|
24
|
+
"contacts",
|
|
25
|
+
"students",
|
|
26
|
+
"pupils",
|
|
27
|
+
"learners",
|
|
28
|
+
"patients",
|
|
29
|
+
"subscribers",
|
|
30
|
+
"donors",
|
|
31
|
+
"guests",
|
|
32
|
+
"residents",
|
|
33
|
+
"tenants",
|
|
34
|
+
"applicants",
|
|
35
|
+
"candidates",
|
|
36
|
+
"leads",
|
|
37
|
+
"prospects"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
concept: "company",
|
|
42
|
+
names: [
|
|
43
|
+
"companies",
|
|
44
|
+
"organizations",
|
|
45
|
+
"organisations",
|
|
46
|
+
"orgs",
|
|
47
|
+
"teams",
|
|
48
|
+
"businesses",
|
|
49
|
+
"accounts"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
concept: "deal",
|
|
54
|
+
names: [
|
|
55
|
+
"deals",
|
|
56
|
+
"opportunities",
|
|
57
|
+
"subscriptions",
|
|
58
|
+
"orders",
|
|
59
|
+
"invoices",
|
|
60
|
+
"sales"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
concept: "conversation",
|
|
65
|
+
names: [
|
|
66
|
+
"conversations",
|
|
67
|
+
"messages",
|
|
68
|
+
"tickets",
|
|
69
|
+
"threads",
|
|
70
|
+
"chats",
|
|
71
|
+
"inbox"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
concept: "activity",
|
|
76
|
+
names: [
|
|
77
|
+
"events",
|
|
78
|
+
"activities",
|
|
79
|
+
"jobs",
|
|
80
|
+
"logs",
|
|
81
|
+
"audit",
|
|
82
|
+
"shifts",
|
|
83
|
+
"scans",
|
|
84
|
+
"sessions"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
concept: "note",
|
|
89
|
+
names: [
|
|
90
|
+
"notes",
|
|
91
|
+
"comments",
|
|
92
|
+
"annotations"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
];
|
|
96
|
+
const CONCEPT_FIELDS = {
|
|
97
|
+
contact: [{
|
|
98
|
+
field: "name",
|
|
99
|
+
candidates: [
|
|
100
|
+
"name",
|
|
101
|
+
"full_name",
|
|
102
|
+
"fullname",
|
|
103
|
+
"display_name"
|
|
104
|
+
],
|
|
105
|
+
required: false
|
|
106
|
+
}, {
|
|
107
|
+
field: "email",
|
|
108
|
+
candidates: ["email", "email_address"],
|
|
109
|
+
required: true
|
|
110
|
+
}],
|
|
111
|
+
company: [{
|
|
112
|
+
field: "name",
|
|
113
|
+
candidates: [
|
|
114
|
+
"name",
|
|
115
|
+
"company_name",
|
|
116
|
+
"legal_name",
|
|
117
|
+
"title"
|
|
118
|
+
],
|
|
119
|
+
required: true
|
|
120
|
+
}, {
|
|
121
|
+
field: "domain",
|
|
122
|
+
candidates: [
|
|
123
|
+
"domain",
|
|
124
|
+
"website",
|
|
125
|
+
"url"
|
|
126
|
+
],
|
|
127
|
+
required: false
|
|
128
|
+
}],
|
|
129
|
+
deal: [
|
|
130
|
+
{
|
|
131
|
+
field: "name",
|
|
132
|
+
candidates: ["name", "title"],
|
|
133
|
+
required: true
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
field: "value",
|
|
137
|
+
candidates: [
|
|
138
|
+
"value",
|
|
139
|
+
"amount",
|
|
140
|
+
"total",
|
|
141
|
+
"price"
|
|
142
|
+
],
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
field: "stage",
|
|
147
|
+
candidates: [
|
|
148
|
+
"stage",
|
|
149
|
+
"status",
|
|
150
|
+
"state"
|
|
151
|
+
],
|
|
152
|
+
required: false
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
activity: [
|
|
156
|
+
{
|
|
157
|
+
field: "type",
|
|
158
|
+
candidates: [
|
|
159
|
+
"type",
|
|
160
|
+
"kind",
|
|
161
|
+
"event_type"
|
|
162
|
+
],
|
|
163
|
+
required: false
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
field: "summary",
|
|
167
|
+
candidates: [
|
|
168
|
+
"summary",
|
|
169
|
+
"description",
|
|
170
|
+
"message",
|
|
171
|
+
"title"
|
|
172
|
+
],
|
|
173
|
+
required: false
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
field: "createdAt",
|
|
177
|
+
candidates: [
|
|
178
|
+
"created_at",
|
|
179
|
+
"createdat",
|
|
180
|
+
"timestamp"
|
|
181
|
+
],
|
|
182
|
+
required: false
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
conversation: [{
|
|
186
|
+
field: "status",
|
|
187
|
+
candidates: ["status", "state"],
|
|
188
|
+
required: false
|
|
189
|
+
}, {
|
|
190
|
+
field: "subject",
|
|
191
|
+
candidates: [
|
|
192
|
+
"subject",
|
|
193
|
+
"title",
|
|
194
|
+
"preview"
|
|
195
|
+
],
|
|
196
|
+
required: false
|
|
197
|
+
}],
|
|
198
|
+
note: [{
|
|
199
|
+
field: "body",
|
|
200
|
+
candidates: [
|
|
201
|
+
"body",
|
|
202
|
+
"content",
|
|
203
|
+
"text",
|
|
204
|
+
"note"
|
|
205
|
+
],
|
|
206
|
+
required: true
|
|
207
|
+
}]
|
|
208
|
+
};
|
|
209
|
+
const CURSOR_CANDIDATES = [
|
|
210
|
+
"updatedat",
|
|
211
|
+
"updated_at",
|
|
212
|
+
"modifiedat",
|
|
213
|
+
"modified_at",
|
|
214
|
+
"createdat",
|
|
215
|
+
"created_at"
|
|
216
|
+
];
|
|
217
|
+
function suggestCursorField(columnKeys) {
|
|
218
|
+
const lowerToActual = new Map(columnKeys.map((c) => [c.toLowerCase(), c]));
|
|
219
|
+
for (const candidate of CURSOR_CANDIDATES) {
|
|
220
|
+
const match = lowerToActual.get(candidate);
|
|
221
|
+
if (match) return match;
|
|
222
|
+
}
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
const MATERIALIZING = new Set(MATERIALIZING_CONCEPTS);
|
|
226
|
+
function matchesConcept(tableName, concept) {
|
|
227
|
+
const normalized = tableName.toLowerCase();
|
|
228
|
+
const entry = TABLE_PATTERNS.find((p) => p.concept === concept);
|
|
229
|
+
if (!entry) return null;
|
|
230
|
+
if (entry.names.includes(normalized)) return { exact: true };
|
|
231
|
+
if (entry.names.some((name) => normalized.includes(name))) return { exact: false };
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
function metaFor(table, column) {
|
|
235
|
+
return table.columnsMeta?.find((c) => c.name === column);
|
|
236
|
+
}
|
|
237
|
+
function hasDefiningColumn(concept, columns) {
|
|
238
|
+
const lower = new Set(columns.map((c) => c.toLowerCase()));
|
|
239
|
+
const required = CONCEPT_FIELDS[concept].filter((f) => f.required);
|
|
240
|
+
return required.length > 0 && required.every((f) => f.candidates.some((c) => lower.has(c)));
|
|
241
|
+
}
|
|
242
|
+
function scoreConcepts(table) {
|
|
243
|
+
const out = [];
|
|
244
|
+
for (const concept of TARGET_CONCEPTS) {
|
|
245
|
+
if (!MATERIALIZING.has(concept)) continue;
|
|
246
|
+
const nameMatch = matchesConcept(table.name, concept);
|
|
247
|
+
if (!nameMatch) continue;
|
|
248
|
+
let score = 0;
|
|
249
|
+
const reasons = [];
|
|
250
|
+
if (nameMatch.exact) {
|
|
251
|
+
score += W.nameExact;
|
|
252
|
+
reasons.push(`name matches "${table.name}"`);
|
|
253
|
+
} else {
|
|
254
|
+
score += W.nameSubstring;
|
|
255
|
+
reasons.push(`name looks like ${concept}`);
|
|
256
|
+
}
|
|
257
|
+
if (hasDefiningColumn(concept, table.columns)) {
|
|
258
|
+
score += W.definingColumn;
|
|
259
|
+
reasons.push(`has the columns a ${concept} needs`);
|
|
260
|
+
}
|
|
261
|
+
if (table.columnsMeta?.some((c) => c.isPrimaryKey)) {
|
|
262
|
+
score += W.hasPrimaryKey;
|
|
263
|
+
reasons.push("has primary key");
|
|
264
|
+
}
|
|
265
|
+
if (table.rowCount !== void 0) if (table.rowCount === 0) {
|
|
266
|
+
score += W.emptyTable;
|
|
267
|
+
reasons.push("table is empty");
|
|
268
|
+
} else {
|
|
269
|
+
score += W.hasRows;
|
|
270
|
+
reasons.push(`${table.rowCount.toLocaleString("en-US")} rows`);
|
|
271
|
+
}
|
|
272
|
+
out.push({
|
|
273
|
+
value: concept,
|
|
274
|
+
score,
|
|
275
|
+
tier: tierFor(score, CONCEPT_TIERS),
|
|
276
|
+
reasons
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
return out.sort((a, b) => b.score - a.score);
|
|
280
|
+
}
|
|
281
|
+
function topConcept(table) {
|
|
282
|
+
const ranked = scoreConcepts(table);
|
|
283
|
+
const best = ranked[0];
|
|
284
|
+
if (!best) return null;
|
|
285
|
+
return {
|
|
286
|
+
best,
|
|
287
|
+
ambiguous: isAmbiguous(ranked)
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function requiredFieldsFor(concept) {
|
|
291
|
+
if (concept === "custom") return [];
|
|
292
|
+
return CONCEPT_FIELDS[concept].filter((f) => f.required).map((f) => f.field);
|
|
293
|
+
}
|
|
294
|
+
function validateMapping(requiredFields, fieldMap) {
|
|
295
|
+
const missing = requiredFields.filter((field) => !fieldMap[field]);
|
|
296
|
+
return {
|
|
297
|
+
valid: missing.length === 0,
|
|
298
|
+
missing
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
const DISCRIMINATOR_COLUMNS = [
|
|
302
|
+
"role",
|
|
303
|
+
"type",
|
|
304
|
+
"kind",
|
|
305
|
+
"status",
|
|
306
|
+
"state",
|
|
307
|
+
"category",
|
|
308
|
+
"tier"
|
|
309
|
+
];
|
|
310
|
+
function suggestDiscriminatorColumns(columns) {
|
|
311
|
+
const lowerToActual = new Map(columns.map((c) => [c.toLowerCase(), c]));
|
|
312
|
+
const out = [];
|
|
313
|
+
for (const name of DISCRIMINATOR_COLUMNS) {
|
|
314
|
+
const match = lowerToActual.get(name);
|
|
315
|
+
if (match) out.push(match);
|
|
316
|
+
}
|
|
317
|
+
return out;
|
|
318
|
+
}
|
|
319
|
+
const COMPANY_FK_HINTS = [
|
|
320
|
+
"organization_id",
|
|
321
|
+
"organisation_id",
|
|
322
|
+
"org_id",
|
|
323
|
+
"company_id",
|
|
324
|
+
"account_id",
|
|
325
|
+
"team_id"
|
|
326
|
+
];
|
|
327
|
+
function firstMatchingColumn(columns, hints) {
|
|
328
|
+
const lowerToActual = new Map(columns.map((c) => [c.toLowerCase(), c]));
|
|
329
|
+
for (const hint of hints) {
|
|
330
|
+
const match = lowerToActual.get(hint);
|
|
331
|
+
if (match) return match;
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Suggest contact→company relationships. When the source table carries FK
|
|
337
|
+
* metadata (`references`), the target table is a *fact*, not a name guess —
|
|
338
|
+
* that scores highest. Without metadata (v1 hosts) we fall back to the legacy
|
|
339
|
+
* FK-name hints at a lower tier.
|
|
340
|
+
*/
|
|
341
|
+
function scoreRelationships(source, allTables) {
|
|
342
|
+
const companyTables = allTables.filter((t) => t.name !== source.name && topConcept(t)?.best.value === "company");
|
|
343
|
+
if (companyTables.length === 0) return [];
|
|
344
|
+
const companyNames = new Set(companyTables.map((t) => t.name.toLowerCase()));
|
|
345
|
+
const out = [];
|
|
346
|
+
const seenTargets = /* @__PURE__ */ new Set();
|
|
347
|
+
for (const col of source.columnsMeta ?? []) {
|
|
348
|
+
const ref = col.references;
|
|
349
|
+
if (!(ref && companyNames.has(ref.table.toLowerCase()))) continue;
|
|
350
|
+
if (seenTargets.has(ref.table.toLowerCase())) continue;
|
|
351
|
+
seenTargets.add(ref.table.toLowerCase());
|
|
352
|
+
out.push({
|
|
353
|
+
value: {
|
|
354
|
+
name: "company",
|
|
355
|
+
entityTable: ref.table,
|
|
356
|
+
via: {
|
|
357
|
+
fkOn: "contact",
|
|
358
|
+
column: `${source.name}.${col.name}`
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
score: W.fkResolved,
|
|
362
|
+
tier: tierFor(W.fkResolved, RELATIONSHIP_TIERS),
|
|
363
|
+
reasons: [`foreign key → ${ref.table}.${ref.column}`]
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
if (source.columnsMeta?.length) return out.sort((a, b) => b.score - a.score);
|
|
367
|
+
const contactFk = firstMatchingColumn(source.columns, COMPANY_FK_HINTS);
|
|
368
|
+
if (contactFk) out.push({
|
|
369
|
+
value: {
|
|
370
|
+
name: "company",
|
|
371
|
+
entityTable: companyTables[0]?.name ?? "",
|
|
372
|
+
via: {
|
|
373
|
+
fkOn: "contact",
|
|
374
|
+
column: `${source.name}.${contactFk}`
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
score: W.fkNameHint,
|
|
378
|
+
tier: tierFor(W.fkNameHint, RELATIONSHIP_TIERS),
|
|
379
|
+
reasons: [`column "${contactFk}" looks like a company link`]
|
|
380
|
+
});
|
|
381
|
+
return out.sort((a, b) => b.score - a.score);
|
|
382
|
+
}
|
|
383
|
+
const FIELD_TYPE_EXPECTATION = {
|
|
384
|
+
name: "text",
|
|
385
|
+
email: "text",
|
|
386
|
+
domain: "text",
|
|
387
|
+
stage: "text",
|
|
388
|
+
status: "text",
|
|
389
|
+
subject: "text",
|
|
390
|
+
body: "text",
|
|
391
|
+
summary: "text",
|
|
392
|
+
type: "text",
|
|
393
|
+
value: "numeric",
|
|
394
|
+
createdAt: "timestamp"
|
|
395
|
+
};
|
|
396
|
+
function typeFits(field, type) {
|
|
397
|
+
const expectation = FIELD_TYPE_EXPECTATION[field];
|
|
398
|
+
if (!(expectation && type)) return null;
|
|
399
|
+
if (expectation === "text") return isTextLike(type);
|
|
400
|
+
if (expectation === "numeric") return isNumericLike(type);
|
|
401
|
+
return isTimestampLike(type);
|
|
402
|
+
}
|
|
403
|
+
function scoreFieldMap(concept, table) {
|
|
404
|
+
const lowerToActual = new Map(table.columns.map((c) => [c.toLowerCase(), c]));
|
|
405
|
+
const out = [];
|
|
406
|
+
for (const { field, candidates, required } of CONCEPT_FIELDS[concept]) for (const candidate of candidates) {
|
|
407
|
+
const column = lowerToActual.get(candidate);
|
|
408
|
+
if (!column) continue;
|
|
409
|
+
let score = W.fieldNameMatch;
|
|
410
|
+
const reasons = [`name matches "${column}"`];
|
|
411
|
+
const meta = metaFor(table, column);
|
|
412
|
+
const fits = typeFits(field, meta?.type);
|
|
413
|
+
if (fits === true) {
|
|
414
|
+
score += W.typeCompatible;
|
|
415
|
+
reasons.push(`type ${meta?.type}`);
|
|
416
|
+
} else if (fits === false) {
|
|
417
|
+
score += W.typeMismatch;
|
|
418
|
+
reasons.push(`type ${meta?.type} does not fit ${field}`);
|
|
419
|
+
}
|
|
420
|
+
if (required && meta?.nullable === false) {
|
|
421
|
+
score += W.requiredNotNull;
|
|
422
|
+
reasons.push("not null");
|
|
423
|
+
}
|
|
424
|
+
out.push({
|
|
425
|
+
value: {
|
|
426
|
+
field,
|
|
427
|
+
column,
|
|
428
|
+
required
|
|
429
|
+
},
|
|
430
|
+
score,
|
|
431
|
+
tier: tierFor(score, FIELD_TIERS),
|
|
432
|
+
reasons
|
|
433
|
+
});
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
return out;
|
|
437
|
+
}
|
|
438
|
+
function toFieldMap(scored) {
|
|
439
|
+
const map = {};
|
|
440
|
+
for (const { value } of scored) map[value.field] = value.column;
|
|
441
|
+
return map;
|
|
442
|
+
}
|
|
443
|
+
//#endregion
|
|
444
|
+
export { TARGET_CONCEPTS, matchesConcept, requiredFieldsFor, scoreConcepts, scoreFieldMap, scoreRelationships, suggestCursorField, suggestDiscriminatorColumns, toFieldMap, topConcept, validateMapping };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
|
|
3
|
+
exports.buildFilterFromDiscriminator = require_mapping_form.buildFilterFromDiscriminator;
|
|
4
|
+
exports.buildRelationships = require_mapping_form.buildRelationships;
|
|
5
|
+
exports.relationshipViaSignature = require_mapping_form.relationshipViaSignature;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_mapping_score = require("./mapping-score-CaB3F4Uu.cjs");
|
|
3
|
+
exports.AMBIGUITY_MARGIN = require_mapping_score.AMBIGUITY_MARGIN;
|
|
4
|
+
exports.CONCEPT_TIERS = require_mapping_score.CONCEPT_TIERS;
|
|
5
|
+
exports.FIELD_TIERS = require_mapping_score.FIELD_TIERS;
|
|
6
|
+
exports.RELATIONSHIP_TIERS = require_mapping_score.RELATIONSHIP_TIERS;
|
|
7
|
+
exports.W = require_mapping_score.W;
|
|
8
|
+
exports.isAmbiguous = require_mapping_score.isAmbiguous;
|
|
9
|
+
exports.isNumericLike = require_mapping_score.isNumericLike;
|
|
10
|
+
exports.isTextLike = require_mapping_score.isTextLike;
|
|
11
|
+
exports.isTimestampLike = require_mapping_score.isTimestampLike;
|
|
12
|
+
exports.tierFor = require_mapping_score.tierFor;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as Scored, c as W, d as isTextLike, f as isTimestampLike, i as RELATIONSHIP_TIERS, l as isAmbiguous, n as CONCEPT_TIERS, o as Thresholds, p as tierFor, r as FIELD_TIERS, s as Tier, t as AMBIGUITY_MARGIN, u as isNumericLike } from "./mapping-score-D7Gzg7Ii.cjs";
|
|
2
|
+
export { AMBIGUITY_MARGIN, CONCEPT_TIERS, FIELD_TIERS, RELATIONSHIP_TIERS, Scored, Thresholds, Tier, W, isAmbiguous, isNumericLike, isTextLike, isTimestampLike, tierFor };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as Scored, c as W, d as isTextLike, f as isTimestampLike, i as RELATIONSHIP_TIERS, l as isAmbiguous, n as CONCEPT_TIERS, o as Thresholds, p as tierFor, r as FIELD_TIERS, s as Tier, t as AMBIGUITY_MARGIN, u as isNumericLike } from "./mapping-score-D7Gzg7Ii.mjs";
|
|
2
|
+
export { AMBIGUITY_MARGIN, CONCEPT_TIERS, FIELD_TIERS, RELATIONSHIP_TIERS, Scored, Thresholds, Tier, W, isAmbiguous, isNumericLike, isTextLike, isTimestampLike, tierFor };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as W, c as isTextLike, i as RELATIONSHIP_TIERS, l as isTimestampLike, n as CONCEPT_TIERS, o as isAmbiguous, r as FIELD_TIERS, s as isNumericLike, t as AMBIGUITY_MARGIN, u as tierFor } from "./mapping-score-C68uAqGB.mjs";
|
|
2
|
+
export { AMBIGUITY_MARGIN, CONCEPT_TIERS, FIELD_TIERS, RELATIONSHIP_TIERS, W, isAmbiguous, isNumericLike, isTextLike, isTimestampLike, tierFor };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_sync_engine = require("./sync-engine-CzEbpQGv.cjs");
|
|
3
|
+
exports.computeSampleWarnings = require_sync_engine.computeSampleWarnings;
|
|
4
|
+
exports.previewSync = require_sync_engine.previewSync;
|
|
5
|
+
exports.reconcile = require_sync_engine.reconcile;
|
|
6
|
+
exports.runSync = require_sync_engine.runSync;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as PreviewWarning, c as SyncResult, d as previewSync, f as reconcile, i as PreviewResult, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult, u as computeSampleWarnings } from "./sync-engine-B7QIbXro.cjs";
|
|
2
|
+
export { EntitySyncResult, MirrorRecord, PersistAction, PreviewResult, PreviewWarning, SourceRow, SyncAction, SyncResult, SyncStore, computeSampleWarnings, previewSync, reconcile, runSync };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as PreviewWarning, c as SyncResult, d as previewSync, f as reconcile, i as PreviewResult, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult, u as computeSampleWarnings } from "./sync-engine-DGk_AeHJ.mjs";
|
|
2
|
+
export { EntitySyncResult, MirrorRecord, PersistAction, PreviewResult, PreviewWarning, SourceRow, SyncAction, SyncResult, SyncStore, computeSampleWarnings, previewSync, reconcile, runSync };
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as UpdateDealInput, S as UpdateContactInput, _ as Task, a as ContactFilters, b as TaskPriority, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as RecordSource, h as Note, i as Contact, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as TaskEntityType, w as UpdateTaskInput, x as TaskStatus, y as TaskFilters } from "./types-B1oRXdNP.cjs";
|
|
2
|
+
export { Activity, ActivityType, Company, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, RecordSource, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateContactInput, UpdateDealInput, UpdateTaskInput };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as UpdateDealInput, S as UpdateContactInput, _ as Task, a as ContactFilters, b as TaskPriority, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as RecordSource, h as Note, i as Contact, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as TaskEntityType, w as UpdateTaskInput, x as TaskStatus, y as TaskFilters } from "./types-B1oRXdNP.mjs";
|
|
2
|
+
export { Activity, ActivityType, Company, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, RecordSource, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateContactInput, UpdateDealInput, UpdateTaskInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_view_compiler = require("./view-compiler-BIwvm-o2.cjs");
|
|
3
|
+
exports.DEFAULT_VIEW_PREFIX = require_view_compiler.DEFAULT_VIEW_PREFIX;
|
|
4
|
+
exports.compileEntityView = require_view_compiler.compileEntityView;
|
|
5
|
+
exports.compileEntityViews = require_view_compiler.compileEntityViews;
|
|
6
|
+
exports.explainEntitiesConfig = require_view_compiler.explainEntitiesConfig;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-BWz0sGdm.cjs";
|
|
2
|
+
export { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-Bn_EJJMO.mjs";
|
|
2
|
+
export { CompileOptions, CompiledView, DEFAULT_VIEW_PREFIX, ExplainResult, compileEntityView, compileEntityViews, explainEntitiesConfig };
|
package/internal.cjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_entity_config = require("./entity-config-D87rV-tE.cjs");
|
|
3
|
+
const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
|
|
4
|
+
const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
|
|
5
|
+
const require_mappings_config = require("./mappings-config-BsRADNRv.cjs");
|
|
6
|
+
const require_view_compiler = require("./view-compiler-BIwvm-o2.cjs");
|
|
7
|
+
const require_sync_engine = require("./sync-engine-CzEbpQGv.cjs");
|
|
8
|
+
exports.CANONICAL_FIELDS = require_entity_config.CANONICAL_FIELDS;
|
|
9
|
+
exports.CRM_CONCEPTS = require_entity_config.CRM_CONCEPTS;
|
|
10
|
+
exports.ClivlyConfigError = require_entity_config.ClivlyConfigError;
|
|
11
|
+
exports.DEFAULT_VIEW_PREFIX = require_view_compiler.DEFAULT_VIEW_PREFIX;
|
|
12
|
+
exports.MATERIALIZING_CONCEPTS = require_entity_config.MATERIALIZING_CONCEPTS;
|
|
13
|
+
exports.authCustom = require_auth_adapter.authCustom;
|
|
14
|
+
exports.buildFilterFromDiscriminator = require_mapping_form.buildFilterFromDiscriminator;
|
|
15
|
+
exports.buildRelationships = require_mapping_form.buildRelationships;
|
|
16
|
+
exports.compileEntityView = require_view_compiler.compileEntityView;
|
|
17
|
+
exports.compileEntityViews = require_view_compiler.compileEntityViews;
|
|
18
|
+
exports.defineClivlyConfig = require_entity_config.defineClivlyConfig;
|
|
19
|
+
exports.entitiesConfigSchema = require_entity_config.entitiesConfigSchema;
|
|
20
|
+
exports.explainEntitiesConfig = require_view_compiler.explainEntitiesConfig;
|
|
21
|
+
exports.filterSchema = require_entity_config.filterSchema;
|
|
22
|
+
exports.mappingsToEntitiesConfig = require_mappings_config.mappingsToEntitiesConfig;
|
|
23
|
+
exports.reconcile = require_sync_engine.reconcile;
|
|
24
|
+
exports.relationshipSchema = require_entity_config.relationshipSchema;
|
|
25
|
+
exports.relationshipViaSignature = require_mapping_form.relationshipViaSignature;
|
|
26
|
+
exports.relationshipsSchema = require_entity_config.relationshipsSchema;
|
|
27
|
+
exports.runSync = require_sync_engine.runSync;
|
|
28
|
+
exports.validateEntitiesConfig = require_entity_config.validateEntitiesConfig;
|
package/internal.d.cts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { C as UpdateDealInput, S as UpdateContactInput, _ as Task, a as ContactFilters, b as TaskPriority, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as RecordSource, h as Note, i as Contact, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as TaskEntityType, w as UpdateTaskInput, x as TaskStatus, y as TaskFilters } from "./types-B1oRXdNP.cjs";
|
|
2
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-DWzgl5Yq.cjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter-C2eRbBfo.cjs";
|
|
4
|
+
import { C as validateEntitiesConfig, S as relationshipsSchema, _ as RelationshipsMap, a as ClivlyEntitiesConfig, b as filterSchema, c as ConfigValidationResult, d as FilterExpr, f as FilterValue, g as RelationshipVia, h as RelationshipSpec, i as ClivlyConfigError, l as CrmConcept, m as MaterializingConcept, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as MATERIALIZING_CONCEPTS, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredSchemaTable, v as defineClivlyConfig, x as relationshipSchema, y as entitiesConfigSchema } from "./entity-config-DoUCXtq5.cjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-lfyEE7EJ.cjs";
|
|
6
|
+
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-XmzB4dag.cjs";
|
|
7
|
+
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-BWz0sGdm.cjs";
|
|
8
|
+
import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine-B7QIbXro.cjs";
|
|
9
|
+
export { type Activity, type ActivityType, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type Note, type PersistAction, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
|
package/internal.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { C as UpdateDealInput, S as UpdateContactInput, _ as Task, a as ContactFilters, b as TaskPriority, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as RecordSource, h as Note, i as Contact, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as TaskEntityType, w as UpdateTaskInput, x as TaskStatus, y as TaskFilters } from "./types-B1oRXdNP.mjs";
|
|
2
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bjgo8LhN.mjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter-D5LRa-NA.mjs";
|
|
4
|
+
import { C as validateEntitiesConfig, S as relationshipsSchema, _ as RelationshipsMap, a as ClivlyEntitiesConfig, b as filterSchema, c as ConfigValidationResult, d as FilterExpr, f as FilterValue, g as RelationshipVia, h as RelationshipSpec, i as ClivlyConfigError, l as CrmConcept, m as MaterializingConcept, n as CRM_CONCEPTS, o as ClivlyEntityConfig, p as MATERIALIZING_CONCEPTS, s as ConfigValidationError, t as CANONICAL_FIELDS, u as DiscoveredSchemaTable, v as defineClivlyConfig, x as relationshipSchema, y as entitiesConfigSchema } from "./entity-config-DoUCXtq5.mjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-D93lhHEc.mjs";
|
|
6
|
+
import { n as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-DsUa7-1w.mjs";
|
|
7
|
+
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-Bn_EJJMO.mjs";
|
|
8
|
+
import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine-DGk_AeHJ.mjs";
|
|
9
|
+
export { type Activity, type ActivityType, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompileOptions, type CompiledView, type ConfigValidationError, type ConfigValidationResult, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type ExplainResult, type FilterExpr, type FilterValue, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type Note, type PersistAction, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
|
package/internal.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as MATERIALIZING_CONCEPTS, c as filterSchema, d as validateEntitiesConfig, i as ClivlyConfigError, l as relationshipSchema, n as CRM_CONCEPTS, o as defineClivlyConfig, s as entitiesConfigSchema, t as CANONICAL_FIELDS, u as relationshipsSchema } from "./entity-config-va2bkH5o.mjs";
|
|
2
|
+
import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
|
|
3
|
+
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
|
|
4
|
+
import { t as mappingsToEntitiesConfig } from "./mappings-config-Dbgxx3Nv.mjs";
|
|
5
|
+
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-ChWr_Lml.mjs";
|
|
6
|
+
import { i as runSync, r as reconcile } from "./sync-engine-Do5ru3WF.mjs";
|
|
7
|
+
export { CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, authCustom, buildFilterFromDiscriminator, buildRelationships, compileEntityView, compileEntityViews, defineClivlyConfig, entitiesConfigSchema, explainEntitiesConfig, filterSchema, mappingsToEntitiesConfig, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, validateEntitiesConfig };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { _ as RelationshipsMap, d as FilterExpr, g as RelationshipVia } from "./entity-config-
|
|
2
|
-
|
|
1
|
+
import { _ as RelationshipsMap, d as FilterExpr, g as RelationshipVia } from "./entity-config-DoUCXtq5.mjs";
|
|
3
2
|
//#region ../core/src/mapping-form.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A relationship the mapping UI can offer or has configured, in the shape the
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { _ as RelationshipsMap, d as FilterExpr, g as RelationshipVia } from "./entity-config-
|
|
2
|
-
|
|
1
|
+
import { _ as RelationshipsMap, d as FilterExpr, g as RelationshipVia } from "./entity-config-DoUCXtq5.cjs";
|
|
3
2
|
//#region ../core/src/mapping-form.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A relationship the mapping UI can offer or has configured, in the shape the
|