react-native-appwrite 0.16.0 → 0.17.1
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/CHANGELOG.md +4 -0
- package/dist/cjs/sdk.js +371 -17
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +371 -17
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/databases/create-document.md +2 -1
- package/docs/examples/databases/create-operations.md +24 -0
- package/docs/examples/databases/create-transaction.md +13 -0
- package/docs/examples/databases/decrement-document-attribute.md +2 -1
- package/docs/examples/databases/delete-document.md +2 -1
- package/docs/examples/databases/delete-transaction.md +13 -0
- package/docs/examples/databases/get-document.md +2 -1
- package/docs/examples/databases/get-transaction.md +13 -0
- package/docs/examples/databases/increment-document-attribute.md +2 -1
- package/docs/examples/databases/list-documents.md +2 -1
- package/docs/examples/databases/list-transactions.md +13 -0
- package/docs/examples/databases/update-document.md +2 -1
- package/docs/examples/databases/update-transaction.md +15 -0
- package/docs/examples/databases/upsert-document.md +2 -1
- package/docs/examples/tablesdb/create-operations.md +24 -0
- package/docs/examples/tablesdb/create-row.md +2 -1
- package/docs/examples/tablesdb/create-transaction.md +13 -0
- package/docs/examples/tablesdb/decrement-row-column.md +2 -1
- package/docs/examples/tablesdb/delete-row.md +2 -1
- package/docs/examples/tablesdb/delete-transaction.md +13 -0
- package/docs/examples/tablesdb/get-row.md +2 -1
- package/docs/examples/tablesdb/get-transaction.md +13 -0
- package/docs/examples/tablesdb/increment-row-column.md +2 -1
- package/docs/examples/tablesdb/list-rows.md +2 -1
- package/docs/examples/tablesdb/list-transactions.md +13 -0
- package/docs/examples/tablesdb/update-row.md +2 -1
- package/docs/examples/tablesdb/update-transaction.md +15 -0
- package/docs/examples/tablesdb/upsert-row.md +2 -1
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +44 -0
- package/src/services/databases.ts +414 -56
- package/src/services/tables-db.ts +414 -56
- package/types/models.d.ts +42 -0
- package/types/services/databases.d.ts +155 -8
- package/types/services/tables-db.d.ts +155 -8
|
@@ -3,12 +3,136 @@ import { Client } from '../client';
|
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
export declare class TablesDB extends Service {
|
|
5
5
|
constructor(client: Client);
|
|
6
|
+
/**
|
|
7
|
+
* List transactions across all databases.
|
|
8
|
+
*
|
|
9
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries).
|
|
10
|
+
* @throws {AppwriteException}
|
|
11
|
+
* @returns {Promise}
|
|
12
|
+
*/
|
|
13
|
+
listTransactions(params?: {
|
|
14
|
+
queries?: string[];
|
|
15
|
+
}): Promise<Models.TransactionList>;
|
|
16
|
+
/**
|
|
17
|
+
* List transactions across all databases.
|
|
18
|
+
*
|
|
19
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries).
|
|
20
|
+
* @throws {AppwriteException}
|
|
21
|
+
* @returns {Promise<Models.TransactionList>}
|
|
22
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
23
|
+
*/
|
|
24
|
+
listTransactions(queries?: string[]): Promise<Models.TransactionList>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a new transaction.
|
|
27
|
+
*
|
|
28
|
+
* @param {number} params.ttl - Seconds before the transaction expires.
|
|
29
|
+
* @throws {AppwriteException}
|
|
30
|
+
* @returns {Promise}
|
|
31
|
+
*/
|
|
32
|
+
createTransaction(params?: {
|
|
33
|
+
ttl?: number;
|
|
34
|
+
}): Promise<Models.Transaction>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a new transaction.
|
|
37
|
+
*
|
|
38
|
+
* @param {number} ttl - Seconds before the transaction expires.
|
|
39
|
+
* @throws {AppwriteException}
|
|
40
|
+
* @returns {Promise<Models.Transaction>}
|
|
41
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
42
|
+
*/
|
|
43
|
+
createTransaction(ttl?: number): Promise<Models.Transaction>;
|
|
44
|
+
/**
|
|
45
|
+
* Get a transaction by its unique ID.
|
|
46
|
+
*
|
|
47
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
48
|
+
* @throws {AppwriteException}
|
|
49
|
+
* @returns {Promise}
|
|
50
|
+
*/
|
|
51
|
+
getTransaction(params: {
|
|
52
|
+
transactionId: string;
|
|
53
|
+
}): Promise<Models.Transaction>;
|
|
54
|
+
/**
|
|
55
|
+
* Get a transaction by its unique ID.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} transactionId - Transaction ID.
|
|
58
|
+
* @throws {AppwriteException}
|
|
59
|
+
* @returns {Promise<Models.Transaction>}
|
|
60
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
61
|
+
*/
|
|
62
|
+
getTransaction(transactionId: string): Promise<Models.Transaction>;
|
|
63
|
+
/**
|
|
64
|
+
* Update a transaction, to either commit or roll back its operations.
|
|
65
|
+
*
|
|
66
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
67
|
+
* @param {boolean} params.commit - Commit transaction?
|
|
68
|
+
* @param {boolean} params.rollback - Rollback transaction?
|
|
69
|
+
* @throws {AppwriteException}
|
|
70
|
+
* @returns {Promise}
|
|
71
|
+
*/
|
|
72
|
+
updateTransaction(params: {
|
|
73
|
+
transactionId: string;
|
|
74
|
+
commit?: boolean;
|
|
75
|
+
rollback?: boolean;
|
|
76
|
+
}): Promise<Models.Transaction>;
|
|
77
|
+
/**
|
|
78
|
+
* Update a transaction, to either commit or roll back its operations.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} transactionId - Transaction ID.
|
|
81
|
+
* @param {boolean} commit - Commit transaction?
|
|
82
|
+
* @param {boolean} rollback - Rollback transaction?
|
|
83
|
+
* @throws {AppwriteException}
|
|
84
|
+
* @returns {Promise<Models.Transaction>}
|
|
85
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
86
|
+
*/
|
|
87
|
+
updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise<Models.Transaction>;
|
|
88
|
+
/**
|
|
89
|
+
* Delete a transaction by its unique ID.
|
|
90
|
+
*
|
|
91
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
92
|
+
* @throws {AppwriteException}
|
|
93
|
+
* @returns {Promise}
|
|
94
|
+
*/
|
|
95
|
+
deleteTransaction(params: {
|
|
96
|
+
transactionId: string;
|
|
97
|
+
}): Promise<{}>;
|
|
98
|
+
/**
|
|
99
|
+
* Delete a transaction by its unique ID.
|
|
100
|
+
*
|
|
101
|
+
* @param {string} transactionId - Transaction ID.
|
|
102
|
+
* @throws {AppwriteException}
|
|
103
|
+
* @returns {Promise<{}>}
|
|
104
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
105
|
+
*/
|
|
106
|
+
deleteTransaction(transactionId: string): Promise<{}>;
|
|
107
|
+
/**
|
|
108
|
+
* Create multiple operations in a single transaction.
|
|
109
|
+
*
|
|
110
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
111
|
+
* @param {object[]} params.operations - Array of staged operations.
|
|
112
|
+
* @throws {AppwriteException}
|
|
113
|
+
* @returns {Promise}
|
|
114
|
+
*/
|
|
115
|
+
createOperations(params: {
|
|
116
|
+
transactionId: string;
|
|
117
|
+
operations?: object[];
|
|
118
|
+
}): Promise<Models.Transaction>;
|
|
119
|
+
/**
|
|
120
|
+
* Create multiple operations in a single transaction.
|
|
121
|
+
*
|
|
122
|
+
* @param {string} transactionId - Transaction ID.
|
|
123
|
+
* @param {object[]} operations - Array of staged operations.
|
|
124
|
+
* @throws {AppwriteException}
|
|
125
|
+
* @returns {Promise<Models.Transaction>}
|
|
126
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
127
|
+
*/
|
|
128
|
+
createOperations(transactionId: string, operations?: object[]): Promise<Models.Transaction>;
|
|
6
129
|
/**
|
|
7
130
|
* Get a list of all the user's rows in a given table. You can use the query params to filter your results.
|
|
8
131
|
*
|
|
9
132
|
* @param {string} params.databaseId - Database ID.
|
|
10
133
|
* @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table).
|
|
11
134
|
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
135
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
12
136
|
* @throws {AppwriteException}
|
|
13
137
|
* @returns {Promise}
|
|
14
138
|
*/
|
|
@@ -16,6 +140,7 @@ export declare class TablesDB extends Service {
|
|
|
16
140
|
databaseId: string;
|
|
17
141
|
tableId: string;
|
|
18
142
|
queries?: string[];
|
|
143
|
+
transactionId?: string;
|
|
19
144
|
}): Promise<Models.RowList<Row>>;
|
|
20
145
|
/**
|
|
21
146
|
* Get a list of all the user's rows in a given table. You can use the query params to filter your results.
|
|
@@ -23,11 +148,12 @@ export declare class TablesDB extends Service {
|
|
|
23
148
|
* @param {string} databaseId - Database ID.
|
|
24
149
|
* @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table).
|
|
25
150
|
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
151
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
26
152
|
* @throws {AppwriteException}
|
|
27
153
|
* @returns {Promise<Models.RowList<Row>>}
|
|
28
154
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
29
155
|
*/
|
|
30
|
-
listRows<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, queries?: string[]): Promise<Models.RowList<Row>>;
|
|
156
|
+
listRows<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, queries?: string[], transactionId?: string): Promise<Models.RowList<Row>>;
|
|
31
157
|
/**
|
|
32
158
|
* Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
|
|
33
159
|
*
|
|
@@ -36,6 +162,7 @@ export declare class TablesDB extends Service {
|
|
|
36
162
|
* @param {string} params.rowId - Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
37
163
|
* @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>} params.data - Row data as JSON object.
|
|
38
164
|
* @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
165
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
39
166
|
* @throws {AppwriteException}
|
|
40
167
|
* @returns {Promise}
|
|
41
168
|
*/
|
|
@@ -45,6 +172,7 @@ export declare class TablesDB extends Service {
|
|
|
45
172
|
rowId: string;
|
|
46
173
|
data: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>;
|
|
47
174
|
permissions?: string[];
|
|
175
|
+
transactionId?: string;
|
|
48
176
|
}): Promise<Row>;
|
|
49
177
|
/**
|
|
50
178
|
* Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
|
|
@@ -54,11 +182,12 @@ export declare class TablesDB extends Service {
|
|
|
54
182
|
* @param {string} rowId - Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
55
183
|
* @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>} data - Row data as JSON object.
|
|
56
184
|
* @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
185
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
57
186
|
* @throws {AppwriteException}
|
|
58
187
|
* @returns {Promise<Row>}
|
|
59
188
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
60
189
|
*/
|
|
61
|
-
createRow<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, data: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>, permissions?: string[]): Promise<Row>;
|
|
190
|
+
createRow<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, data: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>, permissions?: string[], transactionId?: string): Promise<Row>;
|
|
62
191
|
/**
|
|
63
192
|
* Get a row by its unique ID. This endpoint response returns a JSON object with the row data.
|
|
64
193
|
*
|
|
@@ -66,6 +195,7 @@ export declare class TablesDB extends Service {
|
|
|
66
195
|
* @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
67
196
|
* @param {string} params.rowId - Row ID.
|
|
68
197
|
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
198
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
69
199
|
* @throws {AppwriteException}
|
|
70
200
|
* @returns {Promise}
|
|
71
201
|
*/
|
|
@@ -74,6 +204,7 @@ export declare class TablesDB extends Service {
|
|
|
74
204
|
tableId: string;
|
|
75
205
|
rowId: string;
|
|
76
206
|
queries?: string[];
|
|
207
|
+
transactionId?: string;
|
|
77
208
|
}): Promise<Row>;
|
|
78
209
|
/**
|
|
79
210
|
* Get a row by its unique ID. This endpoint response returns a JSON object with the row data.
|
|
@@ -82,11 +213,12 @@ export declare class TablesDB extends Service {
|
|
|
82
213
|
* @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
83
214
|
* @param {string} rowId - Row ID.
|
|
84
215
|
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
216
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
85
217
|
* @throws {AppwriteException}
|
|
86
218
|
* @returns {Promise<Row>}
|
|
87
219
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
88
220
|
*/
|
|
89
|
-
getRow<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, queries?: string[]): Promise<Row>;
|
|
221
|
+
getRow<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, queries?: string[], transactionId?: string): Promise<Row>;
|
|
90
222
|
/**
|
|
91
223
|
* Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
|
|
92
224
|
*
|
|
@@ -95,6 +227,7 @@ export declare class TablesDB extends Service {
|
|
|
95
227
|
* @param {string} params.rowId - Row ID.
|
|
96
228
|
* @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>} params.data - Row data as JSON object. Include all required columns of the row to be created or updated.
|
|
97
229
|
* @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
230
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
98
231
|
* @throws {AppwriteException}
|
|
99
232
|
* @returns {Promise}
|
|
100
233
|
*/
|
|
@@ -104,6 +237,7 @@ export declare class TablesDB extends Service {
|
|
|
104
237
|
rowId: string;
|
|
105
238
|
data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>;
|
|
106
239
|
permissions?: string[];
|
|
240
|
+
transactionId?: string;
|
|
107
241
|
}): Promise<Row>;
|
|
108
242
|
/**
|
|
109
243
|
* Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
|
|
@@ -113,11 +247,12 @@ export declare class TablesDB extends Service {
|
|
|
113
247
|
* @param {string} rowId - Row ID.
|
|
114
248
|
* @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>} data - Row data as JSON object. Include all required columns of the row to be created or updated.
|
|
115
249
|
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
250
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
116
251
|
* @throws {AppwriteException}
|
|
117
252
|
* @returns {Promise<Row>}
|
|
118
253
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
119
254
|
*/
|
|
120
|
-
upsertRow<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>, permissions?: string[]): Promise<Row>;
|
|
255
|
+
upsertRow<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>, permissions?: string[], transactionId?: string): Promise<Row>;
|
|
121
256
|
/**
|
|
122
257
|
* Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
123
258
|
*
|
|
@@ -126,6 +261,7 @@ export declare class TablesDB extends Service {
|
|
|
126
261
|
* @param {string} params.rowId - Row ID.
|
|
127
262
|
* @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>} params.data - Row data as JSON object. Include only columns and value pairs to be updated.
|
|
128
263
|
* @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
264
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
129
265
|
* @throws {AppwriteException}
|
|
130
266
|
* @returns {Promise}
|
|
131
267
|
*/
|
|
@@ -135,6 +271,7 @@ export declare class TablesDB extends Service {
|
|
|
135
271
|
rowId: string;
|
|
136
272
|
data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>;
|
|
137
273
|
permissions?: string[];
|
|
274
|
+
transactionId?: string;
|
|
138
275
|
}): Promise<Row>;
|
|
139
276
|
/**
|
|
140
277
|
* Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
@@ -144,17 +281,19 @@ export declare class TablesDB extends Service {
|
|
|
144
281
|
* @param {string} rowId - Row ID.
|
|
145
282
|
* @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>} data - Row data as JSON object. Include only columns and value pairs to be updated.
|
|
146
283
|
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
284
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
147
285
|
* @throws {AppwriteException}
|
|
148
286
|
* @returns {Promise<Row>}
|
|
149
287
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
150
288
|
*/
|
|
151
|
-
updateRow<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>, permissions?: string[]): Promise<Row>;
|
|
289
|
+
updateRow<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>, permissions?: string[], transactionId?: string): Promise<Row>;
|
|
152
290
|
/**
|
|
153
291
|
* Delete a row by its unique ID.
|
|
154
292
|
*
|
|
155
293
|
* @param {string} params.databaseId - Database ID.
|
|
156
294
|
* @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
157
295
|
* @param {string} params.rowId - Row ID.
|
|
296
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
158
297
|
* @throws {AppwriteException}
|
|
159
298
|
* @returns {Promise}
|
|
160
299
|
*/
|
|
@@ -162,6 +301,7 @@ export declare class TablesDB extends Service {
|
|
|
162
301
|
databaseId: string;
|
|
163
302
|
tableId: string;
|
|
164
303
|
rowId: string;
|
|
304
|
+
transactionId?: string;
|
|
165
305
|
}): Promise<{}>;
|
|
166
306
|
/**
|
|
167
307
|
* Delete a row by its unique ID.
|
|
@@ -169,11 +309,12 @@ export declare class TablesDB extends Service {
|
|
|
169
309
|
* @param {string} databaseId - Database ID.
|
|
170
310
|
* @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
171
311
|
* @param {string} rowId - Row ID.
|
|
312
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
172
313
|
* @throws {AppwriteException}
|
|
173
314
|
* @returns {Promise<{}>}
|
|
174
315
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
175
316
|
*/
|
|
176
|
-
deleteRow(databaseId: string, tableId: string, rowId: string): Promise<{}>;
|
|
317
|
+
deleteRow(databaseId: string, tableId: string, rowId: string, transactionId?: string): Promise<{}>;
|
|
177
318
|
/**
|
|
178
319
|
* Decrement a specific column of a row by a given value.
|
|
179
320
|
*
|
|
@@ -183,6 +324,7 @@ export declare class TablesDB extends Service {
|
|
|
183
324
|
* @param {string} params.column - Column key.
|
|
184
325
|
* @param {number} params.value - Value to increment the column by. The value must be a number.
|
|
185
326
|
* @param {number} params.min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.
|
|
327
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
186
328
|
* @throws {AppwriteException}
|
|
187
329
|
* @returns {Promise}
|
|
188
330
|
*/
|
|
@@ -193,6 +335,7 @@ export declare class TablesDB extends Service {
|
|
|
193
335
|
column: string;
|
|
194
336
|
value?: number;
|
|
195
337
|
min?: number;
|
|
338
|
+
transactionId?: string;
|
|
196
339
|
}): Promise<Row>;
|
|
197
340
|
/**
|
|
198
341
|
* Decrement a specific column of a row by a given value.
|
|
@@ -203,11 +346,12 @@ export declare class TablesDB extends Service {
|
|
|
203
346
|
* @param {string} column - Column key.
|
|
204
347
|
* @param {number} value - Value to increment the column by. The value must be a number.
|
|
205
348
|
* @param {number} min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.
|
|
349
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
206
350
|
* @throws {AppwriteException}
|
|
207
351
|
* @returns {Promise<Row>}
|
|
208
352
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
209
353
|
*/
|
|
210
|
-
decrementRowColumn<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number): Promise<Row>;
|
|
354
|
+
decrementRowColumn<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string): Promise<Row>;
|
|
211
355
|
/**
|
|
212
356
|
* Increment a specific column of a row by a given value.
|
|
213
357
|
*
|
|
@@ -217,6 +361,7 @@ export declare class TablesDB extends Service {
|
|
|
217
361
|
* @param {string} params.column - Column key.
|
|
218
362
|
* @param {number} params.value - Value to increment the column by. The value must be a number.
|
|
219
363
|
* @param {number} params.max - Maximum value for the column. If the current value is greater than this value, an error will be thrown.
|
|
364
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
220
365
|
* @throws {AppwriteException}
|
|
221
366
|
* @returns {Promise}
|
|
222
367
|
*/
|
|
@@ -227,6 +372,7 @@ export declare class TablesDB extends Service {
|
|
|
227
372
|
column: string;
|
|
228
373
|
value?: number;
|
|
229
374
|
max?: number;
|
|
375
|
+
transactionId?: string;
|
|
230
376
|
}): Promise<Row>;
|
|
231
377
|
/**
|
|
232
378
|
* Increment a specific column of a row by a given value.
|
|
@@ -237,9 +383,10 @@ export declare class TablesDB extends Service {
|
|
|
237
383
|
* @param {string} column - Column key.
|
|
238
384
|
* @param {number} value - Value to increment the column by. The value must be a number.
|
|
239
385
|
* @param {number} max - Maximum value for the column. If the current value is greater than this value, an error will be thrown.
|
|
386
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
240
387
|
* @throws {AppwriteException}
|
|
241
388
|
* @returns {Promise<Row>}
|
|
242
389
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
243
390
|
*/
|
|
244
|
-
incrementRowColumn<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number): Promise<Row>;
|
|
391
|
+
incrementRowColumn<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string): Promise<Row>;
|
|
245
392
|
}
|