@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/dist/iife/sdk.js CHANGED
@@ -4279,7 +4279,7 @@
4279
4279
  'x-sdk-name': 'Console',
4280
4280
  'x-sdk-platform': 'console',
4281
4281
  'x-sdk-language': 'web',
4282
- 'x-sdk-version': '2.3.0',
4282
+ 'x-sdk-version': '2.3.1',
4283
4283
  'X-Appwrite-Response-Format': '1.8.0',
4284
4284
  };
4285
4285
  this.realtime = {
@@ -6932,6 +6932,52 @@
6932
6932
  }
6933
6933
  }
6934
6934
 
6935
+ class Activities {
6936
+ constructor(client) {
6937
+ this.client = client;
6938
+ }
6939
+ listEvents(paramsOrFirst) {
6940
+ let params;
6941
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6942
+ params = (paramsOrFirst || {});
6943
+ }
6944
+ else {
6945
+ params = {
6946
+ queries: paramsOrFirst
6947
+ };
6948
+ }
6949
+ const queries = params.queries;
6950
+ const apiPath = '/activities/events';
6951
+ const payload = {};
6952
+ if (typeof queries !== 'undefined') {
6953
+ payload['queries'] = queries;
6954
+ }
6955
+ const uri = new URL(this.client.config.endpoint + apiPath);
6956
+ const apiHeaders = {};
6957
+ return this.client.call('get', uri, apiHeaders, payload);
6958
+ }
6959
+ getEvent(paramsOrFirst) {
6960
+ let params;
6961
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6962
+ params = (paramsOrFirst || {});
6963
+ }
6964
+ else {
6965
+ params = {
6966
+ eventId: paramsOrFirst
6967
+ };
6968
+ }
6969
+ const eventId = params.eventId;
6970
+ if (typeof eventId === 'undefined') {
6971
+ throw new AppwriteException('Missing required parameter: "eventId"');
6972
+ }
6973
+ const apiPath = '/activities/events/{eventId}'.replace('{eventId}', eventId);
6974
+ const payload = {};
6975
+ const uri = new URL(this.client.config.endpoint + apiPath);
6976
+ const apiHeaders = {};
6977
+ return this.client.call('get', uri, apiHeaders, payload);
6978
+ }
6979
+ }
6980
+
6935
6981
  class Avatars {
6936
6982
  constructor(client) {
6937
6983
  this.client = client;
@@ -9457,7 +9503,8 @@
9457
9503
  key: rest[1],
9458
9504
  required: rest[2],
9459
9505
  xdefault: rest[3],
9460
- array: rest[4]
9506
+ array: rest[4],
9507
+ encrypt: rest[5]
9461
9508
  };
9462
9509
  }
9463
9510
  const databaseId = params.databaseId;
@@ -9466,6 +9513,7 @@
9466
9513
  const required = params.required;
9467
9514
  const xdefault = params.xdefault;
9468
9515
  const array = params.array;
9516
+ const encrypt = params.encrypt;
9469
9517
  if (typeof databaseId === 'undefined') {
9470
9518
  throw new AppwriteException('Missing required parameter: "databaseId"');
9471
9519
  }
@@ -9492,6 +9540,9 @@
9492
9540
  if (typeof array !== 'undefined') {
9493
9541
  payload['array'] = array;
9494
9542
  }
9543
+ if (typeof encrypt !== 'undefined') {
9544
+ payload['encrypt'] = encrypt;
9545
+ }
9495
9546
  const uri = new URL(this.client.config.endpoint + apiPath);
9496
9547
  const apiHeaders = {
9497
9548
  'content-type': 'application/json',
@@ -9563,7 +9614,8 @@
9563
9614
  key: rest[1],
9564
9615
  required: rest[2],
9565
9616
  xdefault: rest[3],
9566
- array: rest[4]
9617
+ array: rest[4],
9618
+ encrypt: rest[5]
9567
9619
  };
9568
9620
  }
9569
9621
  const databaseId = params.databaseId;
@@ -9572,6 +9624,7 @@
9572
9624
  const required = params.required;
9573
9625
  const xdefault = params.xdefault;
9574
9626
  const array = params.array;
9627
+ const encrypt = params.encrypt;
9575
9628
  if (typeof databaseId === 'undefined') {
9576
9629
  throw new AppwriteException('Missing required parameter: "databaseId"');
9577
9630
  }
@@ -9598,6 +9651,9 @@
9598
9651
  if (typeof array !== 'undefined') {
9599
9652
  payload['array'] = array;
9600
9653
  }
9654
+ if (typeof encrypt !== 'undefined') {
9655
+ payload['encrypt'] = encrypt;
9656
+ }
9601
9657
  const uri = new URL(this.client.config.endpoint + apiPath);
9602
9658
  const apiHeaders = {
9603
9659
  'content-type': 'application/json',
@@ -10052,7 +10108,8 @@
10052
10108
  key: rest[1],
10053
10109
  required: rest[2],
10054
10110
  xdefault: rest[3],
10055
- array: rest[4]
10111
+ array: rest[4],
10112
+ encrypt: rest[5]
10056
10113
  };
10057
10114
  }
10058
10115
  const databaseId = params.databaseId;
@@ -10061,6 +10118,7 @@
10061
10118
  const required = params.required;
10062
10119
  const xdefault = params.xdefault;
10063
10120
  const array = params.array;
10121
+ const encrypt = params.encrypt;
10064
10122
  if (typeof databaseId === 'undefined') {
10065
10123
  throw new AppwriteException('Missing required parameter: "databaseId"');
10066
10124
  }
@@ -10087,6 +10145,9 @@
10087
10145
  if (typeof array !== 'undefined') {
10088
10146
  payload['array'] = array;
10089
10147
  }
10148
+ if (typeof encrypt !== 'undefined') {
10149
+ payload['encrypt'] = encrypt;
10150
+ }
10090
10151
  const uri = new URL(this.client.config.endpoint + apiPath);
10091
10152
  const apiHeaders = {
10092
10153
  'content-type': 'application/json',
@@ -10265,7 +10326,8 @@
10265
10326
  size: rest[2],
10266
10327
  required: rest[3],
10267
10328
  xdefault: rest[4],
10268
- array: rest[5]
10329
+ array: rest[5],
10330
+ encrypt: rest[6]
10269
10331
  };
10270
10332
  }
10271
10333
  const databaseId = params.databaseId;
@@ -10275,6 +10337,7 @@
10275
10337
  const required = params.required;
10276
10338
  const xdefault = params.xdefault;
10277
10339
  const array = params.array;
10340
+ const encrypt = params.encrypt;
10278
10341
  if (typeof databaseId === 'undefined') {
10279
10342
  throw new AppwriteException('Missing required parameter: "databaseId"');
10280
10343
  }
@@ -10307,6 +10370,9 @@
10307
10370
  if (typeof array !== 'undefined') {
10308
10371
  payload['array'] = array;
10309
10372
  }
10373
+ if (typeof encrypt !== 'undefined') {
10374
+ payload['encrypt'] = encrypt;
10375
+ }
10310
10376
  const uri = new URL(this.client.config.endpoint + apiPath);
10311
10377
  const apiHeaders = {
10312
10378
  'content-type': 'application/json',
@@ -25479,7 +25545,8 @@
25479
25545
  key: rest[1],
25480
25546
  required: rest[2],
25481
25547
  xdefault: rest[3],
25482
- array: rest[4]
25548
+ array: rest[4],
25549
+ encrypt: rest[5]
25483
25550
  };
25484
25551
  }
25485
25552
  const databaseId = params.databaseId;
@@ -25488,6 +25555,7 @@
25488
25555
  const required = params.required;
25489
25556
  const xdefault = params.xdefault;
25490
25557
  const array = params.array;
25558
+ const encrypt = params.encrypt;
25491
25559
  if (typeof databaseId === 'undefined') {
25492
25560
  throw new AppwriteException('Missing required parameter: "databaseId"');
25493
25561
  }
@@ -25514,6 +25582,9 @@
25514
25582
  if (typeof array !== 'undefined') {
25515
25583
  payload['array'] = array;
25516
25584
  }
25585
+ if (typeof encrypt !== 'undefined') {
25586
+ payload['encrypt'] = encrypt;
25587
+ }
25517
25588
  const uri = new URL(this.client.config.endpoint + apiPath);
25518
25589
  const apiHeaders = {
25519
25590
  'content-type': 'application/json',
@@ -25585,7 +25656,8 @@
25585
25656
  key: rest[1],
25586
25657
  required: rest[2],
25587
25658
  xdefault: rest[3],
25588
- array: rest[4]
25659
+ array: rest[4],
25660
+ encrypt: rest[5]
25589
25661
  };
25590
25662
  }
25591
25663
  const databaseId = params.databaseId;
@@ -25594,6 +25666,7 @@
25594
25666
  const required = params.required;
25595
25667
  const xdefault = params.xdefault;
25596
25668
  const array = params.array;
25669
+ const encrypt = params.encrypt;
25597
25670
  if (typeof databaseId === 'undefined') {
25598
25671
  throw new AppwriteException('Missing required parameter: "databaseId"');
25599
25672
  }
@@ -25620,6 +25693,9 @@
25620
25693
  if (typeof array !== 'undefined') {
25621
25694
  payload['array'] = array;
25622
25695
  }
25696
+ if (typeof encrypt !== 'undefined') {
25697
+ payload['encrypt'] = encrypt;
25698
+ }
25623
25699
  const uri = new URL(this.client.config.endpoint + apiPath);
25624
25700
  const apiHeaders = {
25625
25701
  'content-type': 'application/json',
@@ -26074,7 +26150,8 @@
26074
26150
  key: rest[1],
26075
26151
  required: rest[2],
26076
26152
  xdefault: rest[3],
26077
- array: rest[4]
26153
+ array: rest[4],
26154
+ encrypt: rest[5]
26078
26155
  };
26079
26156
  }
26080
26157
  const databaseId = params.databaseId;
@@ -26083,6 +26160,7 @@
26083
26160
  const required = params.required;
26084
26161
  const xdefault = params.xdefault;
26085
26162
  const array = params.array;
26163
+ const encrypt = params.encrypt;
26086
26164
  if (typeof databaseId === 'undefined') {
26087
26165
  throw new AppwriteException('Missing required parameter: "databaseId"');
26088
26166
  }
@@ -26109,6 +26187,9 @@
26109
26187
  if (typeof array !== 'undefined') {
26110
26188
  payload['array'] = array;
26111
26189
  }
26190
+ if (typeof encrypt !== 'undefined') {
26191
+ payload['encrypt'] = encrypt;
26192
+ }
26112
26193
  const uri = new URL(this.client.config.endpoint + apiPath);
26113
26194
  const apiHeaders = {
26114
26195
  'content-type': 'application/json',
@@ -26287,7 +26368,8 @@
26287
26368
  size: rest[2],
26288
26369
  required: rest[3],
26289
26370
  xdefault: rest[4],
26290
- array: rest[5]
26371
+ array: rest[5],
26372
+ encrypt: rest[6]
26291
26373
  };
26292
26374
  }
26293
26375
  const databaseId = params.databaseId;
@@ -26297,6 +26379,7 @@
26297
26379
  const required = params.required;
26298
26380
  const xdefault = params.xdefault;
26299
26381
  const array = params.array;
26382
+ const encrypt = params.encrypt;
26300
26383
  if (typeof databaseId === 'undefined') {
26301
26384
  throw new AppwriteException('Missing required parameter: "databaseId"');
26302
26385
  }
@@ -26329,6 +26412,9 @@
26329
26412
  if (typeof array !== 'undefined') {
26330
26413
  payload['array'] = array;
26331
26414
  }
26415
+ if (typeof encrypt !== 'undefined') {
26416
+ payload['encrypt'] = encrypt;
26417
+ }
26332
26418
  const uri = new URL(this.client.config.endpoint + apiPath);
26333
26419
  const apiHeaders = {
26334
26420
  'content-type': 'application/json',
@@ -31645,9 +31731,6 @@
31645
31731
  Runtime["Python312"] = "python-3.12";
31646
31732
  Runtime["Pythonml311"] = "python-ml-3.11";
31647
31733
  Runtime["Pythonml312"] = "python-ml-3.12";
31648
- Runtime["Deno121"] = "deno-1.21";
31649
- Runtime["Deno124"] = "deno-1.24";
31650
- Runtime["Deno135"] = "deno-1.35";
31651
31734
  Runtime["Deno140"] = "deno-1.40";
31652
31735
  Runtime["Deno146"] = "deno-1.46";
31653
31736
  Runtime["Deno20"] = "deno-2.0";
@@ -31718,9 +31801,6 @@
31718
31801
  Runtimes["Python312"] = "python-3.12";
31719
31802
  Runtimes["Pythonml311"] = "python-ml-3.11";
31720
31803
  Runtimes["Pythonml312"] = "python-ml-3.12";
31721
- Runtimes["Deno121"] = "deno-1.21";
31722
- Runtimes["Deno124"] = "deno-1.24";
31723
- Runtimes["Deno135"] = "deno-1.35";
31724
31804
  Runtimes["Deno140"] = "deno-1.40";
31725
31805
  Runtimes["Deno146"] = "deno-1.46";
31726
31806
  Runtimes["Deno20"] = "deno-2.0";
@@ -32278,9 +32358,6 @@
32278
32358
  BuildRuntime["Python312"] = "python-3.12";
32279
32359
  BuildRuntime["Pythonml311"] = "python-ml-3.11";
32280
32360
  BuildRuntime["Pythonml312"] = "python-ml-3.12";
32281
- BuildRuntime["Deno121"] = "deno-1.21";
32282
- BuildRuntime["Deno124"] = "deno-1.24";
32283
- BuildRuntime["Deno135"] = "deno-1.35";
32284
32361
  BuildRuntime["Deno140"] = "deno-1.40";
32285
32362
  BuildRuntime["Deno146"] = "deno-1.46";
32286
32363
  BuildRuntime["Deno20"] = "deno-2.0";
@@ -32503,6 +32580,7 @@
32503
32580
  })(exports.BillingPlanGroup || (exports.BillingPlanGroup = {}));
32504
32581
 
32505
32582
  exports.Account = Account;
32583
+ exports.Activities = Activities;
32506
32584
  exports.AppwriteException = AppwriteException;
32507
32585
  exports.Assistant = Assistant;
32508
32586
  exports.Avatars = Avatars;
@@ -0,0 +1,15 @@
1
+ ```javascript
2
+ import { Client, Activities } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const activities = new Activities(client);
9
+
10
+ const result = await activities.getEvent({
11
+ eventId: '<EVENT_ID>'
12
+ });
13
+
14
+ console.log(result);
15
+ ```
@@ -0,0 +1,15 @@
1
+ ```javascript
2
+ import { Client, Activities } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const activities = new Activities(client);
9
+
10
+ const result = await activities.listEvents({
11
+ queries: '' // optional
12
+ });
13
+
14
+ console.log(result);
15
+ ```
@@ -13,7 +13,8 @@ const result = await databases.createLongtextAttribute({
13
13
  key: '',
14
14
  required: false,
15
15
  default: '<DEFAULT>', // optional
16
- array: false // optional
16
+ array: false, // optional
17
+ encrypt: false // optional
17
18
  });
18
19
 
19
20
  console.log(result);
@@ -13,7 +13,8 @@ const result = await databases.createMediumtextAttribute({
13
13
  key: '',
14
14
  required: false,
15
15
  default: '<DEFAULT>', // optional
16
- array: false // optional
16
+ array: false, // optional
17
+ encrypt: false // optional
17
18
  });
18
19
 
19
20
  console.log(result);
@@ -13,7 +13,8 @@ const result = await databases.createTextAttribute({
13
13
  key: '',
14
14
  required: false,
15
15
  default: '<DEFAULT>', // optional
16
- array: false // optional
16
+ array: false, // optional
17
+ encrypt: false // optional
17
18
  });
18
19
 
19
20
  console.log(result);
@@ -14,7 +14,8 @@ const result = await databases.createVarcharAttribute({
14
14
  size: 1,
15
15
  required: false,
16
16
  default: '<DEFAULT>', // optional
17
- array: false // optional
17
+ array: false, // optional
18
+ encrypt: false // optional
18
19
  });
19
20
 
20
21
  console.log(result);
@@ -13,7 +13,8 @@ const result = await tablesDB.createLongtextColumn({
13
13
  key: '',
14
14
  required: false,
15
15
  default: '<DEFAULT>', // optional
16
- array: false // optional
16
+ array: false, // optional
17
+ encrypt: false // optional
17
18
  });
18
19
 
19
20
  console.log(result);
@@ -13,7 +13,8 @@ const result = await tablesDB.createMediumtextColumn({
13
13
  key: '',
14
14
  required: false,
15
15
  default: '<DEFAULT>', // optional
16
- array: false // optional
16
+ array: false, // optional
17
+ encrypt: false // optional
17
18
  });
18
19
 
19
20
  console.log(result);
@@ -13,7 +13,8 @@ const result = await tablesDB.createTextColumn({
13
13
  key: '',
14
14
  required: false,
15
15
  default: '<DEFAULT>', // optional
16
- array: false // optional
16
+ array: false, // optional
17
+ encrypt: false // optional
17
18
  });
18
19
 
19
20
  console.log(result);
@@ -14,7 +14,8 @@ const result = await tablesDB.createVarcharColumn({
14
14
  size: 1,
15
15
  required: false,
16
16
  default: '<DEFAULT>', // optional
17
- array: false // optional
17
+ array: false, // optional
18
+ encrypt: false // optional
18
19
  });
19
20
 
20
21
  console.log(result);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appwrite.io/console",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
5
- "version": "2.3.0",
5
+ "version": "2.3.1",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -387,7 +387,7 @@ class Client {
387
387
  'x-sdk-name': 'Console',
388
388
  'x-sdk-platform': 'console',
389
389
  'x-sdk-language': 'web',
390
- 'x-sdk-version': '2.3.0',
390
+ 'x-sdk-version': '2.3.1',
391
391
  'X-Appwrite-Response-Format': '1.8.0',
392
392
  };
393
393
 
@@ -21,9 +21,6 @@ export enum BuildRuntime {
21
21
  Python312 = 'python-3.12',
22
22
  Pythonml311 = 'python-ml-3.11',
23
23
  Pythonml312 = 'python-ml-3.12',
24
- Deno121 = 'deno-1.21',
25
- Deno124 = 'deno-1.24',
26
- Deno135 = 'deno-1.35',
27
24
  Deno140 = 'deno-1.40',
28
25
  Deno146 = 'deno-1.46',
29
26
  Deno20 = 'deno-2.0',
@@ -21,9 +21,6 @@ export enum Runtime {
21
21
  Python312 = 'python-3.12',
22
22
  Pythonml311 = 'python-ml-3.11',
23
23
  Pythonml312 = 'python-ml-3.12',
24
- Deno121 = 'deno-1.21',
25
- Deno124 = 'deno-1.24',
26
- Deno135 = 'deno-1.35',
27
24
  Deno140 = 'deno-1.40',
28
25
  Deno146 = 'deno-1.46',
29
26
  Deno20 = 'deno-2.0',
@@ -21,9 +21,6 @@ export enum Runtimes {
21
21
  Python312 = 'python-3.12',
22
22
  Pythonml311 = 'python-ml-3.11',
23
23
  Pythonml312 = 'python-ml-3.12',
24
- Deno121 = 'deno-1.21',
25
- Deno124 = 'deno-1.24',
26
- Deno135 = 'deno-1.35',
27
24
  Deno140 = 'deno-1.40',
28
25
  Deno146 = 'deno-1.46',
29
26
  Deno20 = 'deno-2.0',
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export { Client, Query, AppwriteException } from './client';
9
9
  export { Account } from './services/account';
10
+ export { Activities } from './services/activities';
10
11
  export { Avatars } from './services/avatars';
11
12
  export { Backups } from './services/backups';
12
13
  export { Assistant } from './services/assistant';