@ronin/compiler 0.17.22-leo-ron-1140-experimental-430 → 0.17.22-leo-ron-1140-experimental-432
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 +6 -0
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -115,6 +115,11 @@ type AddInstructions = Omit<CombinedInstructions, 'with' | 'using'> & {
|
|
|
115
115
|
};
|
|
116
116
|
type RemoveInstructions = Omit<CombinedInstructions, 'to'>;
|
|
117
117
|
type CountInstructions = Omit<CombinedInstructions, 'to'>;
|
|
118
|
+
type ListQuery = {
|
|
119
|
+
models?: null;
|
|
120
|
+
} | {
|
|
121
|
+
model: string;
|
|
122
|
+
};
|
|
118
123
|
type CreateQuery = {
|
|
119
124
|
model: string | PublicModel;
|
|
120
125
|
to?: PublicModel;
|
|
@@ -152,6 +157,7 @@ type Query = {
|
|
|
152
157
|
add?: AddQuery;
|
|
153
158
|
remove?: RemoveQuery;
|
|
154
159
|
count?: CountQuery | CountAllQuery;
|
|
160
|
+
list?: ListQuery;
|
|
155
161
|
create?: CreateQuery;
|
|
156
162
|
alter?: AlterQuery;
|
|
157
163
|
drop?: DropQuery;
|
package/dist/index.js
CHANGED
|
@@ -1789,6 +1789,12 @@ var transformMetaQuery = (models, dependencyStatements, statementParams, query,
|
|
|
1789
1789
|
let slug = entity === "model" && action === "create" ? null : query[queryType] && "model" in query[queryType] ? query[queryType].model : null;
|
|
1790
1790
|
let modelSlug = slug;
|
|
1791
1791
|
let jsonValue;
|
|
1792
|
+
if ("list" in query && query.list) {
|
|
1793
|
+
if (slug) {
|
|
1794
|
+
return { get: { model: { with: { slug } } } };
|
|
1795
|
+
}
|
|
1796
|
+
return { get: { models: {} } };
|
|
1797
|
+
}
|
|
1792
1798
|
if ("create" in query && query.create) {
|
|
1793
1799
|
const init = query.create.model;
|
|
1794
1800
|
jsonValue = "to" in query.create ? { slug: init, ...query.create.to } : init;
|
|
@@ -1807,9 +1813,6 @@ var transformMetaQuery = (models, dependencyStatements, statementParams, query,
|
|
|
1807
1813
|
if ("alter" in query.alter && query.alter.alter) jsonValue = query.alter.alter.to;
|
|
1808
1814
|
}
|
|
1809
1815
|
}
|
|
1810
|
-
if ("get" in query && query.get && slug) {
|
|
1811
|
-
return { get: { model: { with: { slug } } } };
|
|
1812
|
-
}
|
|
1813
1816
|
if (!(modelSlug && slug)) return query;
|
|
1814
1817
|
const model = action === "create" && entity === "model" ? null : getModelBySlug(models, modelSlug);
|
|
1815
1818
|
if (entity === "model") {
|
package/package.json
CHANGED