not-node 5.0.13 → 5.0.16
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/package.json
CHANGED
package/src/core/locales/en.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"booleans_false": "False",
|
|
3
3
|
"booleans_true": "True",
|
|
4
|
+
"empty_list_placeholder": "List is empty",
|
|
5
|
+
"list_navigation_prev_button_label": "Prev",
|
|
6
|
+
"list_navigation_next_button_label": "Next",
|
|
4
7
|
"form_validation_error": "Form validation error",
|
|
5
8
|
"field_active_label": "Active",
|
|
6
9
|
"field_codeName_label": "Code name",
|
package/src/core/locales/ru.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"booleans_false": "Нет",
|
|
3
3
|
"booleans_true": "Да",
|
|
4
|
+
"empty_list_placeholder": "Список пуст",
|
|
5
|
+
"list_navigation_prev_button_label": "Назад",
|
|
6
|
+
"list_navigation_next_button_label": "Дальше",
|
|
4
7
|
"form_validation_error": "Форма заполнена с ошибками",
|
|
5
8
|
"field_active_label": "Активна",
|
|
6
9
|
"field_codeName_label": "Псевдоним",
|
|
@@ -8,7 +11,6 @@
|
|
|
8
11
|
"field_createdAt_label": "Создано",
|
|
9
12
|
"field_createdAt_placeholder": "Дата и время создания",
|
|
10
13
|
"field_default_label": "По умолчанию",
|
|
11
|
-
|
|
12
14
|
"field_title_label": "Название",
|
|
13
15
|
"field_title_placeholder": "Название объекта",
|
|
14
16
|
"field_description_label": "Описание",
|
package/src/model/default.js
CHANGED
|
@@ -106,14 +106,18 @@ function getOne(id, population = [], condition = {}) {
|
|
|
106
106
|
* If versioning ON, it retrieves __latest and not __closed
|
|
107
107
|
* @static
|
|
108
108
|
* @param {number} ID some unique numeric identificator
|
|
109
|
+
* @param {Object} condition optional if needed additional condition
|
|
109
110
|
* @return {Promise} Promise of document, if increment is OFF - then Promise.resolve(null)
|
|
110
111
|
**/
|
|
111
|
-
function getOneByID(ID) {
|
|
112
|
+
function getOneByID(ID, condition = {}) {
|
|
112
113
|
if (this.schema.statics.__incField) {
|
|
113
114
|
let by = (this.schema.statics.__versioning ? {
|
|
115
|
+
...condition,
|
|
114
116
|
__latest: true,
|
|
115
|
-
__closed: false
|
|
116
|
-
} : {
|
|
117
|
+
__closed: false,
|
|
118
|
+
} : {
|
|
119
|
+
...condition
|
|
120
|
+
}),
|
|
117
121
|
query;
|
|
118
122
|
by[this.schema.statics.__incField] = ID;
|
|
119
123
|
query = this.findOne(by);
|
|
@@ -128,11 +132,13 @@ function getOneByID(ID) {
|
|
|
128
132
|
* Retrieves one record by primary key, without any restriction
|
|
129
133
|
* @static
|
|
130
134
|
* @param {string} id primary key
|
|
135
|
+
* @param {Object} condition optional if needed additional condition
|
|
131
136
|
* @return {Promise} Promise
|
|
132
137
|
**/
|
|
133
|
-
function getOneRaw(id) {
|
|
138
|
+
function getOneRaw(id, condition = {}) {
|
|
134
139
|
let query = this.findOne({
|
|
135
|
-
_id: id
|
|
140
|
+
_id: id,
|
|
141
|
+
...condition
|
|
136
142
|
});
|
|
137
143
|
return query.exec();
|
|
138
144
|
}
|