@appwrite.io/console 0.0.2-preview-0.0 → 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 (35) hide show
  1. package/.travis.yml +32 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +505 -14
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +505 -14
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +505 -14
  8. package/docs/examples/databases/update-boolean-attribute.md +18 -0
  9. package/docs/examples/databases/update-datetime-attribute.md +18 -0
  10. package/docs/examples/databases/update-email-attribute.md +18 -0
  11. package/docs/examples/databases/update-enum-attribute.md +18 -0
  12. package/docs/examples/databases/update-float-attribute.md +18 -0
  13. package/docs/examples/databases/update-integer-attribute.md +18 -0
  14. package/docs/examples/databases/update-ip-attribute.md +18 -0
  15. package/docs/examples/databases/update-string-attribute.md +18 -0
  16. package/docs/examples/databases/update-url-attribute.md +18 -0
  17. package/docs/examples/functions/create.md +1 -1
  18. package/docs/examples/functions/update.md +1 -1
  19. package/docs/examples/teams/get-prefs.md +18 -0
  20. package/docs/examples/teams/update-name.md +18 -0
  21. package/docs/examples/teams/update-prefs.md +18 -0
  22. package/docs/examples/teams/update.md +1 -1
  23. package/package.json +1 -1
  24. package/src/client.ts +1 -1
  25. package/src/models.ts +7 -3
  26. package/src/services/account.ts +7 -7
  27. package/src/services/databases.ts +516 -0
  28. package/src/services/functions.ts +3 -11
  29. package/src/services/teams.ts +65 -7
  30. package/types/models.d.ts +7 -3
  31. package/types/services/account.d.ts +7 -7
  32. package/types/services/databases.d.ts +143 -0
  33. package/types/services/functions.d.ts +3 -3
  34. package/types/services/teams.d.ts +31 -7
  35. package/.github/workflows/publish.yml +0 -18
package/dist/esm/sdk.js CHANGED
@@ -96,7 +96,7 @@ class Client {
96
96
  'x-sdk-name': 'Console',
97
97
  'x-sdk-platform': 'console',
98
98
  'x-sdk-language': 'web',
99
- 'x-sdk-version': '0.0.2-preview-0.0',
99
+ 'x-sdk-version': '0.1.0-preview-0.0',
100
100
  'X-Appwrite-Response-Format': '1.0.0',
101
101
  };
102
102
  this.realtime = {
@@ -700,7 +700,7 @@ class Account extends Service {
700
700
  * stored as is, and replaces any previous value. The maximum allowed prefs
701
701
  * size is 64kB and throws error if exceeded.
702
702
  *
703
- * @param {object} prefs
703
+ * @param {Partial<Preferences>} prefs
704
704
  * @throws {AppwriteException}
705
705
  * @returns {Promise}
706
706
  */
@@ -2057,6 +2057,49 @@ class Databases extends Service {
2057
2057
  }, payload);
2058
2058
  });
2059
2059
  }
2060
+ /**
2061
+ * Update Boolean Attribute
2062
+ *
2063
+ *
2064
+ * @param {string} databaseId
2065
+ * @param {string} collectionId
2066
+ * @param {string} key
2067
+ * @param {boolean} required
2068
+ * @param {boolean} xdefault
2069
+ * @throws {AppwriteException}
2070
+ * @returns {Promise}
2071
+ */
2072
+ updateBooleanAttribute(databaseId, collectionId, key, required, xdefault) {
2073
+ return __awaiter(this, void 0, void 0, function* () {
2074
+ if (typeof databaseId === 'undefined') {
2075
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2076
+ }
2077
+ if (typeof collectionId === 'undefined') {
2078
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2079
+ }
2080
+ if (typeof key === 'undefined') {
2081
+ throw new AppwriteException('Missing required parameter: "key"');
2082
+ }
2083
+ if (typeof required === 'undefined') {
2084
+ throw new AppwriteException('Missing required parameter: "required"');
2085
+ }
2086
+ if (typeof xdefault === 'undefined') {
2087
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2088
+ }
2089
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2090
+ let payload = {};
2091
+ if (typeof required !== 'undefined') {
2092
+ payload['required'] = required;
2093
+ }
2094
+ if (typeof xdefault !== 'undefined') {
2095
+ payload['default'] = xdefault;
2096
+ }
2097
+ const uri = new URL(this.client.config.endpoint + path);
2098
+ return yield this.client.call('patch', uri, {
2099
+ 'content-type': 'application/json',
2100
+ }, payload);
2101
+ });
2102
+ }
2060
2103
  /**
2061
2104
  * Create DateTime Attribute
2062
2105
  *
@@ -2104,6 +2147,49 @@ class Databases extends Service {
2104
2147
  }, payload);
2105
2148
  });
2106
2149
  }
2150
+ /**
2151
+ * Update DateTime Attribute
2152
+ *
2153
+ *
2154
+ * @param {string} databaseId
2155
+ * @param {string} collectionId
2156
+ * @param {string} key
2157
+ * @param {boolean} required
2158
+ * @param {string} xdefault
2159
+ * @throws {AppwriteException}
2160
+ * @returns {Promise}
2161
+ */
2162
+ updateDatetimeAttribute(databaseId, collectionId, key, required, xdefault) {
2163
+ return __awaiter(this, void 0, void 0, function* () {
2164
+ if (typeof databaseId === 'undefined') {
2165
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2166
+ }
2167
+ if (typeof collectionId === 'undefined') {
2168
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2169
+ }
2170
+ if (typeof key === 'undefined') {
2171
+ throw new AppwriteException('Missing required parameter: "key"');
2172
+ }
2173
+ if (typeof required === 'undefined') {
2174
+ throw new AppwriteException('Missing required parameter: "required"');
2175
+ }
2176
+ if (typeof xdefault === 'undefined') {
2177
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2178
+ }
2179
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2180
+ let payload = {};
2181
+ if (typeof required !== 'undefined') {
2182
+ payload['required'] = required;
2183
+ }
2184
+ if (typeof xdefault !== 'undefined') {
2185
+ payload['default'] = xdefault;
2186
+ }
2187
+ const uri = new URL(this.client.config.endpoint + path);
2188
+ return yield this.client.call('patch', uri, {
2189
+ 'content-type': 'application/json',
2190
+ }, payload);
2191
+ });
2192
+ }
2107
2193
  /**
2108
2194
  * Create Email Attribute
2109
2195
  *
@@ -2153,6 +2239,52 @@ class Databases extends Service {
2153
2239
  }, payload);
2154
2240
  });
2155
2241
  }
2242
+ /**
2243
+ * Update Email Attribute
2244
+ *
2245
+ * Update an email attribute. Changing the `default` value will not update
2246
+ * already existing documents.
2247
+ *
2248
+ *
2249
+ * @param {string} databaseId
2250
+ * @param {string} collectionId
2251
+ * @param {string} key
2252
+ * @param {boolean} required
2253
+ * @param {string} xdefault
2254
+ * @throws {AppwriteException}
2255
+ * @returns {Promise}
2256
+ */
2257
+ updateEmailAttribute(databaseId, collectionId, key, required, xdefault) {
2258
+ return __awaiter(this, void 0, void 0, function* () {
2259
+ if (typeof databaseId === 'undefined') {
2260
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2261
+ }
2262
+ if (typeof collectionId === 'undefined') {
2263
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2264
+ }
2265
+ if (typeof key === 'undefined') {
2266
+ throw new AppwriteException('Missing required parameter: "key"');
2267
+ }
2268
+ if (typeof required === 'undefined') {
2269
+ throw new AppwriteException('Missing required parameter: "required"');
2270
+ }
2271
+ if (typeof xdefault === 'undefined') {
2272
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2273
+ }
2274
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2275
+ let payload = {};
2276
+ if (typeof required !== 'undefined') {
2277
+ payload['required'] = required;
2278
+ }
2279
+ if (typeof xdefault !== 'undefined') {
2280
+ payload['default'] = xdefault;
2281
+ }
2282
+ const uri = new URL(this.client.config.endpoint + path);
2283
+ return yield this.client.call('patch', uri, {
2284
+ 'content-type': 'application/json',
2285
+ }, payload);
2286
+ });
2287
+ }
2156
2288
  /**
2157
2289
  * Create Enum Attribute
2158
2290
  *
@@ -2207,6 +2339,59 @@ class Databases extends Service {
2207
2339
  }, payload);
2208
2340
  });
2209
2341
  }
2342
+ /**
2343
+ * Update Enum Attribute
2344
+ *
2345
+ * Update an enum attribute. Changing the `default` value will not update
2346
+ * already existing documents.
2347
+ *
2348
+ *
2349
+ * @param {string} databaseId
2350
+ * @param {string} collectionId
2351
+ * @param {string} key
2352
+ * @param {string[]} elements
2353
+ * @param {boolean} required
2354
+ * @param {string} xdefault
2355
+ * @throws {AppwriteException}
2356
+ * @returns {Promise}
2357
+ */
2358
+ updateEnumAttribute(databaseId, collectionId, key, elements, required, xdefault) {
2359
+ return __awaiter(this, void 0, void 0, function* () {
2360
+ if (typeof databaseId === 'undefined') {
2361
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2362
+ }
2363
+ if (typeof collectionId === 'undefined') {
2364
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2365
+ }
2366
+ if (typeof key === 'undefined') {
2367
+ throw new AppwriteException('Missing required parameter: "key"');
2368
+ }
2369
+ if (typeof elements === 'undefined') {
2370
+ throw new AppwriteException('Missing required parameter: "elements"');
2371
+ }
2372
+ if (typeof required === 'undefined') {
2373
+ throw new AppwriteException('Missing required parameter: "required"');
2374
+ }
2375
+ if (typeof xdefault === 'undefined') {
2376
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2377
+ }
2378
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2379
+ let payload = {};
2380
+ if (typeof elements !== 'undefined') {
2381
+ payload['elements'] = elements;
2382
+ }
2383
+ if (typeof required !== 'undefined') {
2384
+ payload['required'] = required;
2385
+ }
2386
+ if (typeof xdefault !== 'undefined') {
2387
+ payload['default'] = xdefault;
2388
+ }
2389
+ const uri = new URL(this.client.config.endpoint + path);
2390
+ return yield this.client.call('patch', uri, {
2391
+ 'content-type': 'application/json',
2392
+ }, payload);
2393
+ });
2394
+ }
2210
2395
  /**
2211
2396
  * Create Float Attribute
2212
2397
  *
@@ -2265,6 +2450,66 @@ class Databases extends Service {
2265
2450
  }, payload);
2266
2451
  });
2267
2452
  }
2453
+ /**
2454
+ * Update Float Attribute
2455
+ *
2456
+ * Update a float attribute. Changing the `default` value will not update
2457
+ * already existing documents.
2458
+ *
2459
+ *
2460
+ * @param {string} databaseId
2461
+ * @param {string} collectionId
2462
+ * @param {string} key
2463
+ * @param {boolean} required
2464
+ * @param {number} min
2465
+ * @param {number} max
2466
+ * @param {number} xdefault
2467
+ * @throws {AppwriteException}
2468
+ * @returns {Promise}
2469
+ */
2470
+ updateFloatAttribute(databaseId, collectionId, key, required, min, max, xdefault) {
2471
+ return __awaiter(this, void 0, void 0, function* () {
2472
+ if (typeof databaseId === 'undefined') {
2473
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2474
+ }
2475
+ if (typeof collectionId === 'undefined') {
2476
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2477
+ }
2478
+ if (typeof key === 'undefined') {
2479
+ throw new AppwriteException('Missing required parameter: "key"');
2480
+ }
2481
+ if (typeof required === 'undefined') {
2482
+ throw new AppwriteException('Missing required parameter: "required"');
2483
+ }
2484
+ if (typeof min === 'undefined') {
2485
+ throw new AppwriteException('Missing required parameter: "min"');
2486
+ }
2487
+ if (typeof max === 'undefined') {
2488
+ throw new AppwriteException('Missing required parameter: "max"');
2489
+ }
2490
+ if (typeof xdefault === 'undefined') {
2491
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2492
+ }
2493
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2494
+ let payload = {};
2495
+ if (typeof required !== 'undefined') {
2496
+ payload['required'] = required;
2497
+ }
2498
+ if (typeof min !== 'undefined') {
2499
+ payload['min'] = min;
2500
+ }
2501
+ if (typeof max !== 'undefined') {
2502
+ payload['max'] = max;
2503
+ }
2504
+ if (typeof xdefault !== 'undefined') {
2505
+ payload['default'] = xdefault;
2506
+ }
2507
+ const uri = new URL(this.client.config.endpoint + path);
2508
+ return yield this.client.call('patch', uri, {
2509
+ 'content-type': 'application/json',
2510
+ }, payload);
2511
+ });
2512
+ }
2268
2513
  /**
2269
2514
  * Create Integer Attribute
2270
2515
  *
@@ -2323,6 +2568,66 @@ class Databases extends Service {
2323
2568
  }, payload);
2324
2569
  });
2325
2570
  }
2571
+ /**
2572
+ * Update Integer Attribute
2573
+ *
2574
+ * Update an integer attribute. Changing the `default` value will not update
2575
+ * already existing documents.
2576
+ *
2577
+ *
2578
+ * @param {string} databaseId
2579
+ * @param {string} collectionId
2580
+ * @param {string} key
2581
+ * @param {boolean} required
2582
+ * @param {number} min
2583
+ * @param {number} max
2584
+ * @param {number} xdefault
2585
+ * @throws {AppwriteException}
2586
+ * @returns {Promise}
2587
+ */
2588
+ updateIntegerAttribute(databaseId, collectionId, key, required, min, max, xdefault) {
2589
+ return __awaiter(this, void 0, void 0, function* () {
2590
+ if (typeof databaseId === 'undefined') {
2591
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2592
+ }
2593
+ if (typeof collectionId === 'undefined') {
2594
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2595
+ }
2596
+ if (typeof key === 'undefined') {
2597
+ throw new AppwriteException('Missing required parameter: "key"');
2598
+ }
2599
+ if (typeof required === 'undefined') {
2600
+ throw new AppwriteException('Missing required parameter: "required"');
2601
+ }
2602
+ if (typeof min === 'undefined') {
2603
+ throw new AppwriteException('Missing required parameter: "min"');
2604
+ }
2605
+ if (typeof max === 'undefined') {
2606
+ throw new AppwriteException('Missing required parameter: "max"');
2607
+ }
2608
+ if (typeof xdefault === 'undefined') {
2609
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2610
+ }
2611
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2612
+ let payload = {};
2613
+ if (typeof required !== 'undefined') {
2614
+ payload['required'] = required;
2615
+ }
2616
+ if (typeof min !== 'undefined') {
2617
+ payload['min'] = min;
2618
+ }
2619
+ if (typeof max !== 'undefined') {
2620
+ payload['max'] = max;
2621
+ }
2622
+ if (typeof xdefault !== 'undefined') {
2623
+ payload['default'] = xdefault;
2624
+ }
2625
+ const uri = new URL(this.client.config.endpoint + path);
2626
+ return yield this.client.call('patch', uri, {
2627
+ 'content-type': 'application/json',
2628
+ }, payload);
2629
+ });
2630
+ }
2326
2631
  /**
2327
2632
  * Create IP Address Attribute
2328
2633
  *
@@ -2372,6 +2677,52 @@ class Databases extends Service {
2372
2677
  }, payload);
2373
2678
  });
2374
2679
  }
2680
+ /**
2681
+ * Update IP Address Attribute
2682
+ *
2683
+ * Update an ip attribute. Changing the `default` value will not update
2684
+ * already existing documents.
2685
+ *
2686
+ *
2687
+ * @param {string} databaseId
2688
+ * @param {string} collectionId
2689
+ * @param {string} key
2690
+ * @param {boolean} required
2691
+ * @param {string} xdefault
2692
+ * @throws {AppwriteException}
2693
+ * @returns {Promise}
2694
+ */
2695
+ updateIpAttribute(databaseId, collectionId, key, required, xdefault) {
2696
+ return __awaiter(this, void 0, void 0, function* () {
2697
+ if (typeof databaseId === 'undefined') {
2698
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2699
+ }
2700
+ if (typeof collectionId === 'undefined') {
2701
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2702
+ }
2703
+ if (typeof key === 'undefined') {
2704
+ throw new AppwriteException('Missing required parameter: "key"');
2705
+ }
2706
+ if (typeof required === 'undefined') {
2707
+ throw new AppwriteException('Missing required parameter: "required"');
2708
+ }
2709
+ if (typeof xdefault === 'undefined') {
2710
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2711
+ }
2712
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2713
+ let payload = {};
2714
+ if (typeof required !== 'undefined') {
2715
+ payload['required'] = required;
2716
+ }
2717
+ if (typeof xdefault !== 'undefined') {
2718
+ payload['default'] = xdefault;
2719
+ }
2720
+ const uri = new URL(this.client.config.endpoint + path);
2721
+ return yield this.client.call('patch', uri, {
2722
+ 'content-type': 'application/json',
2723
+ }, payload);
2724
+ });
2725
+ }
2375
2726
  /**
2376
2727
  * Create String Attribute
2377
2728
  *
@@ -2428,6 +2779,52 @@ class Databases extends Service {
2428
2779
  }, payload);
2429
2780
  });
2430
2781
  }
2782
+ /**
2783
+ * Update String Attribute
2784
+ *
2785
+ * Update a string attribute. Changing the `default` value will not update
2786
+ * already existing documents.
2787
+ *
2788
+ *
2789
+ * @param {string} databaseId
2790
+ * @param {string} collectionId
2791
+ * @param {string} key
2792
+ * @param {boolean} required
2793
+ * @param {string} xdefault
2794
+ * @throws {AppwriteException}
2795
+ * @returns {Promise}
2796
+ */
2797
+ updateStringAttribute(databaseId, collectionId, key, required, xdefault) {
2798
+ return __awaiter(this, void 0, void 0, function* () {
2799
+ if (typeof databaseId === 'undefined') {
2800
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2801
+ }
2802
+ if (typeof collectionId === 'undefined') {
2803
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2804
+ }
2805
+ if (typeof key === 'undefined') {
2806
+ throw new AppwriteException('Missing required parameter: "key"');
2807
+ }
2808
+ if (typeof required === 'undefined') {
2809
+ throw new AppwriteException('Missing required parameter: "required"');
2810
+ }
2811
+ if (typeof xdefault === 'undefined') {
2812
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2813
+ }
2814
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2815
+ let payload = {};
2816
+ if (typeof required !== 'undefined') {
2817
+ payload['required'] = required;
2818
+ }
2819
+ if (typeof xdefault !== 'undefined') {
2820
+ payload['default'] = xdefault;
2821
+ }
2822
+ const uri = new URL(this.client.config.endpoint + path);
2823
+ return yield this.client.call('patch', uri, {
2824
+ 'content-type': 'application/json',
2825
+ }, payload);
2826
+ });
2827
+ }
2431
2828
  /**
2432
2829
  * Create URL Attribute
2433
2830
  *
@@ -2477,6 +2874,52 @@ class Databases extends Service {
2477
2874
  }, payload);
2478
2875
  });
2479
2876
  }
2877
+ /**
2878
+ * Update URL Attribute
2879
+ *
2880
+ * Update an url attribute. Changing the `default` value will not update
2881
+ * already existing documents.
2882
+ *
2883
+ *
2884
+ * @param {string} databaseId
2885
+ * @param {string} collectionId
2886
+ * @param {string} key
2887
+ * @param {boolean} required
2888
+ * @param {string} xdefault
2889
+ * @throws {AppwriteException}
2890
+ * @returns {Promise}
2891
+ */
2892
+ updateUrlAttribute(databaseId, collectionId, key, required, xdefault) {
2893
+ return __awaiter(this, void 0, void 0, function* () {
2894
+ if (typeof databaseId === 'undefined') {
2895
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2896
+ }
2897
+ if (typeof collectionId === 'undefined') {
2898
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2899
+ }
2900
+ if (typeof key === 'undefined') {
2901
+ throw new AppwriteException('Missing required parameter: "key"');
2902
+ }
2903
+ if (typeof required === 'undefined') {
2904
+ throw new AppwriteException('Missing required parameter: "required"');
2905
+ }
2906
+ if (typeof xdefault === 'undefined') {
2907
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2908
+ }
2909
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2910
+ let payload = {};
2911
+ if (typeof required !== 'undefined') {
2912
+ payload['required'] = required;
2913
+ }
2914
+ if (typeof xdefault !== 'undefined') {
2915
+ payload['default'] = xdefault;
2916
+ }
2917
+ const uri = new URL(this.client.config.endpoint + path);
2918
+ return yield this.client.call('patch', uri, {
2919
+ 'content-type': 'application/json',
2920
+ }, payload);
2921
+ });
2922
+ }
2480
2923
  /**
2481
2924
  * Get Attribute
2482
2925
  *
@@ -3032,8 +3475,8 @@ class Functions extends Service {
3032
3475
  *
3033
3476
  * @param {string} functionId
3034
3477
  * @param {string} name
3035
- * @param {string[]} execute
3036
3478
  * @param {string} runtime
3479
+ * @param {string[]} execute
3037
3480
  * @param {string[]} events
3038
3481
  * @param {string} schedule
3039
3482
  * @param {number} timeout
@@ -3041,7 +3484,7 @@ class Functions extends Service {
3041
3484
  * @throws {AppwriteException}
3042
3485
  * @returns {Promise}
3043
3486
  */
3044
- create(functionId, name, execute, runtime, events, schedule, timeout, enabled) {
3487
+ create(functionId, name, runtime, execute, events, schedule, timeout, enabled) {
3045
3488
  return __awaiter(this, void 0, void 0, function* () {
3046
3489
  if (typeof functionId === 'undefined') {
3047
3490
  throw new AppwriteException('Missing required parameter: "functionId"');
@@ -3049,9 +3492,6 @@ class Functions extends Service {
3049
3492
  if (typeof name === 'undefined') {
3050
3493
  throw new AppwriteException('Missing required parameter: "name"');
3051
3494
  }
3052
- if (typeof execute === 'undefined') {
3053
- throw new AppwriteException('Missing required parameter: "execute"');
3054
- }
3055
3495
  if (typeof runtime === 'undefined') {
3056
3496
  throw new AppwriteException('Missing required parameter: "runtime"');
3057
3497
  }
@@ -3171,9 +3611,6 @@ class Functions extends Service {
3171
3611
  if (typeof name === 'undefined') {
3172
3612
  throw new AppwriteException('Missing required parameter: "name"');
3173
3613
  }
3174
- if (typeof execute === 'undefined') {
3175
- throw new AppwriteException('Missing required parameter: "execute"');
3176
- }
3177
3614
  let path = '/functions/{functionId}'.replace('{functionId}', functionId);
3178
3615
  let payload = {};
3179
3616
  if (typeof name !== 'undefined') {
@@ -5950,17 +6387,16 @@ class Teams extends Service {
5950
6387
  });
5951
6388
  }
5952
6389
  /**
5953
- * Update Team
6390
+ * Update Name
5954
6391
  *
5955
- * Update a team using its ID. Only members with the owner role can update the
5956
- * team.
6392
+ * Update the team's name by its unique ID.
5957
6393
  *
5958
6394
  * @param {string} teamId
5959
6395
  * @param {string} name
5960
6396
  * @throws {AppwriteException}
5961
6397
  * @returns {Promise}
5962
6398
  */
5963
- update(teamId, name) {
6399
+ updateName(teamId, name) {
5964
6400
  return __awaiter(this, void 0, void 0, function* () {
5965
6401
  if (typeof teamId === 'undefined') {
5966
6402
  throw new AppwriteException('Missing required parameter: "teamId"');
@@ -6267,6 +6703,61 @@ class Teams extends Service {
6267
6703
  }, payload);
6268
6704
  });
6269
6705
  }
6706
+ /**
6707
+ * Get Team Preferences
6708
+ *
6709
+ * Get the team's shared preferences by its unique ID. If a preference doesn't
6710
+ * need to be shared by all team members, prefer storing them in [user
6711
+ * preferences](/docs/client/account#accountGetPrefs).
6712
+ *
6713
+ * @param {string} teamId
6714
+ * @throws {AppwriteException}
6715
+ * @returns {Promise}
6716
+ */
6717
+ getPrefs(teamId) {
6718
+ return __awaiter(this, void 0, void 0, function* () {
6719
+ if (typeof teamId === 'undefined') {
6720
+ throw new AppwriteException('Missing required parameter: "teamId"');
6721
+ }
6722
+ let path = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
6723
+ let payload = {};
6724
+ const uri = new URL(this.client.config.endpoint + path);
6725
+ return yield this.client.call('get', uri, {
6726
+ 'content-type': 'application/json',
6727
+ }, payload);
6728
+ });
6729
+ }
6730
+ /**
6731
+ * Update Preferences
6732
+ *
6733
+ * Update the team's preferences by its unique ID. The object you pass is
6734
+ * stored as is and replaces any previous value. The maximum allowed prefs
6735
+ * size is 64kB and throws an error if exceeded.
6736
+ *
6737
+ * @param {string} teamId
6738
+ * @param {object} prefs
6739
+ * @throws {AppwriteException}
6740
+ * @returns {Promise}
6741
+ */
6742
+ updatePrefs(teamId, prefs) {
6743
+ return __awaiter(this, void 0, void 0, function* () {
6744
+ if (typeof teamId === 'undefined') {
6745
+ throw new AppwriteException('Missing required parameter: "teamId"');
6746
+ }
6747
+ if (typeof prefs === 'undefined') {
6748
+ throw new AppwriteException('Missing required parameter: "prefs"');
6749
+ }
6750
+ let path = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
6751
+ let payload = {};
6752
+ if (typeof prefs !== 'undefined') {
6753
+ payload['prefs'] = prefs;
6754
+ }
6755
+ const uri = new URL(this.client.config.endpoint + path);
6756
+ return yield this.client.call('put', uri, {
6757
+ 'content-type': 'application/json',
6758
+ }, payload);
6759
+ });
6760
+ }
6270
6761
  }
6271
6762
 
6272
6763
  class Users extends Service {