@ronin/compiler 0.17.1-leo-ron-1099-experimental-378 → 0.17.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/dist/index.d.ts +1 -1
- package/dist/index.js +9 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -324,7 +324,7 @@ type ModelPreset = {
|
|
324
324
|
};
|
325
325
|
type ModelEntityList<T extends {
|
326
326
|
slug: string;
|
327
|
-
}> = Record<NonNullable<T['slug']>,
|
327
|
+
}> = Record<NonNullable<T['slug']>, Partial<T>>;
|
328
328
|
interface Model<T extends ModelEntityList<ModelField> = ModelEntityList<ModelField>> {
|
329
329
|
id: string;
|
330
330
|
name: string;
|
package/dist/index.js
CHANGED
@@ -587,8 +587,7 @@ var handleTo = (models, model, statementParams, queryType, dependencyStatements,
|
|
587
587
|
var handleUsing = (model, instructions) => {
|
588
588
|
const normalizedUsing = Array.isArray(instructions.using) ? Object.fromEntries(instructions.using.map((presetSlug) => [presetSlug, null])) : instructions.using;
|
589
589
|
if ("links" in normalizedUsing) {
|
590
|
-
for (const [fieldSlug,
|
591
|
-
const field = { slug: fieldSlug, ...rest };
|
590
|
+
for (const [fieldSlug, field] of Object.entries(model.fields)) {
|
592
591
|
if (field.type !== "link" || field.kind === "many") continue;
|
593
592
|
normalizedUsing[fieldSlug] = null;
|
594
593
|
}
|
@@ -1395,8 +1394,7 @@ var addDefaultModelPresets = (list, model) => {
|
|
1395
1394
|
}
|
1396
1395
|
const childModels = list.map((subModel) => {
|
1397
1396
|
if (subModel.system?.associationSlug) return null;
|
1398
|
-
const field = Object.entries(subModel.fields).find(([
|
1399
|
-
const field2 = { slug: fieldSlug, ...rest };
|
1397
|
+
const field = Object.entries(subModel.fields).find(([_, field2]) => {
|
1400
1398
|
return field2.type === "link" && field2.target === model.slug;
|
1401
1399
|
});
|
1402
1400
|
if (!field) return null;
|
@@ -1499,25 +1497,30 @@ var getSystemFields = (idPrefix) => ({
|
|
1499
1497
|
id: {
|
1500
1498
|
name: "ID",
|
1501
1499
|
type: "string",
|
1500
|
+
slug: "id",
|
1502
1501
|
defaultValue: ID_EXPRESSION(idPrefix)
|
1503
1502
|
},
|
1504
1503
|
"ronin.createdAt": {
|
1505
1504
|
name: "RONIN - Created At",
|
1506
1505
|
type: "date",
|
1506
|
+
slug: "ronin.createdAt",
|
1507
1507
|
defaultValue: CURRENT_TIME_EXPRESSION
|
1508
1508
|
},
|
1509
1509
|
"ronin.createdBy": {
|
1510
1510
|
name: "RONIN - Created By",
|
1511
|
-
type: "string"
|
1511
|
+
type: "string",
|
1512
|
+
slug: "ronin.createdBy"
|
1512
1513
|
},
|
1513
1514
|
"ronin.updatedAt": {
|
1514
1515
|
name: "RONIN - Updated At",
|
1515
1516
|
type: "date",
|
1517
|
+
slug: "ronin.updatedAt",
|
1516
1518
|
defaultValue: CURRENT_TIME_EXPRESSION
|
1517
1519
|
},
|
1518
1520
|
"ronin.updatedBy": {
|
1519
1521
|
name: "RONIN - Updated By",
|
1520
|
-
type: "string"
|
1522
|
+
type: "string",
|
1523
|
+
slug: "ronin.updatedBy"
|
1521
1524
|
}
|
1522
1525
|
});
|
1523
1526
|
var ROOT_MODEL = {
|