@ronin/compiler 0.9.0-leo-ron-1083-experimental-202 → 0.9.0-leo-ron-1083-experimental-204
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -5920,7 +5920,7 @@ type ModelTriggerField<T extends Array<ModelField> = Array<ModelField>> = {
|
|
5920
5920
|
};
|
5921
5921
|
type ModelTrigger<T extends Array<ModelField> = Array<ModelField>> = {
|
5922
5922
|
/**
|
5923
|
-
* The identifier of the
|
5923
|
+
* The identifier of the trigger.
|
5924
5924
|
*/
|
5925
5925
|
slug?: string;
|
5926
5926
|
/** The type of query for which the trigger should fire. */
|
package/dist/index.js
CHANGED
@@ -20,6 +20,12 @@ var RONIN_MODEL_FIELD_REGEX = new RegExp(
|
|
20
20
|
`${RONIN_MODEL_SYMBOLS.FIELD}[_a-zA-Z0-9]+`,
|
21
21
|
"g"
|
22
22
|
);
|
23
|
+
var MODEL_ENTITY_ERROR_CODES = {
|
24
|
+
field: "FIELD_NOT_FOUND",
|
25
|
+
index: "INDEX_NOT_FOUND",
|
26
|
+
trigger: "TRIGGER_NOT_FOUND",
|
27
|
+
preset: "PRESET_NOT_FOUND"
|
28
|
+
};
|
23
29
|
var RoninError = class extends Error {
|
24
30
|
code;
|
25
31
|
field;
|
@@ -837,12 +843,7 @@ var transformMetaQuery = (models, dependencyStatements, statementParams, query)
|
|
837
843
|
if ((action === "alter" || action === "drop") && (typeof targetEntityIndex === "undefined" || targetEntityIndex === -1)) {
|
838
844
|
throw new RoninError({
|
839
845
|
message: `No ${entity} with slug "${slug}" defined in model "${existingModel.name}".`,
|
840
|
-
code:
|
841
|
-
field: "FIELD_NOT_FOUND",
|
842
|
-
index: "INDEX_NOT_FOUND",
|
843
|
-
trigger: "TRIGGER_NOT_FOUND",
|
844
|
-
preset: "PRESET_NOT_FOUND"
|
845
|
-
}[entity]
|
846
|
+
code: MODEL_ENTITY_ERROR_CODES[entity]
|
846
847
|
});
|
847
848
|
}
|
848
849
|
let json;
|