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.
@@ -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
- //y1 - change exp version to preview?
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
- if (entityMetadata.idMetadata.field instanceof CompoundIdField) {
175
- for (const field of entityMetadata.idMetadata.field.fields) {
176
- if (!orderBy[field.key]) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.26.8-next.1",
3
+ "version": "0.26.9",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -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
- //y1 - change exp version to preview?
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 _a, e_4, _b;
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 = (_a = {},
213
- _a[entityMetadata.idMetadata.field.key] = 'asc',
214
- _a);
212
+ orderBy = {};
215
213
  else
216
214
  orderBy = tslib_1.__assign({}, orderBy);
217
- if (entityMetadata.idMetadata.field instanceof CompoundIdField_js_1.CompoundIdField) {
218
- try {
219
- for (var _c = tslib_1.__values(entityMetadata.idMetadata.field.fields), _d = _c.next(); !_d.done; _d = _c.next()) {
220
- var field = _d.value;
221
- if (!orderBy[field.key]) {
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
- else if (!orderBy[entityMetadata.idMetadata.field.key]) {
235
- orderBy[entityMetadata.idMetadata.field.key] = 'asc';
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
  };