remult 0.26.23-next.2 → 0.27.0

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.
@@ -68,7 +68,7 @@ function buildEntityInfo(options) {
68
68
  }
69
69
  fields.push({
70
70
  key: x.key,
71
- readOnly: x.dbReadOnly || !x.apiUpdateAllowed(),
71
+ readOnly: x.dbReadOnly || !x.apiUpdateAllowed() || x.isServerExpression,
72
72
  values: (0, RepositoryImplementation_js_1.getValueList)(x),
73
73
  valFieldKey: valFieldKey,
74
74
  caption: x.caption,
@@ -4,6 +4,18 @@ exports.flags = void 0;
4
4
  exports.flags = {
5
5
  error500RetryCount: 4,
6
6
  };
7
+ /*y1 - https://github.com/remult/remult/discussions/438
8
+ - https://github.com/remult/remult/blob/query-argumets/projects/tests/dbs/test-sql-database.spec.ts#L100-L128
9
+ */
10
+ //y1 - consider sql expression gets a dbnames of it's own (that already has the "tableName" defined correctly) maybe also the filter translator
11
+ //y2 - soft-delete-discussion https://discord.com/channels/975754286384418847/1230386433093533698/1230386433093533698
12
+ //p1 - fix query docs to also explain how it can be used for infinite scroll and pagination.
13
+ //y1 - 'test expression columns without aliases'
14
+ //y1 - live query update waits for last
15
+ //p1 - add luid - it's cool for order by. - NO
16
+ //p1 - replace uuid with crypto.randomUUID and allow custom fallback NO
17
+ //p1 - add nanoid - NO
18
+ //p1 - add id and use luid by default, but allow changes with Fields.id.defaultIdProvider NO but defaultProvider yes
7
19
  /*p1
8
20
  * field, fieldType ,ValueListFieldType, - return optional parameter for decorators
9
21
  * options to remultExpress tc... should be mandatory
@@ -24,21 +36,17 @@ exports.flags = {
24
36
  //p1 - fix app custom filters example for multiple filters.
25
37
  //p1 - add not!!!!
26
38
  //p1 - add LifecycleEvent to documentation
27
- //y1 - Talk about the case where we had one to many, without a field - just a filter - for example, event,event participants, users - and a field that shows all users that are not participants
28
39
  //p1 - Fix hagai and starter project to latest ts
29
- //y1 - talk about the $ sign in my filter rules - no other orm uses that (part of sql work, with $ etc)
30
- //y1 TODO - discuss next auth withRemult paradox - the gift that keeps on giving - it's doing something crazy there!!
31
40
  //p1 - fix chaining of saving and saved in multiple entity options args
32
41
  //p1 - review starter and examples and separate remult * auth from the routes
33
- /*p1 - https://github.com/remult/remult/discussions/438
34
- - https://github.com/remult/remult/blob/query-argumets/projects/tests/dbs/test-sql-database.spec.ts#L100-L128
35
- */
36
42
  //p1 - min, max, avg, sum
43
+ //p1 - consider upsert (where,set)
37
44
  //y1 - live query with count #436
38
45
  //y1 TODO - In the esm version of our tutorial - the imports are automatically .ts and not .js in react and not in vue
39
46
  //y1 TODO - consider id to also support keyof (id:['company','index']) - had problem with | (keyof Partial<entityType>)[] & `entity`
40
- //y1 TODO - readonly key: keyof MembersOnly<entityType> & string
41
- //y1 - talk about insert / update / delete with relations
47
+ //y1 TODO - readonly key: keyof MembersOnly<entityType> & string
48
+ //y1 TODO - fix remult admin not to load the html into memory until used
49
+ //y2 - talk about insert / update / delete with relations
42
50
  /*
43
51
  repo(Order).insert({},{
44
52
  relations:{
@@ -46,23 +54,19 @@ repo(Order).insert({},{
46
54
  }
47
55
  })
48
56
  */
49
- //y1 - repo batch - for multiple operations:
57
+ //y2 - repo batch - for multiple operations:
50
58
  /*
51
59
  const result = await repo.batch(x=>({
52
60
  data:x.find(),
53
61
  count:x.count()
54
62
  }))
55
63
  */
56
- //p1 - consider upsert (where,set)
57
64
  //y1 - wait a second to close stream -see pr
58
65
  //p1 - Consider enforcing serial operations on JSON database to prevent data loss
59
- //y2 - soft-delete-discussion https://discord.com/channels/975754286384418847/1230386433093533698/1230386433093533698
60
66
  //p1 - prepare the createEntity discussion
61
67
  //p1 - return error on connection error
62
68
  //p1 - article on displayValue including it's definition for entities that is used in relations
63
69
  //p1 - article auth.js with express - played with it, requires type="module" and a few more configurations - https://github.com/noam-honig/express-auth
64
- //p2 - fix remult admin not to load the html into memory until used
65
- //p2 - add update to entityRef and EntityBase
66
70
  //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?
67
71
  //p2 - create foreign key constraints in user code - https://codesandbox.io/p/devbox/fk-validator-tdshcs
68
72
  //p2 - admin url1 - pocketbase use /_ for the admin //{allowed?:Allowed,url?:string} also checkout the admin* as it should probably be something else and didn't work in hono
@@ -86,10 +90,8 @@ const result = await repo.batch(x=>({
86
90
  - delete restrict (implicit, or user selected - and if so, how) (delete & update of id)
87
91
 
88
92
  */
89
- //y1 - consider sql expression gets a dbnames of it's own (that already has the "tableName" defined correctly) maybe also the filter translator
90
93
  //y1 - tried to upgrade vitest, nuxt tests are failing with loading uuid - sounds familiar?
91
94
  //y1 - talk about the parameter issue with backend methods
92
- //y1 - main vs master
93
95
  //y2 - livequery for findfirst (@JY)
94
96
  /*y2 -
95
97
  //y2 - allow api update only for new rows
@@ -115,8 +117,8 @@ const result = await repo.batch(x=>({
115
117
  //y2 - Should we create a separate implementation of command - one that the user uses, and another that the database implements (with only the bear necesities) - for example, to provide a second paramter called field for toDb conversions
116
118
  //y2 - should we simply inherit from SqlDataProvider - and send the required parameter in the call to the base class - I think that new SqlDatabase(new PostgresDataProvider()) is a bilt combersome
117
119
  //y2 - from the crm-demo(https://crm-demo.up.railway.app/deals), after editing a deal: - _updateEntityBasedOnApi
118
- //y2 - Backend methods are transactions, it's not intuitive and maybe should be optional / opt in
119
- //y2 - how to run a transaction as a user
120
+ //y1 - Backend methods are transactions, it's not intuitive and maybe should be optional / opt in (https://github.com/remult/remult/issues/466)
121
+ //y1 - how to run a transaction as a user
120
122
  //y2 - message for relation that is missing
121
123
  //y2 - consider multi tenancies
122
124
  //p2 - and validators to reference