@zenstackhq/orm 3.4.0-beta.3 → 3.4.0-beta.4
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.cjs +13 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -6432,7 +6432,7 @@ var InputValidator = class {
|
|
|
6432
6432
|
}
|
|
6433
6433
|
/**
|
|
6434
6434
|
* Gets the effective set of allowed FilterKind values for a specific model and field.
|
|
6435
|
-
* Respects the precedence: field
|
|
6435
|
+
* Respects the precedence: model[field] > model.$all > $all[field] > $all.$all.
|
|
6436
6436
|
*/
|
|
6437
6437
|
getEffectiveFilterKinds(model, field) {
|
|
6438
6438
|
if (!model) {
|
|
@@ -6442,21 +6442,27 @@ var InputValidator = class {
|
|
|
6442
6442
|
if (!slicing?.models) {
|
|
6443
6443
|
return void 0;
|
|
6444
6444
|
}
|
|
6445
|
-
const
|
|
6445
|
+
const modelsRecord = slicing.models;
|
|
6446
|
+
const modelConfig = modelsRecord[(0, import_common_helpers9.lowerCaseFirst)(model)];
|
|
6446
6447
|
if (modelConfig?.fields) {
|
|
6447
6448
|
const fieldConfig = modelConfig.fields[field];
|
|
6448
6449
|
if (fieldConfig) {
|
|
6449
6450
|
return this.computeFilterKinds(fieldConfig.includedFilterKinds, fieldConfig.excludedFilterKinds);
|
|
6450
6451
|
}
|
|
6451
|
-
const allFieldsConfig = modelConfig.fields
|
|
6452
|
+
const allFieldsConfig = modelConfig.fields["$all"];
|
|
6452
6453
|
if (allFieldsConfig) {
|
|
6453
6454
|
return this.computeFilterKinds(allFieldsConfig.includedFilterKinds, allFieldsConfig.excludedFilterKinds);
|
|
6454
6455
|
}
|
|
6455
6456
|
}
|
|
6456
|
-
const allModelsConfig =
|
|
6457
|
+
const allModelsConfig = modelsRecord["$all"];
|
|
6457
6458
|
if (allModelsConfig?.fields) {
|
|
6458
|
-
|
|
6459
|
-
|
|
6459
|
+
const allModelsFieldConfig = allModelsConfig.fields[field];
|
|
6460
|
+
if (allModelsFieldConfig) {
|
|
6461
|
+
return this.computeFilterKinds(allModelsFieldConfig.includedFilterKinds, allModelsFieldConfig.excludedFilterKinds);
|
|
6462
|
+
}
|
|
6463
|
+
const allModelsAllFieldsConfig = allModelsConfig.fields["$all"];
|
|
6464
|
+
if (allModelsAllFieldsConfig) {
|
|
6465
|
+
return this.computeFilterKinds(allModelsAllFieldsConfig.includedFilterKinds, allModelsAllFieldsConfig.excludedFilterKinds);
|
|
6460
6466
|
}
|
|
6461
6467
|
}
|
|
6462
6468
|
return void 0;
|
|
@@ -9253,7 +9259,7 @@ function createModelCrudHandler(client, model, inputValidator, resultProcessor)
|
|
|
9253
9259
|
};
|
|
9254
9260
|
const slicing = client.$options.slicing;
|
|
9255
9261
|
if (slicing?.models) {
|
|
9256
|
-
const modelSlicing = slicing.models[model];
|
|
9262
|
+
const modelSlicing = slicing.models[(0, import_common_helpers14.lowerCaseFirst)(model)];
|
|
9257
9263
|
const allSlicing = slicing.models.$all;
|
|
9258
9264
|
const includedOperations = modelSlicing?.includedOperations ?? allSlicing?.includedOperations;
|
|
9259
9265
|
const excludedOperations = modelSlicing?.excludedOperations ?? allSlicing?.excludedOperations;
|