@base44-preview/sdk 0.8.56-pr.349.170ad04 → 0.8.56-pr.352.b15ea38
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.
|
@@ -50,7 +50,7 @@ export interface RegisterParams {
|
|
|
50
50
|
email: string;
|
|
51
51
|
/** User's password. */
|
|
52
52
|
password: string;
|
|
53
|
-
/**
|
|
53
|
+
/** Has no effect. Base44 doesn't verify Turnstile tokens for app users. */
|
|
54
54
|
turnstile_token?: string | null;
|
|
55
55
|
/** Optional {@link https://docs.base44.com/Getting-Started/Referral-program | referral code} from an existing user. */
|
|
56
56
|
referral_code?: string | null;
|
|
@@ -137,6 +137,11 @@ export interface AuthModule {
|
|
|
137
137
|
* You can update any [custom fields](/developers/backend/resources/entities/user-schema#custom-fields)
|
|
138
138
|
* defined in your User entity schema.
|
|
139
139
|
*
|
|
140
|
+
* [Field-level security](/developers/backend/resources/entities/security#field-level-security-fls)
|
|
141
|
+
* `write` rules on custom User fields also apply to this method. If `data` includes a field
|
|
142
|
+
* the user isn't allowed to write, the call throws a permission error and no fields are
|
|
143
|
+
* updated.
|
|
144
|
+
*
|
|
140
145
|
* Updating `role` requires editor access on the app.
|
|
141
146
|
*
|
|
142
147
|
* <Note>
|
|
@@ -274,7 +279,7 @@ export interface AuthModule {
|
|
|
274
279
|
*
|
|
275
280
|
* @param email - User's email address.
|
|
276
281
|
* @param password - User's password.
|
|
277
|
-
* @param turnstileToken -
|
|
282
|
+
* @param turnstileToken - Has no effect. Base44 doesn't verify Turnstile tokens for app users.
|
|
278
283
|
* @returns Promise resolving to login response with access token and user data.
|
|
279
284
|
* @throws Error if the email and password combination is invalid or the user is not registered.
|
|
280
285
|
*
|
|
@@ -684,7 +684,11 @@ export interface EntityHandler<T = any> {
|
|
|
684
684
|
/**
|
|
685
685
|
* Deletes a single record by ID.
|
|
686
686
|
*
|
|
687
|
-
*
|
|
687
|
+
* The record moves to the entity's trash. To restore it or delete it permanently,
|
|
688
|
+
* use **Recently deleted** in the [Data tab](/Building-your-app/Managing-your-app-data)
|
|
689
|
+
* or the [Restore entity record](/api-reference/restore-entity-record) and
|
|
690
|
+
* [Permanently delete entity record](/api-reference/permanently-delete-entity-record)
|
|
691
|
+
* endpoints.
|
|
688
692
|
*
|
|
689
693
|
* @param id - The unique identifier of the record to delete.
|
|
690
694
|
* @returns Promise resolving to the deletion result.
|
|
@@ -700,7 +704,12 @@ export interface EntityHandler<T = any> {
|
|
|
700
704
|
/**
|
|
701
705
|
* Deletes multiple records matching a query.
|
|
702
706
|
*
|
|
703
|
-
*
|
|
707
|
+
* The matching records move to the entity's trash. To restore them or delete them
|
|
708
|
+
* permanently, use **Recently deleted** in the
|
|
709
|
+
* [Data tab](/Building-your-app/Managing-your-app-data) or the
|
|
710
|
+
* [Restore entity records](/api-reference/restore-entity-records) and
|
|
711
|
+
* [Permanently delete entity record](/api-reference/permanently-delete-entity-record)
|
|
712
|
+
* endpoints.
|
|
704
713
|
*
|
|
705
714
|
* This isn't a transaction. Each record is deleted on its own, so if the call
|
|
706
715
|
* fails partway, the records already deleted stay deleted. Learn more about
|
|
@@ -758,6 +767,8 @@ export interface EntityHandler<T = any> {
|
|
|
758
767
|
* example, filter by `status: 'pending'` when setting status to `'processed'`.
|
|
759
768
|
*
|
|
760
769
|
* Each matching record is updated on its own, and the call isn't a transaction.
|
|
770
|
+
* All the update operators in a call, such as `$set`, `$inc`, and `$push`, are
|
|
771
|
+
* applied to each record in a single write.
|
|
761
772
|
* To claim one record safely, so that only one of 2 users acting at the same
|
|
762
773
|
* time succeeds, pass that record's `id` as a plain value plus the conditions
|
|
763
774
|
* that must still be true, then check `updated` in the response. The conditions
|
|
@@ -840,6 +851,20 @@ export interface EntityHandler<T = any> {
|
|
|
840
851
|
* // Someone else claimed it first, or it was no longer open
|
|
841
852
|
* }
|
|
842
853
|
* ```
|
|
854
|
+
*
|
|
855
|
+
* @example
|
|
856
|
+
* ```typescript
|
|
857
|
+
* // Save only if the record hasn't changed
|
|
858
|
+
* // `version` is a number field defined in the Document schema.
|
|
859
|
+
* // The edit is saved only if the record is still at the version this user loaded.
|
|
860
|
+
* const result = await base44.entities.Document.updateMany(
|
|
861
|
+
* { id: doc.id, version: doc.version },
|
|
862
|
+
* { $set: { body: newBody }, $inc: { version: 1 } }
|
|
863
|
+
* );
|
|
864
|
+
* if (result.updated === 0) {
|
|
865
|
+
* // Someone else saved a change first. Reload the record and try again.
|
|
866
|
+
* }
|
|
867
|
+
* ```
|
|
843
868
|
*/
|
|
844
869
|
updateMany(query: Partial<T>, data: Record<string, Record<string, any>>): Promise<UpdateManyResult>;
|
|
845
870
|
/**
|
|
@@ -1117,7 +1142,7 @@ type DynamicEntitiesModule = {
|
|
|
1117
1142
|
*
|
|
1118
1143
|
* Every app includes a built-in `User` entity that stores user account information. This entity has special security rules that can't be changed.
|
|
1119
1144
|
*
|
|
1120
|
-
* Regular users can only read and update their own user record. With service role authentication, you can read
|
|
1145
|
+
* Regular users can only read and update their own user record. With service role authentication, you can read and update any user, and remove any user except the app owner. A removed user moves to **Recently deleted** for 30 days, where an app editor can restore them, and is then deleted permanently. You can't create users using the entities module. Instead, use the functions of the {@link AuthModule | auth module} to invite or register new users.
|
|
1121
1146
|
*
|
|
1122
1147
|
* ## Generated Types
|
|
1123
1148
|
*
|