@ronin/compiler 0.14.11 → 0.14.12-leo-ron-1099-1-experimental-351
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.js +17 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -714,7 +714,7 @@ var compileQueryInput = (defaultQuery, models, statementParams, options) => {
|
|
714
714
|
instructions.orderedBy.descending.push("ronin.createdAt");
|
715
715
|
}
|
716
716
|
}
|
717
|
-
if (instructions && (
|
717
|
+
if (instructions && (typeof instructions.before !== "undefined" || typeof instructions.after !== "undefined")) {
|
718
718
|
if (single) {
|
719
719
|
throw new RoninError({
|
720
720
|
message: "The `before` and `after` instructions are not supported when querying for a single record.",
|
@@ -988,15 +988,16 @@ var WITH_CONDITIONS = {
|
|
988
988
|
lessOrEqual: (value) => ["<=", value]
|
989
989
|
};
|
990
990
|
var handleWith = (models, model, statementParams, instruction, parentModel) => {
|
991
|
-
|
991
|
+
return composeConditions(
|
992
992
|
models,
|
993
993
|
model,
|
994
994
|
statementParams,
|
995
995
|
"with",
|
996
996
|
instruction,
|
997
|
-
{
|
997
|
+
{
|
998
|
+
parentModel
|
999
|
+
}
|
998
1000
|
);
|
999
|
-
return `(${subStatement})`;
|
1000
1001
|
};
|
1001
1002
|
|
1002
1003
|
// node_modules/title/dist/esm/lower-case.js
|
@@ -1246,9 +1247,12 @@ var addDefaultModelAttributes = (model, isNew) => {
|
|
1246
1247
|
};
|
1247
1248
|
var addDefaultModelFields = (model, isNew) => {
|
1248
1249
|
const copiedModel = { ...model };
|
1249
|
-
const
|
1250
|
-
if (isNew ||
|
1251
|
-
|
1250
|
+
const existingFields = copiedModel.fields || [];
|
1251
|
+
if (isNew || existingFields.length > 0) {
|
1252
|
+
const additionalFields = getSystemFields(copiedModel.idPrefix).filter((newField) => {
|
1253
|
+
return !existingFields.some(({ slug }) => slug === newField.slug);
|
1254
|
+
});
|
1255
|
+
copiedModel.fields = [...additionalFields, ...existingFields];
|
1252
1256
|
}
|
1253
1257
|
return copiedModel;
|
1254
1258
|
};
|
@@ -1360,8 +1364,12 @@ var addDefaultModelPresets = (list, model) => {
|
|
1360
1364
|
slug: presetSlug
|
1361
1365
|
});
|
1362
1366
|
}
|
1363
|
-
if (
|
1364
|
-
|
1367
|
+
if (defaultPresets.length > 0) {
|
1368
|
+
const existingPresets = model.presets || [];
|
1369
|
+
const additionalPresets = defaultPresets.filter((newPreset) => {
|
1370
|
+
return !existingPresets.some(({ slug }) => slug === newPreset.slug);
|
1371
|
+
});
|
1372
|
+
model.presets = [...additionalPresets, ...existingPresets];
|
1365
1373
|
}
|
1366
1374
|
return model;
|
1367
1375
|
};
|