@appwrite.io/console 2.3.0 → 2.3.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 (36) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/sdk.js +96 -18
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +96 -19
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +96 -18
  7. package/docs/examples/activities/get-event.md +15 -0
  8. package/docs/examples/activities/list-events.md +15 -0
  9. package/docs/examples/databases/create-longtext-attribute.md +2 -1
  10. package/docs/examples/databases/create-mediumtext-attribute.md +2 -1
  11. package/docs/examples/databases/create-text-attribute.md +2 -1
  12. package/docs/examples/databases/create-varchar-attribute.md +2 -1
  13. package/docs/examples/tablesdb/create-longtext-column.md +2 -1
  14. package/docs/examples/tablesdb/create-mediumtext-column.md +2 -1
  15. package/docs/examples/tablesdb/create-text-column.md +2 -1
  16. package/docs/examples/tablesdb/create-varchar-column.md +2 -1
  17. package/package.json +1 -1
  18. package/src/client.ts +1 -1
  19. package/src/enums/build-runtime.ts +0 -3
  20. package/src/enums/runtime.ts +0 -3
  21. package/src/enums/runtimes.ts +0 -3
  22. package/src/index.ts +1 -0
  23. package/src/models.ts +182 -2
  24. package/src/services/activities.ts +116 -0
  25. package/src/services/databases.ts +56 -28
  26. package/src/services/migrations.ts +2 -2
  27. package/src/services/tables-db.ts +56 -28
  28. package/types/enums/build-runtime.d.ts +0 -3
  29. package/types/enums/runtime.d.ts +0 -3
  30. package/types/enums/runtimes.d.ts +0 -3
  31. package/types/index.d.ts +1 -0
  32. package/types/models.d.ts +180 -2
  33. package/types/services/activities.d.ts +46 -0
  34. package/types/services/databases.d.ts +16 -4
  35. package/types/services/migrations.d.ts +2 -2
  36. package/types/services/tables-db.d.ts +16 -4
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@2.3.0"></script>
36
+ <script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@2.3.1"></script>
37
37
  ```
38
38
 
39
39
 
package/dist/cjs/sdk.js CHANGED
@@ -541,7 +541,7 @@ class Client {
541
541
  'x-sdk-name': 'Console',
542
542
  'x-sdk-platform': 'console',
543
543
  'x-sdk-language': 'web',
544
- 'x-sdk-version': '2.3.0',
544
+ 'x-sdk-version': '2.3.1',
545
545
  'X-Appwrite-Response-Format': '1.8.0',
546
546
  };
547
547
  this.realtime = {
@@ -3194,6 +3194,52 @@ class Account {
3194
3194
  }
3195
3195
  }
3196
3196
 
3197
+ class Activities {
3198
+ constructor(client) {
3199
+ this.client = client;
3200
+ }
3201
+ listEvents(paramsOrFirst) {
3202
+ let params;
3203
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3204
+ params = (paramsOrFirst || {});
3205
+ }
3206
+ else {
3207
+ params = {
3208
+ queries: paramsOrFirst
3209
+ };
3210
+ }
3211
+ const queries = params.queries;
3212
+ const apiPath = '/activities/events';
3213
+ const payload = {};
3214
+ if (typeof queries !== 'undefined') {
3215
+ payload['queries'] = queries;
3216
+ }
3217
+ const uri = new URL(this.client.config.endpoint + apiPath);
3218
+ const apiHeaders = {};
3219
+ return this.client.call('get', uri, apiHeaders, payload);
3220
+ }
3221
+ getEvent(paramsOrFirst) {
3222
+ let params;
3223
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3224
+ params = (paramsOrFirst || {});
3225
+ }
3226
+ else {
3227
+ params = {
3228
+ eventId: paramsOrFirst
3229
+ };
3230
+ }
3231
+ const eventId = params.eventId;
3232
+ if (typeof eventId === 'undefined') {
3233
+ throw new AppwriteException('Missing required parameter: "eventId"');
3234
+ }
3235
+ const apiPath = '/activities/events/{eventId}'.replace('{eventId}', eventId);
3236
+ const payload = {};
3237
+ const uri = new URL(this.client.config.endpoint + apiPath);
3238
+ const apiHeaders = {};
3239
+ return this.client.call('get', uri, apiHeaders, payload);
3240
+ }
3241
+ }
3242
+
3197
3243
  class Avatars {
3198
3244
  constructor(client) {
3199
3245
  this.client = client;
@@ -5719,7 +5765,8 @@ class Databases {
5719
5765
  key: rest[1],
5720
5766
  required: rest[2],
5721
5767
  xdefault: rest[3],
5722
- array: rest[4]
5768
+ array: rest[4],
5769
+ encrypt: rest[5]
5723
5770
  };
5724
5771
  }
5725
5772
  const databaseId = params.databaseId;
@@ -5728,6 +5775,7 @@ class Databases {
5728
5775
  const required = params.required;
5729
5776
  const xdefault = params.xdefault;
5730
5777
  const array = params.array;
5778
+ const encrypt = params.encrypt;
5731
5779
  if (typeof databaseId === 'undefined') {
5732
5780
  throw new AppwriteException('Missing required parameter: "databaseId"');
5733
5781
  }
@@ -5754,6 +5802,9 @@ class Databases {
5754
5802
  if (typeof array !== 'undefined') {
5755
5803
  payload['array'] = array;
5756
5804
  }
5805
+ if (typeof encrypt !== 'undefined') {
5806
+ payload['encrypt'] = encrypt;
5807
+ }
5757
5808
  const uri = new URL(this.client.config.endpoint + apiPath);
5758
5809
  const apiHeaders = {
5759
5810
  'content-type': 'application/json',
@@ -5825,7 +5876,8 @@ class Databases {
5825
5876
  key: rest[1],
5826
5877
  required: rest[2],
5827
5878
  xdefault: rest[3],
5828
- array: rest[4]
5879
+ array: rest[4],
5880
+ encrypt: rest[5]
5829
5881
  };
5830
5882
  }
5831
5883
  const databaseId = params.databaseId;
@@ -5834,6 +5886,7 @@ class Databases {
5834
5886
  const required = params.required;
5835
5887
  const xdefault = params.xdefault;
5836
5888
  const array = params.array;
5889
+ const encrypt = params.encrypt;
5837
5890
  if (typeof databaseId === 'undefined') {
5838
5891
  throw new AppwriteException('Missing required parameter: "databaseId"');
5839
5892
  }
@@ -5860,6 +5913,9 @@ class Databases {
5860
5913
  if (typeof array !== 'undefined') {
5861
5914
  payload['array'] = array;
5862
5915
  }
5916
+ if (typeof encrypt !== 'undefined') {
5917
+ payload['encrypt'] = encrypt;
5918
+ }
5863
5919
  const uri = new URL(this.client.config.endpoint + apiPath);
5864
5920
  const apiHeaders = {
5865
5921
  'content-type': 'application/json',
@@ -6314,7 +6370,8 @@ class Databases {
6314
6370
  key: rest[1],
6315
6371
  required: rest[2],
6316
6372
  xdefault: rest[3],
6317
- array: rest[4]
6373
+ array: rest[4],
6374
+ encrypt: rest[5]
6318
6375
  };
6319
6376
  }
6320
6377
  const databaseId = params.databaseId;
@@ -6323,6 +6380,7 @@ class Databases {
6323
6380
  const required = params.required;
6324
6381
  const xdefault = params.xdefault;
6325
6382
  const array = params.array;
6383
+ const encrypt = params.encrypt;
6326
6384
  if (typeof databaseId === 'undefined') {
6327
6385
  throw new AppwriteException('Missing required parameter: "databaseId"');
6328
6386
  }
@@ -6349,6 +6407,9 @@ class Databases {
6349
6407
  if (typeof array !== 'undefined') {
6350
6408
  payload['array'] = array;
6351
6409
  }
6410
+ if (typeof encrypt !== 'undefined') {
6411
+ payload['encrypt'] = encrypt;
6412
+ }
6352
6413
  const uri = new URL(this.client.config.endpoint + apiPath);
6353
6414
  const apiHeaders = {
6354
6415
  'content-type': 'application/json',
@@ -6527,7 +6588,8 @@ class Databases {
6527
6588
  size: rest[2],
6528
6589
  required: rest[3],
6529
6590
  xdefault: rest[4],
6530
- array: rest[5]
6591
+ array: rest[5],
6592
+ encrypt: rest[6]
6531
6593
  };
6532
6594
  }
6533
6595
  const databaseId = params.databaseId;
@@ -6537,6 +6599,7 @@ class Databases {
6537
6599
  const required = params.required;
6538
6600
  const xdefault = params.xdefault;
6539
6601
  const array = params.array;
6602
+ const encrypt = params.encrypt;
6540
6603
  if (typeof databaseId === 'undefined') {
6541
6604
  throw new AppwriteException('Missing required parameter: "databaseId"');
6542
6605
  }
@@ -6569,6 +6632,9 @@ class Databases {
6569
6632
  if (typeof array !== 'undefined') {
6570
6633
  payload['array'] = array;
6571
6634
  }
6635
+ if (typeof encrypt !== 'undefined') {
6636
+ payload['encrypt'] = encrypt;
6637
+ }
6572
6638
  const uri = new URL(this.client.config.endpoint + apiPath);
6573
6639
  const apiHeaders = {
6574
6640
  'content-type': 'application/json',
@@ -21741,7 +21807,8 @@ class TablesDB {
21741
21807
  key: rest[1],
21742
21808
  required: rest[2],
21743
21809
  xdefault: rest[3],
21744
- array: rest[4]
21810
+ array: rest[4],
21811
+ encrypt: rest[5]
21745
21812
  };
21746
21813
  }
21747
21814
  const databaseId = params.databaseId;
@@ -21750,6 +21817,7 @@ class TablesDB {
21750
21817
  const required = params.required;
21751
21818
  const xdefault = params.xdefault;
21752
21819
  const array = params.array;
21820
+ const encrypt = params.encrypt;
21753
21821
  if (typeof databaseId === 'undefined') {
21754
21822
  throw new AppwriteException('Missing required parameter: "databaseId"');
21755
21823
  }
@@ -21776,6 +21844,9 @@ class TablesDB {
21776
21844
  if (typeof array !== 'undefined') {
21777
21845
  payload['array'] = array;
21778
21846
  }
21847
+ if (typeof encrypt !== 'undefined') {
21848
+ payload['encrypt'] = encrypt;
21849
+ }
21779
21850
  const uri = new URL(this.client.config.endpoint + apiPath);
21780
21851
  const apiHeaders = {
21781
21852
  'content-type': 'application/json',
@@ -21847,7 +21918,8 @@ class TablesDB {
21847
21918
  key: rest[1],
21848
21919
  required: rest[2],
21849
21920
  xdefault: rest[3],
21850
- array: rest[4]
21921
+ array: rest[4],
21922
+ encrypt: rest[5]
21851
21923
  };
21852
21924
  }
21853
21925
  const databaseId = params.databaseId;
@@ -21856,6 +21928,7 @@ class TablesDB {
21856
21928
  const required = params.required;
21857
21929
  const xdefault = params.xdefault;
21858
21930
  const array = params.array;
21931
+ const encrypt = params.encrypt;
21859
21932
  if (typeof databaseId === 'undefined') {
21860
21933
  throw new AppwriteException('Missing required parameter: "databaseId"');
21861
21934
  }
@@ -21882,6 +21955,9 @@ class TablesDB {
21882
21955
  if (typeof array !== 'undefined') {
21883
21956
  payload['array'] = array;
21884
21957
  }
21958
+ if (typeof encrypt !== 'undefined') {
21959
+ payload['encrypt'] = encrypt;
21960
+ }
21885
21961
  const uri = new URL(this.client.config.endpoint + apiPath);
21886
21962
  const apiHeaders = {
21887
21963
  'content-type': 'application/json',
@@ -22336,7 +22412,8 @@ class TablesDB {
22336
22412
  key: rest[1],
22337
22413
  required: rest[2],
22338
22414
  xdefault: rest[3],
22339
- array: rest[4]
22415
+ array: rest[4],
22416
+ encrypt: rest[5]
22340
22417
  };
22341
22418
  }
22342
22419
  const databaseId = params.databaseId;
@@ -22345,6 +22422,7 @@ class TablesDB {
22345
22422
  const required = params.required;
22346
22423
  const xdefault = params.xdefault;
22347
22424
  const array = params.array;
22425
+ const encrypt = params.encrypt;
22348
22426
  if (typeof databaseId === 'undefined') {
22349
22427
  throw new AppwriteException('Missing required parameter: "databaseId"');
22350
22428
  }
@@ -22371,6 +22449,9 @@ class TablesDB {
22371
22449
  if (typeof array !== 'undefined') {
22372
22450
  payload['array'] = array;
22373
22451
  }
22452
+ if (typeof encrypt !== 'undefined') {
22453
+ payload['encrypt'] = encrypt;
22454
+ }
22374
22455
  const uri = new URL(this.client.config.endpoint + apiPath);
22375
22456
  const apiHeaders = {
22376
22457
  'content-type': 'application/json',
@@ -22549,7 +22630,8 @@ class TablesDB {
22549
22630
  size: rest[2],
22550
22631
  required: rest[3],
22551
22632
  xdefault: rest[4],
22552
- array: rest[5]
22633
+ array: rest[5],
22634
+ encrypt: rest[6]
22553
22635
  };
22554
22636
  }
22555
22637
  const databaseId = params.databaseId;
@@ -22559,6 +22641,7 @@ class TablesDB {
22559
22641
  const required = params.required;
22560
22642
  const xdefault = params.xdefault;
22561
22643
  const array = params.array;
22644
+ const encrypt = params.encrypt;
22562
22645
  if (typeof databaseId === 'undefined') {
22563
22646
  throw new AppwriteException('Missing required parameter: "databaseId"');
22564
22647
  }
@@ -22591,6 +22674,9 @@ class TablesDB {
22591
22674
  if (typeof array !== 'undefined') {
22592
22675
  payload['array'] = array;
22593
22676
  }
22677
+ if (typeof encrypt !== 'undefined') {
22678
+ payload['encrypt'] = encrypt;
22679
+ }
22594
22680
  const uri = new URL(this.client.config.endpoint + apiPath);
22595
22681
  const apiHeaders = {
22596
22682
  'content-type': 'application/json',
@@ -27907,9 +27993,6 @@ exports.Runtime = void 0;
27907
27993
  Runtime["Python312"] = "python-3.12";
27908
27994
  Runtime["Pythonml311"] = "python-ml-3.11";
27909
27995
  Runtime["Pythonml312"] = "python-ml-3.12";
27910
- Runtime["Deno121"] = "deno-1.21";
27911
- Runtime["Deno124"] = "deno-1.24";
27912
- Runtime["Deno135"] = "deno-1.35";
27913
27996
  Runtime["Deno140"] = "deno-1.40";
27914
27997
  Runtime["Deno146"] = "deno-1.46";
27915
27998
  Runtime["Deno20"] = "deno-2.0";
@@ -27980,9 +28063,6 @@ exports.Runtimes = void 0;
27980
28063
  Runtimes["Python312"] = "python-3.12";
27981
28064
  Runtimes["Pythonml311"] = "python-ml-3.11";
27982
28065
  Runtimes["Pythonml312"] = "python-ml-3.12";
27983
- Runtimes["Deno121"] = "deno-1.21";
27984
- Runtimes["Deno124"] = "deno-1.24";
27985
- Runtimes["Deno135"] = "deno-1.35";
27986
28066
  Runtimes["Deno140"] = "deno-1.40";
27987
28067
  Runtimes["Deno146"] = "deno-1.46";
27988
28068
  Runtimes["Deno20"] = "deno-2.0";
@@ -28540,9 +28620,6 @@ exports.BuildRuntime = void 0;
28540
28620
  BuildRuntime["Python312"] = "python-3.12";
28541
28621
  BuildRuntime["Pythonml311"] = "python-ml-3.11";
28542
28622
  BuildRuntime["Pythonml312"] = "python-ml-3.12";
28543
- BuildRuntime["Deno121"] = "deno-1.21";
28544
- BuildRuntime["Deno124"] = "deno-1.24";
28545
- BuildRuntime["Deno135"] = "deno-1.35";
28546
28623
  BuildRuntime["Deno140"] = "deno-1.40";
28547
28624
  BuildRuntime["Deno146"] = "deno-1.46";
28548
28625
  BuildRuntime["Deno20"] = "deno-2.0";
@@ -28765,6 +28842,7 @@ exports.BillingPlanGroup = void 0;
28765
28842
  })(exports.BillingPlanGroup || (exports.BillingPlanGroup = {}));
28766
28843
 
28767
28844
  exports.Account = Account;
28845
+ exports.Activities = Activities;
28768
28846
  exports.AppwriteException = AppwriteException;
28769
28847
  exports.Assistant = Assistant;
28770
28848
  exports.Avatars = Avatars;