react-native-appwrite 0.16.0 → 0.18.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/CHANGELOG.md +9 -0
- package/dist/cjs/sdk.js +707 -31
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +707 -32
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/list-identities.md +2 -1
- package/docs/examples/account/list-logs.md +2 -1
- package/docs/examples/databases/create-document.md +3 -2
- 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 +3 -1
- package/docs/examples/databases/list-transactions.md +13 -0
- package/docs/examples/databases/update-document.md +3 -2
- package/docs/examples/databases/update-transaction.md +15 -0
- package/docs/examples/databases/upsert-document.md +3 -2
- package/docs/examples/functions/list-executions.md +2 -1
- package/docs/examples/storage/create-file.md +1 -1
- package/docs/examples/storage/list-files.md +2 -1
- package/docs/examples/storage/update-file.md +1 -1
- package/docs/examples/tablesdb/create-operations.md +24 -0
- package/docs/examples/tablesdb/create-row.md +3 -2
- 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 +3 -1
- package/docs/examples/tablesdb/list-transactions.md +13 -0
- package/docs/examples/tablesdb/update-row.md +3 -2
- package/docs/examples/tablesdb/update-transaction.md +15 -0
- package/docs/examples/tablesdb/upsert-row.md +3 -2
- package/docs/examples/teams/list-memberships.md +2 -1
- package/docs/examples/teams/list.md +2 -1
- package/package.json +2 -3
- package/src/client.ts +1 -1
- package/src/enums/execution-status.ts +1 -0
- package/src/index.ts +3 -0
- package/src/models.ts +45 -1
- package/src/operator.ts +308 -0
- package/src/query.ts +6 -6
- package/src/services/account.ts +30 -12
- package/src/services/databases.ts +422 -56
- package/src/services/functions.ts +15 -7
- package/src/services/storage.ts +15 -7
- package/src/services/tables-db.ts +422 -56
- package/src/services/teams.ts +30 -14
- package/types/enums/execution-status.d.ts +2 -1
- package/types/index.d.ts +3 -0
- package/types/models.d.ts +43 -1
- package/types/operator.d.ts +180 -0
- package/types/services/account.d.ts +8 -2
- package/types/services/databases.d.ts +158 -8
- package/types/services/functions.d.ts +4 -1
- package/types/services/storage.d.ts +4 -1
- package/types/services/tables-db.d.ts +158 -8
- package/types/services/teams.d.ts +8 -2
|
@@ -3,12 +3,137 @@ 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.
|
|
136
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
12
137
|
* @throws {AppwriteException}
|
|
13
138
|
* @returns {Promise}
|
|
14
139
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
|
|
@@ -17,6 +142,8 @@ export declare class Databases extends Service {
|
|
|
17
142
|
databaseId: string;
|
|
18
143
|
collectionId: string;
|
|
19
144
|
queries?: string[];
|
|
145
|
+
transactionId?: string;
|
|
146
|
+
total?: boolean;
|
|
20
147
|
}): Promise<Models.DocumentList<Document>>;
|
|
21
148
|
/**
|
|
22
149
|
* 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 +151,13 @@ export declare class Databases extends Service {
|
|
|
24
151
|
* @param {string} databaseId - Database ID.
|
|
25
152
|
* @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
153
|
* @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.
|
|
154
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
155
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
27
156
|
* @throws {AppwriteException}
|
|
28
157
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
29
158
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
30
159
|
*/
|
|
31
|
-
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
160
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean): Promise<Models.DocumentList<Document>>;
|
|
32
161
|
/**
|
|
33
162
|
* 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
163
|
*
|
|
@@ -37,6 +166,7 @@ export declare class Databases extends Service {
|
|
|
37
166
|
* @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
167
|
* @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
168
|
* @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).
|
|
169
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
40
170
|
* @throws {AppwriteException}
|
|
41
171
|
* @returns {Promise}
|
|
42
172
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.
|
|
@@ -47,6 +177,7 @@ export declare class Databases extends Service {
|
|
|
47
177
|
documentId: string;
|
|
48
178
|
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
|
|
49
179
|
permissions?: string[];
|
|
180
|
+
transactionId?: string;
|
|
50
181
|
}): Promise<Document>;
|
|
51
182
|
/**
|
|
52
183
|
* 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 +187,12 @@ export declare class Databases extends Service {
|
|
|
56
187
|
* @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
188
|
* @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
189
|
* @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).
|
|
190
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
59
191
|
* @throws {AppwriteException}
|
|
60
192
|
* @returns {Promise<Document>}
|
|
61
193
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
62
194
|
*/
|
|
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>;
|
|
195
|
+
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
196
|
/**
|
|
65
197
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
66
198
|
*
|
|
@@ -68,6 +200,7 @@ export declare class Databases extends Service {
|
|
|
68
200
|
* @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
201
|
* @param {string} params.documentId - Document ID.
|
|
70
202
|
* @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.
|
|
203
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
71
204
|
* @throws {AppwriteException}
|
|
72
205
|
* @returns {Promise}
|
|
73
206
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.
|
|
@@ -77,6 +210,7 @@ export declare class Databases extends Service {
|
|
|
77
210
|
collectionId: string;
|
|
78
211
|
documentId: string;
|
|
79
212
|
queries?: string[];
|
|
213
|
+
transactionId?: string;
|
|
80
214
|
}): Promise<Document>;
|
|
81
215
|
/**
|
|
82
216
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
@@ -85,11 +219,12 @@ export declare class Databases extends Service {
|
|
|
85
219
|
* @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
220
|
* @param {string} documentId - Document ID.
|
|
87
221
|
* @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.
|
|
222
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
88
223
|
* @throws {AppwriteException}
|
|
89
224
|
* @returns {Promise<Document>}
|
|
90
225
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
91
226
|
*/
|
|
92
|
-
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
|
|
227
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise<Document>;
|
|
93
228
|
/**
|
|
94
229
|
* 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
230
|
*
|
|
@@ -98,6 +233,7 @@ export declare class Databases extends Service {
|
|
|
98
233
|
* @param {string} params.documentId - Document ID.
|
|
99
234
|
* @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
235
|
* @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).
|
|
236
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
101
237
|
* @throws {AppwriteException}
|
|
102
238
|
* @returns {Promise}
|
|
103
239
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.
|
|
@@ -108,6 +244,7 @@ export declare class Databases extends Service {
|
|
|
108
244
|
documentId: string;
|
|
109
245
|
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
110
246
|
permissions?: string[];
|
|
247
|
+
transactionId?: string;
|
|
111
248
|
}): Promise<Document>;
|
|
112
249
|
/**
|
|
113
250
|
* 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 +254,12 @@ export declare class Databases extends Service {
|
|
|
117
254
|
* @param {string} documentId - Document ID.
|
|
118
255
|
* @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
256
|
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
257
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
120
258
|
* @throws {AppwriteException}
|
|
121
259
|
* @returns {Promise<Document>}
|
|
122
260
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
123
261
|
*/
|
|
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>;
|
|
262
|
+
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
263
|
/**
|
|
126
264
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
127
265
|
*
|
|
@@ -130,6 +268,7 @@ export declare class Databases extends Service {
|
|
|
130
268
|
* @param {string} params.documentId - Document ID.
|
|
131
269
|
* @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
270
|
* @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).
|
|
271
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
133
272
|
* @throws {AppwriteException}
|
|
134
273
|
* @returns {Promise}
|
|
135
274
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.
|
|
@@ -140,6 +279,7 @@ export declare class Databases extends Service {
|
|
|
140
279
|
documentId: string;
|
|
141
280
|
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
142
281
|
permissions?: string[];
|
|
282
|
+
transactionId?: string;
|
|
143
283
|
}): Promise<Document>;
|
|
144
284
|
/**
|
|
145
285
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
@@ -149,17 +289,19 @@ export declare class Databases extends Service {
|
|
|
149
289
|
* @param {string} documentId - Document ID.
|
|
150
290
|
* @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
291
|
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
292
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
152
293
|
* @throws {AppwriteException}
|
|
153
294
|
* @returns {Promise<Document>}
|
|
154
295
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
155
296
|
*/
|
|
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>;
|
|
297
|
+
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
298
|
/**
|
|
158
299
|
* Delete a document by its unique ID.
|
|
159
300
|
*
|
|
160
301
|
* @param {string} params.databaseId - Database ID.
|
|
161
302
|
* @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
303
|
* @param {string} params.documentId - Document ID.
|
|
304
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
163
305
|
* @throws {AppwriteException}
|
|
164
306
|
* @returns {Promise}
|
|
165
307
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.
|
|
@@ -168,6 +310,7 @@ export declare class Databases extends Service {
|
|
|
168
310
|
databaseId: string;
|
|
169
311
|
collectionId: string;
|
|
170
312
|
documentId: string;
|
|
313
|
+
transactionId?: string;
|
|
171
314
|
}): Promise<{}>;
|
|
172
315
|
/**
|
|
173
316
|
* Delete a document by its unique ID.
|
|
@@ -175,11 +318,12 @@ export declare class Databases extends Service {
|
|
|
175
318
|
* @param {string} databaseId - Database ID.
|
|
176
319
|
* @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
320
|
* @param {string} documentId - Document ID.
|
|
321
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
178
322
|
* @throws {AppwriteException}
|
|
179
323
|
* @returns {Promise<{}>}
|
|
180
324
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
181
325
|
*/
|
|
182
|
-
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}>;
|
|
326
|
+
deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>;
|
|
183
327
|
/**
|
|
184
328
|
* Decrement a specific attribute of a document by a given value.
|
|
185
329
|
*
|
|
@@ -189,6 +333,7 @@ export declare class Databases extends Service {
|
|
|
189
333
|
* @param {string} params.attribute - Attribute key.
|
|
190
334
|
* @param {number} params.value - Value to increment the attribute by. The value must be a number.
|
|
191
335
|
* @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
|
336
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
192
337
|
* @throws {AppwriteException}
|
|
193
338
|
* @returns {Promise}
|
|
194
339
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.
|
|
@@ -200,6 +345,7 @@ export declare class Databases extends Service {
|
|
|
200
345
|
attribute: string;
|
|
201
346
|
value?: number;
|
|
202
347
|
min?: number;
|
|
348
|
+
transactionId?: string;
|
|
203
349
|
}): Promise<Document>;
|
|
204
350
|
/**
|
|
205
351
|
* Decrement a specific attribute of a document by a given value.
|
|
@@ -210,11 +356,12 @@ export declare class Databases extends Service {
|
|
|
210
356
|
* @param {string} attribute - Attribute key.
|
|
211
357
|
* @param {number} value - Value to increment the attribute by. The value must be a number.
|
|
212
358
|
* @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
|
359
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
213
360
|
* @throws {AppwriteException}
|
|
214
361
|
* @returns {Promise<Document>}
|
|
215
362
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
216
363
|
*/
|
|
217
|
-
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document>;
|
|
364
|
+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise<Document>;
|
|
218
365
|
/**
|
|
219
366
|
* Increment a specific attribute of a document by a given value.
|
|
220
367
|
*
|
|
@@ -224,6 +371,7 @@ export declare class Databases extends Service {
|
|
|
224
371
|
* @param {string} params.attribute - Attribute key.
|
|
225
372
|
* @param {number} params.value - Value to increment the attribute by. The value must be a number.
|
|
226
373
|
* @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
|
374
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
227
375
|
* @throws {AppwriteException}
|
|
228
376
|
* @returns {Promise}
|
|
229
377
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.
|
|
@@ -235,6 +383,7 @@ export declare class Databases extends Service {
|
|
|
235
383
|
attribute: string;
|
|
236
384
|
value?: number;
|
|
237
385
|
max?: number;
|
|
386
|
+
transactionId?: string;
|
|
238
387
|
}): Promise<Document>;
|
|
239
388
|
/**
|
|
240
389
|
* Increment a specific attribute of a document by a given value.
|
|
@@ -245,9 +394,10 @@ export declare class Databases extends Service {
|
|
|
245
394
|
* @param {string} attribute - Attribute key.
|
|
246
395
|
* @param {number} value - Value to increment the attribute by. The value must be a number.
|
|
247
396
|
* @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
|
397
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
248
398
|
* @throws {AppwriteException}
|
|
249
399
|
* @returns {Promise<Document>}
|
|
250
400
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
251
401
|
*/
|
|
252
|
-
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document>;
|
|
402
|
+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise<Document>;
|
|
253
403
|
}
|
|
@@ -9,23 +9,26 @@ export declare class Functions extends Service {
|
|
|
9
9
|
*
|
|
10
10
|
* @param {string} params.functionId - Function ID.
|
|
11
11
|
* @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. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
12
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
12
13
|
* @throws {AppwriteException}
|
|
13
14
|
* @returns {Promise}
|
|
14
15
|
*/
|
|
15
16
|
listExecutions(params: {
|
|
16
17
|
functionId: string;
|
|
17
18
|
queries?: string[];
|
|
19
|
+
total?: boolean;
|
|
18
20
|
}): Promise<Models.ExecutionList>;
|
|
19
21
|
/**
|
|
20
22
|
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
|
21
23
|
*
|
|
22
24
|
* @param {string} functionId - Function ID.
|
|
23
25
|
* @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. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
26
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
24
27
|
* @throws {AppwriteException}
|
|
25
28
|
* @returns {Promise<Models.ExecutionList>}
|
|
26
29
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
27
30
|
*/
|
|
28
|
-
listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList>;
|
|
31
|
+
listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
|
|
29
32
|
/**
|
|
30
33
|
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
|
31
34
|
*
|
|
@@ -12,6 +12,7 @@ export declare class Storage extends Service {
|
|
|
12
12
|
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
13
13
|
* @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. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
14
14
|
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
15
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
15
16
|
* @throws {AppwriteException}
|
|
16
17
|
* @returns {Promise}
|
|
17
18
|
*/
|
|
@@ -19,6 +20,7 @@ export declare class Storage extends Service {
|
|
|
19
20
|
bucketId: string;
|
|
20
21
|
queries?: string[];
|
|
21
22
|
search?: string;
|
|
23
|
+
total?: boolean;
|
|
22
24
|
}): Promise<Models.FileList>;
|
|
23
25
|
/**
|
|
24
26
|
* Get a list of all the user files. You can use the query params to filter your results.
|
|
@@ -26,11 +28,12 @@ export declare class Storage extends Service {
|
|
|
26
28
|
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
27
29
|
* @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. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
28
30
|
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
31
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
29
32
|
* @throws {AppwriteException}
|
|
30
33
|
* @returns {Promise<Models.FileList>}
|
|
31
34
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
32
35
|
*/
|
|
33
|
-
listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>;
|
|
36
|
+
listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.FileList>;
|
|
34
37
|
/**
|
|
35
38
|
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
|
36
39
|
*
|