node-appwrite 20.0.0 → 20.2.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/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/client.mjs.map +1 -1
- package/dist/models.d.mts +42 -0
- package/dist/models.d.ts +42 -0
- package/dist/services/account.d.mts +49 -0
- package/dist/services/account.d.ts +49 -0
- package/dist/services/account.js +70 -4
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +70 -4
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/databases.d.mts +173 -14
- package/dist/services/databases.d.ts +173 -14
- package/dist/services/databases.js +239 -12
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +239 -12
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +2 -2
- package/dist/services/functions.d.ts +2 -2
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/sites.d.mts +2 -2
- package/dist/services/sites.d.ts +2 -2
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +221 -62
- package/dist/services/tables-db.d.ts +221 -62
- package/dist/services/tables-db.js +239 -12
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs +239 -12
- package/dist/services/tables-db.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -69,6 +69,129 @@ declare class Databases {
|
|
|
69
69
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
70
70
|
*/
|
|
71
71
|
create(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database>;
|
|
72
|
+
/**
|
|
73
|
+
* List transactions across all databases.
|
|
74
|
+
*
|
|
75
|
+
* @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).
|
|
76
|
+
* @throws {AppwriteException}
|
|
77
|
+
* @returns {Promise<Models.TransactionList>}
|
|
78
|
+
*/
|
|
79
|
+
listTransactions(params?: {
|
|
80
|
+
queries?: string[];
|
|
81
|
+
}): Promise<Models.TransactionList>;
|
|
82
|
+
/**
|
|
83
|
+
* List transactions across all databases.
|
|
84
|
+
*
|
|
85
|
+
* @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).
|
|
86
|
+
* @throws {AppwriteException}
|
|
87
|
+
* @returns {Promise<Models.TransactionList>}
|
|
88
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
89
|
+
*/
|
|
90
|
+
listTransactions(queries?: string[]): Promise<Models.TransactionList>;
|
|
91
|
+
/**
|
|
92
|
+
* Create a new transaction.
|
|
93
|
+
*
|
|
94
|
+
* @param {number} params.ttl - Seconds before the transaction expires.
|
|
95
|
+
* @throws {AppwriteException}
|
|
96
|
+
* @returns {Promise<Models.Transaction>}
|
|
97
|
+
*/
|
|
98
|
+
createTransaction(params?: {
|
|
99
|
+
ttl?: number;
|
|
100
|
+
}): Promise<Models.Transaction>;
|
|
101
|
+
/**
|
|
102
|
+
* Create a new transaction.
|
|
103
|
+
*
|
|
104
|
+
* @param {number} ttl - Seconds before the transaction expires.
|
|
105
|
+
* @throws {AppwriteException}
|
|
106
|
+
* @returns {Promise<Models.Transaction>}
|
|
107
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
108
|
+
*/
|
|
109
|
+
createTransaction(ttl?: number): Promise<Models.Transaction>;
|
|
110
|
+
/**
|
|
111
|
+
* Get a transaction by its unique ID.
|
|
112
|
+
*
|
|
113
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
114
|
+
* @throws {AppwriteException}
|
|
115
|
+
* @returns {Promise<Models.Transaction>}
|
|
116
|
+
*/
|
|
117
|
+
getTransaction(params: {
|
|
118
|
+
transactionId: string;
|
|
119
|
+
}): Promise<Models.Transaction>;
|
|
120
|
+
/**
|
|
121
|
+
* Get a transaction by its unique ID.
|
|
122
|
+
*
|
|
123
|
+
* @param {string} transactionId - Transaction ID.
|
|
124
|
+
* @throws {AppwriteException}
|
|
125
|
+
* @returns {Promise<Models.Transaction>}
|
|
126
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
127
|
+
*/
|
|
128
|
+
getTransaction(transactionId: string): Promise<Models.Transaction>;
|
|
129
|
+
/**
|
|
130
|
+
* Update a transaction, to either commit or roll back its operations.
|
|
131
|
+
*
|
|
132
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
133
|
+
* @param {boolean} params.commit - Commit transaction?
|
|
134
|
+
* @param {boolean} params.rollback - Rollback transaction?
|
|
135
|
+
* @throws {AppwriteException}
|
|
136
|
+
* @returns {Promise<Models.Transaction>}
|
|
137
|
+
*/
|
|
138
|
+
updateTransaction(params: {
|
|
139
|
+
transactionId: string;
|
|
140
|
+
commit?: boolean;
|
|
141
|
+
rollback?: boolean;
|
|
142
|
+
}): Promise<Models.Transaction>;
|
|
143
|
+
/**
|
|
144
|
+
* Update a transaction, to either commit or roll back its operations.
|
|
145
|
+
*
|
|
146
|
+
* @param {string} transactionId - Transaction ID.
|
|
147
|
+
* @param {boolean} commit - Commit transaction?
|
|
148
|
+
* @param {boolean} rollback - Rollback transaction?
|
|
149
|
+
* @throws {AppwriteException}
|
|
150
|
+
* @returns {Promise<Models.Transaction>}
|
|
151
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
152
|
+
*/
|
|
153
|
+
updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise<Models.Transaction>;
|
|
154
|
+
/**
|
|
155
|
+
* Delete a transaction by its unique ID.
|
|
156
|
+
*
|
|
157
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
158
|
+
* @throws {AppwriteException}
|
|
159
|
+
* @returns {Promise<{}>}
|
|
160
|
+
*/
|
|
161
|
+
deleteTransaction(params: {
|
|
162
|
+
transactionId: string;
|
|
163
|
+
}): Promise<{}>;
|
|
164
|
+
/**
|
|
165
|
+
* Delete a transaction by its unique ID.
|
|
166
|
+
*
|
|
167
|
+
* @param {string} transactionId - Transaction ID.
|
|
168
|
+
* @throws {AppwriteException}
|
|
169
|
+
* @returns {Promise<{}>}
|
|
170
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
171
|
+
*/
|
|
172
|
+
deleteTransaction(transactionId: string): Promise<{}>;
|
|
173
|
+
/**
|
|
174
|
+
* Create multiple operations in a single transaction.
|
|
175
|
+
*
|
|
176
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
177
|
+
* @param {object[]} params.operations - Array of staged operations.
|
|
178
|
+
* @throws {AppwriteException}
|
|
179
|
+
* @returns {Promise<Models.Transaction>}
|
|
180
|
+
*/
|
|
181
|
+
createOperations(params: {
|
|
182
|
+
transactionId: string;
|
|
183
|
+
operations?: object[];
|
|
184
|
+
}): Promise<Models.Transaction>;
|
|
185
|
+
/**
|
|
186
|
+
* Create multiple operations in a single transaction.
|
|
187
|
+
*
|
|
188
|
+
* @param {string} transactionId - Transaction ID.
|
|
189
|
+
* @param {object[]} operations - Array of staged operations.
|
|
190
|
+
* @throws {AppwriteException}
|
|
191
|
+
* @returns {Promise<Models.Transaction>}
|
|
192
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
193
|
+
*/
|
|
194
|
+
createOperations(transactionId: string, operations?: object[]): Promise<Models.Transaction>;
|
|
72
195
|
/**
|
|
73
196
|
* Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
|
|
74
197
|
*
|
|
@@ -1338,6 +1461,7 @@ declare class Databases {
|
|
|
1338
1461
|
* @param {string} params.databaseId - Database ID.
|
|
1339
1462
|
* @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).
|
|
1340
1463
|
* @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.
|
|
1464
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
1341
1465
|
* @throws {AppwriteException}
|
|
1342
1466
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1343
1467
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
|
|
@@ -1346,6 +1470,7 @@ declare class Databases {
|
|
|
1346
1470
|
databaseId: string;
|
|
1347
1471
|
collectionId: string;
|
|
1348
1472
|
queries?: string[];
|
|
1473
|
+
transactionId?: string;
|
|
1349
1474
|
}): Promise<Models.DocumentList<Document>>;
|
|
1350
1475
|
/**
|
|
1351
1476
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
@@ -1353,11 +1478,12 @@ declare class Databases {
|
|
|
1353
1478
|
* @param {string} databaseId - Database ID.
|
|
1354
1479
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1355
1480
|
* @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.
|
|
1481
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
1356
1482
|
* @throws {AppwriteException}
|
|
1357
1483
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1358
1484
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1359
1485
|
*/
|
|
1360
|
-
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
1486
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise<Models.DocumentList<Document>>;
|
|
1361
1487
|
/**
|
|
1362
1488
|
* 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.
|
|
1363
1489
|
*
|
|
@@ -1366,6 +1492,7 @@ declare class Databases {
|
|
|
1366
1492
|
* @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.
|
|
1367
1493
|
* @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.
|
|
1368
1494
|
* @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).
|
|
1495
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1369
1496
|
* @throws {AppwriteException}
|
|
1370
1497
|
* @returns {Promise<Document>}
|
|
1371
1498
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.
|
|
@@ -1376,6 +1503,7 @@ declare class Databases {
|
|
|
1376
1503
|
documentId: string;
|
|
1377
1504
|
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
|
|
1378
1505
|
permissions?: string[];
|
|
1506
|
+
transactionId?: string;
|
|
1379
1507
|
}): Promise<Document>;
|
|
1380
1508
|
/**
|
|
1381
1509
|
* 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.
|
|
@@ -1385,17 +1513,19 @@ declare class Databases {
|
|
|
1385
1513
|
* @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.
|
|
1386
1514
|
* @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.
|
|
1387
1515
|
* @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).
|
|
1516
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1388
1517
|
* @throws {AppwriteException}
|
|
1389
1518
|
* @returns {Promise<Document>}
|
|
1390
1519
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1391
1520
|
*/
|
|
1392
|
-
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>;
|
|
1521
|
+
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>;
|
|
1393
1522
|
/**
|
|
1394
1523
|
* Create new Documents. 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.
|
|
1395
1524
|
*
|
|
1396
1525
|
* @param {string} params.databaseId - Database ID.
|
|
1397
1526
|
* @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). Make sure to define attributes before creating documents.
|
|
1398
1527
|
* @param {object[]} params.documents - Array of documents data as JSON objects.
|
|
1528
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1399
1529
|
* @throws {AppwriteException}
|
|
1400
1530
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1401
1531
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead.
|
|
@@ -1404,6 +1534,7 @@ declare class Databases {
|
|
|
1404
1534
|
databaseId: string;
|
|
1405
1535
|
collectionId: string;
|
|
1406
1536
|
documents: object[];
|
|
1537
|
+
transactionId?: string;
|
|
1407
1538
|
}): Promise<Models.DocumentList<Document>>;
|
|
1408
1539
|
/**
|
|
1409
1540
|
* Create new Documents. 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.
|
|
@@ -1411,11 +1542,12 @@ declare class Databases {
|
|
|
1411
1542
|
* @param {string} databaseId - Database ID.
|
|
1412
1543
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
|
|
1413
1544
|
* @param {object[]} documents - Array of documents data as JSON objects.
|
|
1545
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1414
1546
|
* @throws {AppwriteException}
|
|
1415
1547
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1416
1548
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1417
1549
|
*/
|
|
1418
|
-
createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
|
|
1550
|
+
createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise<Models.DocumentList<Document>>;
|
|
1419
1551
|
/**
|
|
1420
1552
|
* Create or update Documents. 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.
|
|
1421
1553
|
*
|
|
@@ -1423,6 +1555,7 @@ declare class Databases {
|
|
|
1423
1555
|
* @param {string} params.databaseId - Database ID.
|
|
1424
1556
|
* @param {string} params.collectionId - Collection ID.
|
|
1425
1557
|
* @param {object[]} params.documents - Array of document data as JSON objects. May contain partial documents.
|
|
1558
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1426
1559
|
* @throws {AppwriteException}
|
|
1427
1560
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1428
1561
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead.
|
|
@@ -1431,6 +1564,7 @@ declare class Databases {
|
|
|
1431
1564
|
databaseId: string;
|
|
1432
1565
|
collectionId: string;
|
|
1433
1566
|
documents: object[];
|
|
1567
|
+
transactionId?: string;
|
|
1434
1568
|
}): Promise<Models.DocumentList<Document>>;
|
|
1435
1569
|
/**
|
|
1436
1570
|
* Create or update Documents. 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.
|
|
@@ -1439,11 +1573,12 @@ declare class Databases {
|
|
|
1439
1573
|
* @param {string} databaseId - Database ID.
|
|
1440
1574
|
* @param {string} collectionId - Collection ID.
|
|
1441
1575
|
* @param {object[]} documents - Array of document data as JSON objects. May contain partial documents.
|
|
1576
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1442
1577
|
* @throws {AppwriteException}
|
|
1443
1578
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1444
1579
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1445
1580
|
*/
|
|
1446
|
-
upsertDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
|
|
1581
|
+
upsertDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise<Models.DocumentList<Document>>;
|
|
1447
1582
|
/**
|
|
1448
1583
|
* Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
|
|
1449
1584
|
*
|
|
@@ -1451,6 +1586,7 @@ declare class Databases {
|
|
|
1451
1586
|
* @param {string} params.collectionId - Collection ID.
|
|
1452
1587
|
* @param {object} params.data - Document data as JSON object. Include only attribute and value pairs to be updated.
|
|
1453
1588
|
* @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.
|
|
1589
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1454
1590
|
* @throws {AppwriteException}
|
|
1455
1591
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1456
1592
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead.
|
|
@@ -1460,6 +1596,7 @@ declare class Databases {
|
|
|
1460
1596
|
collectionId: string;
|
|
1461
1597
|
data?: object;
|
|
1462
1598
|
queries?: string[];
|
|
1599
|
+
transactionId?: string;
|
|
1463
1600
|
}): Promise<Models.DocumentList<Document>>;
|
|
1464
1601
|
/**
|
|
1465
1602
|
* Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
|
|
@@ -1468,17 +1605,19 @@ declare class Databases {
|
|
|
1468
1605
|
* @param {string} collectionId - Collection ID.
|
|
1469
1606
|
* @param {object} data - Document data as JSON object. Include only attribute and value pairs to be updated.
|
|
1470
1607
|
* @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.
|
|
1608
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1471
1609
|
* @throws {AppwriteException}
|
|
1472
1610
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1473
1611
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1474
1612
|
*/
|
|
1475
|
-
updateDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
1613
|
+
updateDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string): Promise<Models.DocumentList<Document>>;
|
|
1476
1614
|
/**
|
|
1477
1615
|
* Bulk delete documents using queries, if no queries are passed then all documents are deleted.
|
|
1478
1616
|
*
|
|
1479
1617
|
* @param {string} params.databaseId - Database ID.
|
|
1480
1618
|
* @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).
|
|
1481
1619
|
* @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.
|
|
1620
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1482
1621
|
* @throws {AppwriteException}
|
|
1483
1622
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1484
1623
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRows` instead.
|
|
@@ -1487,6 +1626,7 @@ declare class Databases {
|
|
|
1487
1626
|
databaseId: string;
|
|
1488
1627
|
collectionId: string;
|
|
1489
1628
|
queries?: string[];
|
|
1629
|
+
transactionId?: string;
|
|
1490
1630
|
}): Promise<Models.DocumentList<Document>>;
|
|
1491
1631
|
/**
|
|
1492
1632
|
* Bulk delete documents using queries, if no queries are passed then all documents are deleted.
|
|
@@ -1494,11 +1634,12 @@ declare class Databases {
|
|
|
1494
1634
|
* @param {string} databaseId - Database ID.
|
|
1495
1635
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1496
1636
|
* @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.
|
|
1637
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1497
1638
|
* @throws {AppwriteException}
|
|
1498
1639
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1499
1640
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1500
1641
|
*/
|
|
1501
|
-
deleteDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
1642
|
+
deleteDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise<Models.DocumentList<Document>>;
|
|
1502
1643
|
/**
|
|
1503
1644
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
1504
1645
|
*
|
|
@@ -1506,6 +1647,7 @@ declare class Databases {
|
|
|
1506
1647
|
* @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).
|
|
1507
1648
|
* @param {string} params.documentId - Document ID.
|
|
1508
1649
|
* @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.
|
|
1650
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
1509
1651
|
* @throws {AppwriteException}
|
|
1510
1652
|
* @returns {Promise<Document>}
|
|
1511
1653
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.
|
|
@@ -1515,6 +1657,7 @@ declare class Databases {
|
|
|
1515
1657
|
collectionId: string;
|
|
1516
1658
|
documentId: string;
|
|
1517
1659
|
queries?: string[];
|
|
1660
|
+
transactionId?: string;
|
|
1518
1661
|
}): Promise<Document>;
|
|
1519
1662
|
/**
|
|
1520
1663
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
@@ -1523,11 +1666,12 @@ declare class Databases {
|
|
|
1523
1666
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1524
1667
|
* @param {string} documentId - Document ID.
|
|
1525
1668
|
* @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.
|
|
1669
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
1526
1670
|
* @throws {AppwriteException}
|
|
1527
1671
|
* @returns {Promise<Document>}
|
|
1528
1672
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1529
1673
|
*/
|
|
1530
|
-
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
|
|
1674
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise<Document>;
|
|
1531
1675
|
/**
|
|
1532
1676
|
* 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.
|
|
1533
1677
|
*
|
|
@@ -1536,6 +1680,7 @@ declare class Databases {
|
|
|
1536
1680
|
* @param {string} params.documentId - Document ID.
|
|
1537
1681
|
* @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.
|
|
1538
1682
|
* @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).
|
|
1683
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1539
1684
|
* @throws {AppwriteException}
|
|
1540
1685
|
* @returns {Promise<Document>}
|
|
1541
1686
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.
|
|
@@ -1546,6 +1691,7 @@ declare class Databases {
|
|
|
1546
1691
|
documentId: string;
|
|
1547
1692
|
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
1548
1693
|
permissions?: string[];
|
|
1694
|
+
transactionId?: string;
|
|
1549
1695
|
}): Promise<Document>;
|
|
1550
1696
|
/**
|
|
1551
1697
|
* 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.
|
|
@@ -1555,11 +1701,12 @@ declare class Databases {
|
|
|
1555
1701
|
* @param {string} documentId - Document ID.
|
|
1556
1702
|
* @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.
|
|
1557
1703
|
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
1704
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1558
1705
|
* @throws {AppwriteException}
|
|
1559
1706
|
* @returns {Promise<Document>}
|
|
1560
1707
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1561
1708
|
*/
|
|
1562
|
-
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>;
|
|
1709
|
+
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>;
|
|
1563
1710
|
/**
|
|
1564
1711
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
1565
1712
|
*
|
|
@@ -1568,6 +1715,7 @@ declare class Databases {
|
|
|
1568
1715
|
* @param {string} params.documentId - Document ID.
|
|
1569
1716
|
* @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.
|
|
1570
1717
|
* @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).
|
|
1718
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1571
1719
|
* @throws {AppwriteException}
|
|
1572
1720
|
* @returns {Promise<Document>}
|
|
1573
1721
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.
|
|
@@ -1578,6 +1726,7 @@ declare class Databases {
|
|
|
1578
1726
|
documentId: string;
|
|
1579
1727
|
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
1580
1728
|
permissions?: string[];
|
|
1729
|
+
transactionId?: string;
|
|
1581
1730
|
}): Promise<Document>;
|
|
1582
1731
|
/**
|
|
1583
1732
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
@@ -1587,17 +1736,19 @@ declare class Databases {
|
|
|
1587
1736
|
* @param {string} documentId - Document ID.
|
|
1588
1737
|
* @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.
|
|
1589
1738
|
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
1739
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1590
1740
|
* @throws {AppwriteException}
|
|
1591
1741
|
* @returns {Promise<Document>}
|
|
1592
1742
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1593
1743
|
*/
|
|
1594
|
-
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>;
|
|
1744
|
+
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>;
|
|
1595
1745
|
/**
|
|
1596
1746
|
* Delete a document by its unique ID.
|
|
1597
1747
|
*
|
|
1598
1748
|
* @param {string} params.databaseId - Database ID.
|
|
1599
1749
|
* @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).
|
|
1600
1750
|
* @param {string} params.documentId - Document ID.
|
|
1751
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1601
1752
|
* @throws {AppwriteException}
|
|
1602
1753
|
* @returns {Promise<{}>}
|
|
1603
1754
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.
|
|
@@ -1606,6 +1757,7 @@ declare class Databases {
|
|
|
1606
1757
|
databaseId: string;
|
|
1607
1758
|
collectionId: string;
|
|
1608
1759
|
documentId: string;
|
|
1760
|
+
transactionId?: string;
|
|
1609
1761
|
}): Promise<{}>;
|
|
1610
1762
|
/**
|
|
1611
1763
|
* Delete a document by its unique ID.
|
|
@@ -1613,11 +1765,12 @@ declare class Databases {
|
|
|
1613
1765
|
* @param {string} databaseId - Database ID.
|
|
1614
1766
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1615
1767
|
* @param {string} documentId - Document ID.
|
|
1768
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1616
1769
|
* @throws {AppwriteException}
|
|
1617
1770
|
* @returns {Promise<{}>}
|
|
1618
1771
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1619
1772
|
*/
|
|
1620
|
-
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}>;
|
|
1773
|
+
deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>;
|
|
1621
1774
|
/**
|
|
1622
1775
|
* Decrement a specific attribute of a document by a given value.
|
|
1623
1776
|
*
|
|
@@ -1627,6 +1780,7 @@ declare class Databases {
|
|
|
1627
1780
|
* @param {string} params.attribute - Attribute key.
|
|
1628
1781
|
* @param {number} params.value - Value to increment the attribute by. The value must be a number.
|
|
1629
1782
|
* @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
|
1783
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1630
1784
|
* @throws {AppwriteException}
|
|
1631
1785
|
* @returns {Promise<Document>}
|
|
1632
1786
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.
|
|
@@ -1638,6 +1792,7 @@ declare class Databases {
|
|
|
1638
1792
|
attribute: string;
|
|
1639
1793
|
value?: number;
|
|
1640
1794
|
min?: number;
|
|
1795
|
+
transactionId?: string;
|
|
1641
1796
|
}): Promise<Document>;
|
|
1642
1797
|
/**
|
|
1643
1798
|
* Decrement a specific attribute of a document by a given value.
|
|
@@ -1648,11 +1803,12 @@ declare class Databases {
|
|
|
1648
1803
|
* @param {string} attribute - Attribute key.
|
|
1649
1804
|
* @param {number} value - Value to increment the attribute by. The value must be a number.
|
|
1650
1805
|
* @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
|
1806
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1651
1807
|
* @throws {AppwriteException}
|
|
1652
1808
|
* @returns {Promise<Document>}
|
|
1653
1809
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1654
1810
|
*/
|
|
1655
|
-
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document>;
|
|
1811
|
+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise<Document>;
|
|
1656
1812
|
/**
|
|
1657
1813
|
* Increment a specific attribute of a document by a given value.
|
|
1658
1814
|
*
|
|
@@ -1662,6 +1818,7 @@ declare class Databases {
|
|
|
1662
1818
|
* @param {string} params.attribute - Attribute key.
|
|
1663
1819
|
* @param {number} params.value - Value to increment the attribute by. The value must be a number.
|
|
1664
1820
|
* @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
|
1821
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
1665
1822
|
* @throws {AppwriteException}
|
|
1666
1823
|
* @returns {Promise<Document>}
|
|
1667
1824
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.
|
|
@@ -1673,6 +1830,7 @@ declare class Databases {
|
|
|
1673
1830
|
attribute: string;
|
|
1674
1831
|
value?: number;
|
|
1675
1832
|
max?: number;
|
|
1833
|
+
transactionId?: string;
|
|
1676
1834
|
}): Promise<Document>;
|
|
1677
1835
|
/**
|
|
1678
1836
|
* Increment a specific attribute of a document by a given value.
|
|
@@ -1683,11 +1841,12 @@ declare class Databases {
|
|
|
1683
1841
|
* @param {string} attribute - Attribute key.
|
|
1684
1842
|
* @param {number} value - Value to increment the attribute by. The value must be a number.
|
|
1685
1843
|
* @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
|
1844
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
1686
1845
|
* @throws {AppwriteException}
|
|
1687
1846
|
* @returns {Promise<Document>}
|
|
1688
1847
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1689
1848
|
*/
|
|
1690
|
-
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document>;
|
|
1849
|
+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise<Document>;
|
|
1691
1850
|
/**
|
|
1692
1851
|
* List indexes in the collection.
|
|
1693
1852
|
*
|
|
@@ -1755,7 +1914,7 @@ declare class Databases {
|
|
|
1755
1914
|
*/
|
|
1756
1915
|
createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise<Models.Index>;
|
|
1757
1916
|
/**
|
|
1758
|
-
* Get index by ID.
|
|
1917
|
+
* Get an index by its unique ID.
|
|
1759
1918
|
*
|
|
1760
1919
|
* @param {string} params.databaseId - Database ID.
|
|
1761
1920
|
* @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).
|
|
@@ -1770,7 +1929,7 @@ declare class Databases {
|
|
|
1770
1929
|
key: string;
|
|
1771
1930
|
}): Promise<Models.Index>;
|
|
1772
1931
|
/**
|
|
1773
|
-
* Get index by ID.
|
|
1932
|
+
* Get an index by its unique ID.
|
|
1774
1933
|
*
|
|
1775
1934
|
* @param {string} databaseId - Database ID.
|
|
1776
1935
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|