remult 0.27.23-next.3 → 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.
- package/esm/src/remult3/remult3.js +26 -2
- package/package.json +1 -1
- package/src/remult3/Fields.d.ts +1 -1
- package/src/remult3/remult3.js +26 -2
|
@@ -17,8 +17,32 @@ const wnn = [
|
|
|
17
17
|
export const flags = {
|
|
18
18
|
error500RetryCount: 4,
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
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
package/src/remult3/Fields.d.ts
CHANGED
|
@@ -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:
|
|
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.
|
package/src/remult3/remult3.js
CHANGED
|
@@ -20,8 +20,32 @@ var wnn = [
|
|
|
20
20
|
exports.flags = {
|
|
21
21
|
error500RetryCount: 4,
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
|
|
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
|