@appwrite.io/console 1.9.0 → 1.10.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.
Files changed (55) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/CHANGELOG.md +45 -6
  3. package/README.md +82 -2
  4. package/dist/cjs/sdk.js +246 -193
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +246 -193
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +246 -193
  9. package/docs/examples/databases/create-document.md +1 -3
  10. package/docs/examples/databases/create-documents.md +1 -1
  11. package/docs/examples/functions/create-execution.md +1 -1
  12. package/docs/examples/organizations/get-available-credits.md +13 -0
  13. package/docs/examples/organizations/update-projects.md +14 -0
  14. package/docs/examples/vcs/get-repository-contents.md +2 -1
  15. package/package.json +1 -1
  16. package/src/client.ts +1 -1
  17. package/src/models.ts +241 -9
  18. package/src/services/account.ts +97 -36
  19. package/src/services/avatars.ts +26 -20
  20. package/src/services/backups.ts +11 -0
  21. package/src/services/console.ts +8 -1
  22. package/src/services/databases.ts +97 -33
  23. package/src/services/domains.ts +111 -69
  24. package/src/services/functions.ts +37 -8
  25. package/src/services/graphql.ts +1 -0
  26. package/src/services/health.ts +26 -1
  27. package/src/services/locale.ts +9 -2
  28. package/src/services/messaging.ts +53 -8
  29. package/src/services/migrations.ts +12 -0
  30. package/src/services/organizations.ts +106 -16
  31. package/src/services/project.ts +5 -0
  32. package/src/services/projects.ts +50 -0
  33. package/src/services/proxy.ts +7 -0
  34. package/src/services/sites.ts +32 -4
  35. package/src/services/storage.ts +23 -9
  36. package/src/services/teams.ts +30 -17
  37. package/src/services/tokens.ts +4 -0
  38. package/src/services/users.ts +69 -27
  39. package/src/services/vcs.ts +16 -4
  40. package/types/models.d.ts +228 -192
  41. package/types/services/account.d.ts +36 -36
  42. package/types/services/avatars.d.ts +20 -20
  43. package/types/services/console.d.ts +1 -1
  44. package/types/services/databases.d.ts +43 -33
  45. package/types/services/domains.d.ts +69 -69
  46. package/types/services/functions.d.ts +8 -8
  47. package/types/services/health.d.ts +1 -1
  48. package/types/services/locale.d.ts +2 -2
  49. package/types/services/messaging.d.ts +8 -8
  50. package/types/services/organizations.d.ts +33 -16
  51. package/types/services/sites.d.ts +4 -4
  52. package/types/services/storage.d.ts +9 -9
  53. package/types/services/teams.d.ts +17 -17
  54. package/types/services/users.d.ts +27 -27
  55. package/types/services/vcs.d.ts +4 -4
@@ -42,9 +42,10 @@ export class Databases {
42
42
  payload
43
43
  );
44
44
  }
45
+
45
46
  /**
46
47
  * Create a new Database.
47
-
48
+ *
48
49
  *
49
50
  * @param {string} databaseId
50
51
  * @param {string} name
@@ -83,6 +84,7 @@ export class Databases {
83
84
  payload
84
85
  );
85
86
  }
87
+
86
88
  /**
87
89
  * Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
88
90
  *
@@ -108,6 +110,7 @@ export class Databases {
108
110
  payload
109
111
  );
110
112
  }
113
+
111
114
  /**
112
115
  * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
113
116
  *
@@ -133,6 +136,7 @@ export class Databases {
133
136
  payload
134
137
  );
135
138
  }
139
+
136
140
  /**
137
141
  * Update a database by its unique ID.
138
142
  *
@@ -170,6 +174,7 @@ export class Databases {
170
174
  payload
171
175
  );
172
176
  }
177
+
173
178
  /**
174
179
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
175
180
  *
@@ -196,6 +201,7 @@ export class Databases {
196
201
  payload
197
202
  );
198
203
  }
204
+
199
205
  /**
200
206
  * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.
201
207
  *
@@ -229,6 +235,7 @@ export class Databases {
229
235
  payload
230
236
  );
231
237
  }
238
+
232
239
  /**
233
240
  * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
234
241
  *
@@ -281,6 +288,7 @@ export class Databases {
281
288
  payload
282
289
  );
283
290
  }
291
+
284
292
  /**
285
293
  * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
286
294
  *
@@ -310,6 +318,7 @@ export class Databases {
310
318
  payload
311
319
  );
312
320
  }
321
+
313
322
  /**
314
323
  * Update a collection by its unique ID.
315
324
  *
@@ -359,6 +368,7 @@ export class Databases {
359
368
  payload
360
369
  );
361
370
  }
371
+
362
372
  /**
363
373
  * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
364
374
  *
@@ -389,6 +399,7 @@ export class Databases {
389
399
  payload
390
400
  );
391
401
  }
402
+
392
403
  /**
393
404
  * List attributes in the collection.
394
405
  *
@@ -422,9 +433,10 @@ export class Databases {
422
433
  payload
423
434
  );
424
435
  }
436
+
425
437
  /**
426
438
  * Create a boolean attribute.
427
-
439
+ *
428
440
  *
429
441
  * @param {string} databaseId
430
442
  * @param {string} collectionId
@@ -475,6 +487,7 @@ export class Databases {
475
487
  payload
476
488
  );
477
489
  }
490
+
478
491
  /**
479
492
  * Update a boolean attribute. Changing the `default` value will not update already existing documents.
480
493
  *
@@ -527,6 +540,7 @@ export class Databases {
527
540
  payload
528
541
  );
529
542
  }
543
+
530
544
  /**
531
545
  * Create a date time attribute according to the ISO 8601 standard.
532
546
  *
@@ -579,6 +593,7 @@ export class Databases {
579
593
  payload
580
594
  );
581
595
  }
596
+
582
597
  /**
583
598
  * Update a date time attribute. Changing the `default` value will not update already existing documents.
584
599
  *
@@ -631,9 +646,10 @@ export class Databases {
631
646
  payload
632
647
  );
633
648
  }
649
+
634
650
  /**
635
651
  * Create an email attribute.
636
-
652
+ *
637
653
  *
638
654
  * @param {string} databaseId
639
655
  * @param {string} collectionId
@@ -684,9 +700,10 @@ export class Databases {
684
700
  payload
685
701
  );
686
702
  }
703
+
687
704
  /**
688
705
  * Update an email attribute. Changing the `default` value will not update already existing documents.
689
-
706
+ *
690
707
  *
691
708
  * @param {string} databaseId
692
709
  * @param {string} collectionId
@@ -737,9 +754,10 @@ export class Databases {
737
754
  payload
738
755
  );
739
756
  }
757
+
740
758
  /**
741
759
  * Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
742
-
760
+ *
743
761
  *
744
762
  * @param {string} databaseId
745
763
  * @param {string} collectionId
@@ -797,9 +815,10 @@ export class Databases {
797
815
  payload
798
816
  );
799
817
  }
818
+
800
819
  /**
801
820
  * Update an enum attribute. Changing the `default` value will not update already existing documents.
802
-
821
+ *
803
822
  *
804
823
  * @param {string} databaseId
805
824
  * @param {string} collectionId
@@ -857,9 +876,10 @@ export class Databases {
857
876
  payload
858
877
  );
859
878
  }
879
+
860
880
  /**
861
881
  * Create a float attribute. Optionally, minimum and maximum values can be provided.
862
-
882
+ *
863
883
  *
864
884
  * @param {string} databaseId
865
885
  * @param {string} collectionId
@@ -918,9 +938,10 @@ export class Databases {
918
938
  payload
919
939
  );
920
940
  }
941
+
921
942
  /**
922
943
  * Update a float attribute. Changing the `default` value will not update already existing documents.
923
-
944
+ *
924
945
  *
925
946
  * @param {string} databaseId
926
947
  * @param {string} collectionId
@@ -979,9 +1000,10 @@ export class Databases {
979
1000
  payload
980
1001
  );
981
1002
  }
1003
+
982
1004
  /**
983
1005
  * Create an integer attribute. Optionally, minimum and maximum values can be provided.
984
-
1006
+ *
985
1007
  *
986
1008
  * @param {string} databaseId
987
1009
  * @param {string} collectionId
@@ -1040,9 +1062,10 @@ export class Databases {
1040
1062
  payload
1041
1063
  );
1042
1064
  }
1065
+
1043
1066
  /**
1044
1067
  * Update an integer attribute. Changing the `default` value will not update already existing documents.
1045
-
1068
+ *
1046
1069
  *
1047
1070
  * @param {string} databaseId
1048
1071
  * @param {string} collectionId
@@ -1101,9 +1124,10 @@ export class Databases {
1101
1124
  payload
1102
1125
  );
1103
1126
  }
1127
+
1104
1128
  /**
1105
1129
  * Create IP address attribute.
1106
-
1130
+ *
1107
1131
  *
1108
1132
  * @param {string} databaseId
1109
1133
  * @param {string} collectionId
@@ -1154,9 +1178,10 @@ export class Databases {
1154
1178
  payload
1155
1179
  );
1156
1180
  }
1181
+
1157
1182
  /**
1158
1183
  * Update an ip attribute. Changing the `default` value will not update already existing documents.
1159
-
1184
+ *
1160
1185
  *
1161
1186
  * @param {string} databaseId
1162
1187
  * @param {string} collectionId
@@ -1207,9 +1232,10 @@ export class Databases {
1207
1232
  payload
1208
1233
  );
1209
1234
  }
1235
+
1210
1236
  /**
1211
1237
  * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
1212
-
1238
+ *
1213
1239
  *
1214
1240
  * @param {string} databaseId
1215
1241
  * @param {string} collectionId
@@ -1268,9 +1294,10 @@ export class Databases {
1268
1294
  payload
1269
1295
  );
1270
1296
  }
1297
+
1271
1298
  /**
1272
1299
  * Create a string attribute.
1273
-
1300
+ *
1274
1301
  *
1275
1302
  * @param {string} databaseId
1276
1303
  * @param {string} collectionId
@@ -1332,9 +1359,10 @@ export class Databases {
1332
1359
  payload
1333
1360
  );
1334
1361
  }
1362
+
1335
1363
  /**
1336
1364
  * Update a string attribute. Changing the `default` value will not update already existing documents.
1337
-
1365
+ *
1338
1366
  *
1339
1367
  * @param {string} databaseId
1340
1368
  * @param {string} collectionId
@@ -1389,9 +1417,10 @@ export class Databases {
1389
1417
  payload
1390
1418
  );
1391
1419
  }
1420
+
1392
1421
  /**
1393
1422
  * Create a URL attribute.
1394
-
1423
+ *
1395
1424
  *
1396
1425
  * @param {string} databaseId
1397
1426
  * @param {string} collectionId
@@ -1442,9 +1471,10 @@ export class Databases {
1442
1471
  payload
1443
1472
  );
1444
1473
  }
1474
+
1445
1475
  /**
1446
1476
  * Update an url attribute. Changing the `default` value will not update already existing documents.
1447
-
1477
+ *
1448
1478
  *
1449
1479
  * @param {string} databaseId
1450
1480
  * @param {string} collectionId
@@ -1495,6 +1525,7 @@ export class Databases {
1495
1525
  payload
1496
1526
  );
1497
1527
  }
1528
+
1498
1529
  /**
1499
1530
  * Get attribute by ID.
1500
1531
  *
@@ -1528,6 +1559,7 @@ export class Databases {
1528
1559
  payload
1529
1560
  );
1530
1561
  }
1562
+
1531
1563
  /**
1532
1564
  * Deletes an attribute.
1533
1565
  *
@@ -1562,9 +1594,10 @@ export class Databases {
1562
1594
  payload
1563
1595
  );
1564
1596
  }
1597
+
1565
1598
  /**
1566
1599
  * Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
1567
-
1600
+ *
1568
1601
  *
1569
1602
  * @param {string} databaseId
1570
1603
  * @param {string} collectionId
@@ -1605,6 +1638,7 @@ export class Databases {
1605
1638
  payload
1606
1639
  );
1607
1640
  }
1641
+
1608
1642
  /**
1609
1643
  * Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
1610
1644
  *
@@ -1614,7 +1648,7 @@ export class Databases {
1614
1648
  * @throws {AppwriteException}
1615
1649
  * @returns {Promise<Models.DocumentList<Document>>}
1616
1650
  */
1617
- listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
1651
+ listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
1618
1652
  if (typeof databaseId === 'undefined') {
1619
1653
  throw new AppwriteException('Missing required parameter: "databaseId"');
1620
1654
  }
@@ -1638,18 +1672,19 @@ export class Databases {
1638
1672
  payload
1639
1673
  );
1640
1674
  }
1675
+
1641
1676
  /**
1642
1677
  * 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.
1643
1678
  *
1644
1679
  * @param {string} databaseId
1645
1680
  * @param {string} collectionId
1646
1681
  * @param {string} documentId
1647
- * @param {Omit<Document, keyof Models.Document>} data
1682
+ * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data
1648
1683
  * @param {string[]} permissions
1649
1684
  * @throws {AppwriteException}
1650
1685
  * @returns {Promise<Document>}
1651
1686
  */
1652
- createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document> {
1687
+ 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> {
1653
1688
  if (typeof databaseId === 'undefined') {
1654
1689
  throw new AppwriteException('Missing required parameter: "databaseId"');
1655
1690
  }
@@ -1686,7 +1721,10 @@ export class Databases {
1686
1721
  payload
1687
1722
  );
1688
1723
  }
1724
+
1689
1725
  /**
1726
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1727
+ *
1690
1728
  * 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.
1691
1729
  *
1692
1730
  * @param {string} databaseId
@@ -1695,7 +1733,7 @@ export class Databases {
1695
1733
  * @throws {AppwriteException}
1696
1734
  * @returns {Promise<Models.DocumentList<Document>>}
1697
1735
  */
1698
- createDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>> {
1736
+ createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>> {
1699
1737
  if (typeof databaseId === 'undefined') {
1700
1738
  throw new AppwriteException('Missing required parameter: "databaseId"');
1701
1739
  }
@@ -1723,9 +1761,12 @@ export class Databases {
1723
1761
  payload
1724
1762
  );
1725
1763
  }
1764
+
1726
1765
  /**
1766
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1767
+ *
1727
1768
  * 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.
1728
-
1769
+ *
1729
1770
  *
1730
1771
  * @param {string} databaseId
1731
1772
  * @param {string} collectionId
@@ -1733,7 +1774,7 @@ export class Databases {
1733
1774
  * @throws {AppwriteException}
1734
1775
  * @returns {Promise<Models.DocumentList<Document>>}
1735
1776
  */
1736
- upsertDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>> {
1777
+ upsertDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>> {
1737
1778
  if (typeof databaseId === 'undefined') {
1738
1779
  throw new AppwriteException('Missing required parameter: "databaseId"');
1739
1780
  }
@@ -1761,7 +1802,10 @@ export class Databases {
1761
1802
  payload
1762
1803
  );
1763
1804
  }
1805
+
1764
1806
  /**
1807
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1808
+ *
1765
1809
  * 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.
1766
1810
  *
1767
1811
  * @param {string} databaseId
@@ -1771,7 +1815,7 @@ export class Databases {
1771
1815
  * @throws {AppwriteException}
1772
1816
  * @returns {Promise<Models.DocumentList<Document>>}
1773
1817
  */
1774
- updateDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>> {
1818
+ updateDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>> {
1775
1819
  if (typeof databaseId === 'undefined') {
1776
1820
  throw new AppwriteException('Missing required parameter: "databaseId"');
1777
1821
  }
@@ -1799,7 +1843,10 @@ export class Databases {
1799
1843
  payload
1800
1844
  );
1801
1845
  }
1846
+
1802
1847
  /**
1848
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1849
+ *
1803
1850
  * Bulk delete documents using queries, if no queries are passed then all documents are deleted.
1804
1851
  *
1805
1852
  * @param {string} databaseId
@@ -1808,7 +1855,7 @@ export class Databases {
1808
1855
  * @throws {AppwriteException}
1809
1856
  * @returns {Promise<Models.DocumentList<Document>>}
1810
1857
  */
1811
- deleteDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
1858
+ deleteDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
1812
1859
  if (typeof databaseId === 'undefined') {
1813
1860
  throw new AppwriteException('Missing required parameter: "databaseId"');
1814
1861
  }
@@ -1833,6 +1880,7 @@ export class Databases {
1833
1880
  payload
1834
1881
  );
1835
1882
  }
1883
+
1836
1884
  /**
1837
1885
  * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
1838
1886
  *
@@ -1843,7 +1891,7 @@ export class Databases {
1843
1891
  * @throws {AppwriteException}
1844
1892
  * @returns {Promise<Document>}
1845
1893
  */
1846
- getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
1894
+ getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
1847
1895
  if (typeof databaseId === 'undefined') {
1848
1896
  throw new AppwriteException('Missing required parameter: "databaseId"');
1849
1897
  }
@@ -1870,7 +1918,10 @@ export class Databases {
1870
1918
  payload
1871
1919
  );
1872
1920
  }
1921
+
1873
1922
  /**
1923
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
1924
+ *
1874
1925
  * 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.
1875
1926
  *
1876
1927
  * @param {string} databaseId
@@ -1881,7 +1932,7 @@ export class Databases {
1881
1932
  * @throws {AppwriteException}
1882
1933
  * @returns {Promise<Document>}
1883
1934
  */
1884
- upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
1935
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
1885
1936
  if (typeof databaseId === 'undefined') {
1886
1937
  throw new AppwriteException('Missing required parameter: "databaseId"');
1887
1938
  }
@@ -1915,18 +1966,19 @@ export class Databases {
1915
1966
  payload
1916
1967
  );
1917
1968
  }
1969
+
1918
1970
  /**
1919
1971
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
1920
1972
  *
1921
1973
  * @param {string} databaseId
1922
1974
  * @param {string} collectionId
1923
1975
  * @param {string} documentId
1924
- * @param {Partial<Omit<Document, keyof Models.Document>>} data
1976
+ * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data
1925
1977
  * @param {string[]} permissions
1926
1978
  * @throws {AppwriteException}
1927
1979
  * @returns {Promise<Document>}
1928
1980
  */
1929
- updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document> {
1981
+ 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> {
1930
1982
  if (typeof databaseId === 'undefined') {
1931
1983
  throw new AppwriteException('Missing required parameter: "databaseId"');
1932
1984
  }
@@ -1957,6 +2009,7 @@ export class Databases {
1957
2009
  payload
1958
2010
  );
1959
2011
  }
2012
+
1960
2013
  /**
1961
2014
  * Delete a document by its unique ID.
1962
2015
  *
@@ -1991,6 +2044,7 @@ export class Databases {
1991
2044
  payload
1992
2045
  );
1993
2046
  }
2047
+
1994
2048
  /**
1995
2049
  * Get the document activity logs list by its unique ID.
1996
2050
  *
@@ -2028,6 +2082,7 @@ export class Databases {
2028
2082
  payload
2029
2083
  );
2030
2084
  }
2085
+
2031
2086
  /**
2032
2087
  * Decrement a specific attribute of a document by a given value.
2033
2088
  *
@@ -2040,7 +2095,7 @@ export class Databases {
2040
2095
  * @throws {AppwriteException}
2041
2096
  * @returns {Promise<Document>}
2042
2097
  */
2043
- decrementDocumentAttribute<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document> {
2098
+ decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document> {
2044
2099
  if (typeof databaseId === 'undefined') {
2045
2100
  throw new AppwriteException('Missing required parameter: "databaseId"');
2046
2101
  }
@@ -2074,6 +2129,7 @@ export class Databases {
2074
2129
  payload
2075
2130
  );
2076
2131
  }
2132
+
2077
2133
  /**
2078
2134
  * Increment a specific attribute of a document by a given value.
2079
2135
  *
@@ -2086,7 +2142,7 @@ export class Databases {
2086
2142
  * @throws {AppwriteException}
2087
2143
  * @returns {Promise<Document>}
2088
2144
  */
2089
- incrementDocumentAttribute<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document> {
2145
+ incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document> {
2090
2146
  if (typeof databaseId === 'undefined') {
2091
2147
  throw new AppwriteException('Missing required parameter: "databaseId"');
2092
2148
  }
@@ -2120,6 +2176,7 @@ export class Databases {
2120
2176
  payload
2121
2177
  );
2122
2178
  }
2179
+
2123
2180
  /**
2124
2181
  * List indexes in the collection.
2125
2182
  *
@@ -2153,9 +2210,10 @@ export class Databases {
2153
2210
  payload
2154
2211
  );
2155
2212
  }
2213
+
2156
2214
  /**
2157
2215
  * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
2158
- Attributes can be `key`, `fulltext`, and `unique`.
2216
+ * Attributes can be `key`, `fulltext`, and `unique`.
2159
2217
  *
2160
2218
  * @param {string} databaseId
2161
2219
  * @param {string} collectionId
@@ -2213,6 +2271,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
2213
2271
  payload
2214
2272
  );
2215
2273
  }
2274
+
2216
2275
  /**
2217
2276
  * Get index by ID.
2218
2277
  *
@@ -2246,6 +2305,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
2246
2305
  payload
2247
2306
  );
2248
2307
  }
2308
+
2249
2309
  /**
2250
2310
  * Delete an index.
2251
2311
  *
@@ -2280,6 +2340,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
2280
2340
  payload
2281
2341
  );
2282
2342
  }
2343
+
2283
2344
  /**
2284
2345
  * Get the collection activity logs list by its unique ID.
2285
2346
  *
@@ -2313,6 +2374,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
2313
2374
  payload
2314
2375
  );
2315
2376
  }
2377
+
2316
2378
  /**
2317
2379
  * Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
2318
2380
  *
@@ -2346,6 +2408,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
2346
2408
  payload
2347
2409
  );
2348
2410
  }
2411
+
2349
2412
  /**
2350
2413
  * Get the database activity logs list by its unique ID.
2351
2414
  *
@@ -2375,6 +2438,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
2375
2438
  payload
2376
2439
  );
2377
2440
  }
2441
+
2378
2442
  /**
2379
2443
  * Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
2380
2444
  *