remult 0.27.23-next.2 → 0.27.23-next.4

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.
@@ -228,7 +228,7 @@ class LogSQLCommand {
228
228
  let r = await this.origin.execute(sql);
229
229
  if (this.logToConsole !== false) {
230
230
  var d = new Date().valueOf() - start.valueOf();
231
- if (d > SqlDatabase.durationThreshold) {
231
+ if (d >= SqlDatabase.durationThreshold) {
232
232
  const duration = d / 1000;
233
233
  if (this.logToConsole === 'oneLiner') {
234
234
  const rawSql = sql
@@ -17,8 +17,32 @@ const wnn = [
17
17
  export const flags = {
18
18
  error500RetryCount: 4,
19
19
  };
20
- //p1 - make error info an actual error, important for exception handling, and also for auth.js errors that were mistic
21
- //p1 - add validators min,max,between(range)
20
+ /*p1 - issues in https://stackblitz.com/edit/demo-allow-delete-based-on-other-entity:
21
+ - don't like the ensure schema
22
+ - seems like this didn't work well in their version of sqlite:
23
+ ```
24
+ @Entity<TaskUser>('TaskUsers', {
25
+ id: ['taskId', 'userId'],
26
+ })
27
+ ```
28
+ - This could be better
29
+ ```
30
+ sqlExpression: async () => {
31
+ if (!remult.authenticated()) return 'false';
32
+ return (
33
+ '1=' +
34
+ (await sqlRelations(Task).taskUsers.$count({
35
+ userId: [remult.user?.id],
36
+ canDelete: true,
37
+ }))
38
+ );
39
+ },
40
+ ```
41
+
42
+ -
43
+ */
44
+ //p1 - deleteAll({title:undefined}) should throw an error - not return 0 (with direct call to db)
45
+ //p1 - remult-create, move db question ahead of auth - everyone needs a database, not everyone need auth
22
46
  //p1 - allow experimental route registration on remult server, with at least get route, and support redirect, read header and set header - (and the existing get html etc...)
23
47
  //p2 - add parameter all to deleteMany, and updateMany
24
48
  //p2 filter.apply ApiPreFilter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.27.23-next.2",
3
+ "version": "0.27.23-next.4",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -310,7 +310,7 @@ var LogSQLCommand = /** @class */ (function () {
310
310
  r = _a.sent();
311
311
  if (this.logToConsole !== false) {
312
312
  d = new Date().valueOf() - start.valueOf();
313
- if (d > SqlDatabase.durationThreshold) {
313
+ if (d >= SqlDatabase.durationThreshold) {
314
314
  duration = d / 1000;
315
315
  if (this.logToConsole === 'oneLiner') {
316
316
  rawSql = sql
@@ -100,7 +100,7 @@ export declare class Relations {
100
100
  * customer?: Customer;
101
101
  * ```
102
102
  */
103
- static toOne<entityType, toEntityType>(toEntityType: () => ClassType<toEntityType>, options?: (FieldOptions<entityType, toEntityType> & Pick<RelationOptions<entityType, toEntityType, any, any>, 'defaultIncluded'>) | RelationOptions<entityType, toEntityType, entityType> | keyof entityType): (target: any, context: string | ClassFieldDecoratorContextStub<any, toEntityType>, c?: any) => void;
103
+ static toOne<entityType, toEntityType>(toEntityType: () => ClassType<toEntityType>, options?: (FieldOptions<entityType, toEntityType> & Pick<RelationOptions<entityType, toEntityType, any, any>, 'defaultIncluded'>) | RelationOptions<entityType, toEntityType, entityType> | keyof entityType): (target: any, context: ClassFieldDecoratorContextStub<entityType, toEntityType | undefined> | string, c?: any) => void;
104
104
  /**
105
105
  * Define a toMany relation between entities, indicating a one-to-many relationship.
106
106
  * This method allows you to establish a relationship where one entity can have multiple related entities.
@@ -20,8 +20,32 @@ var wnn = [
20
20
  exports.flags = {
21
21
  error500RetryCount: 4,
22
22
  };
23
- //p1 - make error info an actual error, important for exception handling, and also for auth.js errors that were mistic
24
- //p1 - add validators min,max,between(range)
23
+ /*p1 - issues in https://stackblitz.com/edit/demo-allow-delete-based-on-other-entity:
24
+ - don't like the ensure schema
25
+ - seems like this didn't work well in their version of sqlite:
26
+ ```
27
+ @Entity<TaskUser>('TaskUsers', {
28
+ id: ['taskId', 'userId'],
29
+ })
30
+ ```
31
+ - This could be better
32
+ ```
33
+ sqlExpression: async () => {
34
+ if (!remult.authenticated()) return 'false';
35
+ return (
36
+ '1=' +
37
+ (await sqlRelations(Task).taskUsers.$count({
38
+ userId: [remult.user?.id],
39
+ canDelete: true,
40
+ }))
41
+ );
42
+ },
43
+ ```
44
+
45
+ -
46
+ */
47
+ //p1 - deleteAll({title:undefined}) should throw an error - not return 0 (with direct call to db)
48
+ //p1 - remult-create, move db question ahead of auth - everyone needs a database, not everyone need auth
25
49
  //p1 - allow experimental route registration on remult server, with at least get route, and support redirect, read header and set header - (and the existing get html etc...)
26
50
  //p2 - add parameter all to deleteMany, and updateMany
27
51
  //p2 filter.apply ApiPreFilter