node-appwrite 21.0.0 → 22.0.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 (119) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -2
  3. package/dist/client.js +37 -5
  4. package/dist/client.js.map +1 -1
  5. package/dist/client.mjs +1505 -5
  6. package/dist/client.mjs.map +1 -1
  7. package/dist/enums/browser-permission.d.mts +24 -0
  8. package/dist/enums/browser-permission.d.ts +24 -0
  9. package/dist/enums/browser-permission.js +29 -0
  10. package/dist/enums/browser-permission.js.map +1 -0
  11. package/dist/enums/browser-permission.mjs +28 -0
  12. package/dist/enums/browser-permission.mjs.map +1 -0
  13. package/dist/enums/deployment-status.d.mts +1 -0
  14. package/dist/enums/deployment-status.d.ts +1 -0
  15. package/dist/enums/deployment-status.js +1 -0
  16. package/dist/enums/deployment-status.js.map +1 -1
  17. package/dist/enums/deployment-status.mjs +1 -0
  18. package/dist/enums/deployment-status.mjs.map +1 -1
  19. package/dist/enums/name.d.mts +1 -0
  20. package/dist/enums/name.d.ts +1 -0
  21. package/dist/enums/name.js +1 -0
  22. package/dist/enums/name.js.map +1 -1
  23. package/dist/enums/name.mjs +1 -0
  24. package/dist/enums/name.mjs.map +1 -1
  25. package/dist/enums/o-auth-provider.d.mts +1 -2
  26. package/dist/enums/o-auth-provider.d.ts +1 -2
  27. package/dist/enums/o-auth-provider.js +0 -1
  28. package/dist/enums/o-auth-provider.js.map +1 -1
  29. package/dist/enums/o-auth-provider.mjs +0 -1
  30. package/dist/enums/o-auth-provider.mjs.map +1 -1
  31. package/dist/enums/order-by.d.mts +6 -0
  32. package/dist/enums/order-by.d.ts +6 -0
  33. package/dist/enums/order-by.js +11 -0
  34. package/dist/enums/order-by.js.map +1 -0
  35. package/dist/enums/order-by.mjs +10 -0
  36. package/dist/enums/order-by.mjs.map +1 -0
  37. package/dist/enums/roles.d.mts +7 -0
  38. package/dist/enums/roles.d.ts +7 -0
  39. package/dist/enums/roles.js +12 -0
  40. package/dist/enums/roles.js.map +1 -0
  41. package/dist/enums/roles.mjs +11 -0
  42. package/dist/enums/roles.mjs.map +1 -0
  43. package/dist/enums/scopes.d.mts +59 -0
  44. package/dist/enums/scopes.d.ts +59 -0
  45. package/dist/enums/scopes.js +64 -0
  46. package/dist/enums/scopes.js.map +1 -0
  47. package/dist/enums/scopes.mjs +63 -0
  48. package/dist/enums/scopes.mjs.map +1 -0
  49. package/dist/index.d.mts +5 -2
  50. package/dist/index.d.ts +5 -2
  51. package/dist/index.js +21 -6
  52. package/dist/index.js.map +1 -1
  53. package/dist/index.mjs +5 -2
  54. package/dist/index.mjs.map +1 -1
  55. package/dist/models.d.mts +367 -6
  56. package/dist/models.d.ts +367 -6
  57. package/dist/query.d.mts +38 -8
  58. package/dist/query.d.ts +38 -8
  59. package/dist/query.js +48 -7
  60. package/dist/query.js.map +1 -1
  61. package/dist/query.mjs +44 -7
  62. package/dist/query.mjs.map +1 -1
  63. package/dist/services/account.d.mts +13 -1
  64. package/dist/services/account.d.ts +13 -1
  65. package/dist/services/account.js +13 -7
  66. package/dist/services/account.js.map +1 -1
  67. package/dist/services/account.mjs +13 -7
  68. package/dist/services/account.mjs.map +1 -1
  69. package/dist/services/avatars.d.mts +9 -8
  70. package/dist/services/avatars.d.ts +9 -8
  71. package/dist/services/avatars.js.map +1 -1
  72. package/dist/services/avatars.mjs.map +1 -1
  73. package/dist/services/databases.d.mts +336 -35
  74. package/dist/services/databases.d.ts +336 -35
  75. package/dist/services/databases.js +480 -10
  76. package/dist/services/databases.js.map +1 -1
  77. package/dist/services/databases.mjs +480 -10
  78. package/dist/services/databases.mjs.map +1 -1
  79. package/dist/services/functions.d.mts +9 -8
  80. package/dist/services/functions.d.ts +9 -8
  81. package/dist/services/functions.js.map +1 -1
  82. package/dist/services/functions.mjs.map +1 -1
  83. package/dist/services/graphql.js.map +1 -1
  84. package/dist/services/graphql.mjs.map +1 -1
  85. package/dist/services/health.d.mts +25 -6
  86. package/dist/services/health.d.ts +25 -6
  87. package/dist/services/health.js +27 -3
  88. package/dist/services/health.js.map +1 -1
  89. package/dist/services/health.mjs +27 -3
  90. package/dist/services/health.mjs.map +1 -1
  91. package/dist/services/messaging.js.map +1 -1
  92. package/dist/services/messaging.mjs.map +1 -1
  93. package/dist/services/sites.js.map +1 -1
  94. package/dist/services/sites.mjs.map +1 -1
  95. package/dist/services/storage.d.mts +12 -12
  96. package/dist/services/storage.d.ts +12 -12
  97. package/dist/services/storage.js.map +1 -1
  98. package/dist/services/storage.mjs.map +1 -1
  99. package/dist/services/tables-db.d.mts +336 -33
  100. package/dist/services/tables-db.d.ts +336 -33
  101. package/dist/services/tables-db.js +480 -7
  102. package/dist/services/tables-db.js.map +1 -1
  103. package/dist/services/tables-db.mjs +480 -7
  104. package/dist/services/tables-db.mjs.map +1 -1
  105. package/dist/services/teams.d.mts +9 -8
  106. package/dist/services/teams.d.ts +9 -8
  107. package/dist/services/teams.js.map +1 -1
  108. package/dist/services/teams.mjs.map +1 -1
  109. package/dist/services/tokens.js.map +1 -1
  110. package/dist/services/tokens.mjs.map +1 -1
  111. package/dist/services/users.js.map +1 -1
  112. package/dist/services/users.mjs.map +1 -1
  113. package/package.json +4 -2
  114. package/dist/enums/output.d.mts +0 -11
  115. package/dist/enums/output.d.ts +0 -11
  116. package/dist/enums/output.js +0 -16
  117. package/dist/enums/output.js.map +0 -1
  118. package/dist/enums/output.mjs +0 -15
  119. package/dist/enums/output.mjs.map +0 -1
@@ -3,6 +3,7 @@ import { Models } from '../models.mjs';
3
3
  import { RelationshipType } from '../enums/relationship-type.mjs';
4
4
  import { RelationMutate } from '../enums/relation-mutate.mjs';
5
5
  import { IndexType } from '../enums/index-type.mjs';
6
+ import { OrderBy } from '../enums/order-by.mjs';
6
7
  import '../query.mjs';
7
8
  import '../enums/database-type.mjs';
8
9
  import '../enums/attribute-status.mjs';
@@ -227,7 +228,7 @@ declare class Databases {
227
228
  */
228
229
  update(params: {
229
230
  databaseId: string;
230
- name: string;
231
+ name?: string;
231
232
  enabled?: boolean;
232
233
  }): Promise<Models.Database>;
233
234
  /**
@@ -240,7 +241,7 @@ declare class Databases {
240
241
  * @returns {Promise<Models.Database>}
241
242
  * @deprecated Use the object parameter style method for a better developer experience.
242
243
  */
243
- update(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database>;
244
+ update(databaseId: string, name?: string, enabled?: boolean): Promise<Models.Database>;
244
245
  /**
245
246
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
246
247
  *
@@ -299,6 +300,8 @@ declare class Databases {
299
300
  * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
300
301
  * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
301
302
  * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
303
+ * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
304
+ * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
302
305
  * @throws {AppwriteException}
303
306
  * @returns {Promise<Models.Collection>}
304
307
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.
@@ -310,6 +313,8 @@ declare class Databases {
310
313
  permissions?: string[];
311
314
  documentSecurity?: boolean;
312
315
  enabled?: boolean;
316
+ attributes?: object[];
317
+ indexes?: object[];
313
318
  }): Promise<Models.Collection>;
314
319
  /**
315
320
  * 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.
@@ -320,11 +325,13 @@ declare class Databases {
320
325
  * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
321
326
  * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
322
327
  * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
328
+ * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
329
+ * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
323
330
  * @throws {AppwriteException}
324
331
  * @returns {Promise<Models.Collection>}
325
332
  * @deprecated Use the object parameter style method for a better developer experience.
326
333
  */
327
- createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
334
+ createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[]): Promise<Models.Collection>;
328
335
  /**
329
336
  * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
330
337
  *
@@ -364,7 +371,7 @@ declare class Databases {
364
371
  updateCollection(params: {
365
372
  databaseId: string;
366
373
  collectionId: string;
367
- name: string;
374
+ name?: string;
368
375
  permissions?: string[];
369
376
  documentSecurity?: boolean;
370
377
  enabled?: boolean;
@@ -382,7 +389,7 @@ declare class Databases {
382
389
  * @returns {Promise<Models.Collection>}
383
390
  * @deprecated Use the object parameter style method for a better developer experience.
384
391
  */
385
- updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
392
+ updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
386
393
  /**
387
394
  * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
388
395
  *
@@ -825,9 +832,9 @@ declare class Databases {
825
832
  * @param {string} params.collectionId - Collection ID.
826
833
  * @param {string} params.key - Attribute Key.
827
834
  * @param {boolean} params.required - Is attribute required?
828
- * @param {number} params.min - Minimum value
829
- * @param {number} params.max - Maximum value
830
- * @param {number} params.xdefault - Default value. Cannot be set when attribute is required.
835
+ * @param {number | bigint} params.min - Minimum value
836
+ * @param {number | bigint} params.max - Maximum value
837
+ * @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required.
831
838
  * @param {boolean} params.array - Is attribute an array?
832
839
  * @throws {AppwriteException}
833
840
  * @returns {Promise<Models.AttributeInteger>}
@@ -838,9 +845,9 @@ declare class Databases {
838
845
  collectionId: string;
839
846
  key: string;
840
847
  required: boolean;
841
- min?: number;
842
- max?: number;
843
- xdefault?: number;
848
+ min?: number | bigint;
849
+ max?: number | bigint;
850
+ xdefault?: number | bigint;
844
851
  array?: boolean;
845
852
  }): Promise<Models.AttributeInteger>;
846
853
  /**
@@ -851,15 +858,15 @@ declare class Databases {
851
858
  * @param {string} collectionId - Collection ID.
852
859
  * @param {string} key - Attribute Key.
853
860
  * @param {boolean} required - Is attribute required?
854
- * @param {number} min - Minimum value
855
- * @param {number} max - Maximum value
856
- * @param {number} xdefault - Default value. Cannot be set when attribute is required.
861
+ * @param {number | bigint} min - Minimum value
862
+ * @param {number | bigint} max - Maximum value
863
+ * @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required.
857
864
  * @param {boolean} array - Is attribute an array?
858
865
  * @throws {AppwriteException}
859
866
  * @returns {Promise<Models.AttributeInteger>}
860
867
  * @deprecated Use the object parameter style method for a better developer experience.
861
868
  */
862
- createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
869
+ createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise<Models.AttributeInteger>;
863
870
  /**
864
871
  * Update an integer attribute. Changing the `default` value will not update already existing documents.
865
872
  *
@@ -868,9 +875,9 @@ declare class Databases {
868
875
  * @param {string} params.collectionId - Collection ID.
869
876
  * @param {string} params.key - Attribute Key.
870
877
  * @param {boolean} params.required - Is attribute required?
871
- * @param {number} params.xdefault - Default value. Cannot be set when attribute is required.
872
- * @param {number} params.min - Minimum value
873
- * @param {number} params.max - Maximum value
878
+ * @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required.
879
+ * @param {number | bigint} params.min - Minimum value
880
+ * @param {number | bigint} params.max - Maximum value
874
881
  * @param {string} params.newKey - New Attribute Key.
875
882
  * @throws {AppwriteException}
876
883
  * @returns {Promise<Models.AttributeInteger>}
@@ -881,9 +888,9 @@ declare class Databases {
881
888
  collectionId: string;
882
889
  key: string;
883
890
  required: boolean;
884
- xdefault?: number;
885
- min?: number;
886
- max?: number;
891
+ xdefault?: number | bigint;
892
+ min?: number | bigint;
893
+ max?: number | bigint;
887
894
  newKey?: string;
888
895
  }): Promise<Models.AttributeInteger>;
889
896
  /**
@@ -894,15 +901,15 @@ declare class Databases {
894
901
  * @param {string} collectionId - Collection ID.
895
902
  * @param {string} key - Attribute Key.
896
903
  * @param {boolean} required - Is attribute required?
897
- * @param {number} xdefault - Default value. Cannot be set when attribute is required.
898
- * @param {number} min - Minimum value
899
- * @param {number} max - Maximum value
904
+ * @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required.
905
+ * @param {number | bigint} min - Minimum value
906
+ * @param {number | bigint} max - Maximum value
900
907
  * @param {string} newKey - New Attribute Key.
901
908
  * @throws {AppwriteException}
902
909
  * @returns {Promise<Models.AttributeInteger>}
903
910
  * @deprecated Use the object parameter style method for a better developer experience.
904
911
  */
905
- updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger>;
912
+ updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise<Models.AttributeInteger>;
906
913
  /**
907
914
  * Create IP address attribute.
908
915
  *
@@ -1044,6 +1051,150 @@ declare class Databases {
1044
1051
  * @deprecated Use the object parameter style method for a better developer experience.
1045
1052
  */
1046
1053
  updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributeLine>;
1054
+ /**
1055
+ * Create a longtext attribute.
1056
+ *
1057
+ *
1058
+ * @param {string} params.databaseId - Database ID.
1059
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1060
+ * @param {string} params.key - Attribute Key.
1061
+ * @param {boolean} params.required - Is attribute required?
1062
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1063
+ * @param {boolean} params.array - Is attribute an array?
1064
+ * @throws {AppwriteException}
1065
+ * @returns {Promise<Models.AttributeLongtext>}
1066
+ */
1067
+ createLongtextAttribute(params: {
1068
+ databaseId: string;
1069
+ collectionId: string;
1070
+ key: string;
1071
+ required: boolean;
1072
+ xdefault?: string;
1073
+ array?: boolean;
1074
+ }): Promise<Models.AttributeLongtext>;
1075
+ /**
1076
+ * Create a longtext attribute.
1077
+ *
1078
+ *
1079
+ * @param {string} databaseId - Database ID.
1080
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1081
+ * @param {string} key - Attribute Key.
1082
+ * @param {boolean} required - Is attribute required?
1083
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1084
+ * @param {boolean} array - Is attribute an array?
1085
+ * @throws {AppwriteException}
1086
+ * @returns {Promise<Models.AttributeLongtext>}
1087
+ * @deprecated Use the object parameter style method for a better developer experience.
1088
+ */
1089
+ createLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeLongtext>;
1090
+ /**
1091
+ * Update a longtext attribute. Changing the `default` value will not update already existing documents.
1092
+ *
1093
+ *
1094
+ * @param {string} params.databaseId - Database ID.
1095
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1096
+ * @param {string} params.key - Attribute Key.
1097
+ * @param {boolean} params.required - Is attribute required?
1098
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1099
+ * @param {string} params.newKey - New Attribute Key.
1100
+ * @throws {AppwriteException}
1101
+ * @returns {Promise<Models.AttributeLongtext>}
1102
+ */
1103
+ updateLongtextAttribute(params: {
1104
+ databaseId: string;
1105
+ collectionId: string;
1106
+ key: string;
1107
+ required: boolean;
1108
+ xdefault?: string;
1109
+ newKey?: string;
1110
+ }): Promise<Models.AttributeLongtext>;
1111
+ /**
1112
+ * Update a longtext attribute. Changing the `default` value will not update already existing documents.
1113
+ *
1114
+ *
1115
+ * @param {string} databaseId - Database ID.
1116
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1117
+ * @param {string} key - Attribute Key.
1118
+ * @param {boolean} required - Is attribute required?
1119
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1120
+ * @param {string} newKey - New Attribute Key.
1121
+ * @throws {AppwriteException}
1122
+ * @returns {Promise<Models.AttributeLongtext>}
1123
+ * @deprecated Use the object parameter style method for a better developer experience.
1124
+ */
1125
+ updateLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeLongtext>;
1126
+ /**
1127
+ * Create a mediumtext attribute.
1128
+ *
1129
+ *
1130
+ * @param {string} params.databaseId - Database ID.
1131
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1132
+ * @param {string} params.key - Attribute Key.
1133
+ * @param {boolean} params.required - Is attribute required?
1134
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1135
+ * @param {boolean} params.array - Is attribute an array?
1136
+ * @throws {AppwriteException}
1137
+ * @returns {Promise<Models.AttributeMediumtext>}
1138
+ */
1139
+ createMediumtextAttribute(params: {
1140
+ databaseId: string;
1141
+ collectionId: string;
1142
+ key: string;
1143
+ required: boolean;
1144
+ xdefault?: string;
1145
+ array?: boolean;
1146
+ }): Promise<Models.AttributeMediumtext>;
1147
+ /**
1148
+ * Create a mediumtext attribute.
1149
+ *
1150
+ *
1151
+ * @param {string} databaseId - Database ID.
1152
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1153
+ * @param {string} key - Attribute Key.
1154
+ * @param {boolean} required - Is attribute required?
1155
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1156
+ * @param {boolean} array - Is attribute an array?
1157
+ * @throws {AppwriteException}
1158
+ * @returns {Promise<Models.AttributeMediumtext>}
1159
+ * @deprecated Use the object parameter style method for a better developer experience.
1160
+ */
1161
+ createMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeMediumtext>;
1162
+ /**
1163
+ * Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
1164
+ *
1165
+ *
1166
+ * @param {string} params.databaseId - Database ID.
1167
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1168
+ * @param {string} params.key - Attribute Key.
1169
+ * @param {boolean} params.required - Is attribute required?
1170
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1171
+ * @param {string} params.newKey - New Attribute Key.
1172
+ * @throws {AppwriteException}
1173
+ * @returns {Promise<Models.AttributeMediumtext>}
1174
+ */
1175
+ updateMediumtextAttribute(params: {
1176
+ databaseId: string;
1177
+ collectionId: string;
1178
+ key: string;
1179
+ required: boolean;
1180
+ xdefault?: string;
1181
+ newKey?: string;
1182
+ }): Promise<Models.AttributeMediumtext>;
1183
+ /**
1184
+ * Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
1185
+ *
1186
+ *
1187
+ * @param {string} databaseId - Database ID.
1188
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1189
+ * @param {string} key - Attribute Key.
1190
+ * @param {boolean} required - Is attribute required?
1191
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1192
+ * @param {string} newKey - New Attribute Key.
1193
+ * @throws {AppwriteException}
1194
+ * @returns {Promise<Models.AttributeMediumtext>}
1195
+ * @deprecated Use the object parameter style method for a better developer experience.
1196
+ */
1197
+ updateMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeMediumtext>;
1047
1198
  /**
1048
1199
  * Create a geometric point attribute.
1049
1200
  *
@@ -1304,6 +1455,78 @@ declare class Databases {
1304
1455
  * @deprecated Use the object parameter style method for a better developer experience.
1305
1456
  */
1306
1457
  updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString>;
1458
+ /**
1459
+ * Create a text attribute.
1460
+ *
1461
+ *
1462
+ * @param {string} params.databaseId - Database ID.
1463
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1464
+ * @param {string} params.key - Attribute Key.
1465
+ * @param {boolean} params.required - Is attribute required?
1466
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1467
+ * @param {boolean} params.array - Is attribute an array?
1468
+ * @throws {AppwriteException}
1469
+ * @returns {Promise<Models.AttributeText>}
1470
+ */
1471
+ createTextAttribute(params: {
1472
+ databaseId: string;
1473
+ collectionId: string;
1474
+ key: string;
1475
+ required: boolean;
1476
+ xdefault?: string;
1477
+ array?: boolean;
1478
+ }): Promise<Models.AttributeText>;
1479
+ /**
1480
+ * Create a text attribute.
1481
+ *
1482
+ *
1483
+ * @param {string} databaseId - Database ID.
1484
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1485
+ * @param {string} key - Attribute Key.
1486
+ * @param {boolean} required - Is attribute required?
1487
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1488
+ * @param {boolean} array - Is attribute an array?
1489
+ * @throws {AppwriteException}
1490
+ * @returns {Promise<Models.AttributeText>}
1491
+ * @deprecated Use the object parameter style method for a better developer experience.
1492
+ */
1493
+ createTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeText>;
1494
+ /**
1495
+ * Update a text attribute. Changing the `default` value will not update already existing documents.
1496
+ *
1497
+ *
1498
+ * @param {string} params.databaseId - Database ID.
1499
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1500
+ * @param {string} params.key - Attribute Key.
1501
+ * @param {boolean} params.required - Is attribute required?
1502
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1503
+ * @param {string} params.newKey - New Attribute Key.
1504
+ * @throws {AppwriteException}
1505
+ * @returns {Promise<Models.AttributeText>}
1506
+ */
1507
+ updateTextAttribute(params: {
1508
+ databaseId: string;
1509
+ collectionId: string;
1510
+ key: string;
1511
+ required: boolean;
1512
+ xdefault?: string;
1513
+ newKey?: string;
1514
+ }): Promise<Models.AttributeText>;
1515
+ /**
1516
+ * Update a text attribute. Changing the `default` value will not update already existing documents.
1517
+ *
1518
+ *
1519
+ * @param {string} databaseId - Database ID.
1520
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1521
+ * @param {string} key - Attribute Key.
1522
+ * @param {boolean} required - Is attribute required?
1523
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1524
+ * @param {string} newKey - New Attribute Key.
1525
+ * @throws {AppwriteException}
1526
+ * @returns {Promise<Models.AttributeText>}
1527
+ * @deprecated Use the object parameter style method for a better developer experience.
1528
+ */
1529
+ updateTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeText>;
1307
1530
  /**
1308
1531
  * Create a URL attribute.
1309
1532
  *
@@ -1378,6 +1601,84 @@ declare class Databases {
1378
1601
  * @deprecated Use the object parameter style method for a better developer experience.
1379
1602
  */
1380
1603
  updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeUrl>;
1604
+ /**
1605
+ * Create a varchar attribute.
1606
+ *
1607
+ *
1608
+ * @param {string} params.databaseId - Database ID.
1609
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1610
+ * @param {string} params.key - Attribute Key.
1611
+ * @param {number} params.size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
1612
+ * @param {boolean} params.required - Is attribute required?
1613
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1614
+ * @param {boolean} params.array - Is attribute an array?
1615
+ * @throws {AppwriteException}
1616
+ * @returns {Promise<Models.AttributeVarchar>}
1617
+ */
1618
+ createVarcharAttribute(params: {
1619
+ databaseId: string;
1620
+ collectionId: string;
1621
+ key: string;
1622
+ size: number;
1623
+ required: boolean;
1624
+ xdefault?: string;
1625
+ array?: boolean;
1626
+ }): Promise<Models.AttributeVarchar>;
1627
+ /**
1628
+ * Create a varchar attribute.
1629
+ *
1630
+ *
1631
+ * @param {string} databaseId - Database ID.
1632
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1633
+ * @param {string} key - Attribute Key.
1634
+ * @param {number} size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
1635
+ * @param {boolean} required - Is attribute required?
1636
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1637
+ * @param {boolean} array - Is attribute an array?
1638
+ * @throws {AppwriteException}
1639
+ * @returns {Promise<Models.AttributeVarchar>}
1640
+ * @deprecated Use the object parameter style method for a better developer experience.
1641
+ */
1642
+ createVarcharAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeVarchar>;
1643
+ /**
1644
+ * Update a varchar attribute. Changing the `default` value will not update already existing documents.
1645
+ *
1646
+ *
1647
+ * @param {string} params.databaseId - Database ID.
1648
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1649
+ * @param {string} params.key - Attribute Key.
1650
+ * @param {boolean} params.required - Is attribute required?
1651
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1652
+ * @param {number} params.size - Maximum size of the varchar attribute.
1653
+ * @param {string} params.newKey - New Attribute Key.
1654
+ * @throws {AppwriteException}
1655
+ * @returns {Promise<Models.AttributeVarchar>}
1656
+ */
1657
+ updateVarcharAttribute(params: {
1658
+ databaseId: string;
1659
+ collectionId: string;
1660
+ key: string;
1661
+ required: boolean;
1662
+ xdefault?: string;
1663
+ size?: number;
1664
+ newKey?: string;
1665
+ }): Promise<Models.AttributeVarchar>;
1666
+ /**
1667
+ * Update a varchar attribute. Changing the `default` value will not update already existing documents.
1668
+ *
1669
+ *
1670
+ * @param {string} databaseId - Database ID.
1671
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1672
+ * @param {string} key - Attribute Key.
1673
+ * @param {boolean} required - Is attribute required?
1674
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1675
+ * @param {number} size - Maximum size of the varchar attribute.
1676
+ * @param {string} newKey - New Attribute Key.
1677
+ * @throws {AppwriteException}
1678
+ * @returns {Promise<Models.AttributeVarchar>}
1679
+ * @deprecated Use the object parameter style method for a better developer experience.
1680
+ */
1681
+ updateVarcharAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeVarchar>;
1381
1682
  /**
1382
1683
  * Get attribute by ID.
1383
1684
  *
@@ -1385,14 +1686,14 @@ declare class Databases {
1385
1686
  * @param {string} params.collectionId - Collection ID.
1386
1687
  * @param {string} params.key - Attribute Key.
1387
1688
  * @throws {AppwriteException}
1388
- * @returns {Promise<{}>}
1689
+ * @returns {Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>}
1389
1690
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead.
1390
1691
  */
1391
1692
  getAttribute(params: {
1392
1693
  databaseId: string;
1393
1694
  collectionId: string;
1394
1695
  key: string;
1395
- }): Promise<{}>;
1696
+ }): Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>;
1396
1697
  /**
1397
1698
  * Get attribute by ID.
1398
1699
  *
@@ -1400,10 +1701,10 @@ declare class Databases {
1400
1701
  * @param {string} collectionId - Collection ID.
1401
1702
  * @param {string} key - Attribute Key.
1402
1703
  * @throws {AppwriteException}
1403
- * @returns {Promise<{}>}
1704
+ * @returns {Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>}
1404
1705
  * @deprecated Use the object parameter style method for a better developer experience.
1405
1706
  */
1406
- getAttribute(databaseId: string, collectionId: string, key: string): Promise<{}>;
1707
+ getAttribute(databaseId: string, collectionId: string, key: string): Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>;
1407
1708
  /**
1408
1709
  * Deletes an attribute.
1409
1710
  *
@@ -1701,7 +2002,7 @@ declare class Databases {
1701
2002
  databaseId: string;
1702
2003
  collectionId: string;
1703
2004
  documentId: string;
1704
- data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
2005
+ data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
1705
2006
  permissions?: string[];
1706
2007
  transactionId?: string;
1707
2008
  }): Promise<Document>;
@@ -1718,7 +2019,7 @@ declare class Databases {
1718
2019
  * @returns {Promise<Document>}
1719
2020
  * @deprecated Use the object parameter style method for a better developer experience.
1720
2021
  */
1721
- upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
2022
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
1722
2023
  /**
1723
2024
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
1724
2025
  *
@@ -1897,7 +2198,7 @@ declare class Databases {
1897
2198
  * @param {string} params.key - Index Key.
1898
2199
  * @param {IndexType} params.type - Index type.
1899
2200
  * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1900
- * @param {string[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
2201
+ * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
1901
2202
  * @param {number[]} params.lengths - Length of index. Maximum of 100
1902
2203
  * @throws {AppwriteException}
1903
2204
  * @returns {Promise<Models.Index>}
@@ -1909,7 +2210,7 @@ declare class Databases {
1909
2210
  key: string;
1910
2211
  type: IndexType;
1911
2212
  attributes: string[];
1912
- orders?: string[];
2213
+ orders?: OrderBy[];
1913
2214
  lengths?: number[];
1914
2215
  }): Promise<Models.Index>;
1915
2216
  /**
@@ -1921,13 +2222,13 @@ declare class Databases {
1921
2222
  * @param {string} key - Index Key.
1922
2223
  * @param {IndexType} type - Index type.
1923
2224
  * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1924
- * @param {string[]} orders - Array of index orders. Maximum of 100 orders are allowed.
2225
+ * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
1925
2226
  * @param {number[]} lengths - Length of index. Maximum of 100
1926
2227
  * @throws {AppwriteException}
1927
2228
  * @returns {Promise<Models.Index>}
1928
2229
  * @deprecated Use the object parameter style method for a better developer experience.
1929
2230
  */
1930
- createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise<Models.Index>;
2231
+ createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.Index>;
1931
2232
  /**
1932
2233
  * Get an index by its unique ID.
1933
2234
  *