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