remult 0.26.8-next.1 → 0.26.9
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/esm/src/remult3/remult3.js +2 -8
- package/esm/src/sort.js +4 -11
- package/package.json +1 -1
- package/src/remult3/remult3.js +2 -8
- package/src/sort.js +13 -20
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//p1 - remove controller and instance backend methods from the regular backend method article
|
|
3
|
-
//p1 - describe entity
|
|
4
|
-
//p1 - fix includeInApi documentation - figure out why we can't see the see?
|
|
5
2
|
//y2 - soft-delete-discussion https://discord.com/channels/975754286384418847/1230386433093533698/1230386433093533698
|
|
6
3
|
//y1 - In the esm version of our tutorial - the imports are automatically .ts and not .js in react and not in vue
|
|
7
|
-
//y1 - talk about insert with relations
|
|
8
4
|
//y1 - consider id to also support keyof (id:['company','index']) - had problem with | (keyof Partial<entityType>)[] & `entity`
|
|
9
|
-
//
|
|
5
|
+
//y2 - readonly key: keyof MembersOnly<entityType> & string
|
|
10
6
|
//y1 - talk about insert / update / delete with relations
|
|
11
7
|
/*
|
|
12
8
|
repo(Order).insert({},{
|
|
@@ -22,14 +18,12 @@ export {};
|
|
|
22
18
|
count:x.count()
|
|
23
19
|
}))
|
|
24
20
|
*/
|
|
25
|
-
//p1 - add documentation for bun sqlite
|
|
26
21
|
//p1 - consider upsert (where,set)
|
|
27
22
|
//p1 - wait a second to close stream
|
|
28
23
|
//p1 - prepare the createEntity discussion
|
|
29
|
-
//p1 - write active record article
|
|
30
24
|
//p1 - return error on connection error
|
|
31
|
-
//p1 - consider including the admin in the tutorial - and maybe even in the demo when we setup the api
|
|
32
25
|
//p1 - reconsider key typing to be keyof & string
|
|
26
|
+
//p1 - article on displayValue including it's definition for entities that is used in relations
|
|
33
27
|
//p2 -fix remult admin not to load the html into memory until used
|
|
34
28
|
//y2 - JY suggestion of having generate as part of the ensure schema - not sure
|
|
35
29
|
//y2 - currently for string fields we default for 255 in knex (which is their default) why not just use text (varchar max) - and only use exact length when one is provided?
|
package/esm/src/sort.js
CHANGED
|
@@ -166,21 +166,14 @@ export class Sort {
|
|
|
166
166
|
if (!orderBy || Object.keys(orderBy).length === 0)
|
|
167
167
|
orderBy = entityMetadata.options.defaultOrderBy;
|
|
168
168
|
if (!orderBy)
|
|
169
|
-
orderBy = {
|
|
170
|
-
[entityMetadata.idMetadata.field.key]: 'asc',
|
|
171
|
-
};
|
|
169
|
+
orderBy = {};
|
|
172
170
|
else
|
|
173
171
|
orderBy = { ...orderBy };
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
orderBy[field.key] = 'asc';
|
|
178
|
-
}
|
|
172
|
+
for (const field of entityMetadata.idMetadata.fields) {
|
|
173
|
+
if (!orderBy[field.key]) {
|
|
174
|
+
orderBy[field.key] = 'asc';
|
|
179
175
|
}
|
|
180
176
|
}
|
|
181
|
-
else if (!orderBy[entityMetadata.idMetadata.field.key]) {
|
|
182
|
-
orderBy[entityMetadata.idMetadata.field.key] = 'asc';
|
|
183
|
-
}
|
|
184
177
|
return orderBy;
|
|
185
178
|
}
|
|
186
179
|
}
|
package/package.json
CHANGED
package/src/remult3/remult3.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//p1 - remove controller and instance backend methods from the regular backend method article
|
|
4
|
-
//p1 - describe entity
|
|
5
|
-
//p1 - fix includeInApi documentation - figure out why we can't see the see?
|
|
6
3
|
//y2 - soft-delete-discussion https://discord.com/channels/975754286384418847/1230386433093533698/1230386433093533698
|
|
7
4
|
//y1 - In the esm version of our tutorial - the imports are automatically .ts and not .js in react and not in vue
|
|
8
|
-
//y1 - talk about insert with relations
|
|
9
5
|
//y1 - consider id to also support keyof (id:['company','index']) - had problem with | (keyof Partial<entityType>)[] & `entity`
|
|
10
|
-
//
|
|
6
|
+
//y2 - readonly key: keyof MembersOnly<entityType> & string
|
|
11
7
|
//y1 - talk about insert / update / delete with relations
|
|
12
8
|
/*
|
|
13
9
|
repo(Order).insert({},{
|
|
@@ -23,14 +19,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
19
|
count:x.count()
|
|
24
20
|
}))
|
|
25
21
|
*/
|
|
26
|
-
//p1 - add documentation for bun sqlite
|
|
27
22
|
//p1 - consider upsert (where,set)
|
|
28
23
|
//p1 - wait a second to close stream
|
|
29
24
|
//p1 - prepare the createEntity discussion
|
|
30
|
-
//p1 - write active record article
|
|
31
25
|
//p1 - return error on connection error
|
|
32
|
-
//p1 - consider including the admin in the tutorial - and maybe even in the demo when we setup the api
|
|
33
26
|
//p1 - reconsider key typing to be keyof & string
|
|
27
|
+
//p1 - article on displayValue including it's definition for entities that is used in relations
|
|
34
28
|
//p2 -fix remult admin not to load the html into memory until used
|
|
35
29
|
//y2 - JY suggestion of having generate as part of the ensure schema - not sure
|
|
36
30
|
//y2 - currently for string fields we default for 255 in knex (which is their default) why not just use text (varchar max) - and only use exact length when one is provided?
|
package/src/sort.js
CHANGED
|
@@ -205,34 +205,27 @@ var Sort = /** @class */ (function () {
|
|
|
205
205
|
* @returns {EntityOrderBy<T>} An `EntityOrderBy` representing the unique order by criteria.
|
|
206
206
|
*/
|
|
207
207
|
Sort.createUniqueEntityOrderBy = function (entityMetadata, orderBy) {
|
|
208
|
-
var
|
|
208
|
+
var e_4, _a;
|
|
209
209
|
if (!orderBy || Object.keys(orderBy).length === 0)
|
|
210
210
|
orderBy = entityMetadata.options.defaultOrderBy;
|
|
211
211
|
if (!orderBy)
|
|
212
|
-
orderBy =
|
|
213
|
-
_a[entityMetadata.idMetadata.field.key] = 'asc',
|
|
214
|
-
_a);
|
|
212
|
+
orderBy = {};
|
|
215
213
|
else
|
|
216
214
|
orderBy = tslib_1.__assign({}, orderBy);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
orderBy[field.key] = 'asc';
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
227
|
-
finally {
|
|
228
|
-
try {
|
|
229
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
215
|
+
try {
|
|
216
|
+
for (var _b = tslib_1.__values(entityMetadata.idMetadata.fields), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
217
|
+
var field = _c.value;
|
|
218
|
+
if (!orderBy[field.key]) {
|
|
219
|
+
orderBy[field.key] = 'asc';
|
|
230
220
|
}
|
|
231
|
-
finally { if (e_4) throw e_4.error; }
|
|
232
221
|
}
|
|
233
222
|
}
|
|
234
|
-
|
|
235
|
-
|
|
223
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
224
|
+
finally {
|
|
225
|
+
try {
|
|
226
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
227
|
+
}
|
|
228
|
+
finally { if (e_4) throw e_4.error; }
|
|
236
229
|
}
|
|
237
230
|
return orderBy;
|
|
238
231
|
};
|