@appwrite.io/console 0.0.2-preview-0.0 → 0.1.0-preview-0.1

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 (37) hide show
  1. package/.travis.yml +32 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +602 -15
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +602 -15
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +602 -15
  8. package/docs/examples/databases/create-relationship-attribute.md +18 -0
  9. package/docs/examples/databases/update-boolean-attribute.md +18 -0
  10. package/docs/examples/databases/update-datetime-attribute.md +18 -0
  11. package/docs/examples/databases/update-email-attribute.md +18 -0
  12. package/docs/examples/databases/update-enum-attribute.md +18 -0
  13. package/docs/examples/databases/update-float-attribute.md +18 -0
  14. package/docs/examples/databases/update-integer-attribute.md +18 -0
  15. package/docs/examples/databases/update-ip-attribute.md +18 -0
  16. package/docs/examples/databases/update-relationship-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/teams/get-prefs.md +18 -0
  22. package/docs/examples/teams/update-name.md +18 -0
  23. package/docs/examples/teams/update-prefs.md +18 -0
  24. package/docs/examples/teams/update.md +1 -1
  25. package/package.json +1 -1
  26. package/src/client.ts +1 -1
  27. package/src/models.ts +52 -3
  28. package/src/services/account.ts +7 -7
  29. package/src/services/databases.ts +736 -108
  30. package/src/services/functions.ts +3 -11
  31. package/src/services/teams.ts +65 -7
  32. package/types/models.d.ts +52 -3
  33. package/types/services/account.d.ts +7 -7
  34. package/types/services/databases.d.ts +174 -1
  35. package/types/services/functions.d.ts +3 -3
  36. package/types/services/teams.d.ts +31 -7
  37. 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.1',
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,107 @@ 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
+ }
2726
+ /**
2727
+ * Create relationship Attribute
2728
+ *
2729
+ *
2730
+ * @param {string} databaseId
2731
+ * @param {string} collectionId
2732
+ * @param {string} relatedCollectionId
2733
+ * @param {string} type
2734
+ * @param {boolean} twoWay
2735
+ * @param {string} key
2736
+ * @param {string} twoWayKey
2737
+ * @param {string} onDelete
2738
+ * @throws {AppwriteException}
2739
+ * @returns {Promise}
2740
+ */
2741
+ createRelationshipAttribute(databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete) {
2742
+ return __awaiter(this, void 0, void 0, function* () {
2743
+ if (typeof databaseId === 'undefined') {
2744
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2745
+ }
2746
+ if (typeof collectionId === 'undefined') {
2747
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2748
+ }
2749
+ if (typeof relatedCollectionId === 'undefined') {
2750
+ throw new AppwriteException('Missing required parameter: "relatedCollectionId"');
2751
+ }
2752
+ if (typeof type === 'undefined') {
2753
+ throw new AppwriteException('Missing required parameter: "type"');
2754
+ }
2755
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2756
+ let payload = {};
2757
+ if (typeof relatedCollectionId !== 'undefined') {
2758
+ payload['relatedCollectionId'] = relatedCollectionId;
2759
+ }
2760
+ if (typeof type !== 'undefined') {
2761
+ payload['type'] = type;
2762
+ }
2763
+ if (typeof twoWay !== 'undefined') {
2764
+ payload['twoWay'] = twoWay;
2765
+ }
2766
+ if (typeof key !== 'undefined') {
2767
+ payload['key'] = key;
2768
+ }
2769
+ if (typeof twoWayKey !== 'undefined') {
2770
+ payload['twoWayKey'] = twoWayKey;
2771
+ }
2772
+ if (typeof onDelete !== 'undefined') {
2773
+ payload['onDelete'] = onDelete;
2774
+ }
2775
+ const uri = new URL(this.client.config.endpoint + path);
2776
+ return yield this.client.call('post', uri, {
2777
+ 'content-type': 'application/json',
2778
+ }, payload);
2779
+ });
2780
+ }
2375
2781
  /**
2376
2782
  * Create String Attribute
2377
2783
  *
@@ -2428,6 +2834,52 @@ class Databases extends Service {
2428
2834
  }, payload);
2429
2835
  });
2430
2836
  }
2837
+ /**
2838
+ * Update String Attribute
2839
+ *
2840
+ * Update a string attribute. Changing the `default` value will not update
2841
+ * already existing documents.
2842
+ *
2843
+ *
2844
+ * @param {string} databaseId
2845
+ * @param {string} collectionId
2846
+ * @param {string} key
2847
+ * @param {boolean} required
2848
+ * @param {string} xdefault
2849
+ * @throws {AppwriteException}
2850
+ * @returns {Promise}
2851
+ */
2852
+ updateStringAttribute(databaseId, collectionId, key, required, xdefault) {
2853
+ return __awaiter(this, void 0, void 0, function* () {
2854
+ if (typeof databaseId === 'undefined') {
2855
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2856
+ }
2857
+ if (typeof collectionId === 'undefined') {
2858
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2859
+ }
2860
+ if (typeof key === 'undefined') {
2861
+ throw new AppwriteException('Missing required parameter: "key"');
2862
+ }
2863
+ if (typeof required === 'undefined') {
2864
+ throw new AppwriteException('Missing required parameter: "required"');
2865
+ }
2866
+ if (typeof xdefault === 'undefined') {
2867
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2868
+ }
2869
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2870
+ let payload = {};
2871
+ if (typeof required !== 'undefined') {
2872
+ payload['required'] = required;
2873
+ }
2874
+ if (typeof xdefault !== 'undefined') {
2875
+ payload['default'] = xdefault;
2876
+ }
2877
+ const uri = new URL(this.client.config.endpoint + path);
2878
+ return yield this.client.call('patch', uri, {
2879
+ 'content-type': 'application/json',
2880
+ }, payload);
2881
+ });
2882
+ }
2431
2883
  /**
2432
2884
  * Create URL Attribute
2433
2885
  *
@@ -2477,6 +2929,52 @@ class Databases extends Service {
2477
2929
  }, payload);
2478
2930
  });
2479
2931
  }
2932
+ /**
2933
+ * Update URL Attribute
2934
+ *
2935
+ * Update an url attribute. Changing the `default` value will not update
2936
+ * already existing documents.
2937
+ *
2938
+ *
2939
+ * @param {string} databaseId
2940
+ * @param {string} collectionId
2941
+ * @param {string} key
2942
+ * @param {boolean} required
2943
+ * @param {string} xdefault
2944
+ * @throws {AppwriteException}
2945
+ * @returns {Promise}
2946
+ */
2947
+ updateUrlAttribute(databaseId, collectionId, key, required, xdefault) {
2948
+ return __awaiter(this, void 0, void 0, function* () {
2949
+ if (typeof databaseId === 'undefined') {
2950
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2951
+ }
2952
+ if (typeof collectionId === 'undefined') {
2953
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2954
+ }
2955
+ if (typeof key === 'undefined') {
2956
+ throw new AppwriteException('Missing required parameter: "key"');
2957
+ }
2958
+ if (typeof required === 'undefined') {
2959
+ throw new AppwriteException('Missing required parameter: "required"');
2960
+ }
2961
+ if (typeof xdefault === 'undefined') {
2962
+ throw new AppwriteException('Missing required parameter: "xdefault"');
2963
+ }
2964
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2965
+ let payload = {};
2966
+ if (typeof required !== 'undefined') {
2967
+ payload['required'] = required;
2968
+ }
2969
+ if (typeof xdefault !== 'undefined') {
2970
+ payload['default'] = xdefault;
2971
+ }
2972
+ const uri = new URL(this.client.config.endpoint + path);
2973
+ return yield this.client.call('patch', uri, {
2974
+ 'content-type': 'application/json',
2975
+ }, payload);
2976
+ });
2977
+ }
2480
2978
  /**
2481
2979
  * Get Attribute
2482
2980
  *
@@ -2535,6 +3033,43 @@ class Databases extends Service {
2535
3033
  }, payload);
2536
3034
  });
2537
3035
  }
3036
+ /**
3037
+ * Update Relationship Attribute
3038
+ *
3039
+ *
3040
+ * @param {string} databaseId
3041
+ * @param {string} collectionId
3042
+ * @param {string} key
3043
+ * @param {boolean} twoWay
3044
+ * @param {string} onDelete
3045
+ * @throws {AppwriteException}
3046
+ * @returns {Promise}
3047
+ */
3048
+ updateRelationshipAttribute(databaseId, collectionId, key, twoWay, onDelete) {
3049
+ return __awaiter(this, void 0, void 0, function* () {
3050
+ if (typeof databaseId === 'undefined') {
3051
+ throw new AppwriteException('Missing required parameter: "databaseId"');
3052
+ }
3053
+ if (typeof collectionId === 'undefined') {
3054
+ throw new AppwriteException('Missing required parameter: "collectionId"');
3055
+ }
3056
+ if (typeof key === 'undefined') {
3057
+ throw new AppwriteException('Missing required parameter: "key"');
3058
+ }
3059
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
3060
+ let payload = {};
3061
+ if (typeof twoWay !== 'undefined') {
3062
+ payload['twoWay'] = twoWay;
3063
+ }
3064
+ if (typeof onDelete !== 'undefined') {
3065
+ payload['onDelete'] = onDelete;
3066
+ }
3067
+ const uri = new URL(this.client.config.endpoint + path);
3068
+ return yield this.client.call('patch', uri, {
3069
+ 'content-type': 'application/json',
3070
+ }, payload);
3071
+ });
3072
+ }
2538
3073
  /**
2539
3074
  * List Documents
2540
3075
  *
@@ -2622,10 +3157,11 @@ class Databases extends Service {
2622
3157
  * @param {string} databaseId
2623
3158
  * @param {string} collectionId
2624
3159
  * @param {string} documentId
3160
+ * @param {string[]} queries
2625
3161
  * @throws {AppwriteException}
2626
3162
  * @returns {Promise}
2627
3163
  */
2628
- getDocument(databaseId, collectionId, documentId) {
3164
+ getDocument(databaseId, collectionId, documentId, queries) {
2629
3165
  return __awaiter(this, void 0, void 0, function* () {
2630
3166
  if (typeof databaseId === 'undefined') {
2631
3167
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -2638,6 +3174,9 @@ class Databases extends Service {
2638
3174
  }
2639
3175
  let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2640
3176
  let payload = {};
3177
+ if (typeof queries !== 'undefined') {
3178
+ payload['queries'] = queries;
3179
+ }
2641
3180
  const uri = new URL(this.client.config.endpoint + path);
2642
3181
  return yield this.client.call('get', uri, {
2643
3182
  'content-type': 'application/json',
@@ -3032,8 +3571,8 @@ class Functions extends Service {
3032
3571
  *
3033
3572
  * @param {string} functionId
3034
3573
  * @param {string} name
3035
- * @param {string[]} execute
3036
3574
  * @param {string} runtime
3575
+ * @param {string[]} execute
3037
3576
  * @param {string[]} events
3038
3577
  * @param {string} schedule
3039
3578
  * @param {number} timeout
@@ -3041,7 +3580,7 @@ class Functions extends Service {
3041
3580
  * @throws {AppwriteException}
3042
3581
  * @returns {Promise}
3043
3582
  */
3044
- create(functionId, name, execute, runtime, events, schedule, timeout, enabled) {
3583
+ create(functionId, name, runtime, execute, events, schedule, timeout, enabled) {
3045
3584
  return __awaiter(this, void 0, void 0, function* () {
3046
3585
  if (typeof functionId === 'undefined') {
3047
3586
  throw new AppwriteException('Missing required parameter: "functionId"');
@@ -3049,9 +3588,6 @@ class Functions extends Service {
3049
3588
  if (typeof name === 'undefined') {
3050
3589
  throw new AppwriteException('Missing required parameter: "name"');
3051
3590
  }
3052
- if (typeof execute === 'undefined') {
3053
- throw new AppwriteException('Missing required parameter: "execute"');
3054
- }
3055
3591
  if (typeof runtime === 'undefined') {
3056
3592
  throw new AppwriteException('Missing required parameter: "runtime"');
3057
3593
  }
@@ -3171,9 +3707,6 @@ class Functions extends Service {
3171
3707
  if (typeof name === 'undefined') {
3172
3708
  throw new AppwriteException('Missing required parameter: "name"');
3173
3709
  }
3174
- if (typeof execute === 'undefined') {
3175
- throw new AppwriteException('Missing required parameter: "execute"');
3176
- }
3177
3710
  let path = '/functions/{functionId}'.replace('{functionId}', functionId);
3178
3711
  let payload = {};
3179
3712
  if (typeof name !== 'undefined') {
@@ -5950,17 +6483,16 @@ class Teams extends Service {
5950
6483
  });
5951
6484
  }
5952
6485
  /**
5953
- * Update Team
6486
+ * Update Name
5954
6487
  *
5955
- * Update a team using its ID. Only members with the owner role can update the
5956
- * team.
6488
+ * Update the team's name by its unique ID.
5957
6489
  *
5958
6490
  * @param {string} teamId
5959
6491
  * @param {string} name
5960
6492
  * @throws {AppwriteException}
5961
6493
  * @returns {Promise}
5962
6494
  */
5963
- update(teamId, name) {
6495
+ updateName(teamId, name) {
5964
6496
  return __awaiter(this, void 0, void 0, function* () {
5965
6497
  if (typeof teamId === 'undefined') {
5966
6498
  throw new AppwriteException('Missing required parameter: "teamId"');
@@ -6267,6 +6799,61 @@ class Teams extends Service {
6267
6799
  }, payload);
6268
6800
  });
6269
6801
  }
6802
+ /**
6803
+ * Get Team Preferences
6804
+ *
6805
+ * Get the team's shared preferences by its unique ID. If a preference doesn't
6806
+ * need to be shared by all team members, prefer storing them in [user
6807
+ * preferences](/docs/client/account#accountGetPrefs).
6808
+ *
6809
+ * @param {string} teamId
6810
+ * @throws {AppwriteException}
6811
+ * @returns {Promise}
6812
+ */
6813
+ getPrefs(teamId) {
6814
+ return __awaiter(this, void 0, void 0, function* () {
6815
+ if (typeof teamId === 'undefined') {
6816
+ throw new AppwriteException('Missing required parameter: "teamId"');
6817
+ }
6818
+ let path = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
6819
+ let payload = {};
6820
+ const uri = new URL(this.client.config.endpoint + path);
6821
+ return yield this.client.call('get', uri, {
6822
+ 'content-type': 'application/json',
6823
+ }, payload);
6824
+ });
6825
+ }
6826
+ /**
6827
+ * Update Preferences
6828
+ *
6829
+ * Update the team's preferences by its unique ID. The object you pass is
6830
+ * stored as is and replaces any previous value. The maximum allowed prefs
6831
+ * size is 64kB and throws an error if exceeded.
6832
+ *
6833
+ * @param {string} teamId
6834
+ * @param {object} prefs
6835
+ * @throws {AppwriteException}
6836
+ * @returns {Promise}
6837
+ */
6838
+ updatePrefs(teamId, prefs) {
6839
+ return __awaiter(this, void 0, void 0, function* () {
6840
+ if (typeof teamId === 'undefined') {
6841
+ throw new AppwriteException('Missing required parameter: "teamId"');
6842
+ }
6843
+ if (typeof prefs === 'undefined') {
6844
+ throw new AppwriteException('Missing required parameter: "prefs"');
6845
+ }
6846
+ let path = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
6847
+ let payload = {};
6848
+ if (typeof prefs !== 'undefined') {
6849
+ payload['prefs'] = prefs;
6850
+ }
6851
+ const uri = new URL(this.client.config.endpoint + path);
6852
+ return yield this.client.call('put', uri, {
6853
+ 'content-type': 'application/json',
6854
+ }, payload);
6855
+ });
6856
+ }
6270
6857
  }
6271
6858
 
6272
6859
  class Users extends Service {