remult 3.2.1 → 3.2.2-next.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.
- package/README.md +1 -1
- package/esm/server/get-remult-admin-html.js +123 -1
- package/esm/src/remult3/Fields.js +4 -4
- package/esm/src/remult3/entity.js +6 -1
- package/esm/src/standard-schema/index.js +1 -1
- package/package.json +1 -1
- package/server/get-remult-admin-html.js +1 -1
- package/server/remult-api-server.d.ts +5 -5
- package/src/column-interfaces.d.ts +6 -2
- package/src/entity.d.ts +6 -9
- package/src/remult3/Fields.d.ts +6 -6
- package/src/remult3/Fields.js +4 -4
- package/src/remult3/entity.d.ts +6 -1
- package/src/remult3/entity.js +6 -1
- package/src/remult3/remult3.d.ts +6 -4
- package/src/standard-schema/index.d.ts +1 -1
- package/src/standard-schema/index.js +1 -1
|
@@ -239,18 +239,18 @@ export class Relations {
|
|
|
239
239
|
* @returns A decorator function to apply the to-one relation to an entity field.
|
|
240
240
|
*
|
|
241
241
|
* Example usage:
|
|
242
|
-
* ```
|
|
242
|
+
* ```ts
|
|
243
243
|
* @Relations.toOne(() => Customer)
|
|
244
244
|
* customer?: Customer;
|
|
245
245
|
* ```
|
|
246
|
-
* ```
|
|
246
|
+
* ```ts
|
|
247
247
|
* Fields.string()
|
|
248
248
|
* customerId?: string;
|
|
249
249
|
*
|
|
250
250
|
* @Relations.toOne(() => Customer, "customerId")
|
|
251
251
|
* customer?: Customer;
|
|
252
252
|
* ```
|
|
253
|
-
* ```
|
|
253
|
+
* ```ts
|
|
254
254
|
* Fields.string()
|
|
255
255
|
* customerId?: string;
|
|
256
256
|
*
|
|
@@ -260,7 +260,7 @@ export class Relations {
|
|
|
260
260
|
* })
|
|
261
261
|
* customer?: Customer;
|
|
262
262
|
* ```
|
|
263
|
-
* ```
|
|
263
|
+
* ```ts
|
|
264
264
|
* Fields.string()
|
|
265
265
|
* customerId?: string;
|
|
266
266
|
*
|
|
@@ -4,6 +4,7 @@ import { remultStatic } from '../remult-static.js';
|
|
|
4
4
|
/**Decorates classes that should be used as entities.
|
|
5
5
|
* Receives a key and an array of EntityOptions.
|
|
6
6
|
* @example
|
|
7
|
+
* ```ts
|
|
7
8
|
* import { Entity, Fields } from "remult";
|
|
8
9
|
* @Entity("tasks", {
|
|
9
10
|
* allowApiCrud: true
|
|
@@ -16,14 +17,18 @@ import { remultStatic } from '../remult-static.js';
|
|
|
16
17
|
* @Fields.boolean()
|
|
17
18
|
* completed = false;
|
|
18
19
|
* }
|
|
19
|
-
*
|
|
20
|
+
* ```
|
|
20
21
|
* EntityOptions can be set in two ways:
|
|
21
22
|
* @example
|
|
23
|
+
* ```ts
|
|
22
24
|
* // as an object
|
|
23
25
|
* @Entity("tasks",{ allowApiCrud:true })
|
|
26
|
+
* ```
|
|
24
27
|
* @example
|
|
28
|
+
* ```ts
|
|
25
29
|
* // as an arrow function that receives `remult` as a parameter
|
|
26
30
|
* @Entity("tasks", (options,remult) => options.allowApiCrud = true)
|
|
31
|
+
* ```
|
|
27
32
|
*/
|
|
28
33
|
export function Entity(key, ...options) {
|
|
29
34
|
return (target, info) => {
|