node-appwrite 17.0.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 (100) hide show
  1. package/README.md +1 -1
  2. package/dist/client.js +6 -5
  3. package/dist/client.js.map +1 -1
  4. package/dist/client.mjs +6 -5
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/enums/build-runtime.d.mts +3 -1
  7. package/dist/enums/build-runtime.d.ts +3 -1
  8. package/dist/enums/build-runtime.js +2 -0
  9. package/dist/enums/build-runtime.js.map +1 -1
  10. package/dist/enums/build-runtime.mjs +2 -0
  11. package/dist/enums/build-runtime.mjs.map +1 -1
  12. package/dist/enums/image-format.d.mts +2 -1
  13. package/dist/enums/image-format.d.ts +2 -1
  14. package/dist/enums/image-format.js +1 -0
  15. package/dist/enums/image-format.js.map +1 -1
  16. package/dist/enums/image-format.mjs +1 -0
  17. package/dist/enums/image-format.mjs.map +1 -1
  18. package/dist/enums/runtime.d.mts +3 -1
  19. package/dist/enums/runtime.d.ts +3 -1
  20. package/dist/enums/runtime.js +2 -0
  21. package/dist/enums/runtime.js.map +1 -1
  22. package/dist/enums/runtime.mjs +2 -0
  23. package/dist/enums/runtime.mjs.map +1 -1
  24. package/dist/models.d.mts +122 -97
  25. package/dist/models.d.ts +122 -97
  26. package/dist/services/account.d.mts +31 -31
  27. package/dist/services/account.d.ts +31 -31
  28. package/dist/services/account.js +81 -81
  29. package/dist/services/account.js.map +1 -1
  30. package/dist/services/account.mjs +81 -81
  31. package/dist/services/account.mjs.map +1 -1
  32. package/dist/services/avatars.d.mts +20 -20
  33. package/dist/services/avatars.d.ts +20 -20
  34. package/dist/services/avatars.js +79 -79
  35. package/dist/services/avatars.js.map +1 -1
  36. package/dist/services/avatars.mjs +79 -79
  37. package/dist/services/avatars.mjs.map +1 -1
  38. package/dist/services/databases.d.mts +78 -30
  39. package/dist/services/databases.d.ts +78 -30
  40. package/dist/services/databases.js +395 -251
  41. package/dist/services/databases.js.map +1 -1
  42. package/dist/services/databases.mjs +395 -251
  43. package/dist/services/databases.mjs.map +1 -1
  44. package/dist/services/functions.d.mts +8 -8
  45. package/dist/services/functions.d.ts +8 -8
  46. package/dist/services/functions.js +38 -38
  47. package/dist/services/functions.js.map +1 -1
  48. package/dist/services/functions.mjs +38 -38
  49. package/dist/services/functions.mjs.map +1 -1
  50. package/dist/services/graphql.js.map +1 -1
  51. package/dist/services/graphql.mjs.map +1 -1
  52. package/dist/services/health.d.mts +1 -1
  53. package/dist/services/health.d.ts +1 -1
  54. package/dist/services/health.js +8 -8
  55. package/dist/services/health.js.map +1 -1
  56. package/dist/services/health.mjs +8 -8
  57. package/dist/services/health.mjs.map +1 -1
  58. package/dist/services/locale.d.mts +2 -2
  59. package/dist/services/locale.d.ts +2 -2
  60. package/dist/services/locale.js +7 -7
  61. package/dist/services/locale.js.map +1 -1
  62. package/dist/services/locale.mjs +7 -7
  63. package/dist/services/locale.mjs.map +1 -1
  64. package/dist/services/messaging.d.mts +8 -8
  65. package/dist/services/messaging.d.ts +8 -8
  66. package/dist/services/messaging.js +94 -94
  67. package/dist/services/messaging.js.map +1 -1
  68. package/dist/services/messaging.mjs +94 -94
  69. package/dist/services/messaging.mjs.map +1 -1
  70. package/dist/services/sites.d.mts +4 -4
  71. package/dist/services/sites.d.ts +4 -4
  72. package/dist/services/sites.js +24 -24
  73. package/dist/services/sites.js.map +1 -1
  74. package/dist/services/sites.mjs +24 -24
  75. package/dist/services/sites.mjs.map +1 -1
  76. package/dist/services/storage.d.mts +7 -7
  77. package/dist/services/storage.d.ts +7 -7
  78. package/dist/services/storage.js +16 -16
  79. package/dist/services/storage.js.map +1 -1
  80. package/dist/services/storage.mjs +16 -16
  81. package/dist/services/storage.mjs.map +1 -1
  82. package/dist/services/teams.d.mts +17 -17
  83. package/dist/services/teams.d.ts +17 -17
  84. package/dist/services/teams.js +40 -40
  85. package/dist/services/teams.js.map +1 -1
  86. package/dist/services/teams.mjs +40 -40
  87. package/dist/services/teams.mjs.map +1 -1
  88. package/dist/services/tokens.d.mts +1 -1
  89. package/dist/services/tokens.d.ts +1 -1
  90. package/dist/services/tokens.js +1 -1
  91. package/dist/services/tokens.js.map +1 -1
  92. package/dist/services/tokens.mjs +1 -1
  93. package/dist/services/tokens.mjs.map +1 -1
  94. package/dist/services/users.d.mts +26 -26
  95. package/dist/services/users.d.ts +26 -26
  96. package/dist/services/users.js +26 -26
  97. package/dist/services/users.js.map +1 -1
  98. package/dist/services/users.mjs +26 -26
  99. package/dist/services/users.mjs.map +1 -1
  100. 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,20 +438,22 @@ 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
+ * **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
+ *
455
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
458
  *
457
459
  * @param {string} databaseId
@@ -460,10 +462,12 @@ declare class Databases {
460
462
  * @throws {AppwriteException}
461
463
  * @returns {Promise<Models.DocumentList<Document>>}
462
464
  */
463
- 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>>;
464
466
  /**
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
+ *
465
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.
466
-
470
+ *
467
471
  *
468
472
  * @param {string} databaseId
469
473
  * @param {string} collectionId
@@ -471,8 +475,10 @@ declare class Databases {
471
475
  * @throws {AppwriteException}
472
476
  * @returns {Promise<Models.DocumentList<Document>>}
473
477
  */
474
- 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>>;
475
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.
481
+ *
476
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.
477
483
  *
478
484
  * @param {string} databaseId
@@ -482,8 +488,10 @@ declare class Databases {
482
488
  * @throws {AppwriteException}
483
489
  * @returns {Promise<Models.DocumentList<Document>>}
484
490
  */
485
- 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>>;
486
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.
494
+ *
487
495
  * Bulk delete documents using queries, if no queries are passed then all documents are deleted.
488
496
  *
489
497
  * @param {string} databaseId
@@ -492,7 +500,7 @@ declare class Databases {
492
500
  * @throws {AppwriteException}
493
501
  * @returns {Promise<Models.DocumentList<Document>>}
494
502
  */
495
- 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>>;
496
504
  /**
497
505
  * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
498
506
  *
@@ -503,19 +511,33 @@ declare class Databases {
503
511
  * @throws {AppwriteException}
504
512
  * @returns {Promise<Document>}
505
513
  */
506
- 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>;
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.
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.
519
+ *
520
+ * @param {string} databaseId
521
+ * @param {string} collectionId
522
+ * @param {string} documentId
523
+ * @param {object} data
524
+ * @param {string[]} permissions
525
+ * @throws {AppwriteException}
526
+ * @returns {Promise<Document>}
527
+ */
528
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
507
529
  /**
508
530
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
509
531
  *
510
532
  * @param {string} databaseId
511
533
  * @param {string} collectionId
512
534
  * @param {string} documentId
513
- * @param {Partial<Omit<Document, keyof Models.Document>>} data
535
+ * @param {Partial<Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>>} data
514
536
  * @param {string[]} permissions
515
537
  * @throws {AppwriteException}
516
538
  * @returns {Promise<Document>}
517
539
  */
518
- 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>;
519
541
  /**
520
542
  * Delete a document by its unique ID.
521
543
  *
@@ -526,6 +548,32 @@ declare class Databases {
526
548
  * @returns {Promise<{}>}
527
549
  */
528
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>;
529
577
  /**
530
578
  * List indexes in the collection.
531
579
  *
@@ -538,7 +586,7 @@ declare class Databases {
538
586
  listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList>;
539
587
  /**
540
588
  * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
541
- Attributes can be `key`, `fulltext`, and `unique`.
589
+ * Attributes can be `key`, `fulltext`, and `unique`.
542
590
  *
543
591
  * @param {string} databaseId
544
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,20 +438,22 @@ 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
+ * **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
+ *
455
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
458
  *
457
459
  * @param {string} databaseId
@@ -460,10 +462,12 @@ declare class Databases {
460
462
  * @throws {AppwriteException}
461
463
  * @returns {Promise<Models.DocumentList<Document>>}
462
464
  */
463
- 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>>;
464
466
  /**
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
+ *
465
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.
466
-
470
+ *
467
471
  *
468
472
  * @param {string} databaseId
469
473
  * @param {string} collectionId
@@ -471,8 +475,10 @@ declare class Databases {
471
475
  * @throws {AppwriteException}
472
476
  * @returns {Promise<Models.DocumentList<Document>>}
473
477
  */
474
- 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>>;
475
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.
481
+ *
476
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.
477
483
  *
478
484
  * @param {string} databaseId
@@ -482,8 +488,10 @@ declare class Databases {
482
488
  * @throws {AppwriteException}
483
489
  * @returns {Promise<Models.DocumentList<Document>>}
484
490
  */
485
- 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>>;
486
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.
494
+ *
487
495
  * Bulk delete documents using queries, if no queries are passed then all documents are deleted.
488
496
  *
489
497
  * @param {string} databaseId
@@ -492,7 +500,7 @@ declare class Databases {
492
500
  * @throws {AppwriteException}
493
501
  * @returns {Promise<Models.DocumentList<Document>>}
494
502
  */
495
- 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>>;
496
504
  /**
497
505
  * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
498
506
  *
@@ -503,19 +511,33 @@ declare class Databases {
503
511
  * @throws {AppwriteException}
504
512
  * @returns {Promise<Document>}
505
513
  */
506
- 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>;
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.
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.
519
+ *
520
+ * @param {string} databaseId
521
+ * @param {string} collectionId
522
+ * @param {string} documentId
523
+ * @param {object} data
524
+ * @param {string[]} permissions
525
+ * @throws {AppwriteException}
526
+ * @returns {Promise<Document>}
527
+ */
528
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>;
507
529
  /**
508
530
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
509
531
  *
510
532
  * @param {string} databaseId
511
533
  * @param {string} collectionId
512
534
  * @param {string} documentId
513
- * @param {Partial<Omit<Document, keyof Models.Document>>} data
535
+ * @param {Partial<Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>>} data
514
536
  * @param {string[]} permissions
515
537
  * @throws {AppwriteException}
516
538
  * @returns {Promise<Document>}
517
539
  */
518
- 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>;
519
541
  /**
520
542
  * Delete a document by its unique ID.
521
543
  *
@@ -526,6 +548,32 @@ declare class Databases {
526
548
  * @returns {Promise<{}>}
527
549
  */
528
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>;
529
577
  /**
530
578
  * List indexes in the collection.
531
579
  *
@@ -538,7 +586,7 @@ declare class Databases {
538
586
  listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList>;
539
587
  /**
540
588
  * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
541
- Attributes can be `key`, `fulltext`, and `unique`.
589
+ * Attributes can be `key`, `fulltext`, and `unique`.
542
590
  *
543
591
  * @param {string} databaseId
544
592
  * @param {string} collectionId