@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
@@ -4,6 +4,7 @@ import { UsageRange } from '../enums/usage-range';
4
4
  import { RelationshipType } from '../enums/relationship-type';
5
5
  import { RelationMutate } from '../enums/relation-mutate';
6
6
  import { IndexType } from '../enums/index-type';
7
+ import { OrderBy } from '../enums/order-by';
7
8
  export declare class Databases {
8
9
  client: Client;
9
10
  constructor(client: Client);
@@ -236,7 +237,7 @@ export declare class Databases {
236
237
  */
237
238
  update(params: {
238
239
  databaseId: string;
239
- name: string;
240
+ name?: string;
240
241
  enabled?: boolean;
241
242
  }): Promise<Models.Database>;
242
243
  /**
@@ -249,7 +250,7 @@ export declare class Databases {
249
250
  * @returns {Promise<Models.Database>}
250
251
  * @deprecated Use the object parameter style method for a better developer experience.
251
252
  */
252
- update(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database>;
253
+ update(databaseId: string, name?: string, enabled?: boolean): Promise<Models.Database>;
253
254
  /**
254
255
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
255
256
  *
@@ -379,7 +380,7 @@ export declare class Databases {
379
380
  updateCollection(params: {
380
381
  databaseId: string;
381
382
  collectionId: string;
382
- name: string;
383
+ name?: string;
383
384
  permissions?: string[];
384
385
  documentSecurity?: boolean;
385
386
  enabled?: boolean;
@@ -397,7 +398,7 @@ export declare class Databases {
397
398
  * @returns {Promise<Models.Collection>}
398
399
  * @deprecated Use the object parameter style method for a better developer experience.
399
400
  */
400
- updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
401
+ updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
401
402
  /**
402
403
  * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
403
404
  *
@@ -1059,6 +1060,150 @@ export declare class Databases {
1059
1060
  * @deprecated Use the object parameter style method for a better developer experience.
1060
1061
  */
1061
1062
  updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributeLine>;
1063
+ /**
1064
+ * Create a longtext attribute.
1065
+ *
1066
+ *
1067
+ * @param {string} params.databaseId - Database ID.
1068
+ * @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).
1069
+ * @param {string} params.key - Attribute Key.
1070
+ * @param {boolean} params.required - Is attribute required?
1071
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1072
+ * @param {boolean} params.array - Is attribute an array?
1073
+ * @throws {AppwriteException}
1074
+ * @returns {Promise<Models.AttributeLongtext>}
1075
+ */
1076
+ createLongtextAttribute(params: {
1077
+ databaseId: string;
1078
+ collectionId: string;
1079
+ key: string;
1080
+ required: boolean;
1081
+ xdefault?: string;
1082
+ array?: boolean;
1083
+ }): Promise<Models.AttributeLongtext>;
1084
+ /**
1085
+ * Create a longtext attribute.
1086
+ *
1087
+ *
1088
+ * @param {string} databaseId - Database ID.
1089
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1090
+ * @param {string} key - Attribute Key.
1091
+ * @param {boolean} required - Is attribute required?
1092
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1093
+ * @param {boolean} array - Is attribute an array?
1094
+ * @throws {AppwriteException}
1095
+ * @returns {Promise<Models.AttributeLongtext>}
1096
+ * @deprecated Use the object parameter style method for a better developer experience.
1097
+ */
1098
+ createLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeLongtext>;
1099
+ /**
1100
+ * Update a longtext attribute. Changing the `default` value will not update already existing documents.
1101
+ *
1102
+ *
1103
+ * @param {string} params.databaseId - Database ID.
1104
+ * @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).
1105
+ * @param {string} params.key - Attribute Key.
1106
+ * @param {boolean} params.required - Is attribute required?
1107
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1108
+ * @param {string} params.newKey - New Attribute Key.
1109
+ * @throws {AppwriteException}
1110
+ * @returns {Promise<Models.AttributeLongtext>}
1111
+ */
1112
+ updateLongtextAttribute(params: {
1113
+ databaseId: string;
1114
+ collectionId: string;
1115
+ key: string;
1116
+ required: boolean;
1117
+ xdefault?: string;
1118
+ newKey?: string;
1119
+ }): Promise<Models.AttributeLongtext>;
1120
+ /**
1121
+ * Update a longtext attribute. Changing the `default` value will not update already existing documents.
1122
+ *
1123
+ *
1124
+ * @param {string} databaseId - Database ID.
1125
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1126
+ * @param {string} key - Attribute Key.
1127
+ * @param {boolean} required - Is attribute required?
1128
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1129
+ * @param {string} newKey - New Attribute Key.
1130
+ * @throws {AppwriteException}
1131
+ * @returns {Promise<Models.AttributeLongtext>}
1132
+ * @deprecated Use the object parameter style method for a better developer experience.
1133
+ */
1134
+ updateLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeLongtext>;
1135
+ /**
1136
+ * Create a mediumtext attribute.
1137
+ *
1138
+ *
1139
+ * @param {string} params.databaseId - Database ID.
1140
+ * @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).
1141
+ * @param {string} params.key - Attribute Key.
1142
+ * @param {boolean} params.required - Is attribute required?
1143
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1144
+ * @param {boolean} params.array - Is attribute an array?
1145
+ * @throws {AppwriteException}
1146
+ * @returns {Promise<Models.AttributeMediumtext>}
1147
+ */
1148
+ createMediumtextAttribute(params: {
1149
+ databaseId: string;
1150
+ collectionId: string;
1151
+ key: string;
1152
+ required: boolean;
1153
+ xdefault?: string;
1154
+ array?: boolean;
1155
+ }): Promise<Models.AttributeMediumtext>;
1156
+ /**
1157
+ * Create a mediumtext attribute.
1158
+ *
1159
+ *
1160
+ * @param {string} databaseId - Database ID.
1161
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1162
+ * @param {string} key - Attribute Key.
1163
+ * @param {boolean} required - Is attribute required?
1164
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1165
+ * @param {boolean} array - Is attribute an array?
1166
+ * @throws {AppwriteException}
1167
+ * @returns {Promise<Models.AttributeMediumtext>}
1168
+ * @deprecated Use the object parameter style method for a better developer experience.
1169
+ */
1170
+ createMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeMediumtext>;
1171
+ /**
1172
+ * Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
1173
+ *
1174
+ *
1175
+ * @param {string} params.databaseId - Database ID.
1176
+ * @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).
1177
+ * @param {string} params.key - Attribute Key.
1178
+ * @param {boolean} params.required - Is attribute required?
1179
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1180
+ * @param {string} params.newKey - New Attribute Key.
1181
+ * @throws {AppwriteException}
1182
+ * @returns {Promise<Models.AttributeMediumtext>}
1183
+ */
1184
+ updateMediumtextAttribute(params: {
1185
+ databaseId: string;
1186
+ collectionId: string;
1187
+ key: string;
1188
+ required: boolean;
1189
+ xdefault?: string;
1190
+ newKey?: string;
1191
+ }): Promise<Models.AttributeMediumtext>;
1192
+ /**
1193
+ * Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
1194
+ *
1195
+ *
1196
+ * @param {string} databaseId - Database ID.
1197
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1198
+ * @param {string} key - Attribute Key.
1199
+ * @param {boolean} required - Is attribute required?
1200
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1201
+ * @param {string} newKey - New Attribute Key.
1202
+ * @throws {AppwriteException}
1203
+ * @returns {Promise<Models.AttributeMediumtext>}
1204
+ * @deprecated Use the object parameter style method for a better developer experience.
1205
+ */
1206
+ updateMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeMediumtext>;
1062
1207
  /**
1063
1208
  * Create a geometric point attribute.
1064
1209
  *
@@ -1319,6 +1464,78 @@ export declare class Databases {
1319
1464
  * @deprecated Use the object parameter style method for a better developer experience.
1320
1465
  */
1321
1466
  updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString>;
1467
+ /**
1468
+ * Create a text attribute.
1469
+ *
1470
+ *
1471
+ * @param {string} params.databaseId - Database ID.
1472
+ * @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).
1473
+ * @param {string} params.key - Attribute Key.
1474
+ * @param {boolean} params.required - Is attribute required?
1475
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1476
+ * @param {boolean} params.array - Is attribute an array?
1477
+ * @throws {AppwriteException}
1478
+ * @returns {Promise<Models.AttributeText>}
1479
+ */
1480
+ createTextAttribute(params: {
1481
+ databaseId: string;
1482
+ collectionId: string;
1483
+ key: string;
1484
+ required: boolean;
1485
+ xdefault?: string;
1486
+ array?: boolean;
1487
+ }): Promise<Models.AttributeText>;
1488
+ /**
1489
+ * Create a text attribute.
1490
+ *
1491
+ *
1492
+ * @param {string} databaseId - Database ID.
1493
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1494
+ * @param {string} key - Attribute Key.
1495
+ * @param {boolean} required - Is attribute required?
1496
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1497
+ * @param {boolean} array - Is attribute an array?
1498
+ * @throws {AppwriteException}
1499
+ * @returns {Promise<Models.AttributeText>}
1500
+ * @deprecated Use the object parameter style method for a better developer experience.
1501
+ */
1502
+ createTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeText>;
1503
+ /**
1504
+ * Update a text attribute. Changing the `default` value will not update already existing documents.
1505
+ *
1506
+ *
1507
+ * @param {string} params.databaseId - Database ID.
1508
+ * @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).
1509
+ * @param {string} params.key - Attribute Key.
1510
+ * @param {boolean} params.required - Is attribute required?
1511
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1512
+ * @param {string} params.newKey - New Attribute Key.
1513
+ * @throws {AppwriteException}
1514
+ * @returns {Promise<Models.AttributeText>}
1515
+ */
1516
+ updateTextAttribute(params: {
1517
+ databaseId: string;
1518
+ collectionId: string;
1519
+ key: string;
1520
+ required: boolean;
1521
+ xdefault?: string;
1522
+ newKey?: string;
1523
+ }): Promise<Models.AttributeText>;
1524
+ /**
1525
+ * Update a text attribute. Changing the `default` value will not update already existing documents.
1526
+ *
1527
+ *
1528
+ * @param {string} databaseId - Database ID.
1529
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1530
+ * @param {string} key - Attribute Key.
1531
+ * @param {boolean} required - Is attribute required?
1532
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1533
+ * @param {string} newKey - New Attribute Key.
1534
+ * @throws {AppwriteException}
1535
+ * @returns {Promise<Models.AttributeText>}
1536
+ * @deprecated Use the object parameter style method for a better developer experience.
1537
+ */
1538
+ updateTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeText>;
1322
1539
  /**
1323
1540
  * Create a URL attribute.
1324
1541
  *
@@ -1393,6 +1610,84 @@ export declare class Databases {
1393
1610
  * @deprecated Use the object parameter style method for a better developer experience.
1394
1611
  */
1395
1612
  updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeUrl>;
1613
+ /**
1614
+ * Create a varchar attribute.
1615
+ *
1616
+ *
1617
+ * @param {string} params.databaseId - Database ID.
1618
+ * @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).
1619
+ * @param {string} params.key - Attribute Key.
1620
+ * @param {number} params.size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
1621
+ * @param {boolean} params.required - Is attribute required?
1622
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1623
+ * @param {boolean} params.array - Is attribute an array?
1624
+ * @throws {AppwriteException}
1625
+ * @returns {Promise<Models.AttributeVarchar>}
1626
+ */
1627
+ createVarcharAttribute(params: {
1628
+ databaseId: string;
1629
+ collectionId: string;
1630
+ key: string;
1631
+ size: number;
1632
+ required: boolean;
1633
+ xdefault?: string;
1634
+ array?: boolean;
1635
+ }): Promise<Models.AttributeVarchar>;
1636
+ /**
1637
+ * Create a varchar attribute.
1638
+ *
1639
+ *
1640
+ * @param {string} databaseId - Database ID.
1641
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1642
+ * @param {string} key - Attribute Key.
1643
+ * @param {number} size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
1644
+ * @param {boolean} required - Is attribute required?
1645
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1646
+ * @param {boolean} array - Is attribute an array?
1647
+ * @throws {AppwriteException}
1648
+ * @returns {Promise<Models.AttributeVarchar>}
1649
+ * @deprecated Use the object parameter style method for a better developer experience.
1650
+ */
1651
+ createVarcharAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeVarchar>;
1652
+ /**
1653
+ * Update a varchar attribute. Changing the `default` value will not update already existing documents.
1654
+ *
1655
+ *
1656
+ * @param {string} params.databaseId - Database ID.
1657
+ * @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).
1658
+ * @param {string} params.key - Attribute Key.
1659
+ * @param {boolean} params.required - Is attribute required?
1660
+ * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1661
+ * @param {number} params.size - Maximum size of the varchar attribute.
1662
+ * @param {string} params.newKey - New Attribute Key.
1663
+ * @throws {AppwriteException}
1664
+ * @returns {Promise<Models.AttributeVarchar>}
1665
+ */
1666
+ updateVarcharAttribute(params: {
1667
+ databaseId: string;
1668
+ collectionId: string;
1669
+ key: string;
1670
+ required: boolean;
1671
+ xdefault?: string;
1672
+ size?: number;
1673
+ newKey?: string;
1674
+ }): Promise<Models.AttributeVarchar>;
1675
+ /**
1676
+ * Update a varchar attribute. Changing the `default` value will not update already existing documents.
1677
+ *
1678
+ *
1679
+ * @param {string} databaseId - Database ID.
1680
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1681
+ * @param {string} key - Attribute Key.
1682
+ * @param {boolean} required - Is attribute required?
1683
+ * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
1684
+ * @param {number} size - Maximum size of the varchar attribute.
1685
+ * @param {string} newKey - New Attribute Key.
1686
+ * @throws {AppwriteException}
1687
+ * @returns {Promise<Models.AttributeVarchar>}
1688
+ * @deprecated Use the object parameter style method for a better developer experience.
1689
+ */
1690
+ updateVarcharAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeVarchar>;
1396
1691
  /**
1397
1692
  * Get attribute by ID.
1398
1693
  *
@@ -1941,7 +2236,7 @@ export declare class Databases {
1941
2236
  * @param {string} params.key - Index Key.
1942
2237
  * @param {IndexType} params.type - Index type.
1943
2238
  * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1944
- * @param {string[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
2239
+ * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
1945
2240
  * @param {number[]} params.lengths - Length of index. Maximum of 100
1946
2241
  * @throws {AppwriteException}
1947
2242
  * @returns {Promise<Models.Index>}
@@ -1953,7 +2248,7 @@ export declare class Databases {
1953
2248
  key: string;
1954
2249
  type: IndexType;
1955
2250
  attributes: string[];
1956
- orders?: string[];
2251
+ orders?: OrderBy[];
1957
2252
  lengths?: number[];
1958
2253
  }): Promise<Models.Index>;
1959
2254
  /**
@@ -1965,13 +2260,13 @@ export declare class Databases {
1965
2260
  * @param {string} key - Index Key.
1966
2261
  * @param {IndexType} type - Index type.
1967
2262
  * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1968
- * @param {string[]} orders - Array of index orders. Maximum of 100 orders are allowed.
2263
+ * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
1969
2264
  * @param {number[]} lengths - Length of index. Maximum of 100
1970
2265
  * @throws {AppwriteException}
1971
2266
  * @returns {Promise<Models.Index>}
1972
2267
  * @deprecated Use the object parameter style method for a better developer experience.
1973
2268
  */
1974
- createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise<Models.Index>;
2269
+ createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.Index>;
1975
2270
  /**
1976
2271
  * Get an index by its unique ID.
1977
2272
  *
@@ -1,6 +1,9 @@
1
1
  import { Client, UploadProgress } from '../client';
2
2
  import type { Models } from '../models';
3
3
  import { Runtime } from '../enums/runtime';
4
+ import { Scopes } from '../enums/scopes';
5
+ import { Runtimes } from '../enums/runtimes';
6
+ import { UseCases } from '../enums/use-cases';
4
7
  import { UsageRange } from '../enums/usage-range';
5
8
  import { TemplateReferenceType } from '../enums/template-reference-type';
6
9
  import { VCSReferenceType } from '../enums/vcs-reference-type';
@@ -48,7 +51,7 @@ export declare class Functions {
48
51
  * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
49
52
  * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
50
53
  * @param {string} params.commands - Build Commands.
51
- * @param {string[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
54
+ * @param {Scopes[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
52
55
  * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
53
56
  * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function.
54
57
  * @param {string} params.providerBranch - Production branch for the repo linked to the function.
@@ -70,7 +73,7 @@ export declare class Functions {
70
73
  logging?: boolean;
71
74
  entrypoint?: string;
72
75
  commands?: string;
73
- scopes?: string[];
76
+ scopes?: Scopes[];
74
77
  installationId?: string;
75
78
  providerRepositoryId?: string;
76
79
  providerBranch?: string;
@@ -92,7 +95,7 @@ export declare class Functions {
92
95
  * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
93
96
  * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
94
97
  * @param {string} commands - Build Commands.
95
- * @param {string[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
98
+ * @param {Scopes[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
96
99
  * @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
97
100
  * @param {string} providerRepositoryId - Repository ID of the repo linked to the function.
98
101
  * @param {string} providerBranch - Production branch for the repo linked to the function.
@@ -103,7 +106,7 @@ export declare class Functions {
103
106
  * @returns {Promise<Models.Function>}
104
107
  * @deprecated Use the object parameter style method for a better developer experience.
105
108
  */
106
- create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
109
+ create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
107
110
  /**
108
111
  * Get a list of all runtimes that are currently active on your instance.
109
112
  *
@@ -121,8 +124,8 @@ export declare class Functions {
121
124
  /**
122
125
  * List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
123
126
  *
124
- * @param {string[]} params.runtimes - List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
125
- * @param {string[]} params.useCases - List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
127
+ * @param {Runtimes[]} params.runtimes - List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
128
+ * @param {UseCases[]} params.useCases - List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
126
129
  * @param {number} params.limit - Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
127
130
  * @param {number} params.offset - Offset the list of returned templates. Maximum offset is 5000.
128
131
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
@@ -130,8 +133,8 @@ export declare class Functions {
130
133
  * @returns {Promise<Models.TemplateFunctionList>}
131
134
  */
132
135
  listTemplates(params?: {
133
- runtimes?: string[];
134
- useCases?: string[];
136
+ runtimes?: Runtimes[];
137
+ useCases?: UseCases[];
135
138
  limit?: number;
136
139
  offset?: number;
137
140
  total?: boolean;
@@ -139,8 +142,8 @@ export declare class Functions {
139
142
  /**
140
143
  * List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
141
144
  *
142
- * @param {string[]} runtimes - List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
143
- * @param {string[]} useCases - List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
145
+ * @param {Runtimes[]} runtimes - List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
146
+ * @param {UseCases[]} useCases - List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
144
147
  * @param {number} limit - Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
145
148
  * @param {number} offset - Offset the list of returned templates. Maximum offset is 5000.
146
149
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
@@ -148,7 +151,7 @@ export declare class Functions {
148
151
  * @returns {Promise<Models.TemplateFunctionList>}
149
152
  * @deprecated Use the object parameter style method for a better developer experience.
150
153
  */
151
- listTemplates(runtimes?: string[], useCases?: string[], limit?: number, offset?: number, total?: boolean): Promise<Models.TemplateFunctionList>;
154
+ listTemplates(runtimes?: Runtimes[], useCases?: UseCases[], limit?: number, offset?: number, total?: boolean): Promise<Models.TemplateFunctionList>;
152
155
  /**
153
156
  * Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
154
157
  *
@@ -220,7 +223,7 @@ export declare class Functions {
220
223
  * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
221
224
  * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
222
225
  * @param {string} params.commands - Build Commands.
223
- * @param {string[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
226
+ * @param {Scopes[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
224
227
  * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
225
228
  * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function
226
229
  * @param {string} params.providerBranch - Production branch for the repo linked to the function
@@ -242,7 +245,7 @@ export declare class Functions {
242
245
  logging?: boolean;
243
246
  entrypoint?: string;
244
247
  commands?: string;
245
- scopes?: string[];
248
+ scopes?: Scopes[];
246
249
  installationId?: string;
247
250
  providerRepositoryId?: string;
248
251
  providerBranch?: string;
@@ -264,7 +267,7 @@ export declare class Functions {
264
267
  * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
265
268
  * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
266
269
  * @param {string} commands - Build Commands.
267
- * @param {string[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
270
+ * @param {Scopes[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
268
271
  * @param {string} installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
269
272
  * @param {string} providerRepositoryId - Repository ID of the repo linked to the function
270
273
  * @param {string} providerBranch - Production branch for the repo linked to the function
@@ -275,7 +278,7 @@ export declare class Functions {
275
278
  * @returns {Promise<Models.Function>}
276
279
  * @deprecated Use the object parameter style method for a better developer experience.
277
280
  */
278
- update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
281
+ update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
279
282
  /**
280
283
  * Delete a function by its unique ID.
281
284
  *
@@ -59,6 +59,7 @@ export declare class Health {
59
59
  */
60
60
  getPubSub(): Promise<Models.HealthStatusList>;
61
61
  /**
62
+ * Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server.
62
63
  *
63
64
  * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
64
65
  * @throws {AppwriteException}
@@ -68,6 +69,7 @@ export declare class Health {
68
69
  threshold?: number;
69
70
  }): Promise<Models.HealthQueue>;
70
71
  /**
72
+ * Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server.
71
73
  *
72
74
  * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
73
75
  * @throws {AppwriteException}