@appwrite.io/console 2.1.2 → 2.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 (137) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +2099 -520
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +2098 -521
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +2003 -444
  8. package/docs/examples/account/create-key.md +15 -0
  9. package/docs/examples/account/delete-key.md +13 -0
  10. package/docs/examples/account/get-key.md +13 -0
  11. package/docs/examples/account/list-keys.md +13 -0
  12. package/docs/examples/account/update-key.md +16 -0
  13. package/docs/examples/avatars/get-screenshot.md +5 -5
  14. package/docs/examples/backups/create-archive.md +2 -2
  15. package/docs/examples/backups/create-policy.md +2 -2
  16. package/docs/examples/backups/create-restoration.md +2 -2
  17. package/docs/examples/console/{get-regions.md → list-regions.md} +1 -3
  18. package/docs/examples/databases/create-index.md +2 -2
  19. package/docs/examples/databases/create-longtext-attribute.md +18 -0
  20. package/docs/examples/databases/create-mediumtext-attribute.md +18 -0
  21. package/docs/examples/databases/create-text-attribute.md +18 -0
  22. package/docs/examples/databases/create-varchar-attribute.md +19 -0
  23. package/docs/examples/databases/update-collection.md +1 -1
  24. package/docs/examples/databases/update-longtext-attribute.md +18 -0
  25. package/docs/examples/databases/update-mediumtext-attribute.md +18 -0
  26. package/docs/examples/databases/update-text-attribute.md +18 -0
  27. package/docs/examples/databases/update-varchar-attribute.md +19 -0
  28. package/docs/examples/databases/update.md +1 -1
  29. package/docs/examples/functions/create.md +2 -2
  30. package/docs/examples/functions/list-templates.md +3 -3
  31. package/docs/examples/functions/update.md +2 -2
  32. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  33. package/docs/examples/migrations/create-firebase-migration.md +2 -2
  34. package/docs/examples/migrations/create-n-host-migration.md +2 -2
  35. package/docs/examples/migrations/create-supabase-migration.md +2 -2
  36. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  37. package/docs/examples/migrations/get-firebase-report.md +2 -2
  38. package/docs/examples/migrations/get-n-host-report.md +2 -2
  39. package/docs/examples/migrations/get-supabase-report.md +2 -2
  40. package/docs/examples/organizations/create-key.md +16 -0
  41. package/docs/examples/organizations/create.md +2 -2
  42. package/docs/examples/organizations/delete-key.md +14 -0
  43. package/docs/examples/organizations/estimation-create-organization.md +2 -2
  44. package/docs/examples/organizations/estimation-update-plan.md +2 -2
  45. package/docs/examples/organizations/get-key.md +14 -0
  46. package/docs/examples/organizations/list-keys.md +14 -0
  47. package/docs/examples/organizations/list-regions.md +13 -0
  48. package/docs/examples/organizations/update-key.md +17 -0
  49. package/docs/examples/organizations/update-plan.md +2 -2
  50. package/docs/examples/projects/create-jwt.md +2 -2
  51. package/docs/examples/projects/create-key.md +2 -2
  52. package/docs/examples/projects/update-key.md +2 -2
  53. package/docs/examples/sites/list-templates.md +3 -3
  54. package/docs/examples/tablesdb/create-index.md +2 -2
  55. package/docs/examples/tablesdb/create-longtext-column.md +18 -0
  56. package/docs/examples/tablesdb/create-mediumtext-column.md +18 -0
  57. package/docs/examples/tablesdb/create-text-column.md +18 -0
  58. package/docs/examples/tablesdb/create-varchar-column.md +19 -0
  59. package/docs/examples/tablesdb/update-longtext-column.md +18 -0
  60. package/docs/examples/tablesdb/update-mediumtext-column.md +18 -0
  61. package/docs/examples/tablesdb/update-table.md +1 -1
  62. package/docs/examples/tablesdb/update-text-column.md +18 -0
  63. package/docs/examples/tablesdb/update-varchar-column.md +19 -0
  64. package/docs/examples/tablesdb/update.md +1 -1
  65. package/docs/examples/teams/create-membership.md +2 -2
  66. package/docs/examples/teams/update-membership.md +2 -2
  67. package/package.json +3 -2
  68. package/src/channel.ts +138 -0
  69. package/src/client.ts +54 -9
  70. package/src/enums/browser-permission.ts +22 -0
  71. package/src/enums/deployment-status.ts +1 -0
  72. package/src/enums/frameworks.ts +17 -0
  73. package/src/enums/order-by.ts +4 -0
  74. package/src/enums/resources.ts +13 -0
  75. package/src/enums/roles.ts +7 -0
  76. package/src/enums/runtimes.ts +66 -0
  77. package/src/enums/scopes.ts +65 -0
  78. package/src/enums/services.ts +5 -0
  79. package/src/enums/use-cases.ts +11 -0
  80. package/src/index.ts +10 -1
  81. package/src/models.ts +349 -1
  82. package/src/query.ts +42 -0
  83. package/src/services/account.ts +364 -56
  84. package/src/services/assistant.ts +1 -1
  85. package/src/services/avatars.ts +17 -16
  86. package/src/services/backups.ts +37 -36
  87. package/src/services/console.ts +11 -42
  88. package/src/services/databases.ts +1060 -280
  89. package/src/services/domains.ts +44 -44
  90. package/src/services/functions.ts +60 -57
  91. package/src/services/graphql.ts +2 -2
  92. package/src/services/health.ts +22 -20
  93. package/src/services/messaging.ts +56 -56
  94. package/src/services/migrations.ts +79 -78
  95. package/src/services/organizations.ts +466 -70
  96. package/src/services/project.ts +5 -5
  97. package/src/services/projects.ts +86 -85
  98. package/src/services/proxy.ts +8 -8
  99. package/src/services/realtime.ts +35 -12
  100. package/src/services/sites.ts +42 -40
  101. package/src/services/storage.ts +16 -16
  102. package/src/services/tables-db.ts +1050 -268
  103. package/src/services/teams.ts +31 -30
  104. package/src/services/tokens.ts +5 -5
  105. package/src/services/users.ts +49 -49
  106. package/src/services/vcs.ts +10 -10
  107. package/types/channel.d.ts +72 -0
  108. package/types/client.d.ts +11 -3
  109. package/types/enums/browser-permission.d.ts +22 -0
  110. package/types/enums/deployment-status.d.ts +1 -0
  111. package/types/enums/frameworks.d.ts +17 -0
  112. package/types/enums/order-by.d.ts +4 -0
  113. package/types/enums/resources.d.ts +13 -0
  114. package/types/enums/roles.d.ts +7 -0
  115. package/types/enums/runtimes.d.ts +66 -0
  116. package/types/enums/scopes.d.ts +65 -0
  117. package/types/enums/services.d.ts +5 -0
  118. package/types/enums/use-cases.d.ts +11 -0
  119. package/types/index.d.ts +10 -1
  120. package/types/models.d.ts +341 -1
  121. package/types/query.d.ts +30 -0
  122. package/types/services/account.d.ts +111 -0
  123. package/types/services/avatars.d.ts +5 -4
  124. package/types/services/backups.d.ts +13 -12
  125. package/types/services/console.d.ts +1 -13
  126. package/types/services/databases.d.ts +303 -8
  127. package/types/services/functions.d.ts +18 -15
  128. package/types/services/health.d.ts +2 -0
  129. package/types/services/migrations.d.ts +33 -32
  130. package/types/services/organizations.d.ts +161 -17
  131. package/types/services/projects.d.ts +13 -12
  132. package/types/services/realtime.d.ts +17 -8
  133. package/types/services/sites.d.ts +9 -7
  134. package/types/services/tables-db.d.ts +305 -8
  135. package/types/services/teams.d.ts +9 -8
  136. package/src/enums/billing-plan.ts +0 -17
  137. package/types/enums/billing-plan.d.ts +0 -17
@@ -6,6 +6,7 @@ import { UsageRange } from '../enums/usage-range';
6
6
  import { RelationshipType } from '../enums/relationship-type';
7
7
  import { RelationMutate } from '../enums/relation-mutate';
8
8
  import { IndexType } from '../enums/index-type';
9
+ import { OrderBy } from '../enums/order-by';
9
10
 
10
11
  export class Databases {
11
12
  client: Client;
@@ -24,7 +25,7 @@ export class Databases {
24
25
  * @returns {Promise<Models.DatabaseList>}
25
26
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.list` instead.
26
27
  */
27
- list(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.DatabaseList>;
28
+ list(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.DatabaseList>;
28
29
  /**
29
30
  * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
30
31
  *
@@ -92,7 +93,7 @@ export class Databases {
92
93
  * @returns {Promise<Models.Database>}
93
94
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.create` instead.
94
95
  */
95
- create(params: { databaseId: string, name: string, enabled?: boolean }): Promise<Models.Database>;
96
+ create(params: { databaseId: string, name: string, enabled?: boolean }): Promise<Models.Database>;
96
97
  /**
97
98
  * Create a new Database.
98
99
  *
@@ -164,7 +165,7 @@ export class Databases {
164
165
  * @throws {AppwriteException}
165
166
  * @returns {Promise<Models.TransactionList>}
166
167
  */
167
- listTransactions(params?: { queries?: string[] }): Promise<Models.TransactionList>;
168
+ listTransactions(params?: { queries?: string[] }): Promise<Models.TransactionList>;
168
169
  /**
169
170
  * List transactions across all databases.
170
171
  *
@@ -215,7 +216,7 @@ export class Databases {
215
216
  * @throws {AppwriteException}
216
217
  * @returns {Promise<Models.Transaction>}
217
218
  */
218
- createTransaction(params?: { ttl?: number }): Promise<Models.Transaction>;
219
+ createTransaction(params?: { ttl?: number }): Promise<Models.Transaction>;
219
220
  /**
220
221
  * Create a new transaction.
221
222
  *
@@ -267,7 +268,7 @@ export class Databases {
267
268
  * @throws {AppwriteException}
268
269
  * @returns {Promise<Models.Transaction>}
269
270
  */
270
- getTransaction(params: { transactionId: string }): Promise<Models.Transaction>;
271
+ getTransaction(params: { transactionId: string }): Promise<Models.Transaction>;
271
272
  /**
272
273
  * Get a transaction by its unique ID.
273
274
  *
@@ -320,7 +321,7 @@ export class Databases {
320
321
  * @throws {AppwriteException}
321
322
  * @returns {Promise<Models.Transaction>}
322
323
  */
323
- updateTransaction(params: { transactionId: string, commit?: boolean, rollback?: boolean }): Promise<Models.Transaction>;
324
+ updateTransaction(params: { transactionId: string, commit?: boolean, rollback?: boolean }): Promise<Models.Transaction>;
324
325
  /**
325
326
  * Update a transaction, to either commit or roll back its operations.
326
327
  *
@@ -385,7 +386,7 @@ export class Databases {
385
386
  * @throws {AppwriteException}
386
387
  * @returns {Promise<{}>}
387
388
  */
388
- deleteTransaction(params: { transactionId: string }): Promise<{}>;
389
+ deleteTransaction(params: { transactionId: string }): Promise<{}>;
389
390
  /**
390
391
  * Delete a transaction by its unique ID.
391
392
  *
@@ -438,7 +439,7 @@ export class Databases {
438
439
  * @throws {AppwriteException}
439
440
  * @returns {Promise<Models.Transaction>}
440
441
  */
441
- createOperations(params: { transactionId: string, operations?: object[] }): Promise<Models.Transaction>;
442
+ createOperations(params: { transactionId: string, operations?: object[] }): Promise<Models.Transaction>;
442
443
  /**
443
444
  * Create multiple operations in a single transaction.
444
445
  *
@@ -498,7 +499,7 @@ export class Databases {
498
499
  * @returns {Promise<Models.UsageDatabases>}
499
500
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listUsage` instead.
500
501
  */
501
- listUsage(params?: { range?: UsageRange }): Promise<Models.UsageDatabases>;
502
+ listUsage(params?: { range?: UsageRange }): Promise<Models.UsageDatabases>;
502
503
  /**
503
504
  * List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
504
505
  *
@@ -550,7 +551,7 @@ export class Databases {
550
551
  * @returns {Promise<Models.Database>}
551
552
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.get` instead.
552
553
  */
553
- get(params: { databaseId: string }): Promise<Models.Database>;
554
+ get(params: { databaseId: string }): Promise<Models.Database>;
554
555
  /**
555
556
  * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
556
557
  *
@@ -604,7 +605,7 @@ export class Databases {
604
605
  * @returns {Promise<Models.Database>}
605
606
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead.
606
607
  */
607
- update(params: { databaseId: string, name: string, enabled?: boolean }): Promise<Models.Database>;
608
+ update(params: { databaseId: string, name?: string, enabled?: boolean }): Promise<Models.Database>;
608
609
  /**
609
610
  * Update a database by its unique ID.
610
611
  *
@@ -615,15 +616,15 @@ export class Databases {
615
616
  * @returns {Promise<Models.Database>}
616
617
  * @deprecated Use the object parameter style method for a better developer experience.
617
618
  */
618
- update(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database>;
619
+ update(databaseId: string, name?: string, enabled?: boolean): Promise<Models.Database>;
619
620
  update(
620
- paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string,
621
+ paramsOrFirst: { databaseId: string, name?: string, enabled?: boolean } | string,
621
622
  ...rest: [(string)?, (boolean)?]
622
623
  ): Promise<Models.Database> {
623
- let params: { databaseId: string, name: string, enabled?: boolean };
624
+ let params: { databaseId: string, name?: string, enabled?: boolean };
624
625
 
625
626
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
626
- params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean };
627
+ params = (paramsOrFirst || {}) as { databaseId: string, name?: string, enabled?: boolean };
627
628
  } else {
628
629
  params = {
629
630
  databaseId: paramsOrFirst as string,
@@ -639,9 +640,6 @@ export class Databases {
639
640
  if (typeof databaseId === 'undefined') {
640
641
  throw new AppwriteException('Missing required parameter: "databaseId"');
641
642
  }
642
- if (typeof name === 'undefined') {
643
- throw new AppwriteException('Missing required parameter: "name"');
644
- }
645
643
 
646
644
  const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
647
645
  const payload: Payload = {};
@@ -673,7 +671,7 @@ export class Databases {
673
671
  * @returns {Promise<{}>}
674
672
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.delete` instead.
675
673
  */
676
- delete(params: { databaseId: string }): Promise<{}>;
674
+ delete(params: { databaseId: string }): Promise<{}>;
677
675
  /**
678
676
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
679
677
  *
@@ -729,7 +727,7 @@ export class Databases {
729
727
  * @returns {Promise<Models.CollectionList>}
730
728
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listTables` instead.
731
729
  */
732
- listCollections(params: { databaseId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.CollectionList>;
730
+ listCollections(params: { databaseId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.CollectionList>;
733
731
  /**
734
732
  * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.
735
733
  *
@@ -807,7 +805,7 @@ export class Databases {
807
805
  * @returns {Promise<Models.Collection>}
808
806
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.
809
807
  */
810
- createCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }): Promise<Models.Collection>;
808
+ createCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }): Promise<Models.Collection>;
811
809
  /**
812
810
  * 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.
813
811
  *
@@ -910,7 +908,7 @@ export class Databases {
910
908
  * @returns {Promise<Models.Collection>}
911
909
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getTable` instead.
912
910
  */
913
- getCollection(params: { databaseId: string, collectionId: string }): Promise<Models.Collection>;
911
+ getCollection(params: { databaseId: string, collectionId: string }): Promise<Models.Collection>;
914
912
  /**
915
913
  * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
916
914
  *
@@ -974,7 +972,7 @@ export class Databases {
974
972
  * @returns {Promise<Models.Collection>}
975
973
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead.
976
974
  */
977
- updateCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise<Models.Collection>;
975
+ updateCollection(params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise<Models.Collection>;
978
976
  /**
979
977
  * Update a collection by its unique ID.
980
978
  *
@@ -988,15 +986,15 @@ export class Databases {
988
986
  * @returns {Promise<Models.Collection>}
989
987
  * @deprecated Use the object parameter style method for a better developer experience.
990
988
  */
991
- updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
989
+ updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
992
990
  updateCollection(
993
- paramsOrFirst: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string,
991
+ paramsOrFirst: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string,
994
992
  ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?]
995
993
  ): Promise<Models.Collection> {
996
- let params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean };
994
+ let params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean };
997
995
 
998
996
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
999
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean };
997
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean };
1000
998
  } else {
1001
999
  params = {
1002
1000
  databaseId: paramsOrFirst as string,
@@ -1021,9 +1019,6 @@ export class Databases {
1021
1019
  if (typeof collectionId === 'undefined') {
1022
1020
  throw new AppwriteException('Missing required parameter: "collectionId"');
1023
1021
  }
1024
- if (typeof name === 'undefined') {
1025
- throw new AppwriteException('Missing required parameter: "name"');
1026
- }
1027
1022
 
1028
1023
  const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1029
1024
  const payload: Payload = {};
@@ -1062,7 +1057,7 @@ export class Databases {
1062
1057
  * @returns {Promise<{}>}
1063
1058
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTable` instead.
1064
1059
  */
1065
- deleteCollection(params: { databaseId: string, collectionId: string }): Promise<{}>;
1060
+ deleteCollection(params: { databaseId: string, collectionId: string }): Promise<{}>;
1066
1061
  /**
1067
1062
  * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
1068
1063
  *
@@ -1125,7 +1120,7 @@ export class Databases {
1125
1120
  * @returns {Promise<Models.AttributeList>}
1126
1121
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listColumns` instead.
1127
1122
  */
1128
- listAttributes(params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }): Promise<Models.AttributeList>;
1123
+ listAttributes(params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }): Promise<Models.AttributeList>;
1129
1124
  /**
1130
1125
  * List attributes in the collection.
1131
1126
  *
@@ -1202,7 +1197,7 @@ export class Databases {
1202
1197
  * @returns {Promise<Models.AttributeBoolean>}
1203
1198
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead.
1204
1199
  */
1205
- createBooleanAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean }): Promise<Models.AttributeBoolean>;
1200
+ createBooleanAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean }): Promise<Models.AttributeBoolean>;
1206
1201
  /**
1207
1202
  * Create a boolean attribute.
1208
1203
  *
@@ -1298,7 +1293,7 @@ export class Databases {
1298
1293
  * @returns {Promise<Models.AttributeBoolean>}
1299
1294
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateBooleanColumn` instead.
1300
1295
  */
1301
- updateBooleanAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string }): Promise<Models.AttributeBoolean>;
1296
+ updateBooleanAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string }): Promise<Models.AttributeBoolean>;
1302
1297
  /**
1303
1298
  * Update a boolean attribute. Changing the `default` value will not update already existing documents.
1304
1299
  *
@@ -1393,7 +1388,7 @@ export class Databases {
1393
1388
  * @returns {Promise<Models.AttributeDatetime>}
1394
1389
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createDatetimeColumn` instead.
1395
1390
  */
1396
- createDatetimeAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeDatetime>;
1391
+ createDatetimeAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeDatetime>;
1397
1392
  /**
1398
1393
  * Create a date time attribute according to the ISO 8601 standard.
1399
1394
  *
@@ -1488,7 +1483,7 @@ export class Databases {
1488
1483
  * @returns {Promise<Models.AttributeDatetime>}
1489
1484
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateDatetimeColumn` instead.
1490
1485
  */
1491
- updateDatetimeAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeDatetime>;
1486
+ updateDatetimeAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeDatetime>;
1492
1487
  /**
1493
1488
  * Update a date time attribute. Changing the `default` value will not update already existing documents.
1494
1489
  *
@@ -1584,7 +1579,7 @@ export class Databases {
1584
1579
  * @returns {Promise<Models.AttributeEmail>}
1585
1580
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEmailColumn` instead.
1586
1581
  */
1587
- createEmailAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeEmail>;
1582
+ createEmailAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeEmail>;
1588
1583
  /**
1589
1584
  * Create an email attribute.
1590
1585
  *
@@ -1681,7 +1676,7 @@ export class Databases {
1681
1676
  * @returns {Promise<Models.AttributeEmail>}
1682
1677
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEmailColumn` instead.
1683
1678
  */
1684
- updateEmailAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeEmail>;
1679
+ updateEmailAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeEmail>;
1685
1680
  /**
1686
1681
  * Update an email attribute. Changing the `default` value will not update already existing documents.
1687
1682
  *
@@ -1779,7 +1774,7 @@ export class Databases {
1779
1774
  * @returns {Promise<Models.AttributeEnum>}
1780
1775
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEnumColumn` instead.
1781
1776
  */
1782
- createEnumAttribute(params: { databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeEnum>;
1777
+ createEnumAttribute(params: { databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeEnum>;
1783
1778
  /**
1784
1779
  * Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute.
1785
1780
  *
@@ -1886,7 +1881,7 @@ export class Databases {
1886
1881
  * @returns {Promise<Models.AttributeEnum>}
1887
1882
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEnumColumn` instead.
1888
1883
  */
1889
- updateEnumAttribute(params: { databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeEnum>;
1884
+ updateEnumAttribute(params: { databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeEnum>;
1890
1885
  /**
1891
1886
  * Update an enum attribute. Changing the `default` value will not update already existing documents.
1892
1887
  *
@@ -1994,7 +1989,7 @@ export class Databases {
1994
1989
  * @returns {Promise<Models.AttributeFloat>}
1995
1990
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead.
1996
1991
  */
1997
- createFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise<Models.AttributeFloat>;
1992
+ createFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise<Models.AttributeFloat>;
1998
1993
  /**
1999
1994
  * Create a float attribute. Optionally, minimum and maximum values can be provided.
2000
1995
  *
@@ -2105,7 +2100,7 @@ export class Databases {
2105
2100
  * @returns {Promise<Models.AttributeFloat>}
2106
2101
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead.
2107
2102
  */
2108
- updateFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise<Models.AttributeFloat>;
2103
+ updateFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise<Models.AttributeFloat>;
2109
2104
  /**
2110
2105
  * Update a float attribute. Changing the `default` value will not update already existing documents.
2111
2106
  *
@@ -2216,7 +2211,7 @@ export class Databases {
2216
2211
  * @returns {Promise<Models.AttributeInteger>}
2217
2212
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead.
2218
2213
  */
2219
- createIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise<Models.AttributeInteger>;
2214
+ createIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise<Models.AttributeInteger>;
2220
2215
  /**
2221
2216
  * Create an integer attribute. Optionally, minimum and maximum values can be provided.
2222
2217
  *
@@ -2327,7 +2322,7 @@ export class Databases {
2327
2322
  * @returns {Promise<Models.AttributeInteger>}
2328
2323
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead.
2329
2324
  */
2330
- updateIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise<Models.AttributeInteger>;
2325
+ updateIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise<Models.AttributeInteger>;
2331
2326
  /**
2332
2327
  * Update an integer attribute. Changing the `default` value will not update already existing documents.
2333
2328
  *
@@ -2436,7 +2431,7 @@ export class Databases {
2436
2431
  * @returns {Promise<Models.AttributeIp>}
2437
2432
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIpColumn` instead.
2438
2433
  */
2439
- createIpAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeIp>;
2434
+ createIpAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeIp>;
2440
2435
  /**
2441
2436
  * Create IP address attribute.
2442
2437
  *
@@ -2533,7 +2528,7 @@ export class Databases {
2533
2528
  * @returns {Promise<Models.AttributeIp>}
2534
2529
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIpColumn` instead.
2535
2530
  */
2536
- updateIpAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeIp>;
2531
+ updateIpAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeIp>;
2537
2532
  /**
2538
2533
  * Update an ip attribute. Changing the `default` value will not update already existing documents.
2539
2534
  *
@@ -2628,7 +2623,7 @@ export class Databases {
2628
2623
  * @returns {Promise<Models.AttributeLine>}
2629
2624
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead.
2630
2625
  */
2631
- createLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise<Models.AttributeLine>;
2626
+ createLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise<Models.AttributeLine>;
2632
2627
  /**
2633
2628
  * Create a geometric line attribute.
2634
2629
  *
@@ -2717,7 +2712,7 @@ export class Databases {
2717
2712
  * @returns {Promise<Models.AttributeLine>}
2718
2713
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead.
2719
2714
  */
2720
- updateLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise<Models.AttributeLine>;
2715
+ updateLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise<Models.AttributeLine>;
2721
2716
  /**
2722
2717
  * Update a line attribute. Changing the `default` value will not update already existing documents.
2723
2718
  *
@@ -2797,46 +2792,50 @@ export class Databases {
2797
2792
  }
2798
2793
 
2799
2794
  /**
2800
- * Create a geometric point attribute.
2795
+ * Create a longtext attribute.
2796
+ *
2801
2797
  *
2802
2798
  * @param {string} params.databaseId - Database ID.
2803
2799
  * @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).
2804
2800
  * @param {string} params.key - Attribute Key.
2805
2801
  * @param {boolean} params.required - Is attribute required?
2806
- * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
2802
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
2803
+ * @param {boolean} params.array - Is attribute an array?
2807
2804
  * @throws {AppwriteException}
2808
- * @returns {Promise<Models.AttributePoint>}
2809
- * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.
2805
+ * @returns {Promise<Models.AttributeLongtext>}
2810
2806
  */
2811
- createPointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise<Models.AttributePoint>;
2807
+ createLongtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeLongtext>;
2812
2808
  /**
2813
- * Create a geometric point attribute.
2809
+ * Create a longtext attribute.
2810
+ *
2814
2811
  *
2815
2812
  * @param {string} databaseId - Database ID.
2816
2813
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2817
2814
  * @param {string} key - Attribute Key.
2818
2815
  * @param {boolean} required - Is attribute required?
2819
- * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
2816
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
2817
+ * @param {boolean} array - Is attribute an array?
2820
2818
  * @throws {AppwriteException}
2821
- * @returns {Promise<Models.AttributePoint>}
2819
+ * @returns {Promise<Models.AttributeLongtext>}
2822
2820
  * @deprecated Use the object parameter style method for a better developer experience.
2823
2821
  */
2824
- createPointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributePoint>;
2825
- createPointAttribute(
2826
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string,
2827
- ...rest: [(string)?, (string)?, (boolean)?, (any[])?]
2828
- ): Promise<Models.AttributePoint> {
2829
- let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] };
2822
+ createLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeLongtext>;
2823
+ createLongtextAttribute(
2824
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
2825
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
2826
+ ): Promise<Models.AttributeLongtext> {
2827
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
2830
2828
 
2831
2829
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2832
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] };
2830
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
2833
2831
  } else {
2834
2832
  params = {
2835
2833
  databaseId: paramsOrFirst as string,
2836
2834
  collectionId: rest[0] as string,
2837
2835
  key: rest[1] as string,
2838
2836
  required: rest[2] as boolean,
2839
- xdefault: rest[3] as any[]
2837
+ xdefault: rest[3] as string,
2838
+ array: rest[4] as boolean
2840
2839
  };
2841
2840
  }
2842
2841
 
@@ -2845,6 +2844,7 @@ export class Databases {
2845
2844
  const key = params.key;
2846
2845
  const required = params.required;
2847
2846
  const xdefault = params.xdefault;
2847
+ const array = params.array;
2848
2848
 
2849
2849
  if (typeof databaseId === 'undefined') {
2850
2850
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -2859,7 +2859,7 @@ export class Databases {
2859
2859
  throw new AppwriteException('Missing required parameter: "required"');
2860
2860
  }
2861
2861
 
2862
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2862
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/longtext'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2863
2863
  const payload: Payload = {};
2864
2864
  if (typeof key !== 'undefined') {
2865
2865
  payload['key'] = key;
@@ -2870,6 +2870,9 @@ export class Databases {
2870
2870
  if (typeof xdefault !== 'undefined') {
2871
2871
  payload['default'] = xdefault;
2872
2872
  }
2873
+ if (typeof array !== 'undefined') {
2874
+ payload['array'] = array;
2875
+ }
2873
2876
  const uri = new URL(this.client.config.endpoint + apiPath);
2874
2877
 
2875
2878
  const apiHeaders: { [header: string]: string } = {
@@ -2885,48 +2888,49 @@ export class Databases {
2885
2888
  }
2886
2889
 
2887
2890
  /**
2888
- * Update a point attribute. Changing the `default` value will not update already existing documents.
2891
+ * Update a longtext attribute. Changing the `default` value will not update already existing documents.
2892
+ *
2889
2893
  *
2890
2894
  * @param {string} params.databaseId - Database ID.
2891
- * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
2895
+ * @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).
2892
2896
  * @param {string} params.key - Attribute Key.
2893
2897
  * @param {boolean} params.required - Is attribute required?
2894
- * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
2895
- * @param {string} params.newKey - New attribute key.
2898
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
2899
+ * @param {string} params.newKey - New Attribute Key.
2896
2900
  * @throws {AppwriteException}
2897
- * @returns {Promise<Models.AttributePoint>}
2898
- * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead.
2901
+ * @returns {Promise<Models.AttributeLongtext>}
2899
2902
  */
2900
- updatePointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise<Models.AttributePoint>;
2903
+ updateLongtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeLongtext>;
2901
2904
  /**
2902
- * Update a point attribute. Changing the `default` value will not update already existing documents.
2905
+ * Update a longtext attribute. Changing the `default` value will not update already existing documents.
2906
+ *
2903
2907
  *
2904
2908
  * @param {string} databaseId - Database ID.
2905
- * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
2909
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2906
2910
  * @param {string} key - Attribute Key.
2907
2911
  * @param {boolean} required - Is attribute required?
2908
- * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
2909
- * @param {string} newKey - New attribute key.
2912
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
2913
+ * @param {string} newKey - New Attribute Key.
2910
2914
  * @throws {AppwriteException}
2911
- * @returns {Promise<Models.AttributePoint>}
2915
+ * @returns {Promise<Models.AttributeLongtext>}
2912
2916
  * @deprecated Use the object parameter style method for a better developer experience.
2913
2917
  */
2914
- updatePointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributePoint>;
2915
- updatePointAttribute(
2916
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string,
2917
- ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?]
2918
- ): Promise<Models.AttributePoint> {
2919
- let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string };
2918
+ updateLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeLongtext>;
2919
+ updateLongtextAttribute(
2920
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string } | string,
2921
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?]
2922
+ ): Promise<Models.AttributeLongtext> {
2923
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string };
2920
2924
 
2921
2925
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2922
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string };
2926
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string };
2923
2927
  } else {
2924
2928
  params = {
2925
2929
  databaseId: paramsOrFirst as string,
2926
2930
  collectionId: rest[0] as string,
2927
2931
  key: rest[1] as string,
2928
2932
  required: rest[2] as boolean,
2929
- xdefault: rest[3] as any[],
2933
+ xdefault: rest[3] as string,
2930
2934
  newKey: rest[4] as string
2931
2935
  };
2932
2936
  }
@@ -2950,8 +2954,11 @@ export class Databases {
2950
2954
  if (typeof required === 'undefined') {
2951
2955
  throw new AppwriteException('Missing required parameter: "required"');
2952
2956
  }
2957
+ if (typeof xdefault === 'undefined') {
2958
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2959
+ }
2953
2960
 
2954
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2961
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2955
2962
  const payload: Payload = {};
2956
2963
  if (typeof required !== 'undefined') {
2957
2964
  payload['required'] = required;
@@ -2977,46 +2984,50 @@ export class Databases {
2977
2984
  }
2978
2985
 
2979
2986
  /**
2980
- * Create a geometric polygon attribute.
2987
+ * Create a mediumtext attribute.
2988
+ *
2981
2989
  *
2982
2990
  * @param {string} params.databaseId - Database ID.
2983
2991
  * @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).
2984
2992
  * @param {string} params.key - Attribute Key.
2985
2993
  * @param {boolean} params.required - Is attribute required?
2986
- * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
2994
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
2995
+ * @param {boolean} params.array - Is attribute an array?
2987
2996
  * @throws {AppwriteException}
2988
- * @returns {Promise<Models.AttributePolygon>}
2989
- * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead.
2997
+ * @returns {Promise<Models.AttributeMediumtext>}
2990
2998
  */
2991
- createPolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise<Models.AttributePolygon>;
2999
+ createMediumtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeMediumtext>;
2992
3000
  /**
2993
- * Create a geometric polygon attribute.
3001
+ * Create a mediumtext attribute.
3002
+ *
2994
3003
  *
2995
3004
  * @param {string} databaseId - Database ID.
2996
3005
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2997
3006
  * @param {string} key - Attribute Key.
2998
3007
  * @param {boolean} required - Is attribute required?
2999
- * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
3008
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3009
+ * @param {boolean} array - Is attribute an array?
3000
3010
  * @throws {AppwriteException}
3001
- * @returns {Promise<Models.AttributePolygon>}
3011
+ * @returns {Promise<Models.AttributeMediumtext>}
3002
3012
  * @deprecated Use the object parameter style method for a better developer experience.
3003
3013
  */
3004
- createPolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributePolygon>;
3005
- createPolygonAttribute(
3006
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string,
3007
- ...rest: [(string)?, (string)?, (boolean)?, (any[])?]
3008
- ): Promise<Models.AttributePolygon> {
3009
- let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] };
3014
+ createMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeMediumtext>;
3015
+ createMediumtextAttribute(
3016
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
3017
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
3018
+ ): Promise<Models.AttributeMediumtext> {
3019
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
3010
3020
 
3011
3021
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3012
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] };
3022
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
3013
3023
  } else {
3014
3024
  params = {
3015
3025
  databaseId: paramsOrFirst as string,
3016
3026
  collectionId: rest[0] as string,
3017
3027
  key: rest[1] as string,
3018
3028
  required: rest[2] as boolean,
3019
- xdefault: rest[3] as any[]
3029
+ xdefault: rest[3] as string,
3030
+ array: rest[4] as boolean
3020
3031
  };
3021
3032
  }
3022
3033
 
@@ -3025,6 +3036,7 @@ export class Databases {
3025
3036
  const key = params.key;
3026
3037
  const required = params.required;
3027
3038
  const xdefault = params.xdefault;
3039
+ const array = params.array;
3028
3040
 
3029
3041
  if (typeof databaseId === 'undefined') {
3030
3042
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -3039,7 +3051,7 @@ export class Databases {
3039
3051
  throw new AppwriteException('Missing required parameter: "required"');
3040
3052
  }
3041
3053
 
3042
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3054
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3043
3055
  const payload: Payload = {};
3044
3056
  if (typeof key !== 'undefined') {
3045
3057
  payload['key'] = key;
@@ -3050,6 +3062,9 @@ export class Databases {
3050
3062
  if (typeof xdefault !== 'undefined') {
3051
3063
  payload['default'] = xdefault;
3052
3064
  }
3065
+ if (typeof array !== 'undefined') {
3066
+ payload['array'] = array;
3067
+ }
3053
3068
  const uri = new URL(this.client.config.endpoint + apiPath);
3054
3069
 
3055
3070
  const apiHeaders: { [header: string]: string } = {
@@ -3065,48 +3080,49 @@ export class Databases {
3065
3080
  }
3066
3081
 
3067
3082
  /**
3068
- * Update a polygon attribute. Changing the `default` value will not update already existing documents.
3083
+ * Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
3084
+ *
3069
3085
  *
3070
3086
  * @param {string} params.databaseId - Database ID.
3071
- * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
3087
+ * @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).
3072
3088
  * @param {string} params.key - Attribute Key.
3073
3089
  * @param {boolean} params.required - Is attribute required?
3074
- * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
3075
- * @param {string} params.newKey - New attribute key.
3090
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3091
+ * @param {string} params.newKey - New Attribute Key.
3076
3092
  * @throws {AppwriteException}
3077
- * @returns {Promise<Models.AttributePolygon>}
3078
- * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead.
3093
+ * @returns {Promise<Models.AttributeMediumtext>}
3079
3094
  */
3080
- updatePolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise<Models.AttributePolygon>;
3095
+ updateMediumtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeMediumtext>;
3081
3096
  /**
3082
- * Update a polygon attribute. Changing the `default` value will not update already existing documents.
3097
+ * Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
3098
+ *
3083
3099
  *
3084
3100
  * @param {string} databaseId - Database ID.
3085
- * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
3101
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3086
3102
  * @param {string} key - Attribute Key.
3087
3103
  * @param {boolean} required - Is attribute required?
3088
- * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
3089
- * @param {string} newKey - New attribute key.
3104
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3105
+ * @param {string} newKey - New Attribute Key.
3090
3106
  * @throws {AppwriteException}
3091
- * @returns {Promise<Models.AttributePolygon>}
3107
+ * @returns {Promise<Models.AttributeMediumtext>}
3092
3108
  * @deprecated Use the object parameter style method for a better developer experience.
3093
3109
  */
3094
- updatePolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributePolygon>;
3095
- updatePolygonAttribute(
3096
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string,
3097
- ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?]
3098
- ): Promise<Models.AttributePolygon> {
3099
- let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string };
3110
+ updateMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeMediumtext>;
3111
+ updateMediumtextAttribute(
3112
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string } | string,
3113
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?]
3114
+ ): Promise<Models.AttributeMediumtext> {
3115
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string };
3100
3116
 
3101
3117
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3102
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string };
3118
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string };
3103
3119
  } else {
3104
3120
  params = {
3105
3121
  databaseId: paramsOrFirst as string,
3106
3122
  collectionId: rest[0] as string,
3107
3123
  key: rest[1] as string,
3108
3124
  required: rest[2] as boolean,
3109
- xdefault: rest[3] as any[],
3125
+ xdefault: rest[3] as string,
3110
3126
  newKey: rest[4] as string
3111
3127
  };
3112
3128
  }
@@ -3130,8 +3146,11 @@ export class Databases {
3130
3146
  if (typeof required === 'undefined') {
3131
3147
  throw new AppwriteException('Missing required parameter: "required"');
3132
3148
  }
3149
+ if (typeof xdefault === 'undefined') {
3150
+ throw new AppwriteException('Missing required parameter: "xdefault"');
3151
+ }
3133
3152
 
3134
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
3153
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
3135
3154
  const payload: Payload = {};
3136
3155
  if (typeof required !== 'undefined') {
3137
3156
  payload['required'] = required;
@@ -3157,68 +3176,54 @@ export class Databases {
3157
3176
  }
3158
3177
 
3159
3178
  /**
3160
- * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
3161
- *
3179
+ * Create a geometric point attribute.
3162
3180
  *
3163
3181
  * @param {string} params.databaseId - Database ID.
3164
- * @param {string} params.collectionId - Collection ID.
3165
- * @param {string} params.relatedCollectionId - Related Collection ID.
3166
- * @param {RelationshipType} params.type - Relation type
3167
- * @param {boolean} params.twoWay - Is Two Way?
3182
+ * @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).
3168
3183
  * @param {string} params.key - Attribute Key.
3169
- * @param {string} params.twoWayKey - Two Way Attribute Key.
3170
- * @param {RelationMutate} params.onDelete - Constraints option
3184
+ * @param {boolean} params.required - Is attribute required?
3185
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
3171
3186
  * @throws {AppwriteException}
3172
- * @returns {Promise<Models.AttributeRelationship>}
3173
- * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead.
3187
+ * @returns {Promise<Models.AttributePoint>}
3188
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.
3174
3189
  */
3175
- createRelationshipAttribute(params: { databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate }): Promise<Models.AttributeRelationship>;
3190
+ createPointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise<Models.AttributePoint>;
3176
3191
  /**
3177
- * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
3178
- *
3192
+ * Create a geometric point attribute.
3179
3193
  *
3180
3194
  * @param {string} databaseId - Database ID.
3181
- * @param {string} collectionId - Collection ID.
3182
- * @param {string} relatedCollectionId - Related Collection ID.
3183
- * @param {RelationshipType} type - Relation type
3184
- * @param {boolean} twoWay - Is Two Way?
3195
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3185
3196
  * @param {string} key - Attribute Key.
3186
- * @param {string} twoWayKey - Two Way Attribute Key.
3187
- * @param {RelationMutate} onDelete - Constraints option
3197
+ * @param {boolean} required - Is attribute required?
3198
+ * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
3188
3199
  * @throws {AppwriteException}
3189
- * @returns {Promise<Models.AttributeRelationship>}
3200
+ * @returns {Promise<Models.AttributePoint>}
3190
3201
  * @deprecated Use the object parameter style method for a better developer experience.
3191
3202
  */
3192
- createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship>;
3193
- createRelationshipAttribute(
3194
- paramsOrFirst: { databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate } | string,
3195
- ...rest: [(string)?, (string)?, (RelationshipType)?, (boolean)?, (string)?, (string)?, (RelationMutate)?]
3196
- ): Promise<Models.AttributeRelationship> {
3197
- let params: { databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate };
3203
+ createPointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributePoint>;
3204
+ createPointAttribute(
3205
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string,
3206
+ ...rest: [(string)?, (string)?, (boolean)?, (any[])?]
3207
+ ): Promise<Models.AttributePoint> {
3208
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] };
3198
3209
 
3199
3210
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3200
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate };
3211
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] };
3201
3212
  } else {
3202
3213
  params = {
3203
3214
  databaseId: paramsOrFirst as string,
3204
3215
  collectionId: rest[0] as string,
3205
- relatedCollectionId: rest[1] as string,
3206
- type: rest[2] as RelationshipType,
3207
- twoWay: rest[3] as boolean,
3208
- key: rest[4] as string,
3209
- twoWayKey: rest[5] as string,
3210
- onDelete: rest[6] as RelationMutate
3216
+ key: rest[1] as string,
3217
+ required: rest[2] as boolean,
3218
+ xdefault: rest[3] as any[]
3211
3219
  };
3212
3220
  }
3213
3221
 
3214
3222
  const databaseId = params.databaseId;
3215
3223
  const collectionId = params.collectionId;
3216
- const relatedCollectionId = params.relatedCollectionId;
3217
- const type = params.type;
3218
- const twoWay = params.twoWay;
3219
3224
  const key = params.key;
3220
- const twoWayKey = params.twoWayKey;
3221
- const onDelete = params.onDelete;
3225
+ const required = params.required;
3226
+ const xdefault = params.xdefault;
3222
3227
 
3223
3228
  if (typeof databaseId === 'undefined') {
3224
3229
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -3226,32 +3231,23 @@ export class Databases {
3226
3231
  if (typeof collectionId === 'undefined') {
3227
3232
  throw new AppwriteException('Missing required parameter: "collectionId"');
3228
3233
  }
3229
- if (typeof relatedCollectionId === 'undefined') {
3230
- throw new AppwriteException('Missing required parameter: "relatedCollectionId"');
3234
+ if (typeof key === 'undefined') {
3235
+ throw new AppwriteException('Missing required parameter: "key"');
3231
3236
  }
3232
- if (typeof type === 'undefined') {
3233
- throw new AppwriteException('Missing required parameter: "type"');
3237
+ if (typeof required === 'undefined') {
3238
+ throw new AppwriteException('Missing required parameter: "required"');
3234
3239
  }
3235
3240
 
3236
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3241
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3237
3242
  const payload: Payload = {};
3238
- if (typeof relatedCollectionId !== 'undefined') {
3239
- payload['relatedCollectionId'] = relatedCollectionId;
3240
- }
3241
- if (typeof type !== 'undefined') {
3242
- payload['type'] = type;
3243
- }
3244
- if (typeof twoWay !== 'undefined') {
3245
- payload['twoWay'] = twoWay;
3246
- }
3247
3243
  if (typeof key !== 'undefined') {
3248
3244
  payload['key'] = key;
3249
3245
  }
3250
- if (typeof twoWayKey !== 'undefined') {
3251
- payload['twoWayKey'] = twoWayKey;
3246
+ if (typeof required !== 'undefined') {
3247
+ payload['required'] = required;
3252
3248
  }
3253
- if (typeof onDelete !== 'undefined') {
3254
- payload['onDelete'] = onDelete;
3249
+ if (typeof xdefault !== 'undefined') {
3250
+ payload['default'] = xdefault;
3255
3251
  }
3256
3252
  const uri = new URL(this.client.config.endpoint + apiPath);
3257
3253
 
@@ -3268,68 +3264,660 @@ export class Databases {
3268
3264
  }
3269
3265
 
3270
3266
  /**
3271
- * Create a string attribute.
3272
- *
3267
+ * Update a point attribute. Changing the `default` value will not update already existing documents.
3273
3268
  *
3274
3269
  * @param {string} params.databaseId - Database ID.
3275
- * @param {string} params.collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3270
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
3276
3271
  * @param {string} params.key - Attribute Key.
3277
- * @param {number} params.size - Attribute size for text attributes, in number of characters.
3278
3272
  * @param {boolean} params.required - Is attribute required?
3279
- * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3280
- * @param {boolean} params.array - Is attribute an array?
3281
- * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
3273
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
3274
+ * @param {string} params.newKey - New attribute key.
3282
3275
  * @throws {AppwriteException}
3283
- * @returns {Promise<Models.AttributeString>}
3284
- * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead.
3276
+ * @returns {Promise<Models.AttributePoint>}
3277
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead.
3285
3278
  */
3286
- createStringAttribute(params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.AttributeString>;
3279
+ updatePointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise<Models.AttributePoint>;
3287
3280
  /**
3288
- * Create a string attribute.
3289
- *
3281
+ * Update a point attribute. Changing the `default` value will not update already existing documents.
3290
3282
  *
3291
3283
  * @param {string} databaseId - Database ID.
3292
- * @param {string} collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3284
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
3293
3285
  * @param {string} key - Attribute Key.
3294
- * @param {number} size - Attribute size for text attributes, in number of characters.
3295
3286
  * @param {boolean} required - Is attribute required?
3296
- * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3297
- * @param {boolean} array - Is attribute an array?
3298
- * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
3287
+ * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
3288
+ * @param {string} newKey - New attribute key.
3289
+ * @throws {AppwriteException}
3290
+ * @returns {Promise<Models.AttributePoint>}
3291
+ * @deprecated Use the object parameter style method for a better developer experience.
3292
+ */
3293
+ updatePointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributePoint>;
3294
+ updatePointAttribute(
3295
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string,
3296
+ ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?]
3297
+ ): Promise<Models.AttributePoint> {
3298
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string };
3299
+
3300
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3301
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string };
3302
+ } else {
3303
+ params = {
3304
+ databaseId: paramsOrFirst as string,
3305
+ collectionId: rest[0] as string,
3306
+ key: rest[1] as string,
3307
+ required: rest[2] as boolean,
3308
+ xdefault: rest[3] as any[],
3309
+ newKey: rest[4] as string
3310
+ };
3311
+ }
3312
+
3313
+ const databaseId = params.databaseId;
3314
+ const collectionId = params.collectionId;
3315
+ const key = params.key;
3316
+ const required = params.required;
3317
+ const xdefault = params.xdefault;
3318
+ const newKey = params.newKey;
3319
+
3320
+ if (typeof databaseId === 'undefined') {
3321
+ throw new AppwriteException('Missing required parameter: "databaseId"');
3322
+ }
3323
+ if (typeof collectionId === 'undefined') {
3324
+ throw new AppwriteException('Missing required parameter: "collectionId"');
3325
+ }
3326
+ if (typeof key === 'undefined') {
3327
+ throw new AppwriteException('Missing required parameter: "key"');
3328
+ }
3329
+ if (typeof required === 'undefined') {
3330
+ throw new AppwriteException('Missing required parameter: "required"');
3331
+ }
3332
+
3333
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
3334
+ const payload: Payload = {};
3335
+ if (typeof required !== 'undefined') {
3336
+ payload['required'] = required;
3337
+ }
3338
+ if (typeof xdefault !== 'undefined') {
3339
+ payload['default'] = xdefault;
3340
+ }
3341
+ if (typeof newKey !== 'undefined') {
3342
+ payload['newKey'] = newKey;
3343
+ }
3344
+ const uri = new URL(this.client.config.endpoint + apiPath);
3345
+
3346
+ const apiHeaders: { [header: string]: string } = {
3347
+ 'content-type': 'application/json',
3348
+ }
3349
+
3350
+ return this.client.call(
3351
+ 'patch',
3352
+ uri,
3353
+ apiHeaders,
3354
+ payload
3355
+ );
3356
+ }
3357
+
3358
+ /**
3359
+ * Create a geometric polygon attribute.
3360
+ *
3361
+ * @param {string} params.databaseId - Database ID.
3362
+ * @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).
3363
+ * @param {string} params.key - Attribute Key.
3364
+ * @param {boolean} params.required - Is attribute required?
3365
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
3366
+ * @throws {AppwriteException}
3367
+ * @returns {Promise<Models.AttributePolygon>}
3368
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead.
3369
+ */
3370
+ createPolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise<Models.AttributePolygon>;
3371
+ /**
3372
+ * Create a geometric polygon attribute.
3373
+ *
3374
+ * @param {string} databaseId - Database ID.
3375
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3376
+ * @param {string} key - Attribute Key.
3377
+ * @param {boolean} required - Is attribute required?
3378
+ * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
3379
+ * @throws {AppwriteException}
3380
+ * @returns {Promise<Models.AttributePolygon>}
3381
+ * @deprecated Use the object parameter style method for a better developer experience.
3382
+ */
3383
+ createPolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributePolygon>;
3384
+ createPolygonAttribute(
3385
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string,
3386
+ ...rest: [(string)?, (string)?, (boolean)?, (any[])?]
3387
+ ): Promise<Models.AttributePolygon> {
3388
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] };
3389
+
3390
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3391
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] };
3392
+ } else {
3393
+ params = {
3394
+ databaseId: paramsOrFirst as string,
3395
+ collectionId: rest[0] as string,
3396
+ key: rest[1] as string,
3397
+ required: rest[2] as boolean,
3398
+ xdefault: rest[3] as any[]
3399
+ };
3400
+ }
3401
+
3402
+ const databaseId = params.databaseId;
3403
+ const collectionId = params.collectionId;
3404
+ const key = params.key;
3405
+ const required = params.required;
3406
+ const xdefault = params.xdefault;
3407
+
3408
+ if (typeof databaseId === 'undefined') {
3409
+ throw new AppwriteException('Missing required parameter: "databaseId"');
3410
+ }
3411
+ if (typeof collectionId === 'undefined') {
3412
+ throw new AppwriteException('Missing required parameter: "collectionId"');
3413
+ }
3414
+ if (typeof key === 'undefined') {
3415
+ throw new AppwriteException('Missing required parameter: "key"');
3416
+ }
3417
+ if (typeof required === 'undefined') {
3418
+ throw new AppwriteException('Missing required parameter: "required"');
3419
+ }
3420
+
3421
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3422
+ const payload: Payload = {};
3423
+ if (typeof key !== 'undefined') {
3424
+ payload['key'] = key;
3425
+ }
3426
+ if (typeof required !== 'undefined') {
3427
+ payload['required'] = required;
3428
+ }
3429
+ if (typeof xdefault !== 'undefined') {
3430
+ payload['default'] = xdefault;
3431
+ }
3432
+ const uri = new URL(this.client.config.endpoint + apiPath);
3433
+
3434
+ const apiHeaders: { [header: string]: string } = {
3435
+ 'content-type': 'application/json',
3436
+ }
3437
+
3438
+ return this.client.call(
3439
+ 'post',
3440
+ uri,
3441
+ apiHeaders,
3442
+ payload
3443
+ );
3444
+ }
3445
+
3446
+ /**
3447
+ * Update a polygon attribute. Changing the `default` value will not update already existing documents.
3448
+ *
3449
+ * @param {string} params.databaseId - Database ID.
3450
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
3451
+ * @param {string} params.key - Attribute Key.
3452
+ * @param {boolean} params.required - Is attribute required?
3453
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
3454
+ * @param {string} params.newKey - New attribute key.
3455
+ * @throws {AppwriteException}
3456
+ * @returns {Promise<Models.AttributePolygon>}
3457
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead.
3458
+ */
3459
+ updatePolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise<Models.AttributePolygon>;
3460
+ /**
3461
+ * Update a polygon attribute. Changing the `default` value will not update already existing documents.
3462
+ *
3463
+ * @param {string} databaseId - Database ID.
3464
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
3465
+ * @param {string} key - Attribute Key.
3466
+ * @param {boolean} required - Is attribute required?
3467
+ * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
3468
+ * @param {string} newKey - New attribute key.
3469
+ * @throws {AppwriteException}
3470
+ * @returns {Promise<Models.AttributePolygon>}
3471
+ * @deprecated Use the object parameter style method for a better developer experience.
3472
+ */
3473
+ updatePolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributePolygon>;
3474
+ updatePolygonAttribute(
3475
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string,
3476
+ ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?]
3477
+ ): Promise<Models.AttributePolygon> {
3478
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string };
3479
+
3480
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3481
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string };
3482
+ } else {
3483
+ params = {
3484
+ databaseId: paramsOrFirst as string,
3485
+ collectionId: rest[0] as string,
3486
+ key: rest[1] as string,
3487
+ required: rest[2] as boolean,
3488
+ xdefault: rest[3] as any[],
3489
+ newKey: rest[4] as string
3490
+ };
3491
+ }
3492
+
3493
+ const databaseId = params.databaseId;
3494
+ const collectionId = params.collectionId;
3495
+ const key = params.key;
3496
+ const required = params.required;
3497
+ const xdefault = params.xdefault;
3498
+ const newKey = params.newKey;
3499
+
3500
+ if (typeof databaseId === 'undefined') {
3501
+ throw new AppwriteException('Missing required parameter: "databaseId"');
3502
+ }
3503
+ if (typeof collectionId === 'undefined') {
3504
+ throw new AppwriteException('Missing required parameter: "collectionId"');
3505
+ }
3506
+ if (typeof key === 'undefined') {
3507
+ throw new AppwriteException('Missing required parameter: "key"');
3508
+ }
3509
+ if (typeof required === 'undefined') {
3510
+ throw new AppwriteException('Missing required parameter: "required"');
3511
+ }
3512
+
3513
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
3514
+ const payload: Payload = {};
3515
+ if (typeof required !== 'undefined') {
3516
+ payload['required'] = required;
3517
+ }
3518
+ if (typeof xdefault !== 'undefined') {
3519
+ payload['default'] = xdefault;
3520
+ }
3521
+ if (typeof newKey !== 'undefined') {
3522
+ payload['newKey'] = newKey;
3523
+ }
3524
+ const uri = new URL(this.client.config.endpoint + apiPath);
3525
+
3526
+ const apiHeaders: { [header: string]: string } = {
3527
+ 'content-type': 'application/json',
3528
+ }
3529
+
3530
+ return this.client.call(
3531
+ 'patch',
3532
+ uri,
3533
+ apiHeaders,
3534
+ payload
3535
+ );
3536
+ }
3537
+
3538
+ /**
3539
+ * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
3540
+ *
3541
+ *
3542
+ * @param {string} params.databaseId - Database ID.
3543
+ * @param {string} params.collectionId - Collection ID.
3544
+ * @param {string} params.relatedCollectionId - Related Collection ID.
3545
+ * @param {RelationshipType} params.type - Relation type
3546
+ * @param {boolean} params.twoWay - Is Two Way?
3547
+ * @param {string} params.key - Attribute Key.
3548
+ * @param {string} params.twoWayKey - Two Way Attribute Key.
3549
+ * @param {RelationMutate} params.onDelete - Constraints option
3550
+ * @throws {AppwriteException}
3551
+ * @returns {Promise<Models.AttributeRelationship>}
3552
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead.
3553
+ */
3554
+ createRelationshipAttribute(params: { databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate }): Promise<Models.AttributeRelationship>;
3555
+ /**
3556
+ * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
3557
+ *
3558
+ *
3559
+ * @param {string} databaseId - Database ID.
3560
+ * @param {string} collectionId - Collection ID.
3561
+ * @param {string} relatedCollectionId - Related Collection ID.
3562
+ * @param {RelationshipType} type - Relation type
3563
+ * @param {boolean} twoWay - Is Two Way?
3564
+ * @param {string} key - Attribute Key.
3565
+ * @param {string} twoWayKey - Two Way Attribute Key.
3566
+ * @param {RelationMutate} onDelete - Constraints option
3567
+ * @throws {AppwriteException}
3568
+ * @returns {Promise<Models.AttributeRelationship>}
3569
+ * @deprecated Use the object parameter style method for a better developer experience.
3570
+ */
3571
+ createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship>;
3572
+ createRelationshipAttribute(
3573
+ paramsOrFirst: { databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate } | string,
3574
+ ...rest: [(string)?, (string)?, (RelationshipType)?, (boolean)?, (string)?, (string)?, (RelationMutate)?]
3575
+ ): Promise<Models.AttributeRelationship> {
3576
+ let params: { databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate };
3577
+
3578
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3579
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate };
3580
+ } else {
3581
+ params = {
3582
+ databaseId: paramsOrFirst as string,
3583
+ collectionId: rest[0] as string,
3584
+ relatedCollectionId: rest[1] as string,
3585
+ type: rest[2] as RelationshipType,
3586
+ twoWay: rest[3] as boolean,
3587
+ key: rest[4] as string,
3588
+ twoWayKey: rest[5] as string,
3589
+ onDelete: rest[6] as RelationMutate
3590
+ };
3591
+ }
3592
+
3593
+ const databaseId = params.databaseId;
3594
+ const collectionId = params.collectionId;
3595
+ const relatedCollectionId = params.relatedCollectionId;
3596
+ const type = params.type;
3597
+ const twoWay = params.twoWay;
3598
+ const key = params.key;
3599
+ const twoWayKey = params.twoWayKey;
3600
+ const onDelete = params.onDelete;
3601
+
3602
+ if (typeof databaseId === 'undefined') {
3603
+ throw new AppwriteException('Missing required parameter: "databaseId"');
3604
+ }
3605
+ if (typeof collectionId === 'undefined') {
3606
+ throw new AppwriteException('Missing required parameter: "collectionId"');
3607
+ }
3608
+ if (typeof relatedCollectionId === 'undefined') {
3609
+ throw new AppwriteException('Missing required parameter: "relatedCollectionId"');
3610
+ }
3611
+ if (typeof type === 'undefined') {
3612
+ throw new AppwriteException('Missing required parameter: "type"');
3613
+ }
3614
+
3615
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3616
+ const payload: Payload = {};
3617
+ if (typeof relatedCollectionId !== 'undefined') {
3618
+ payload['relatedCollectionId'] = relatedCollectionId;
3619
+ }
3620
+ if (typeof type !== 'undefined') {
3621
+ payload['type'] = type;
3622
+ }
3623
+ if (typeof twoWay !== 'undefined') {
3624
+ payload['twoWay'] = twoWay;
3625
+ }
3626
+ if (typeof key !== 'undefined') {
3627
+ payload['key'] = key;
3628
+ }
3629
+ if (typeof twoWayKey !== 'undefined') {
3630
+ payload['twoWayKey'] = twoWayKey;
3631
+ }
3632
+ if (typeof onDelete !== 'undefined') {
3633
+ payload['onDelete'] = onDelete;
3634
+ }
3635
+ const uri = new URL(this.client.config.endpoint + apiPath);
3636
+
3637
+ const apiHeaders: { [header: string]: string } = {
3638
+ 'content-type': 'application/json',
3639
+ }
3640
+
3641
+ return this.client.call(
3642
+ 'post',
3643
+ uri,
3644
+ apiHeaders,
3645
+ payload
3646
+ );
3647
+ }
3648
+
3649
+ /**
3650
+ * Create a string attribute.
3651
+ *
3652
+ *
3653
+ * @param {string} params.databaseId - Database ID.
3654
+ * @param {string} params.collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3655
+ * @param {string} params.key - Attribute Key.
3656
+ * @param {number} params.size - Attribute size for text attributes, in number of characters.
3657
+ * @param {boolean} params.required - Is attribute required?
3658
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3659
+ * @param {boolean} params.array - Is attribute an array?
3660
+ * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
3661
+ * @throws {AppwriteException}
3662
+ * @returns {Promise<Models.AttributeString>}
3663
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead.
3664
+ */
3665
+ createStringAttribute(params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.AttributeString>;
3666
+ /**
3667
+ * Create a string attribute.
3668
+ *
3669
+ *
3670
+ * @param {string} databaseId - Database ID.
3671
+ * @param {string} collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3672
+ * @param {string} key - Attribute Key.
3673
+ * @param {number} size - Attribute size for text attributes, in number of characters.
3674
+ * @param {boolean} required - Is attribute required?
3675
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3676
+ * @param {boolean} array - Is attribute an array?
3677
+ * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
3678
+ * @throws {AppwriteException}
3679
+ * @returns {Promise<Models.AttributeString>}
3680
+ * @deprecated Use the object parameter style method for a better developer experience.
3681
+ */
3682
+ createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString>;
3683
+ createStringAttribute(
3684
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
3685
+ ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
3686
+ ): Promise<Models.AttributeString> {
3687
+ let params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
3688
+
3689
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3690
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
3691
+ } else {
3692
+ params = {
3693
+ databaseId: paramsOrFirst as string,
3694
+ collectionId: rest[0] as string,
3695
+ key: rest[1] as string,
3696
+ size: rest[2] as number,
3697
+ required: rest[3] as boolean,
3698
+ xdefault: rest[4] as string,
3699
+ array: rest[5] as boolean,
3700
+ encrypt: rest[6] as boolean
3701
+ };
3702
+ }
3703
+
3704
+ const databaseId = params.databaseId;
3705
+ const collectionId = params.collectionId;
3706
+ const key = params.key;
3707
+ const size = params.size;
3708
+ const required = params.required;
3709
+ const xdefault = params.xdefault;
3710
+ const array = params.array;
3711
+ const encrypt = params.encrypt;
3712
+
3713
+ if (typeof databaseId === 'undefined') {
3714
+ throw new AppwriteException('Missing required parameter: "databaseId"');
3715
+ }
3716
+ if (typeof collectionId === 'undefined') {
3717
+ throw new AppwriteException('Missing required parameter: "collectionId"');
3718
+ }
3719
+ if (typeof key === 'undefined') {
3720
+ throw new AppwriteException('Missing required parameter: "key"');
3721
+ }
3722
+ if (typeof size === 'undefined') {
3723
+ throw new AppwriteException('Missing required parameter: "size"');
3724
+ }
3725
+ if (typeof required === 'undefined') {
3726
+ throw new AppwriteException('Missing required parameter: "required"');
3727
+ }
3728
+
3729
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3730
+ const payload: Payload = {};
3731
+ if (typeof key !== 'undefined') {
3732
+ payload['key'] = key;
3733
+ }
3734
+ if (typeof size !== 'undefined') {
3735
+ payload['size'] = size;
3736
+ }
3737
+ if (typeof required !== 'undefined') {
3738
+ payload['required'] = required;
3739
+ }
3740
+ if (typeof xdefault !== 'undefined') {
3741
+ payload['default'] = xdefault;
3742
+ }
3743
+ if (typeof array !== 'undefined') {
3744
+ payload['array'] = array;
3745
+ }
3746
+ if (typeof encrypt !== 'undefined') {
3747
+ payload['encrypt'] = encrypt;
3748
+ }
3749
+ const uri = new URL(this.client.config.endpoint + apiPath);
3750
+
3751
+ const apiHeaders: { [header: string]: string } = {
3752
+ 'content-type': 'application/json',
3753
+ }
3754
+
3755
+ return this.client.call(
3756
+ 'post',
3757
+ uri,
3758
+ apiHeaders,
3759
+ payload
3760
+ );
3761
+ }
3762
+
3763
+ /**
3764
+ * Update a string attribute. Changing the `default` value will not update already existing documents.
3765
+ *
3766
+ *
3767
+ * @param {string} params.databaseId - Database ID.
3768
+ * @param {string} params.collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3769
+ * @param {string} params.key - Attribute Key.
3770
+ * @param {boolean} params.required - Is attribute required?
3771
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3772
+ * @param {number} params.size - Maximum size of the string attribute.
3773
+ * @param {string} params.newKey - New Attribute Key.
3774
+ * @throws {AppwriteException}
3775
+ * @returns {Promise<Models.AttributeString>}
3776
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead.
3777
+ */
3778
+ updateStringAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }): Promise<Models.AttributeString>;
3779
+ /**
3780
+ * Update a string attribute. Changing the `default` value will not update already existing documents.
3781
+ *
3782
+ *
3783
+ * @param {string} databaseId - Database ID.
3784
+ * @param {string} collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3785
+ * @param {string} key - Attribute Key.
3786
+ * @param {boolean} required - Is attribute required?
3787
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3788
+ * @param {number} size - Maximum size of the string attribute.
3789
+ * @param {string} newKey - New Attribute Key.
3790
+ * @throws {AppwriteException}
3791
+ * @returns {Promise<Models.AttributeString>}
3792
+ * @deprecated Use the object parameter style method for a better developer experience.
3793
+ */
3794
+ updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString>;
3795
+ updateStringAttribute(
3796
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string } | string,
3797
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number)?, (string)?]
3798
+ ): Promise<Models.AttributeString> {
3799
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string };
3800
+
3801
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3802
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string };
3803
+ } else {
3804
+ params = {
3805
+ databaseId: paramsOrFirst as string,
3806
+ collectionId: rest[0] as string,
3807
+ key: rest[1] as string,
3808
+ required: rest[2] as boolean,
3809
+ xdefault: rest[3] as string,
3810
+ size: rest[4] as number,
3811
+ newKey: rest[5] as string
3812
+ };
3813
+ }
3814
+
3815
+ const databaseId = params.databaseId;
3816
+ const collectionId = params.collectionId;
3817
+ const key = params.key;
3818
+ const required = params.required;
3819
+ const xdefault = params.xdefault;
3820
+ const size = params.size;
3821
+ const newKey = params.newKey;
3822
+
3823
+ if (typeof databaseId === 'undefined') {
3824
+ throw new AppwriteException('Missing required parameter: "databaseId"');
3825
+ }
3826
+ if (typeof collectionId === 'undefined') {
3827
+ throw new AppwriteException('Missing required parameter: "collectionId"');
3828
+ }
3829
+ if (typeof key === 'undefined') {
3830
+ throw new AppwriteException('Missing required parameter: "key"');
3831
+ }
3832
+ if (typeof required === 'undefined') {
3833
+ throw new AppwriteException('Missing required parameter: "required"');
3834
+ }
3835
+ if (typeof xdefault === 'undefined') {
3836
+ throw new AppwriteException('Missing required parameter: "xdefault"');
3837
+ }
3838
+
3839
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
3840
+ const payload: Payload = {};
3841
+ if (typeof required !== 'undefined') {
3842
+ payload['required'] = required;
3843
+ }
3844
+ if (typeof xdefault !== 'undefined') {
3845
+ payload['default'] = xdefault;
3846
+ }
3847
+ if (typeof size !== 'undefined') {
3848
+ payload['size'] = size;
3849
+ }
3850
+ if (typeof newKey !== 'undefined') {
3851
+ payload['newKey'] = newKey;
3852
+ }
3853
+ const uri = new URL(this.client.config.endpoint + apiPath);
3854
+
3855
+ const apiHeaders: { [header: string]: string } = {
3856
+ 'content-type': 'application/json',
3857
+ }
3858
+
3859
+ return this.client.call(
3860
+ 'patch',
3861
+ uri,
3862
+ apiHeaders,
3863
+ payload
3864
+ );
3865
+ }
3866
+
3867
+ /**
3868
+ * Create a text attribute.
3869
+ *
3870
+ *
3871
+ * @param {string} params.databaseId - Database ID.
3872
+ * @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).
3873
+ * @param {string} params.key - Attribute Key.
3874
+ * @param {boolean} params.required - Is attribute required?
3875
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3876
+ * @param {boolean} params.array - Is attribute an array?
3299
3877
  * @throws {AppwriteException}
3300
- * @returns {Promise<Models.AttributeString>}
3878
+ * @returns {Promise<Models.AttributeText>}
3879
+ */
3880
+ createTextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeText>;
3881
+ /**
3882
+ * Create a text attribute.
3883
+ *
3884
+ *
3885
+ * @param {string} databaseId - Database ID.
3886
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3887
+ * @param {string} key - Attribute Key.
3888
+ * @param {boolean} required - Is attribute required?
3889
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3890
+ * @param {boolean} array - Is attribute an array?
3891
+ * @throws {AppwriteException}
3892
+ * @returns {Promise<Models.AttributeText>}
3301
3893
  * @deprecated Use the object parameter style method for a better developer experience.
3302
3894
  */
3303
- createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString>;
3304
- createStringAttribute(
3305
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
3306
- ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
3307
- ): Promise<Models.AttributeString> {
3308
- let params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
3895
+ createTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeText>;
3896
+ createTextAttribute(
3897
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
3898
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
3899
+ ): Promise<Models.AttributeText> {
3900
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
3309
3901
 
3310
3902
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3311
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
3903
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
3312
3904
  } else {
3313
3905
  params = {
3314
3906
  databaseId: paramsOrFirst as string,
3315
3907
  collectionId: rest[0] as string,
3316
3908
  key: rest[1] as string,
3317
- size: rest[2] as number,
3318
- required: rest[3] as boolean,
3319
- xdefault: rest[4] as string,
3320
- array: rest[5] as boolean,
3321
- encrypt: rest[6] as boolean
3909
+ required: rest[2] as boolean,
3910
+ xdefault: rest[3] as string,
3911
+ array: rest[4] as boolean
3322
3912
  };
3323
3913
  }
3324
3914
 
3325
3915
  const databaseId = params.databaseId;
3326
3916
  const collectionId = params.collectionId;
3327
3917
  const key = params.key;
3328
- const size = params.size;
3329
3918
  const required = params.required;
3330
3919
  const xdefault = params.xdefault;
3331
3920
  const array = params.array;
3332
- const encrypt = params.encrypt;
3333
3921
 
3334
3922
  if (typeof databaseId === 'undefined') {
3335
3923
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -3340,21 +3928,15 @@ export class Databases {
3340
3928
  if (typeof key === 'undefined') {
3341
3929
  throw new AppwriteException('Missing required parameter: "key"');
3342
3930
  }
3343
- if (typeof size === 'undefined') {
3344
- throw new AppwriteException('Missing required parameter: "size"');
3345
- }
3346
3931
  if (typeof required === 'undefined') {
3347
3932
  throw new AppwriteException('Missing required parameter: "required"');
3348
3933
  }
3349
3934
 
3350
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3935
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/text'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
3351
3936
  const payload: Payload = {};
3352
3937
  if (typeof key !== 'undefined') {
3353
3938
  payload['key'] = key;
3354
3939
  }
3355
- if (typeof size !== 'undefined') {
3356
- payload['size'] = size;
3357
- }
3358
3940
  if (typeof required !== 'undefined') {
3359
3941
  payload['required'] = required;
3360
3942
  }
@@ -3364,9 +3946,6 @@ export class Databases {
3364
3946
  if (typeof array !== 'undefined') {
3365
3947
  payload['array'] = array;
3366
3948
  }
3367
- if (typeof encrypt !== 'undefined') {
3368
- payload['encrypt'] = encrypt;
3369
- }
3370
3949
  const uri = new URL(this.client.config.endpoint + apiPath);
3371
3950
 
3372
3951
  const apiHeaders: { [header: string]: string } = {
@@ -3382,45 +3961,42 @@ export class Databases {
3382
3961
  }
3383
3962
 
3384
3963
  /**
3385
- * Update a string attribute. Changing the `default` value will not update already existing documents.
3964
+ * Update a text attribute. Changing the `default` value will not update already existing documents.
3386
3965
  *
3387
3966
  *
3388
3967
  * @param {string} params.databaseId - Database ID.
3389
- * @param {string} params.collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3968
+ * @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).
3390
3969
  * @param {string} params.key - Attribute Key.
3391
3970
  * @param {boolean} params.required - Is attribute required?
3392
3971
  * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3393
- * @param {number} params.size - Maximum size of the string attribute.
3394
3972
  * @param {string} params.newKey - New Attribute Key.
3395
3973
  * @throws {AppwriteException}
3396
- * @returns {Promise<Models.AttributeString>}
3397
- * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead.
3974
+ * @returns {Promise<Models.AttributeText>}
3398
3975
  */
3399
- updateStringAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }): Promise<Models.AttributeString>;
3976
+ updateTextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeText>;
3400
3977
  /**
3401
- * Update a string attribute. Changing the `default` value will not update already existing documents.
3978
+ * Update a text attribute. Changing the `default` value will not update already existing documents.
3402
3979
  *
3403
3980
  *
3404
3981
  * @param {string} databaseId - Database ID.
3405
- * @param {string} collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3982
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
3406
3983
  * @param {string} key - Attribute Key.
3407
3984
  * @param {boolean} required - Is attribute required?
3408
3985
  * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3409
- * @param {number} size - Maximum size of the string attribute.
3410
3986
  * @param {string} newKey - New Attribute Key.
3411
3987
  * @throws {AppwriteException}
3412
- * @returns {Promise<Models.AttributeString>}
3988
+ * @returns {Promise<Models.AttributeText>}
3413
3989
  * @deprecated Use the object parameter style method for a better developer experience.
3414
3990
  */
3415
- updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString>;
3416
- updateStringAttribute(
3417
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string } | string,
3418
- ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number)?, (string)?]
3419
- ): Promise<Models.AttributeString> {
3420
- let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string };
3991
+ updateTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeText>;
3992
+ updateTextAttribute(
3993
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string } | string,
3994
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?]
3995
+ ): Promise<Models.AttributeText> {
3996
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string };
3421
3997
 
3422
3998
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3423
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string };
3999
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string };
3424
4000
  } else {
3425
4001
  params = {
3426
4002
  databaseId: paramsOrFirst as string,
@@ -3428,8 +4004,7 @@ export class Databases {
3428
4004
  key: rest[1] as string,
3429
4005
  required: rest[2] as boolean,
3430
4006
  xdefault: rest[3] as string,
3431
- size: rest[4] as number,
3432
- newKey: rest[5] as string
4007
+ newKey: rest[4] as string
3433
4008
  };
3434
4009
  }
3435
4010
 
@@ -3438,7 +4013,6 @@ export class Databases {
3438
4013
  const key = params.key;
3439
4014
  const required = params.required;
3440
4015
  const xdefault = params.xdefault;
3441
- const size = params.size;
3442
4016
  const newKey = params.newKey;
3443
4017
 
3444
4018
  if (typeof databaseId === 'undefined') {
@@ -3457,7 +4031,7 @@ export class Databases {
3457
4031
  throw new AppwriteException('Missing required parameter: "xdefault"');
3458
4032
  }
3459
4033
 
3460
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
4034
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/text/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
3461
4035
  const payload: Payload = {};
3462
4036
  if (typeof required !== 'undefined') {
3463
4037
  payload['required'] = required;
@@ -3465,9 +4039,6 @@ export class Databases {
3465
4039
  if (typeof xdefault !== 'undefined') {
3466
4040
  payload['default'] = xdefault;
3467
4041
  }
3468
- if (typeof size !== 'undefined') {
3469
- payload['size'] = size;
3470
- }
3471
4042
  if (typeof newKey !== 'undefined') {
3472
4043
  payload['newKey'] = newKey;
3473
4044
  }
@@ -3499,7 +4070,7 @@ export class Databases {
3499
4070
  * @returns {Promise<Models.AttributeUrl>}
3500
4071
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createUrlColumn` instead.
3501
4072
  */
3502
- createUrlAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeUrl>;
4073
+ createUrlAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeUrl>;
3503
4074
  /**
3504
4075
  * Create a URL attribute.
3505
4076
  *
@@ -3596,7 +4167,7 @@ export class Databases {
3596
4167
  * @returns {Promise<Models.AttributeUrl>}
3597
4168
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateUrlColumn` instead.
3598
4169
  */
3599
- updateUrlAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeUrl>;
4170
+ updateUrlAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.AttributeUrl>;
3600
4171
  /**
3601
4172
  * Update an url attribute. Changing the `default` value will not update already existing documents.
3602
4173
  *
@@ -3679,6 +4250,215 @@ export class Databases {
3679
4250
  );
3680
4251
  }
3681
4252
 
4253
+ /**
4254
+ * Create a varchar attribute.
4255
+ *
4256
+ *
4257
+ * @param {string} params.databaseId - Database ID.
4258
+ * @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).
4259
+ * @param {string} params.key - Attribute Key.
4260
+ * @param {number} params.size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
4261
+ * @param {boolean} params.required - Is attribute required?
4262
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
4263
+ * @param {boolean} params.array - Is attribute an array?
4264
+ * @throws {AppwriteException}
4265
+ * @returns {Promise<Models.AttributeVarchar>}
4266
+ */
4267
+ createVarcharAttribute(params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeVarchar>;
4268
+ /**
4269
+ * Create a varchar attribute.
4270
+ *
4271
+ *
4272
+ * @param {string} databaseId - Database ID.
4273
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
4274
+ * @param {string} key - Attribute Key.
4275
+ * @param {number} size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
4276
+ * @param {boolean} required - Is attribute required?
4277
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
4278
+ * @param {boolean} array - Is attribute an array?
4279
+ * @throws {AppwriteException}
4280
+ * @returns {Promise<Models.AttributeVarchar>}
4281
+ * @deprecated Use the object parameter style method for a better developer experience.
4282
+ */
4283
+ createVarcharAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeVarchar>;
4284
+ createVarcharAttribute(
4285
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean } | string,
4286
+ ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?]
4287
+ ): Promise<Models.AttributeVarchar> {
4288
+ let params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean };
4289
+
4290
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4291
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean };
4292
+ } else {
4293
+ params = {
4294
+ databaseId: paramsOrFirst as string,
4295
+ collectionId: rest[0] as string,
4296
+ key: rest[1] as string,
4297
+ size: rest[2] as number,
4298
+ required: rest[3] as boolean,
4299
+ xdefault: rest[4] as string,
4300
+ array: rest[5] as boolean
4301
+ };
4302
+ }
4303
+
4304
+ const databaseId = params.databaseId;
4305
+ const collectionId = params.collectionId;
4306
+ const key = params.key;
4307
+ const size = params.size;
4308
+ const required = params.required;
4309
+ const xdefault = params.xdefault;
4310
+ const array = params.array;
4311
+
4312
+ if (typeof databaseId === 'undefined') {
4313
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4314
+ }
4315
+ if (typeof collectionId === 'undefined') {
4316
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4317
+ }
4318
+ if (typeof key === 'undefined') {
4319
+ throw new AppwriteException('Missing required parameter: "key"');
4320
+ }
4321
+ if (typeof size === 'undefined') {
4322
+ throw new AppwriteException('Missing required parameter: "size"');
4323
+ }
4324
+ if (typeof required === 'undefined') {
4325
+ throw new AppwriteException('Missing required parameter: "required"');
4326
+ }
4327
+
4328
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/varchar'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
4329
+ const payload: Payload = {};
4330
+ if (typeof key !== 'undefined') {
4331
+ payload['key'] = key;
4332
+ }
4333
+ if (typeof size !== 'undefined') {
4334
+ payload['size'] = size;
4335
+ }
4336
+ if (typeof required !== 'undefined') {
4337
+ payload['required'] = required;
4338
+ }
4339
+ if (typeof xdefault !== 'undefined') {
4340
+ payload['default'] = xdefault;
4341
+ }
4342
+ if (typeof array !== 'undefined') {
4343
+ payload['array'] = array;
4344
+ }
4345
+ const uri = new URL(this.client.config.endpoint + apiPath);
4346
+
4347
+ const apiHeaders: { [header: string]: string } = {
4348
+ 'content-type': 'application/json',
4349
+ }
4350
+
4351
+ return this.client.call(
4352
+ 'post',
4353
+ uri,
4354
+ apiHeaders,
4355
+ payload
4356
+ );
4357
+ }
4358
+
4359
+ /**
4360
+ * Update a varchar attribute. Changing the `default` value will not update already existing documents.
4361
+ *
4362
+ *
4363
+ * @param {string} params.databaseId - Database ID.
4364
+ * @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).
4365
+ * @param {string} params.key - Attribute Key.
4366
+ * @param {boolean} params.required - Is attribute required?
4367
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
4368
+ * @param {number} params.size - Maximum size of the varchar attribute.
4369
+ * @param {string} params.newKey - New Attribute Key.
4370
+ * @throws {AppwriteException}
4371
+ * @returns {Promise<Models.AttributeVarchar>}
4372
+ */
4373
+ updateVarcharAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }): Promise<Models.AttributeVarchar>;
4374
+ /**
4375
+ * Update a varchar attribute. Changing the `default` value will not update already existing documents.
4376
+ *
4377
+ *
4378
+ * @param {string} databaseId - Database ID.
4379
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
4380
+ * @param {string} key - Attribute Key.
4381
+ * @param {boolean} required - Is attribute required?
4382
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
4383
+ * @param {number} size - Maximum size of the varchar attribute.
4384
+ * @param {string} newKey - New Attribute Key.
4385
+ * @throws {AppwriteException}
4386
+ * @returns {Promise<Models.AttributeVarchar>}
4387
+ * @deprecated Use the object parameter style method for a better developer experience.
4388
+ */
4389
+ updateVarcharAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeVarchar>;
4390
+ updateVarcharAttribute(
4391
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string } | string,
4392
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number)?, (string)?]
4393
+ ): Promise<Models.AttributeVarchar> {
4394
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string };
4395
+
4396
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4397
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string };
4398
+ } else {
4399
+ params = {
4400
+ databaseId: paramsOrFirst as string,
4401
+ collectionId: rest[0] as string,
4402
+ key: rest[1] as string,
4403
+ required: rest[2] as boolean,
4404
+ xdefault: rest[3] as string,
4405
+ size: rest[4] as number,
4406
+ newKey: rest[5] as string
4407
+ };
4408
+ }
4409
+
4410
+ const databaseId = params.databaseId;
4411
+ const collectionId = params.collectionId;
4412
+ const key = params.key;
4413
+ const required = params.required;
4414
+ const xdefault = params.xdefault;
4415
+ const size = params.size;
4416
+ const newKey = params.newKey;
4417
+
4418
+ if (typeof databaseId === 'undefined') {
4419
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4420
+ }
4421
+ if (typeof collectionId === 'undefined') {
4422
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4423
+ }
4424
+ if (typeof key === 'undefined') {
4425
+ throw new AppwriteException('Missing required parameter: "key"');
4426
+ }
4427
+ if (typeof required === 'undefined') {
4428
+ throw new AppwriteException('Missing required parameter: "required"');
4429
+ }
4430
+ if (typeof xdefault === 'undefined') {
4431
+ throw new AppwriteException('Missing required parameter: "xdefault"');
4432
+ }
4433
+
4434
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
4435
+ const payload: Payload = {};
4436
+ if (typeof required !== 'undefined') {
4437
+ payload['required'] = required;
4438
+ }
4439
+ if (typeof xdefault !== 'undefined') {
4440
+ payload['default'] = xdefault;
4441
+ }
4442
+ if (typeof size !== 'undefined') {
4443
+ payload['size'] = size;
4444
+ }
4445
+ if (typeof newKey !== 'undefined') {
4446
+ payload['newKey'] = newKey;
4447
+ }
4448
+ const uri = new URL(this.client.config.endpoint + apiPath);
4449
+
4450
+ const apiHeaders: { [header: string]: string } = {
4451
+ 'content-type': 'application/json',
4452
+ }
4453
+
4454
+ return this.client.call(
4455
+ 'patch',
4456
+ uri,
4457
+ apiHeaders,
4458
+ payload
4459
+ );
4460
+ }
4461
+
3682
4462
  /**
3683
4463
  * Get attribute by ID.
3684
4464
  *
@@ -3689,7 +4469,7 @@ export class Databases {
3689
4469
  * @returns {Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>}
3690
4470
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead.
3691
4471
  */
3692
- getAttribute(params: { 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>;
4472
+ getAttribute(params: { 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>;
3693
4473
  /**
3694
4474
  * Get attribute by ID.
3695
4475
  *
@@ -3756,7 +4536,7 @@ export class Databases {
3756
4536
  * @returns {Promise<{}>}
3757
4537
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteColumn` instead.
3758
4538
  */
3759
- deleteAttribute(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>;
4539
+ deleteAttribute(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>;
3760
4540
  /**
3761
4541
  * Deletes an attribute.
3762
4542
  *
@@ -3827,7 +4607,7 @@ export class Databases {
3827
4607
  * @returns {Promise<Models.AttributeRelationship>}
3828
4608
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.
3829
4609
  */
3830
- updateRelationshipAttribute(params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string }): Promise<Models.AttributeRelationship>;
4610
+ updateRelationshipAttribute(params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string }): Promise<Models.AttributeRelationship>;
3831
4611
  /**
3832
4612
  * Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
3833
4613
  *
@@ -3910,7 +4690,7 @@ export class Databases {
3910
4690
  * @returns {Promise<Models.DocumentList<Document>>}
3911
4691
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
3912
4692
  */
3913
- listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean }): Promise<Models.DocumentList<Document>>;
4693
+ listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean }): Promise<Models.DocumentList<Document>>;
3914
4694
  /**
3915
4695
  * Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
3916
4696
  *
@@ -3992,7 +4772,7 @@ export class Databases {
3992
4772
  * @returns {Promise<Document>}
3993
4773
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.
3994
4774
  */
3995
- createDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[], transactionId?: string }): Promise<Document>;
4775
+ createDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[], transactionId?: string }): Promise<Document>;
3996
4776
  /**
3997
4777
  * 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.
3998
4778
  *
@@ -4085,7 +4865,7 @@ export class Databases {
4085
4865
  * @returns {Promise<Models.DocumentList<Document>>}
4086
4866
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead.
4087
4867
  */
4088
- createDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
4868
+ createDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
4089
4869
  /**
4090
4870
  * 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.
4091
4871
  *
@@ -4164,7 +4944,7 @@ export class Databases {
4164
4944
  * @returns {Promise<Models.DocumentList<Document>>}
4165
4945
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead.
4166
4946
  */
4167
- upsertDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
4947
+ upsertDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
4168
4948
  /**
4169
4949
  * 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.
4170
4950
  *
@@ -4244,7 +5024,7 @@ export class Databases {
4244
5024
  * @returns {Promise<Models.DocumentList<Document>>}
4245
5025
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead.
4246
5026
  */
4247
- updateDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
5027
+ updateDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
4248
5028
  /**
4249
5029
  * 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.
4250
5030
  *
@@ -4325,7 +5105,7 @@ export class Databases {
4325
5105
  * @returns {Promise<Models.DocumentList<Document>>}
4326
5106
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRows` instead.
4327
5107
  */
4328
- deleteDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
5108
+ deleteDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }): Promise<Models.DocumentList<Document>>;
4329
5109
  /**
4330
5110
  * Bulk delete documents using queries, if no queries are passed then all documents are deleted.
4331
5111
  *
@@ -4401,7 +5181,7 @@ export class Databases {
4401
5181
  * @returns {Promise<Document>}
4402
5182
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.
4403
5183
  */
4404
- getDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }): Promise<Document>;
5184
+ getDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }): Promise<Document>;
4405
5185
  /**
4406
5186
  * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
4407
5187
  *
@@ -4483,7 +5263,7 @@ export class Databases {
4483
5263
  * @returns {Promise<Document>}
4484
5264
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.
4485
5265
  */
4486
- upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params: { 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>;
5266
+ upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params: { 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>;
4487
5267
  /**
4488
5268
  * 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.
4489
5269
  *
@@ -4572,7 +5352,7 @@ export class Databases {
4572
5352
  * @returns {Promise<Document>}
4573
5353
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.
4574
5354
  */
4575
- updateDocument<Document extends Models.Document = Models.DefaultDocument>(params: { 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>;
5355
+ updateDocument<Document extends Models.Document = Models.DefaultDocument>(params: { 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>;
4576
5356
  /**
4577
5357
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
4578
5358
  *
@@ -4659,7 +5439,7 @@ export class Databases {
4659
5439
  * @returns {Promise<{}>}
4660
5440
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.
4661
5441
  */
4662
- deleteDocument(params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }): Promise<{}>;
5442
+ deleteDocument(params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }): Promise<{}>;
4663
5443
  /**
4664
5444
  * Delete a document by its unique ID.
4665
5445
  *
@@ -4734,7 +5514,7 @@ export class Databases {
4734
5514
  * @returns {Promise<Models.LogList>}
4735
5515
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRowLogs` instead.
4736
5516
  */
4737
- listDocumentLogs(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }): Promise<Models.LogList>;
5517
+ listDocumentLogs(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }): Promise<Models.LogList>;
4738
5518
  /**
4739
5519
  * Get the document activity logs list by its unique ID.
4740
5520
  *
@@ -4811,7 +5591,7 @@ export class Databases {
4811
5591
  * @returns {Promise<Document>}
4812
5592
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.
4813
5593
  */
4814
- decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }): Promise<Document>;
5594
+ decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }): Promise<Document>;
4815
5595
  /**
4816
5596
  * Decrement a specific attribute of a document by a given value.
4817
5597
  *
@@ -4907,7 +5687,7 @@ export class Databases {
4907
5687
  * @returns {Promise<Document>}
4908
5688
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.
4909
5689
  */
4910
- incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }): Promise<Document>;
5690
+ incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }): Promise<Document>;
4911
5691
  /**
4912
5692
  * Increment a specific attribute of a document by a given value.
4913
5693
  *
@@ -5000,7 +5780,7 @@ export class Databases {
5000
5780
  * @returns {Promise<Models.IndexList>}
5001
5781
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listIndexes` instead.
5002
5782
  */
5003
- listIndexes(params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }): Promise<Models.IndexList>;
5783
+ listIndexes(params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }): Promise<Models.IndexList>;
5004
5784
  /**
5005
5785
  * List indexes in the collection.
5006
5786
  *
@@ -5072,13 +5852,13 @@ export class Databases {
5072
5852
  * @param {string} params.key - Index Key.
5073
5853
  * @param {IndexType} params.type - Index type.
5074
5854
  * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
5075
- * @param {string[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
5855
+ * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
5076
5856
  * @param {number[]} params.lengths - Length of index. Maximum of 100
5077
5857
  * @throws {AppwriteException}
5078
5858
  * @returns {Promise<Models.Index>}
5079
5859
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead.
5080
5860
  */
5081
- createIndex(params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] }): Promise<Models.Index>;
5861
+ createIndex(params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }): Promise<Models.Index>;
5082
5862
  /**
5083
5863
  * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
5084
5864
  * Attributes can be `key`, `fulltext`, and `unique`.
@@ -5088,21 +5868,21 @@ export class Databases {
5088
5868
  * @param {string} key - Index Key.
5089
5869
  * @param {IndexType} type - Index type.
5090
5870
  * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
5091
- * @param {string[]} orders - Array of index orders. Maximum of 100 orders are allowed.
5871
+ * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
5092
5872
  * @param {number[]} lengths - Length of index. Maximum of 100
5093
5873
  * @throws {AppwriteException}
5094
5874
  * @returns {Promise<Models.Index>}
5095
5875
  * @deprecated Use the object parameter style method for a better developer experience.
5096
5876
  */
5097
- createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise<Models.Index>;
5877
+ createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.Index>;
5098
5878
  createIndex(
5099
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] } | string,
5100
- ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number[])?]
5879
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] } | string,
5880
+ ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (OrderBy[])?, (number[])?]
5101
5881
  ): Promise<Models.Index> {
5102
- let params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] };
5882
+ let params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] };
5103
5883
 
5104
5884
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5105
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] };
5885
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] };
5106
5886
  } else {
5107
5887
  params = {
5108
5888
  databaseId: paramsOrFirst as string,
@@ -5110,7 +5890,7 @@ export class Databases {
5110
5890
  key: rest[1] as string,
5111
5891
  type: rest[2] as IndexType,
5112
5892
  attributes: rest[3] as string[],
5113
- orders: rest[4] as string[],
5893
+ orders: rest[4] as OrderBy[],
5114
5894
  lengths: rest[5] as number[]
5115
5895
  };
5116
5896
  }
@@ -5180,7 +5960,7 @@ export class Databases {
5180
5960
  * @returns {Promise<Models.Index>}
5181
5961
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getIndex` instead.
5182
5962
  */
5183
- getIndex(params: { databaseId: string, collectionId: string, key: string }): Promise<Models.Index>;
5963
+ getIndex(params: { databaseId: string, collectionId: string, key: string }): Promise<Models.Index>;
5184
5964
  /**
5185
5965
  * Get an index by its unique ID.
5186
5966
  *
@@ -5247,7 +6027,7 @@ export class Databases {
5247
6027
  * @returns {Promise<{}>}
5248
6028
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteIndex` instead.
5249
6029
  */
5250
- deleteIndex(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>;
6030
+ deleteIndex(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>;
5251
6031
  /**
5252
6032
  * Delete an index.
5253
6033
  *
@@ -5315,7 +6095,7 @@ export class Databases {
5315
6095
  * @returns {Promise<Models.LogList>}
5316
6096
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listTableLogs` instead.
5317
6097
  */
5318
- listCollectionLogs(params: { databaseId: string, collectionId: string, queries?: string[] }): Promise<Models.LogList>;
6098
+ listCollectionLogs(params: { databaseId: string, collectionId: string, queries?: string[] }): Promise<Models.LogList>;
5319
6099
  /**
5320
6100
  * Get the collection activity logs list by its unique ID.
5321
6101
  *
@@ -5382,7 +6162,7 @@ export class Databases {
5382
6162
  * @returns {Promise<Models.UsageCollection>}
5383
6163
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getTableUsage` instead.
5384
6164
  */
5385
- getCollectionUsage(params: { databaseId: string, collectionId: string, range?: UsageRange }): Promise<Models.UsageCollection>;
6165
+ getCollectionUsage(params: { databaseId: string, collectionId: string, range?: UsageRange }): Promise<Models.UsageCollection>;
5386
6166
  /**
5387
6167
  * Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
5388
6168
  *
@@ -5448,7 +6228,7 @@ export class Databases {
5448
6228
  * @returns {Promise<Models.LogList>}
5449
6229
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listDatabaseLogs` instead.
5450
6230
  */
5451
- listLogs(params: { databaseId: string, queries?: string[] }): Promise<Models.LogList>;
6231
+ listLogs(params: { databaseId: string, queries?: string[] }): Promise<Models.LogList>;
5452
6232
  /**
5453
6233
  * Get the database activity logs list by its unique ID.
5454
6234
  *
@@ -5508,7 +6288,7 @@ export class Databases {
5508
6288
  * @returns {Promise<Models.UsageDatabase>}
5509
6289
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getUsage` instead.
5510
6290
  */
5511
- getUsage(params: { databaseId: string, range?: UsageRange }): Promise<Models.UsageDatabase>;
6291
+ getUsage(params: { databaseId: string, range?: UsageRange }): Promise<Models.UsageDatabase>;
5512
6292
  /**
5513
6293
  * Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
5514
6294
  *