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