hola-server 0.4.6 → 0.4.8
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/core/meta.js +3 -3
- package/db/entity.js +1 -4
- package/package.json +1 -1
package/core/meta.js
CHANGED
|
@@ -15,7 +15,7 @@ const meta_manager = {};
|
|
|
15
15
|
* link property: field link property link to entity field and the field should ref to an entity.
|
|
16
16
|
* and the field name should be the same with the ref entity field name and shouldn't make as required and no other property
|
|
17
17
|
*/
|
|
18
|
-
const field_attrs = ["name", "type", "required", "ref", "link", "delete", "create", "list", "search", "update", "clone", "sys"];
|
|
18
|
+
const field_attrs = ["name", "type", "required", "ref", "link", "delete", "create", "list", "search", "update", "clone", "sys", "secure"];
|
|
19
19
|
const meta_attrs = ["collection", "primary_keys", "fields", "creatable", "readable", "updatable", "deleteable", "cloneable", "after_read",
|
|
20
20
|
"before_create", "after_create", "before_clone", "after_clone", "before_update", "after_update", "before_delete", "after_delete", "create", "clone", "update", "batch_update", "after_batch_update", "delete",
|
|
21
21
|
"ref_label", "ref_filter", "route", "user_field"];
|
|
@@ -218,12 +218,12 @@ class EntityMeta {
|
|
|
218
218
|
this.field_names = this.fields.map(field => field.name);
|
|
219
219
|
this.user_field = meta.user_field;
|
|
220
220
|
|
|
221
|
-
this.property_fields = this.fields.filter(field => field.sys != true);
|
|
221
|
+
this.property_fields = this.fields.filter(field => field.sys != true && field.secure != true);
|
|
222
222
|
this.create_fields = this.fields.filter(field => field.create != false && field.sys != true);
|
|
223
223
|
this.update_fields = this.fields.filter(field => field.create != false && field.update != false && field.sys != true);
|
|
224
224
|
this.search_fields = this.fields.filter(field => field.search != false && field.sys != true);
|
|
225
225
|
this.clone_fields = this.fields.filter(field => field.clone != false && field.sys != true);
|
|
226
|
-
this.list_fields = this.fields.filter(field => field.list != false && field.sys != true);
|
|
226
|
+
this.list_fields = this.fields.filter(field => field.list != false && field.sys != true && field.secure != true);
|
|
227
227
|
this.primary_key_fields = this.fields.filter(field => meta.primary_keys.includes(field.name));
|
|
228
228
|
this.required_field_names = this.fields.filter(field => field.required == true || this.primary_keys.includes(field.name)).map(field => field.name);
|
|
229
229
|
|
package/db/entity.js
CHANGED
|
@@ -43,11 +43,8 @@ const parse_search_value = function (name, type_name, search_value) {
|
|
|
43
43
|
} else if (search_value.startsWith("<")) {
|
|
44
44
|
const value = search_value.substring(1);
|
|
45
45
|
return { [name]: { "$lt": convert_search_value_by_type(type_name, value) } };
|
|
46
|
-
} else if (search_value.includes(",")) {
|
|
47
|
-
const values = search_value.split(",").map(v => convert_search_value_by_type(type_name, v));
|
|
48
|
-
return { [name]: { "$in": values } };
|
|
49
46
|
} else if (type_name === "array") {
|
|
50
|
-
return { [name]: { "$
|
|
47
|
+
return { [name]: { "$in": [search_value] } };
|
|
51
48
|
} else {
|
|
52
49
|
let value = convert_search_value_by_type(type_name, search_value);
|
|
53
50
|
if (typeof value === "string") {
|