@base44-preview/sdk 0.8.18-pr.117.203ff32 → 0.8.18-pr.117.2b7242d
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.
|
@@ -3,7 +3,7 @@ import { RoomsSocket } from "../utils/socket-utils.js";
|
|
|
3
3
|
import { ModelFilterParams } from "../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Registry of agent names.
|
|
6
|
-
*
|
|
6
|
+
* Augmented by `base44 types generate` to enable autocomplete for agent names.
|
|
7
7
|
*/
|
|
8
8
|
export interface AgentNameRegistry {
|
|
9
9
|
}
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
export type RealtimeEventType = "create" | "update" | "delete";
|
|
5
5
|
/**
|
|
6
6
|
* Payload received when a realtime event occurs.
|
|
7
|
-
|
|
8
|
-
* @typeParam T - The entity type for the data field. Defaults to `any`.
|
|
9
|
-
*/
|
|
7
|
+
g */
|
|
10
8
|
export interface RealtimeEvent<T = any> {
|
|
11
9
|
/** The type of change that occurred */
|
|
12
10
|
type: RealtimeEventType;
|
|
@@ -19,8 +17,6 @@ export interface RealtimeEvent<T = any> {
|
|
|
19
17
|
}
|
|
20
18
|
/**
|
|
21
19
|
* Callback function invoked when a realtime event occurs.
|
|
22
|
-
*
|
|
23
|
-
* @typeParam T - The entity type for the event data. Defaults to `any`.
|
|
24
20
|
*/
|
|
25
21
|
export type RealtimeCallback<T = any> = (event: RealtimeEvent<T>) => void;
|
|
26
22
|
/**
|
|
@@ -41,36 +37,22 @@ export interface DeleteManyResult {
|
|
|
41
37
|
}
|
|
42
38
|
/**
|
|
43
39
|
* Result returned when importing entities from a file.
|
|
44
|
-
*
|
|
45
|
-
* @typeParam T - The entity type for imported records. Defaults to `any`.
|
|
46
40
|
*/
|
|
47
41
|
export interface ImportResult<T = any> {
|
|
48
42
|
/** Status of the import operation */
|
|
49
43
|
status: "success" | "error";
|
|
50
|
-
/** Details message
|
|
44
|
+
/** Details message */
|
|
51
45
|
details: string | null;
|
|
52
46
|
/** Array of created entity objects when successful, or null on error */
|
|
53
47
|
output: T[] | null;
|
|
54
48
|
}
|
|
55
49
|
/**
|
|
56
|
-
* Sort field
|
|
57
|
-
*
|
|
58
|
-
* Supports ascending (no prefix or `'+'`) and descending (`'-'`) sorting.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* // Ascending sort (default)
|
|
63
|
-
* 'created_date'
|
|
64
|
-
* '+created_date'
|
|
65
|
-
*
|
|
66
|
-
* // Descending sort
|
|
67
|
-
* '-created_date'
|
|
68
|
-
* ```
|
|
50
|
+
* Sort field for entity queries. Prefix with `-` for descending order.
|
|
69
51
|
*/
|
|
70
52
|
export type SortField<T> = (keyof T & string) | `+${keyof T & string}` | `-${keyof T & string}`;
|
|
71
53
|
/**
|
|
72
54
|
* Registry mapping entity names to their TypeScript types.
|
|
73
|
-
*
|
|
55
|
+
* Augmented by `base44 types generate` to enable type-safe entity access.
|
|
74
56
|
*/
|
|
75
57
|
export interface EntityTypeRegistry {
|
|
76
58
|
}
|
|
@@ -88,7 +70,6 @@ export interface EntityHandler<T = any> {
|
|
|
88
70
|
*
|
|
89
71
|
* **Note:** The maximum limit is 5,000 items per request.
|
|
90
72
|
*
|
|
91
|
-
* @typeParam K - The fields to include in the response. Defaults to all fields.
|
|
92
73
|
* @param sort - Sort parameter, such as `'-created_date'` for descending. Defaults to `'-created_date'`.
|
|
93
74
|
* @param limit - Maximum number of results to return. Defaults to `50`.
|
|
94
75
|
* @param skip - Number of results to skip for pagination. Defaults to `0`.
|
|
@@ -129,7 +110,6 @@ export interface EntityHandler<T = any> {
|
|
|
129
110
|
*
|
|
130
111
|
* **Note:** The maximum limit is 5,000 items per request.
|
|
131
112
|
*
|
|
132
|
-
* @typeParam K - The fields to include in the response. Defaults to all fields.
|
|
133
113
|
* @param query - Query object with field-value pairs. Each key should be a field name
|
|
134
114
|
* from your entity schema, and each value is the criteria to match. Records matching all
|
|
135
115
|
* specified criteria are returned. Field names are case-sensitive.
|
|
@@ -374,6 +354,9 @@ type DynamicEntitiesModule = {
|
|
|
374
354
|
* Entities are accessed dynamically using the pattern:
|
|
375
355
|
* `base44.entities.EntityName.method()`
|
|
376
356
|
*
|
|
357
|
+
* When {@link EntityTypeRegistry} is augmented (via `base44 types generate`),
|
|
358
|
+
* entity access becomes type-safe with autocomplete and type checking.
|
|
359
|
+
*
|
|
377
360
|
* This module is available to use with a client in all three authentication modes:
|
|
378
361
|
*
|
|
379
362
|
* - **Anonymous or User authentication** (`base44.entities`): Access is scoped to the current user's permissions. Anonymous users can only access public entities, while authenticated users can access entities they have permission to view or modify.
|