@appwrite.io/console 0.0.1 → 0.1.0-preview-0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.travis.yml +32 -0
  2. package/README.md +2 -2
  3. package/dist/cjs/sdk.js +7743 -0
  4. package/dist/cjs/sdk.js.map +1 -0
  5. package/dist/esm/sdk.js +7725 -0
  6. package/dist/esm/sdk.js.map +1 -0
  7. package/dist/iife/sdk.js +7744 -0
  8. package/docs/examples/account/create.md +1 -1
  9. package/docs/examples/account/update-password.md +1 -1
  10. package/docs/examples/databases/update-boolean-attribute.md +18 -0
  11. package/docs/examples/databases/update-datetime-attribute.md +18 -0
  12. package/docs/examples/databases/update-email-attribute.md +18 -0
  13. package/docs/examples/databases/update-enum-attribute.md +18 -0
  14. package/docs/examples/databases/update-float-attribute.md +18 -0
  15. package/docs/examples/databases/update-integer-attribute.md +18 -0
  16. package/docs/examples/databases/update-ip-attribute.md +18 -0
  17. package/docs/examples/databases/update-string-attribute.md +18 -0
  18. package/docs/examples/databases/update-url-attribute.md +18 -0
  19. package/docs/examples/functions/create.md +1 -1
  20. package/docs/examples/functions/update.md +1 -1
  21. package/docs/examples/projects/update-auth-password-dictionary.md +18 -0
  22. package/docs/examples/projects/update-auth-password-history.md +18 -0
  23. package/docs/examples/teams/create-membership.md +1 -1
  24. package/docs/examples/teams/get-prefs.md +18 -0
  25. package/docs/examples/teams/update-name.md +18 -0
  26. package/docs/examples/teams/update-prefs.md +18 -0
  27. package/docs/examples/teams/update.md +1 -1
  28. package/docs/examples/users/update-password.md +1 -1
  29. package/package.json +1 -1
  30. package/src/client.ts +1 -1
  31. package/src/models.ts +15 -3
  32. package/src/services/account.ts +7 -7
  33. package/src/services/databases.ts +516 -0
  34. package/src/services/functions.ts +3 -11
  35. package/src/services/projects.ts +62 -0
  36. package/src/services/teams.ts +92 -22
  37. package/types/client.d.ts +135 -0
  38. package/types/id.d.ts +4 -0
  39. package/types/index.d.ts +17 -0
  40. package/types/models.d.ts +2552 -0
  41. package/types/permission.d.ts +7 -0
  42. package/types/query.d.ts +21 -0
  43. package/types/role.d.ts +8 -0
  44. package/types/service.d.ts +8 -0
  45. package/types/services/account.d.ts +442 -0
  46. package/types/services/avatars.d.ts +145 -0
  47. package/types/services/databases.d.ts +637 -0
  48. package/types/services/functions.d.ts +280 -0
  49. package/types/services/graphql.d.ts +25 -0
  50. package/types/services/health.d.ts +106 -0
  51. package/types/services/locale.d.ts +81 -0
  52. package/types/services/projects.d.ts +400 -0
  53. package/types/services/storage.d.ts +229 -0
  54. package/types/services/teams.d.ts +207 -0
  55. package/types/services/users.d.ts +340 -0
  56. package/.github/workflows/publish.yml +0 -18
@@ -460,6 +460,56 @@ export class Databases extends Service {
460
460
  }, payload);
461
461
  }
462
462
 
463
+ /**
464
+ * Update Boolean Attribute
465
+ *
466
+ *
467
+ * @param {string} databaseId
468
+ * @param {string} collectionId
469
+ * @param {string} key
470
+ * @param {boolean} required
471
+ * @param {boolean} xdefault
472
+ * @throws {AppwriteException}
473
+ * @returns {Promise}
474
+ */
475
+ async updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault: boolean): Promise<Models.AttributeBoolean> {
476
+ if (typeof databaseId === 'undefined') {
477
+ throw new AppwriteException('Missing required parameter: "databaseId"');
478
+ }
479
+
480
+ if (typeof collectionId === 'undefined') {
481
+ throw new AppwriteException('Missing required parameter: "collectionId"');
482
+ }
483
+
484
+ if (typeof key === 'undefined') {
485
+ throw new AppwriteException('Missing required parameter: "key"');
486
+ }
487
+
488
+ if (typeof required === 'undefined') {
489
+ throw new AppwriteException('Missing required parameter: "required"');
490
+ }
491
+
492
+ if (typeof xdefault === 'undefined') {
493
+ throw new AppwriteException('Missing required parameter: "xdefault"');
494
+ }
495
+
496
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
497
+ let payload: Payload = {};
498
+
499
+ if (typeof required !== 'undefined') {
500
+ payload['required'] = required;
501
+ }
502
+
503
+ if (typeof xdefault !== 'undefined') {
504
+ payload['default'] = xdefault;
505
+ }
506
+
507
+ const uri = new URL(this.client.config.endpoint + path);
508
+ return await this.client.call('patch', uri, {
509
+ 'content-type': 'application/json',
510
+ }, payload);
511
+ }
512
+
463
513
  /**
464
514
  * Create DateTime Attribute
465
515
  *
@@ -515,6 +565,56 @@ export class Databases extends Service {
515
565
  }, payload);
516
566
  }
517
567
 
568
+ /**
569
+ * Update DateTime Attribute
570
+ *
571
+ *
572
+ * @param {string} databaseId
573
+ * @param {string} collectionId
574
+ * @param {string} key
575
+ * @param {boolean} required
576
+ * @param {string} xdefault
577
+ * @throws {AppwriteException}
578
+ * @returns {Promise}
579
+ */
580
+ async updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault: string): Promise<Models.AttributeDatetime> {
581
+ if (typeof databaseId === 'undefined') {
582
+ throw new AppwriteException('Missing required parameter: "databaseId"');
583
+ }
584
+
585
+ if (typeof collectionId === 'undefined') {
586
+ throw new AppwriteException('Missing required parameter: "collectionId"');
587
+ }
588
+
589
+ if (typeof key === 'undefined') {
590
+ throw new AppwriteException('Missing required parameter: "key"');
591
+ }
592
+
593
+ if (typeof required === 'undefined') {
594
+ throw new AppwriteException('Missing required parameter: "required"');
595
+ }
596
+
597
+ if (typeof xdefault === 'undefined') {
598
+ throw new AppwriteException('Missing required parameter: "xdefault"');
599
+ }
600
+
601
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
602
+ let payload: Payload = {};
603
+
604
+ if (typeof required !== 'undefined') {
605
+ payload['required'] = required;
606
+ }
607
+
608
+ if (typeof xdefault !== 'undefined') {
609
+ payload['default'] = xdefault;
610
+ }
611
+
612
+ const uri = new URL(this.client.config.endpoint + path);
613
+ return await this.client.call('patch', uri, {
614
+ 'content-type': 'application/json',
615
+ }, payload);
616
+ }
617
+
518
618
  /**
519
619
  * Create Email Attribute
520
620
  *
@@ -572,6 +672,59 @@ export class Databases extends Service {
572
672
  }, payload);
573
673
  }
574
674
 
675
+ /**
676
+ * Update Email Attribute
677
+ *
678
+ * Update an email attribute. Changing the `default` value will not update
679
+ * already existing documents.
680
+ *
681
+ *
682
+ * @param {string} databaseId
683
+ * @param {string} collectionId
684
+ * @param {string} key
685
+ * @param {boolean} required
686
+ * @param {string} xdefault
687
+ * @throws {AppwriteException}
688
+ * @returns {Promise}
689
+ */
690
+ async updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault: string): Promise<Models.AttributeEmail> {
691
+ if (typeof databaseId === 'undefined') {
692
+ throw new AppwriteException('Missing required parameter: "databaseId"');
693
+ }
694
+
695
+ if (typeof collectionId === 'undefined') {
696
+ throw new AppwriteException('Missing required parameter: "collectionId"');
697
+ }
698
+
699
+ if (typeof key === 'undefined') {
700
+ throw new AppwriteException('Missing required parameter: "key"');
701
+ }
702
+
703
+ if (typeof required === 'undefined') {
704
+ throw new AppwriteException('Missing required parameter: "required"');
705
+ }
706
+
707
+ if (typeof xdefault === 'undefined') {
708
+ throw new AppwriteException('Missing required parameter: "xdefault"');
709
+ }
710
+
711
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
712
+ let payload: Payload = {};
713
+
714
+ if (typeof required !== 'undefined') {
715
+ payload['required'] = required;
716
+ }
717
+
718
+ if (typeof xdefault !== 'undefined') {
719
+ payload['default'] = xdefault;
720
+ }
721
+
722
+ const uri = new URL(this.client.config.endpoint + path);
723
+ return await this.client.call('patch', uri, {
724
+ 'content-type': 'application/json',
725
+ }, payload);
726
+ }
727
+
575
728
  /**
576
729
  * Create Enum Attribute
577
730
  *
@@ -636,6 +789,68 @@ export class Databases extends Service {
636
789
  }, payload);
637
790
  }
638
791
 
792
+ /**
793
+ * Update Enum Attribute
794
+ *
795
+ * Update an enum attribute. Changing the `default` value will not update
796
+ * already existing documents.
797
+ *
798
+ *
799
+ * @param {string} databaseId
800
+ * @param {string} collectionId
801
+ * @param {string} key
802
+ * @param {string[]} elements
803
+ * @param {boolean} required
804
+ * @param {string} xdefault
805
+ * @throws {AppwriteException}
806
+ * @returns {Promise}
807
+ */
808
+ async updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault: string): Promise<Models.AttributeEnum> {
809
+ if (typeof databaseId === 'undefined') {
810
+ throw new AppwriteException('Missing required parameter: "databaseId"');
811
+ }
812
+
813
+ if (typeof collectionId === 'undefined') {
814
+ throw new AppwriteException('Missing required parameter: "collectionId"');
815
+ }
816
+
817
+ if (typeof key === 'undefined') {
818
+ throw new AppwriteException('Missing required parameter: "key"');
819
+ }
820
+
821
+ if (typeof elements === 'undefined') {
822
+ throw new AppwriteException('Missing required parameter: "elements"');
823
+ }
824
+
825
+ if (typeof required === 'undefined') {
826
+ throw new AppwriteException('Missing required parameter: "required"');
827
+ }
828
+
829
+ if (typeof xdefault === 'undefined') {
830
+ throw new AppwriteException('Missing required parameter: "xdefault"');
831
+ }
832
+
833
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
834
+ let payload: Payload = {};
835
+
836
+ if (typeof elements !== 'undefined') {
837
+ payload['elements'] = elements;
838
+ }
839
+
840
+ if (typeof required !== 'undefined') {
841
+ payload['required'] = required;
842
+ }
843
+
844
+ if (typeof xdefault !== 'undefined') {
845
+ payload['default'] = xdefault;
846
+ }
847
+
848
+ const uri = new URL(this.client.config.endpoint + path);
849
+ return await this.client.call('patch', uri, {
850
+ 'content-type': 'application/json',
851
+ }, payload);
852
+ }
853
+
639
854
  /**
640
855
  * Create Float Attribute
641
856
  *
@@ -704,6 +919,77 @@ export class Databases extends Service {
704
919
  }, payload);
705
920
  }
706
921
 
922
+ /**
923
+ * Update Float Attribute
924
+ *
925
+ * Update a float attribute. Changing the `default` value will not update
926
+ * already existing documents.
927
+ *
928
+ *
929
+ * @param {string} databaseId
930
+ * @param {string} collectionId
931
+ * @param {string} key
932
+ * @param {boolean} required
933
+ * @param {number} min
934
+ * @param {number} max
935
+ * @param {number} xdefault
936
+ * @throws {AppwriteException}
937
+ * @returns {Promise}
938
+ */
939
+ async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault: number): Promise<Models.AttributeFloat> {
940
+ if (typeof databaseId === 'undefined') {
941
+ throw new AppwriteException('Missing required parameter: "databaseId"');
942
+ }
943
+
944
+ if (typeof collectionId === 'undefined') {
945
+ throw new AppwriteException('Missing required parameter: "collectionId"');
946
+ }
947
+
948
+ if (typeof key === 'undefined') {
949
+ throw new AppwriteException('Missing required parameter: "key"');
950
+ }
951
+
952
+ if (typeof required === 'undefined') {
953
+ throw new AppwriteException('Missing required parameter: "required"');
954
+ }
955
+
956
+ if (typeof min === 'undefined') {
957
+ throw new AppwriteException('Missing required parameter: "min"');
958
+ }
959
+
960
+ if (typeof max === 'undefined') {
961
+ throw new AppwriteException('Missing required parameter: "max"');
962
+ }
963
+
964
+ if (typeof xdefault === 'undefined') {
965
+ throw new AppwriteException('Missing required parameter: "xdefault"');
966
+ }
967
+
968
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
969
+ let payload: Payload = {};
970
+
971
+ if (typeof required !== 'undefined') {
972
+ payload['required'] = required;
973
+ }
974
+
975
+ if (typeof min !== 'undefined') {
976
+ payload['min'] = min;
977
+ }
978
+
979
+ if (typeof max !== 'undefined') {
980
+ payload['max'] = max;
981
+ }
982
+
983
+ if (typeof xdefault !== 'undefined') {
984
+ payload['default'] = xdefault;
985
+ }
986
+
987
+ const uri = new URL(this.client.config.endpoint + path);
988
+ return await this.client.call('patch', uri, {
989
+ 'content-type': 'application/json',
990
+ }, payload);
991
+ }
992
+
707
993
  /**
708
994
  * Create Integer Attribute
709
995
  *
@@ -772,6 +1058,77 @@ export class Databases extends Service {
772
1058
  }, payload);
773
1059
  }
774
1060
 
1061
+ /**
1062
+ * Update Integer Attribute
1063
+ *
1064
+ * Update an integer attribute. Changing the `default` value will not update
1065
+ * already existing documents.
1066
+ *
1067
+ *
1068
+ * @param {string} databaseId
1069
+ * @param {string} collectionId
1070
+ * @param {string} key
1071
+ * @param {boolean} required
1072
+ * @param {number} min
1073
+ * @param {number} max
1074
+ * @param {number} xdefault
1075
+ * @throws {AppwriteException}
1076
+ * @returns {Promise}
1077
+ */
1078
+ async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault: number): Promise<Models.AttributeInteger> {
1079
+ if (typeof databaseId === 'undefined') {
1080
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1081
+ }
1082
+
1083
+ if (typeof collectionId === 'undefined') {
1084
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1085
+ }
1086
+
1087
+ if (typeof key === 'undefined') {
1088
+ throw new AppwriteException('Missing required parameter: "key"');
1089
+ }
1090
+
1091
+ if (typeof required === 'undefined') {
1092
+ throw new AppwriteException('Missing required parameter: "required"');
1093
+ }
1094
+
1095
+ if (typeof min === 'undefined') {
1096
+ throw new AppwriteException('Missing required parameter: "min"');
1097
+ }
1098
+
1099
+ if (typeof max === 'undefined') {
1100
+ throw new AppwriteException('Missing required parameter: "max"');
1101
+ }
1102
+
1103
+ if (typeof xdefault === 'undefined') {
1104
+ throw new AppwriteException('Missing required parameter: "xdefault"');
1105
+ }
1106
+
1107
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1108
+ let payload: Payload = {};
1109
+
1110
+ if (typeof required !== 'undefined') {
1111
+ payload['required'] = required;
1112
+ }
1113
+
1114
+ if (typeof min !== 'undefined') {
1115
+ payload['min'] = min;
1116
+ }
1117
+
1118
+ if (typeof max !== 'undefined') {
1119
+ payload['max'] = max;
1120
+ }
1121
+
1122
+ if (typeof xdefault !== 'undefined') {
1123
+ payload['default'] = xdefault;
1124
+ }
1125
+
1126
+ const uri = new URL(this.client.config.endpoint + path);
1127
+ return await this.client.call('patch', uri, {
1128
+ 'content-type': 'application/json',
1129
+ }, payload);
1130
+ }
1131
+
775
1132
  /**
776
1133
  * Create IP Address Attribute
777
1134
  *
@@ -829,6 +1186,59 @@ export class Databases extends Service {
829
1186
  }, payload);
830
1187
  }
831
1188
 
1189
+ /**
1190
+ * Update IP Address Attribute
1191
+ *
1192
+ * Update an ip attribute. Changing the `default` value will not update
1193
+ * already existing documents.
1194
+ *
1195
+ *
1196
+ * @param {string} databaseId
1197
+ * @param {string} collectionId
1198
+ * @param {string} key
1199
+ * @param {boolean} required
1200
+ * @param {string} xdefault
1201
+ * @throws {AppwriteException}
1202
+ * @returns {Promise}
1203
+ */
1204
+ async updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault: string): Promise<Models.AttributeIp> {
1205
+ if (typeof databaseId === 'undefined') {
1206
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1207
+ }
1208
+
1209
+ if (typeof collectionId === 'undefined') {
1210
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1211
+ }
1212
+
1213
+ if (typeof key === 'undefined') {
1214
+ throw new AppwriteException('Missing required parameter: "key"');
1215
+ }
1216
+
1217
+ if (typeof required === 'undefined') {
1218
+ throw new AppwriteException('Missing required parameter: "required"');
1219
+ }
1220
+
1221
+ if (typeof xdefault === 'undefined') {
1222
+ throw new AppwriteException('Missing required parameter: "xdefault"');
1223
+ }
1224
+
1225
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1226
+ let payload: Payload = {};
1227
+
1228
+ if (typeof required !== 'undefined') {
1229
+ payload['required'] = required;
1230
+ }
1231
+
1232
+ if (typeof xdefault !== 'undefined') {
1233
+ payload['default'] = xdefault;
1234
+ }
1235
+
1236
+ const uri = new URL(this.client.config.endpoint + path);
1237
+ return await this.client.call('patch', uri, {
1238
+ 'content-type': 'application/json',
1239
+ }, payload);
1240
+ }
1241
+
832
1242
  /**
833
1243
  * Create String Attribute
834
1244
  *
@@ -895,6 +1305,59 @@ export class Databases extends Service {
895
1305
  }, payload);
896
1306
  }
897
1307
 
1308
+ /**
1309
+ * Update String Attribute
1310
+ *
1311
+ * Update a string attribute. Changing the `default` value will not update
1312
+ * already existing documents.
1313
+ *
1314
+ *
1315
+ * @param {string} databaseId
1316
+ * @param {string} collectionId
1317
+ * @param {string} key
1318
+ * @param {boolean} required
1319
+ * @param {string} xdefault
1320
+ * @throws {AppwriteException}
1321
+ * @returns {Promise}
1322
+ */
1323
+ async updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault: string): Promise<Models.AttributeString> {
1324
+ if (typeof databaseId === 'undefined') {
1325
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1326
+ }
1327
+
1328
+ if (typeof collectionId === 'undefined') {
1329
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1330
+ }
1331
+
1332
+ if (typeof key === 'undefined') {
1333
+ throw new AppwriteException('Missing required parameter: "key"');
1334
+ }
1335
+
1336
+ if (typeof required === 'undefined') {
1337
+ throw new AppwriteException('Missing required parameter: "required"');
1338
+ }
1339
+
1340
+ if (typeof xdefault === 'undefined') {
1341
+ throw new AppwriteException('Missing required parameter: "xdefault"');
1342
+ }
1343
+
1344
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1345
+ let payload: Payload = {};
1346
+
1347
+ if (typeof required !== 'undefined') {
1348
+ payload['required'] = required;
1349
+ }
1350
+
1351
+ if (typeof xdefault !== 'undefined') {
1352
+ payload['default'] = xdefault;
1353
+ }
1354
+
1355
+ const uri = new URL(this.client.config.endpoint + path);
1356
+ return await this.client.call('patch', uri, {
1357
+ 'content-type': 'application/json',
1358
+ }, payload);
1359
+ }
1360
+
898
1361
  /**
899
1362
  * Create URL Attribute
900
1363
  *
@@ -952,6 +1415,59 @@ export class Databases extends Service {
952
1415
  }, payload);
953
1416
  }
954
1417
 
1418
+ /**
1419
+ * Update URL Attribute
1420
+ *
1421
+ * Update an url attribute. Changing the `default` value will not update
1422
+ * already existing documents.
1423
+ *
1424
+ *
1425
+ * @param {string} databaseId
1426
+ * @param {string} collectionId
1427
+ * @param {string} key
1428
+ * @param {boolean} required
1429
+ * @param {string} xdefault
1430
+ * @throws {AppwriteException}
1431
+ * @returns {Promise}
1432
+ */
1433
+ async updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault: string): Promise<Models.AttributeUrl> {
1434
+ if (typeof databaseId === 'undefined') {
1435
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1436
+ }
1437
+
1438
+ if (typeof collectionId === 'undefined') {
1439
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1440
+ }
1441
+
1442
+ if (typeof key === 'undefined') {
1443
+ throw new AppwriteException('Missing required parameter: "key"');
1444
+ }
1445
+
1446
+ if (typeof required === 'undefined') {
1447
+ throw new AppwriteException('Missing required parameter: "required"');
1448
+ }
1449
+
1450
+ if (typeof xdefault === 'undefined') {
1451
+ throw new AppwriteException('Missing required parameter: "xdefault"');
1452
+ }
1453
+
1454
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1455
+ let payload: Payload = {};
1456
+
1457
+ if (typeof required !== 'undefined') {
1458
+ payload['required'] = required;
1459
+ }
1460
+
1461
+ if (typeof xdefault !== 'undefined') {
1462
+ payload['default'] = xdefault;
1463
+ }
1464
+
1465
+ const uri = new URL(this.client.config.endpoint + path);
1466
+ return await this.client.call('patch', uri, {
1467
+ 'content-type': 'application/json',
1468
+ }, payload);
1469
+ }
1470
+
955
1471
  /**
956
1472
  * Get Attribute
957
1473
  *
@@ -48,8 +48,8 @@ export class Functions extends Service {
48
48
  *
49
49
  * @param {string} functionId
50
50
  * @param {string} name
51
- * @param {string[]} execute
52
51
  * @param {string} runtime
52
+ * @param {string[]} execute
53
53
  * @param {string[]} events
54
54
  * @param {string} schedule
55
55
  * @param {number} timeout
@@ -57,7 +57,7 @@ export class Functions extends Service {
57
57
  * @throws {AppwriteException}
58
58
  * @returns {Promise}
59
59
  */
60
- async create(functionId: string, name: string, execute: string[], runtime: string, events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function> {
60
+ async create(functionId: string, name: string, runtime: string, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function> {
61
61
  if (typeof functionId === 'undefined') {
62
62
  throw new AppwriteException('Missing required parameter: "functionId"');
63
63
  }
@@ -66,10 +66,6 @@ export class Functions extends Service {
66
66
  throw new AppwriteException('Missing required parameter: "name"');
67
67
  }
68
68
 
69
- if (typeof execute === 'undefined') {
70
- throw new AppwriteException('Missing required parameter: "execute"');
71
- }
72
-
73
69
  if (typeof runtime === 'undefined') {
74
70
  throw new AppwriteException('Missing required parameter: "runtime"');
75
71
  }
@@ -193,7 +189,7 @@ export class Functions extends Service {
193
189
  * @throws {AppwriteException}
194
190
  * @returns {Promise}
195
191
  */
196
- async update(functionId: string, name: string, execute: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function> {
192
+ async update(functionId: string, name: string, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function> {
197
193
  if (typeof functionId === 'undefined') {
198
194
  throw new AppwriteException('Missing required parameter: "functionId"');
199
195
  }
@@ -202,10 +198,6 @@ export class Functions extends Service {
202
198
  throw new AppwriteException('Missing required parameter: "name"');
203
199
  }
204
200
 
205
- if (typeof execute === 'undefined') {
206
- throw new AppwriteException('Missing required parameter: "execute"');
207
- }
208
-
209
201
  let path = '/functions/{functionId}'.replace('{functionId}', functionId);
210
202
  let payload: Payload = {};
211
203
 
@@ -353,6 +353,68 @@ export class Projects extends Service {
353
353
  }, payload);
354
354
  }
355
355
 
356
+ /**
357
+ * Update authentication password disctionary status. Use this endpoint to enable or disable the dicitonary check for user password
358
+ *
359
+ *
360
+ * @param {string} projectId
361
+ * @param {boolean} enabled
362
+ * @throws {AppwriteException}
363
+ * @returns {Promise}
364
+ */
365
+ async updateAuthPasswordDictionary(projectId: string, enabled: boolean): Promise<Models.Project> {
366
+ if (typeof projectId === 'undefined') {
367
+ throw new AppwriteException('Missing required parameter: "projectId"');
368
+ }
369
+
370
+ if (typeof enabled === 'undefined') {
371
+ throw new AppwriteException('Missing required parameter: "enabled"');
372
+ }
373
+
374
+ let path = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);
375
+ let payload: Payload = {};
376
+
377
+ if (typeof enabled !== 'undefined') {
378
+ payload['enabled'] = enabled;
379
+ }
380
+
381
+ const uri = new URL(this.client.config.endpoint + path);
382
+ return await this.client.call('patch', uri, {
383
+ 'content-type': 'application/json',
384
+ }, payload);
385
+ }
386
+
387
+ /**
388
+ * Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.
389
+ *
390
+ *
391
+ * @param {string} projectId
392
+ * @param {number} limit
393
+ * @throws {AppwriteException}
394
+ * @returns {Promise}
395
+ */
396
+ async updateAuthPasswordHistory(projectId: string, limit: number): Promise<Models.Project> {
397
+ if (typeof projectId === 'undefined') {
398
+ throw new AppwriteException('Missing required parameter: "projectId"');
399
+ }
400
+
401
+ if (typeof limit === 'undefined') {
402
+ throw new AppwriteException('Missing required parameter: "limit"');
403
+ }
404
+
405
+ let path = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);
406
+ let payload: Payload = {};
407
+
408
+ if (typeof limit !== 'undefined') {
409
+ payload['limit'] = limit;
410
+ }
411
+
412
+ const uri = new URL(this.client.config.endpoint + path);
413
+ return await this.client.call('patch', uri, {
414
+ 'content-type': 'application/json',
415
+ }, payload);
416
+ }
417
+
356
418
  /**
357
419
  * Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project.
358
420
  *