node-appwrite 17.1.0 → 17.2.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 (77) hide show
  1. package/dist/client.js +2 -2
  2. package/dist/client.js.map +1 -1
  3. package/dist/client.mjs +2 -2
  4. package/dist/client.mjs.map +1 -1
  5. package/dist/models.d.mts +122 -97
  6. package/dist/models.d.ts +122 -97
  7. package/dist/services/account.d.mts +31 -31
  8. package/dist/services/account.d.ts +31 -31
  9. package/dist/services/account.js +81 -81
  10. package/dist/services/account.js.map +1 -1
  11. package/dist/services/account.mjs +81 -81
  12. package/dist/services/account.mjs.map +1 -1
  13. package/dist/services/avatars.d.mts +20 -20
  14. package/dist/services/avatars.d.ts +20 -20
  15. package/dist/services/avatars.js +79 -79
  16. package/dist/services/avatars.js.map +1 -1
  17. package/dist/services/avatars.mjs +79 -79
  18. package/dist/services/avatars.mjs.map +1 -1
  19. package/dist/services/databases.d.mts +67 -40
  20. package/dist/services/databases.d.ts +67 -40
  21. package/dist/services/databases.js +384 -295
  22. package/dist/services/databases.js.map +1 -1
  23. package/dist/services/databases.mjs +384 -295
  24. package/dist/services/databases.mjs.map +1 -1
  25. package/dist/services/functions.d.mts +8 -8
  26. package/dist/services/functions.d.ts +8 -8
  27. package/dist/services/functions.js +38 -38
  28. package/dist/services/functions.js.map +1 -1
  29. package/dist/services/functions.mjs +38 -38
  30. package/dist/services/functions.mjs.map +1 -1
  31. package/dist/services/graphql.js.map +1 -1
  32. package/dist/services/graphql.mjs.map +1 -1
  33. package/dist/services/health.d.mts +1 -1
  34. package/dist/services/health.d.ts +1 -1
  35. package/dist/services/health.js +8 -8
  36. package/dist/services/health.js.map +1 -1
  37. package/dist/services/health.mjs +8 -8
  38. package/dist/services/health.mjs.map +1 -1
  39. package/dist/services/locale.d.mts +2 -2
  40. package/dist/services/locale.d.ts +2 -2
  41. package/dist/services/locale.js +7 -7
  42. package/dist/services/locale.js.map +1 -1
  43. package/dist/services/locale.mjs +7 -7
  44. package/dist/services/locale.mjs.map +1 -1
  45. package/dist/services/messaging.d.mts +8 -8
  46. package/dist/services/messaging.d.ts +8 -8
  47. package/dist/services/messaging.js +94 -94
  48. package/dist/services/messaging.js.map +1 -1
  49. package/dist/services/messaging.mjs +94 -94
  50. package/dist/services/messaging.mjs.map +1 -1
  51. package/dist/services/sites.d.mts +4 -4
  52. package/dist/services/sites.d.ts +4 -4
  53. package/dist/services/sites.js +24 -24
  54. package/dist/services/sites.js.map +1 -1
  55. package/dist/services/sites.mjs +24 -24
  56. package/dist/services/sites.mjs.map +1 -1
  57. package/dist/services/storage.d.mts +7 -7
  58. package/dist/services/storage.d.ts +7 -7
  59. package/dist/services/storage.js +16 -16
  60. package/dist/services/storage.js.map +1 -1
  61. package/dist/services/storage.mjs +16 -16
  62. package/dist/services/storage.mjs.map +1 -1
  63. package/dist/services/teams.d.mts +17 -17
  64. package/dist/services/teams.d.ts +17 -17
  65. package/dist/services/teams.js +40 -40
  66. package/dist/services/teams.js.map +1 -1
  67. package/dist/services/teams.mjs +40 -40
  68. package/dist/services/teams.mjs.map +1 -1
  69. package/dist/services/tokens.js.map +1 -1
  70. package/dist/services/tokens.mjs.map +1 -1
  71. package/dist/services/users.d.mts +26 -26
  72. package/dist/services/users.d.ts +26 -26
  73. package/dist/services/users.js +26 -26
  74. package/dist/services/users.js.map +1 -1
  75. package/dist/services/users.mjs +26 -26
  76. package/dist/services/users.mjs.map +1 -1
  77. package/package.json +1 -1
@@ -19,7 +19,7 @@ declare class Databases {
19
19
  list(queries?: string[], search?: string): Promise<Models.DatabaseList>;
20
20
  /**
21
21
  * Create a new Database.
22
-
22
+ *
23
23
  *
24
24
  * @param {string} databaseId
25
25
  * @param {string} name
@@ -120,7 +120,7 @@ declare class Databases {
120
120
  listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.AttributeList>;
121
121
  /**
122
122
  * Create a boolean attribute.
123
-
123
+ *
124
124
  *
125
125
  * @param {string} databaseId
126
126
  * @param {string} collectionId
@@ -173,7 +173,7 @@ declare class Databases {
173
173
  updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeDatetime>;
174
174
  /**
175
175
  * Create an email attribute.
176
-
176
+ *
177
177
  *
178
178
  * @param {string} databaseId
179
179
  * @param {string} collectionId
@@ -187,7 +187,7 @@ declare class Databases {
187
187
  createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
188
188
  /**
189
189
  * Update an email attribute. Changing the `default` value will not update already existing documents.
190
-
190
+ *
191
191
  *
192
192
  * @param {string} databaseId
193
193
  * @param {string} collectionId
@@ -201,7 +201,7 @@ declare class Databases {
201
201
  updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEmail>;
202
202
  /**
203
203
  * Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
204
-
204
+ *
205
205
  *
206
206
  * @param {string} databaseId
207
207
  * @param {string} collectionId
@@ -216,7 +216,7 @@ declare class Databases {
216
216
  createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
217
217
  /**
218
218
  * Update an enum attribute. Changing the `default` value will not update already existing documents.
219
-
219
+ *
220
220
  *
221
221
  * @param {string} databaseId
222
222
  * @param {string} collectionId
@@ -231,7 +231,7 @@ declare class Databases {
231
231
  updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEnum>;
232
232
  /**
233
233
  * Create a float attribute. Optionally, minimum and maximum values can be provided.
234
-
234
+ *
235
235
  *
236
236
  * @param {string} databaseId
237
237
  * @param {string} collectionId
@@ -247,7 +247,7 @@ declare class Databases {
247
247
  createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>;
248
248
  /**
249
249
  * Update a float attribute. Changing the `default` value will not update already existing documents.
250
-
250
+ *
251
251
  *
252
252
  * @param {string} databaseId
253
253
  * @param {string} collectionId
@@ -263,7 +263,7 @@ declare class Databases {
263
263
  updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeFloat>;
264
264
  /**
265
265
  * Create an integer attribute. Optionally, minimum and maximum values can be provided.
266
-
266
+ *
267
267
  *
268
268
  * @param {string} databaseId
269
269
  * @param {string} collectionId
@@ -279,7 +279,7 @@ declare class Databases {
279
279
  createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
280
280
  /**
281
281
  * Update an integer attribute. Changing the `default` value will not update already existing documents.
282
-
282
+ *
283
283
  *
284
284
  * @param {string} databaseId
285
285
  * @param {string} collectionId
@@ -295,7 +295,7 @@ declare class Databases {
295
295
  updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger>;
296
296
  /**
297
297
  * Create IP address attribute.
298
-
298
+ *
299
299
  *
300
300
  * @param {string} databaseId
301
301
  * @param {string} collectionId
@@ -309,7 +309,7 @@ declare class Databases {
309
309
  createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
310
310
  /**
311
311
  * Update an ip attribute. Changing the `default` value will not update already existing documents.
312
-
312
+ *
313
313
  *
314
314
  * @param {string} databaseId
315
315
  * @param {string} collectionId
@@ -323,7 +323,7 @@ declare class Databases {
323
323
  updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp>;
324
324
  /**
325
325
  * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
326
-
326
+ *
327
327
  *
328
328
  * @param {string} databaseId
329
329
  * @param {string} collectionId
@@ -339,7 +339,7 @@ declare class Databases {
339
339
  createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship>;
340
340
  /**
341
341
  * Create a string attribute.
342
-
342
+ *
343
343
  *
344
344
  * @param {string} databaseId
345
345
  * @param {string} collectionId
@@ -355,7 +355,7 @@ declare class Databases {
355
355
  createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString>;
356
356
  /**
357
357
  * Update a string attribute. Changing the `default` value will not update already existing documents.
358
-
358
+ *
359
359
  *
360
360
  * @param {string} databaseId
361
361
  * @param {string} collectionId
@@ -370,7 +370,7 @@ declare class Databases {
370
370
  updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString>;
371
371
  /**
372
372
  * Create a URL attribute.
373
-
373
+ *
374
374
  *
375
375
  * @param {string} databaseId
376
376
  * @param {string} collectionId
@@ -384,7 +384,7 @@ declare class Databases {
384
384
  createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
385
385
  /**
386
386
  * Update an url attribute. Changing the `default` value will not update already existing documents.
387
-
387
+ *
388
388
  *
389
389
  * @param {string} databaseId
390
390
  * @param {string} collectionId
@@ -418,7 +418,7 @@ declare class Databases {
418
418
  deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}>;
419
419
  /**
420
420
  * Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
421
-
421
+ *
422
422
  *
423
423
  * @param {string} databaseId
424
424
  * @param {string} collectionId
@@ -438,23 +438,23 @@ declare class Databases {
438
438
  * @throws {AppwriteException}
439
439
  * @returns {Promise<Models.DocumentList<Document>>}
440
440
  */
441
- listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
441
+ listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
442
442
  /**
443
443
  * 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.
444
444
  *
445
445
  * @param {string} databaseId
446
446
  * @param {string} collectionId
447
447
  * @param {string} documentId
448
- * @param {Omit<Document, keyof Models.Document>} data
448
+ * @param {Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>} data
449
449
  * @param {string[]} permissions
450
450
  * @throws {AppwriteException}
451
451
  * @returns {Promise<Document>}
452
452
  */
453
- createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
453
+ createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
454
454
  /**
455
455
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
456
-
457
- 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.
456
+ *
457
+ * 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.
458
458
  *
459
459
  * @param {string} databaseId
460
460
  * @param {string} collectionId
@@ -462,11 +462,12 @@ Create new Documents. Before using this route, you should create a new collectio
462
462
  * @throws {AppwriteException}
463
463
  * @returns {Promise<Models.DocumentList<Document>>}
464
464
  */
465
- createDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
465
+ createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
466
466
  /**
467
467
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
468
-
469
- 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.
468
+ *
469
+ * 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.
470
+ *
470
471
  *
471
472
  * @param {string} databaseId
472
473
  * @param {string} collectionId
@@ -474,11 +475,11 @@ Create or update Documents. Before using this route, you should create a new col
474
475
  * @throws {AppwriteException}
475
476
  * @returns {Promise<Models.DocumentList<Document>>}
476
477
  */
477
- upsertDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
478
+ upsertDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
478
479
  /**
479
480
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
480
-
481
- 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.
481
+ *
482
+ * 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.
482
483
  *
483
484
  * @param {string} databaseId
484
485
  * @param {string} collectionId
@@ -487,11 +488,11 @@ Update all documents that match your queries, if no queries are submitted then a
487
488
  * @throws {AppwriteException}
488
489
  * @returns {Promise<Models.DocumentList<Document>>}
489
490
  */
490
- updateDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>>;
491
+ updateDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>>;
491
492
  /**
492
493
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
493
-
494
- Bulk delete documents using queries, if no queries are passed then all documents are deleted.
494
+ *
495
+ * Bulk delete documents using queries, if no queries are passed then all documents are deleted.
495
496
  *
496
497
  * @param {string} databaseId
497
498
  * @param {string} collectionId
@@ -499,7 +500,7 @@ Bulk delete documents using queries, if no queries are passed then all documents
499
500
  * @throws {AppwriteException}
500
501
  * @returns {Promise<Models.DocumentList<Document>>}
501
502
  */
502
- deleteDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
503
+ deleteDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
503
504
  /**
504
505
  * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
505
506
  *
@@ -510,11 +511,11 @@ Bulk delete documents using queries, if no queries are passed then all documents
510
511
  * @throws {AppwriteException}
511
512
  * @returns {Promise<Document>}
512
513
  */
513
- getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
514
+ getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
514
515
  /**
515
516
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
516
-
517
- 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.
517
+ *
518
+ * 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.
518
519
  *
519
520
  * @param {string} databaseId
520
521
  * @param {string} collectionId
@@ -524,19 +525,19 @@ Create or update a Document. Before using this route, you should create a new co
524
525
  * @throws {AppwriteException}
525
526
  * @returns {Promise<Document>}
526
527
  */
527
- upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
528
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
528
529
  /**
529
530
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
530
531
  *
531
532
  * @param {string} databaseId
532
533
  * @param {string} collectionId
533
534
  * @param {string} documentId
534
- * @param {Partial<Omit<Document, keyof Models.Document>>} data
535
+ * @param {Partial<Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>>} data
535
536
  * @param {string[]} permissions
536
537
  * @throws {AppwriteException}
537
538
  * @returns {Promise<Document>}
538
539
  */
539
- updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
540
+ updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
540
541
  /**
541
542
  * Delete a document by its unique ID.
542
543
  *
@@ -547,6 +548,32 @@ Create or update a Document. Before using this route, you should create a new co
547
548
  * @returns {Promise<{}>}
548
549
  */
549
550
  deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}>;
551
+ /**
552
+ * Decrement a specific attribute of a document by a given value.
553
+ *
554
+ * @param {string} databaseId
555
+ * @param {string} collectionId
556
+ * @param {string} documentId
557
+ * @param {string} attribute
558
+ * @param {number} value
559
+ * @param {number} min
560
+ * @throws {AppwriteException}
561
+ * @returns {Promise<Document>}
562
+ */
563
+ decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document>;
564
+ /**
565
+ * Increment a specific attribute of a document by a given value.
566
+ *
567
+ * @param {string} databaseId
568
+ * @param {string} collectionId
569
+ * @param {string} documentId
570
+ * @param {string} attribute
571
+ * @param {number} value
572
+ * @param {number} max
573
+ * @throws {AppwriteException}
574
+ * @returns {Promise<Document>}
575
+ */
576
+ incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document>;
550
577
  /**
551
578
  * List indexes in the collection.
552
579
  *
@@ -559,7 +586,7 @@ Create or update a Document. Before using this route, you should create a new co
559
586
  listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList>;
560
587
  /**
561
588
  * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
562
- Attributes can be `key`, `fulltext`, and `unique`.
589
+ * Attributes can be `key`, `fulltext`, and `unique`.
563
590
  *
564
591
  * @param {string} databaseId
565
592
  * @param {string} collectionId
@@ -19,7 +19,7 @@ declare class Databases {
19
19
  list(queries?: string[], search?: string): Promise<Models.DatabaseList>;
20
20
  /**
21
21
  * Create a new Database.
22
-
22
+ *
23
23
  *
24
24
  * @param {string} databaseId
25
25
  * @param {string} name
@@ -120,7 +120,7 @@ declare class Databases {
120
120
  listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.AttributeList>;
121
121
  /**
122
122
  * Create a boolean attribute.
123
-
123
+ *
124
124
  *
125
125
  * @param {string} databaseId
126
126
  * @param {string} collectionId
@@ -173,7 +173,7 @@ declare class Databases {
173
173
  updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeDatetime>;
174
174
  /**
175
175
  * Create an email attribute.
176
-
176
+ *
177
177
  *
178
178
  * @param {string} databaseId
179
179
  * @param {string} collectionId
@@ -187,7 +187,7 @@ declare class Databases {
187
187
  createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>;
188
188
  /**
189
189
  * Update an email attribute. Changing the `default` value will not update already existing documents.
190
-
190
+ *
191
191
  *
192
192
  * @param {string} databaseId
193
193
  * @param {string} collectionId
@@ -201,7 +201,7 @@ declare class Databases {
201
201
  updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEmail>;
202
202
  /**
203
203
  * Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
204
-
204
+ *
205
205
  *
206
206
  * @param {string} databaseId
207
207
  * @param {string} collectionId
@@ -216,7 +216,7 @@ declare class Databases {
216
216
  createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>;
217
217
  /**
218
218
  * Update an enum attribute. Changing the `default` value will not update already existing documents.
219
-
219
+ *
220
220
  *
221
221
  * @param {string} databaseId
222
222
  * @param {string} collectionId
@@ -231,7 +231,7 @@ declare class Databases {
231
231
  updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEnum>;
232
232
  /**
233
233
  * Create a float attribute. Optionally, minimum and maximum values can be provided.
234
-
234
+ *
235
235
  *
236
236
  * @param {string} databaseId
237
237
  * @param {string} collectionId
@@ -247,7 +247,7 @@ declare class Databases {
247
247
  createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>;
248
248
  /**
249
249
  * Update a float attribute. Changing the `default` value will not update already existing documents.
250
-
250
+ *
251
251
  *
252
252
  * @param {string} databaseId
253
253
  * @param {string} collectionId
@@ -263,7 +263,7 @@ declare class Databases {
263
263
  updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeFloat>;
264
264
  /**
265
265
  * Create an integer attribute. Optionally, minimum and maximum values can be provided.
266
-
266
+ *
267
267
  *
268
268
  * @param {string} databaseId
269
269
  * @param {string} collectionId
@@ -279,7 +279,7 @@ declare class Databases {
279
279
  createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
280
280
  /**
281
281
  * Update an integer attribute. Changing the `default` value will not update already existing documents.
282
-
282
+ *
283
283
  *
284
284
  * @param {string} databaseId
285
285
  * @param {string} collectionId
@@ -295,7 +295,7 @@ declare class Databases {
295
295
  updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger>;
296
296
  /**
297
297
  * Create IP address attribute.
298
-
298
+ *
299
299
  *
300
300
  * @param {string} databaseId
301
301
  * @param {string} collectionId
@@ -309,7 +309,7 @@ declare class Databases {
309
309
  createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp>;
310
310
  /**
311
311
  * Update an ip attribute. Changing the `default` value will not update already existing documents.
312
-
312
+ *
313
313
  *
314
314
  * @param {string} databaseId
315
315
  * @param {string} collectionId
@@ -323,7 +323,7 @@ declare class Databases {
323
323
  updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp>;
324
324
  /**
325
325
  * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
326
-
326
+ *
327
327
  *
328
328
  * @param {string} databaseId
329
329
  * @param {string} collectionId
@@ -339,7 +339,7 @@ declare class Databases {
339
339
  createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship>;
340
340
  /**
341
341
  * Create a string attribute.
342
-
342
+ *
343
343
  *
344
344
  * @param {string} databaseId
345
345
  * @param {string} collectionId
@@ -355,7 +355,7 @@ declare class Databases {
355
355
  createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString>;
356
356
  /**
357
357
  * Update a string attribute. Changing the `default` value will not update already existing documents.
358
-
358
+ *
359
359
  *
360
360
  * @param {string} databaseId
361
361
  * @param {string} collectionId
@@ -370,7 +370,7 @@ declare class Databases {
370
370
  updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString>;
371
371
  /**
372
372
  * Create a URL attribute.
373
-
373
+ *
374
374
  *
375
375
  * @param {string} databaseId
376
376
  * @param {string} collectionId
@@ -384,7 +384,7 @@ declare class Databases {
384
384
  createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl>;
385
385
  /**
386
386
  * Update an url attribute. Changing the `default` value will not update already existing documents.
387
-
387
+ *
388
388
  *
389
389
  * @param {string} databaseId
390
390
  * @param {string} collectionId
@@ -418,7 +418,7 @@ declare class Databases {
418
418
  deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}>;
419
419
  /**
420
420
  * Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
421
-
421
+ *
422
422
  *
423
423
  * @param {string} databaseId
424
424
  * @param {string} collectionId
@@ -438,23 +438,23 @@ declare class Databases {
438
438
  * @throws {AppwriteException}
439
439
  * @returns {Promise<Models.DocumentList<Document>>}
440
440
  */
441
- listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
441
+ listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
442
442
  /**
443
443
  * 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.
444
444
  *
445
445
  * @param {string} databaseId
446
446
  * @param {string} collectionId
447
447
  * @param {string} documentId
448
- * @param {Omit<Document, keyof Models.Document>} data
448
+ * @param {Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>} data
449
449
  * @param {string[]} permissions
450
450
  * @throws {AppwriteException}
451
451
  * @returns {Promise<Document>}
452
452
  */
453
- createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
453
+ createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
454
454
  /**
455
455
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
456
-
457
- 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.
456
+ *
457
+ * 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.
458
458
  *
459
459
  * @param {string} databaseId
460
460
  * @param {string} collectionId
@@ -462,11 +462,12 @@ Create new Documents. Before using this route, you should create a new collectio
462
462
  * @throws {AppwriteException}
463
463
  * @returns {Promise<Models.DocumentList<Document>>}
464
464
  */
465
- createDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
465
+ createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
466
466
  /**
467
467
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
468
-
469
- 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.
468
+ *
469
+ * 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.
470
+ *
470
471
  *
471
472
  * @param {string} databaseId
472
473
  * @param {string} collectionId
@@ -474,11 +475,11 @@ Create or update Documents. Before using this route, you should create a new col
474
475
  * @throws {AppwriteException}
475
476
  * @returns {Promise<Models.DocumentList<Document>>}
476
477
  */
477
- upsertDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
478
+ upsertDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
478
479
  /**
479
480
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
480
-
481
- 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.
481
+ *
482
+ * 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.
482
483
  *
483
484
  * @param {string} databaseId
484
485
  * @param {string} collectionId
@@ -487,11 +488,11 @@ Update all documents that match your queries, if no queries are submitted then a
487
488
  * @throws {AppwriteException}
488
489
  * @returns {Promise<Models.DocumentList<Document>>}
489
490
  */
490
- updateDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>>;
491
+ updateDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>>;
491
492
  /**
492
493
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
493
-
494
- Bulk delete documents using queries, if no queries are passed then all documents are deleted.
494
+ *
495
+ * Bulk delete documents using queries, if no queries are passed then all documents are deleted.
495
496
  *
496
497
  * @param {string} databaseId
497
498
  * @param {string} collectionId
@@ -499,7 +500,7 @@ Bulk delete documents using queries, if no queries are passed then all documents
499
500
  * @throws {AppwriteException}
500
501
  * @returns {Promise<Models.DocumentList<Document>>}
501
502
  */
502
- deleteDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
503
+ deleteDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
503
504
  /**
504
505
  * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
505
506
  *
@@ -510,11 +511,11 @@ Bulk delete documents using queries, if no queries are passed then all documents
510
511
  * @throws {AppwriteException}
511
512
  * @returns {Promise<Document>}
512
513
  */
513
- getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
514
+ getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
514
515
  /**
515
516
  * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
516
-
517
- 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.
517
+ *
518
+ * 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.
518
519
  *
519
520
  * @param {string} databaseId
520
521
  * @param {string} collectionId
@@ -524,19 +525,19 @@ Create or update a Document. Before using this route, you should create a new co
524
525
  * @throws {AppwriteException}
525
526
  * @returns {Promise<Document>}
526
527
  */
527
- upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
528
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
528
529
  /**
529
530
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
530
531
  *
531
532
  * @param {string} databaseId
532
533
  * @param {string} collectionId
533
534
  * @param {string} documentId
534
- * @param {Partial<Omit<Document, keyof Models.Document>>} data
535
+ * @param {Partial<Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>>} data
535
536
  * @param {string[]} permissions
536
537
  * @throws {AppwriteException}
537
538
  * @returns {Promise<Document>}
538
539
  */
539
- updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
540
+ updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
540
541
  /**
541
542
  * Delete a document by its unique ID.
542
543
  *
@@ -547,6 +548,32 @@ Create or update a Document. Before using this route, you should create a new co
547
548
  * @returns {Promise<{}>}
548
549
  */
549
550
  deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}>;
551
+ /**
552
+ * Decrement a specific attribute of a document by a given value.
553
+ *
554
+ * @param {string} databaseId
555
+ * @param {string} collectionId
556
+ * @param {string} documentId
557
+ * @param {string} attribute
558
+ * @param {number} value
559
+ * @param {number} min
560
+ * @throws {AppwriteException}
561
+ * @returns {Promise<Document>}
562
+ */
563
+ decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document>;
564
+ /**
565
+ * Increment a specific attribute of a document by a given value.
566
+ *
567
+ * @param {string} databaseId
568
+ * @param {string} collectionId
569
+ * @param {string} documentId
570
+ * @param {string} attribute
571
+ * @param {number} value
572
+ * @param {number} max
573
+ * @throws {AppwriteException}
574
+ * @returns {Promise<Document>}
575
+ */
576
+ incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document>;
550
577
  /**
551
578
  * List indexes in the collection.
552
579
  *
@@ -559,7 +586,7 @@ Create or update a Document. Before using this route, you should create a new co
559
586
  listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList>;
560
587
  /**
561
588
  * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
562
- Attributes can be `key`, `fulltext`, and `unique`.
589
+ * Attributes can be `key`, `fulltext`, and `unique`.
563
590
  *
564
591
  * @param {string} databaseId
565
592
  * @param {string} collectionId