@clivly/core 0.9.1 → 0.9.2
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 +3 -0
- package/dist/drizzle.d.cts +1 -1
- package/dist/drizzle.d.mts +1 -1
- package/dist/{entity-config-Dh8aEcgj.cjs → entity-config-Bfq3OkCU.cjs} +36 -12
- package/dist/{entity-config-8Fgr6IOH.mjs → entity-config-DFJ8L9jm.mjs} +31 -13
- package/dist/{entity-config-CLxI8dVb.d.cts → entity-config-buOIVtMM.d.cts} +25 -1
- package/dist/{entity-config-CLxI8dVb.d.mts → entity-config-buOIVtMM.d.mts} +25 -1
- package/dist/entity-config.cjs +2 -1
- package/dist/entity-config.d.cts +2 -2
- package/dist/entity-config.d.mts +2 -2
- package/dist/entity-config.mjs +2 -2
- package/dist/entity-heuristics.cjs +1 -1
- package/dist/entity-heuristics.d.cts +1 -1
- package/dist/entity-heuristics.d.mts +1 -1
- package/dist/entity-heuristics.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/integration-state.cjs +98 -26
- package/dist/integration-state.d.cts +94 -7
- package/dist/integration-state.d.mts +94 -7
- package/dist/integration-state.mjs +96 -27
- package/dist/mapping-form.d.cts +1 -1
- package/dist/mapping-form.d.mts +1 -1
- package/dist/mappings-config.cjs +25 -1
- package/dist/mappings-config.d.cts +40 -2
- package/dist/mappings-config.d.mts +40 -2
- package/dist/mappings-config.mjs +25 -2
- package/dist/sync-engine.d.cts +1 -1
- package/dist/sync-engine.d.mts +1 -1
- package/dist/view-compiler.d.cts +1 -1
- package/dist/view-compiler.d.mts +1 -1
- package/package.json +1 -1
package/dist/mappings-config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CANONICAL_FIELDS } from "./entity-config-
|
|
1
|
+
import { t as CANONICAL_FIELDS } from "./entity-config-DFJ8L9jm.mjs";
|
|
2
2
|
//#region src/mappings-config.ts
|
|
3
3
|
const RESERVED_FIELD = "id";
|
|
4
4
|
/**
|
|
@@ -121,5 +121,28 @@ function mappingsToEntitiesConfig(rows) {
|
|
|
121
121
|
for (const { row, key } of assigned) entities[key] = buildEntity(row, refIndex);
|
|
122
122
|
return { entities };
|
|
123
123
|
}
|
|
124
|
+
const CUSTOM_CONCEPT = "custom";
|
|
125
|
+
function entitiesToMappings(config) {
|
|
126
|
+
const rows = [];
|
|
127
|
+
for (const [entityKey, entity] of Object.entries(config.entities)) {
|
|
128
|
+
const row = {
|
|
129
|
+
entityKey,
|
|
130
|
+
sourceTable: entity.projection?.baseTable ?? entity.source,
|
|
131
|
+
targetConcept: entity.concept,
|
|
132
|
+
role: entity.role ?? DEFAULT_ROLE,
|
|
133
|
+
fieldMap: entity.projection ? {} : entity.fields
|
|
134
|
+
};
|
|
135
|
+
if (entity.filter) row.filter = entity.filter;
|
|
136
|
+
if (entity.relationships) row.relationships = entity.relationships;
|
|
137
|
+
if (entity.projection) row.projection = entity.projection;
|
|
138
|
+
if (entity.concept === CUSTOM_CONCEPT) {
|
|
139
|
+
row.objectTypeSlug = entityKey;
|
|
140
|
+
if (entity.objectType) row.objectType = entity.objectType;
|
|
141
|
+
}
|
|
142
|
+
if (entity.targetObjectTypeId) row.targetObjectTypeId = entity.targetObjectTypeId;
|
|
143
|
+
rows.push(row);
|
|
144
|
+
}
|
|
145
|
+
return rows;
|
|
146
|
+
}
|
|
124
147
|
//#endregion
|
|
125
|
-
export { mappingsToEntitiesConfig };
|
|
148
|
+
export { entitiesToMappings, mappingsToEntitiesConfig };
|
package/dist/sync-engine.d.cts
CHANGED
package/dist/sync-engine.d.mts
CHANGED
package/dist/view-compiler.d.cts
CHANGED
package/dist/view-compiler.d.mts
CHANGED