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.
Files changed (41) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/cjs/sdk.js +371 -17
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +371 -17
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/docs/examples/databases/create-document.md +2 -1
  7. package/docs/examples/databases/create-operations.md +24 -0
  8. package/docs/examples/databases/create-transaction.md +13 -0
  9. package/docs/examples/databases/decrement-document-attribute.md +2 -1
  10. package/docs/examples/databases/delete-document.md +2 -1
  11. package/docs/examples/databases/delete-transaction.md +13 -0
  12. package/docs/examples/databases/get-document.md +2 -1
  13. package/docs/examples/databases/get-transaction.md +13 -0
  14. package/docs/examples/databases/increment-document-attribute.md +2 -1
  15. package/docs/examples/databases/list-documents.md +2 -1
  16. package/docs/examples/databases/list-transactions.md +13 -0
  17. package/docs/examples/databases/update-document.md +2 -1
  18. package/docs/examples/databases/update-transaction.md +15 -0
  19. package/docs/examples/databases/upsert-document.md +2 -1
  20. package/docs/examples/tablesdb/create-operations.md +24 -0
  21. package/docs/examples/tablesdb/create-row.md +2 -1
  22. package/docs/examples/tablesdb/create-transaction.md +13 -0
  23. package/docs/examples/tablesdb/decrement-row-column.md +2 -1
  24. package/docs/examples/tablesdb/delete-row.md +2 -1
  25. package/docs/examples/tablesdb/delete-transaction.md +13 -0
  26. package/docs/examples/tablesdb/get-row.md +2 -1
  27. package/docs/examples/tablesdb/get-transaction.md +13 -0
  28. package/docs/examples/tablesdb/increment-row-column.md +2 -1
  29. package/docs/examples/tablesdb/list-rows.md +2 -1
  30. package/docs/examples/tablesdb/list-transactions.md +13 -0
  31. package/docs/examples/tablesdb/update-row.md +2 -1
  32. package/docs/examples/tablesdb/update-transaction.md +15 -0
  33. package/docs/examples/tablesdb/upsert-row.md +2 -1
  34. package/package.json +1 -1
  35. package/src/client.ts +1 -1
  36. package/src/models.ts +44 -0
  37. package/src/services/databases.ts +414 -56
  38. package/src/services/tables-db.ts +414 -56
  39. package/types/models.d.ts +42 -0
  40. package/types/services/databases.d.ts +155 -8
  41. package/types/services/tables-db.d.ts +155 -8
package/types/models.d.ts CHANGED
@@ -197,6 +197,19 @@ export declare namespace Models {
197
197
  */
198
198
  localeCodes: LocaleCode[];
199
199
  };
200
+ /**
201
+ * Transaction List
202
+ */
203
+ export type TransactionList = {
204
+ /**
205
+ * Total number of transactions that matched your query.
206
+ */
207
+ total: number;
208
+ /**
209
+ * List of transactions.
210
+ */
211
+ transactions: Transaction[];
212
+ };
200
213
  /**
201
214
  * Row
202
215
  */
@@ -1184,6 +1197,35 @@ export declare namespace Models {
1184
1197
  */
1185
1198
  recoveryCode: boolean;
1186
1199
  };
1200
+ /**
1201
+ * Transaction
1202
+ */
1203
+ export type Transaction = {
1204
+ /**
1205
+ * Transaction ID.
1206
+ */
1207
+ $id: string;
1208
+ /**
1209
+ * Transaction creation time in ISO 8601 format.
1210
+ */
1211
+ $createdAt: string;
1212
+ /**
1213
+ * Transaction update date in ISO 8601 format.
1214
+ */
1215
+ $updatedAt: string;
1216
+ /**
1217
+ * Current status of the transaction. One of: pending, committing, committed, rolled_back, failed.
1218
+ */
1219
+ status: string;
1220
+ /**
1221
+ * Number of operations in the transaction.
1222
+ */
1223
+ operations: number;
1224
+ /**
1225
+ * Expiration time in ISO 8601 format.
1226
+ */
1227
+ expiresAt: string;
1228
+ };
1187
1229
  /**
1188
1230
  * Subscriber
1189
1231
  */
@@ -3,12 +3,136 @@ import { Client } from '../client';
3
3
  import type { Models } from '../models';
4
4
  export declare class Databases 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 documents in a given collection. 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.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
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
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
@@ -17,6 +141,7 @@ export declare class Databases extends Service {
17
141
  databaseId: string;
18
142
  collectionId: string;
19
143
  queries?: string[];
144
+ transactionId?: string;
20
145
  }): Promise<Models.DocumentList<Document>>;
21
146
  /**
22
147
  * Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
@@ -24,11 +149,12 @@ export declare class Databases extends Service {
24
149
  * @param {string} databaseId - Database ID.
25
150
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
26
151
  * @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.
152
+ * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
27
153
  * @throws {AppwriteException}
28
154
  * @returns {Promise<Models.DocumentList<Document>>}
29
155
  * @deprecated Use the object parameter style method for a better developer experience.
30
156
  */
31
- listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
157
+ listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise<Models.DocumentList<Document>>;
32
158
  /**
33
159
  * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
34
160
  *
@@ -37,6 +163,7 @@ export declare class Databases extends Service {
37
163
  * @param {string} params.documentId - Document 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.
38
164
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} params.data - Document data as JSON object.
39
165
  * @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).
166
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
40
167
  * @throws {AppwriteException}
41
168
  * @returns {Promise}
42
169
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.
@@ -47,6 +174,7 @@ export declare class Databases extends Service {
47
174
  documentId: string;
48
175
  data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
49
176
  permissions?: string[];
177
+ transactionId?: string;
50
178
  }): Promise<Document>;
51
179
  /**
52
180
  * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
@@ -56,11 +184,12 @@ export declare class Databases extends Service {
56
184
  * @param {string} documentId - Document 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.
57
185
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data - Document data as JSON object.
58
186
  * @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).
187
+ * @param {string} transactionId - Transaction ID for staging the operation.
59
188
  * @throws {AppwriteException}
60
189
  * @returns {Promise<Document>}
61
190
  * @deprecated Use the object parameter style method for a better developer experience.
62
191
  */
63
- createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
192
+ createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[], transactionId?: string): Promise<Document>;
64
193
  /**
65
194
  * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
66
195
  *
@@ -68,6 +197,7 @@ export declare class Databases extends Service {
68
197
  * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
69
198
  * @param {string} params.documentId - Document ID.
70
199
  * @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.
200
+ * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
71
201
  * @throws {AppwriteException}
72
202
  * @returns {Promise}
73
203
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.
@@ -77,6 +207,7 @@ export declare class Databases extends Service {
77
207
  collectionId: string;
78
208
  documentId: string;
79
209
  queries?: string[];
210
+ transactionId?: string;
80
211
  }): Promise<Document>;
81
212
  /**
82
213
  * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
@@ -85,11 +216,12 @@ export declare class Databases extends Service {
85
216
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
86
217
  * @param {string} documentId - Document ID.
87
218
  * @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.
219
+ * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
88
220
  * @throws {AppwriteException}
89
221
  * @returns {Promise<Document>}
90
222
  * @deprecated Use the object parameter style method for a better developer experience.
91
223
  */
92
- getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
224
+ getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise<Document>;
93
225
  /**
94
226
  * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
95
227
  *
@@ -98,6 +230,7 @@ export declare class Databases extends Service {
98
230
  * @param {string} params.documentId - Document ID.
99
231
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} params.data - Document data as JSON object. Include all required attributes of the document to be created or updated.
100
232
  * @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).
233
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
101
234
  * @throws {AppwriteException}
102
235
  * @returns {Promise}
103
236
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.
@@ -108,6 +241,7 @@ export declare class Databases extends Service {
108
241
  documentId: string;
109
242
  data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
110
243
  permissions?: string[];
244
+ transactionId?: string;
111
245
  }): Promise<Document>;
112
246
  /**
113
247
  * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
@@ -117,11 +251,12 @@ export declare class Databases extends Service {
117
251
  * @param {string} documentId - Document ID.
118
252
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data - Document data as JSON object. Include all required attributes of the document to be created or updated.
119
253
  * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
254
+ * @param {string} transactionId - Transaction ID for staging the operation.
120
255
  * @throws {AppwriteException}
121
256
  * @returns {Promise<Document>}
122
257
  * @deprecated Use the object parameter style method for a better developer experience.
123
258
  */
124
- upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
259
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
125
260
  /**
126
261
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
127
262
  *
@@ -130,6 +265,7 @@ export declare class Databases extends Service {
130
265
  * @param {string} params.documentId - Document ID.
131
266
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} params.data - Document data as JSON object. Include only attribute and value pairs to be updated.
132
267
  * @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).
268
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
133
269
  * @throws {AppwriteException}
134
270
  * @returns {Promise}
135
271
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.
@@ -140,6 +276,7 @@ export declare class Databases extends Service {
140
276
  documentId: string;
141
277
  data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
142
278
  permissions?: string[];
279
+ transactionId?: string;
143
280
  }): Promise<Document>;
144
281
  /**
145
282
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
@@ -149,17 +286,19 @@ export declare class Databases extends Service {
149
286
  * @param {string} documentId - Document ID.
150
287
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data - Document data as JSON object. Include only attribute and value pairs to be updated.
151
288
  * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
289
+ * @param {string} transactionId - Transaction ID for staging the operation.
152
290
  * @throws {AppwriteException}
153
291
  * @returns {Promise<Document>}
154
292
  * @deprecated Use the object parameter style method for a better developer experience.
155
293
  */
156
- updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
294
+ updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
157
295
  /**
158
296
  * Delete a document by its unique ID.
159
297
  *
160
298
  * @param {string} params.databaseId - Database ID.
161
299
  * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
162
300
  * @param {string} params.documentId - Document ID.
301
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
163
302
  * @throws {AppwriteException}
164
303
  * @returns {Promise}
165
304
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.
@@ -168,6 +307,7 @@ export declare class Databases extends Service {
168
307
  databaseId: string;
169
308
  collectionId: string;
170
309
  documentId: string;
310
+ transactionId?: string;
171
311
  }): Promise<{}>;
172
312
  /**
173
313
  * Delete a document by its unique ID.
@@ -175,11 +315,12 @@ export declare class Databases extends Service {
175
315
  * @param {string} databaseId - Database ID.
176
316
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
177
317
  * @param {string} documentId - Document ID.
318
+ * @param {string} transactionId - Transaction ID for staging the operation.
178
319
  * @throws {AppwriteException}
179
320
  * @returns {Promise<{}>}
180
321
  * @deprecated Use the object parameter style method for a better developer experience.
181
322
  */
182
- deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}>;
323
+ deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>;
183
324
  /**
184
325
  * Decrement a specific attribute of a document by a given value.
185
326
  *
@@ -189,6 +330,7 @@ export declare class Databases extends Service {
189
330
  * @param {string} params.attribute - Attribute key.
190
331
  * @param {number} params.value - Value to increment the attribute by. The value must be a number.
191
332
  * @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
333
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
192
334
  * @throws {AppwriteException}
193
335
  * @returns {Promise}
194
336
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.
@@ -200,6 +342,7 @@ export declare class Databases extends Service {
200
342
  attribute: string;
201
343
  value?: number;
202
344
  min?: number;
345
+ transactionId?: string;
203
346
  }): Promise<Document>;
204
347
  /**
205
348
  * Decrement a specific attribute of a document by a given value.
@@ -210,11 +353,12 @@ export declare class Databases extends Service {
210
353
  * @param {string} attribute - Attribute key.
211
354
  * @param {number} value - Value to increment the attribute by. The value must be a number.
212
355
  * @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
356
+ * @param {string} transactionId - Transaction ID for staging the operation.
213
357
  * @throws {AppwriteException}
214
358
  * @returns {Promise<Document>}
215
359
  * @deprecated Use the object parameter style method for a better developer experience.
216
360
  */
217
- decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document>;
361
+ decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise<Document>;
218
362
  /**
219
363
  * Increment a specific attribute of a document by a given value.
220
364
  *
@@ -224,6 +368,7 @@ export declare class Databases extends Service {
224
368
  * @param {string} params.attribute - Attribute key.
225
369
  * @param {number} params.value - Value to increment the attribute by. The value must be a number.
226
370
  * @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
371
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
227
372
  * @throws {AppwriteException}
228
373
  * @returns {Promise}
229
374
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.
@@ -235,6 +380,7 @@ export declare class Databases extends Service {
235
380
  attribute: string;
236
381
  value?: number;
237
382
  max?: number;
383
+ transactionId?: string;
238
384
  }): Promise<Document>;
239
385
  /**
240
386
  * Increment a specific attribute of a document by a given value.
@@ -245,9 +391,10 @@ export declare class Databases extends Service {
245
391
  * @param {string} attribute - Attribute key.
246
392
  * @param {number} value - Value to increment the attribute by. The value must be a number.
247
393
  * @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
394
+ * @param {string} transactionId - Transaction ID for staging the operation.
248
395
  * @throws {AppwriteException}
249
396
  * @returns {Promise<Document>}
250
397
  * @deprecated Use the object parameter style method for a better developer experience.
251
398
  */
252
- incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document>;
399
+ incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise<Document>;
253
400
  }