@appwrite.io/console 2.3.0 → 3.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 (56) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +2 -2
  3. package/dist/cjs/sdk.js +294 -28
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +294 -28
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +347 -61
  8. package/docs/examples/activities/get-event.md +15 -0
  9. package/docs/examples/activities/list-events.md +15 -0
  10. package/docs/examples/databases/create-longtext-attribute.md +2 -1
  11. package/docs/examples/databases/create-mediumtext-attribute.md +2 -1
  12. package/docs/examples/databases/create-text-attribute.md +2 -1
  13. package/docs/examples/databases/create-varchar-attribute.md +2 -1
  14. package/docs/examples/projects/create-schedule.md +20 -0
  15. package/docs/examples/projects/get-schedule.md +16 -0
  16. package/docs/examples/projects/list-schedules.md +17 -0
  17. package/docs/examples/tablesdb/create-longtext-column.md +2 -1
  18. package/docs/examples/tablesdb/create-mediumtext-column.md +2 -1
  19. package/docs/examples/tablesdb/create-text-column.md +2 -1
  20. package/docs/examples/tablesdb/create-varchar-column.md +2 -1
  21. package/package.json +2 -3
  22. package/src/channel.ts +4 -0
  23. package/src/client.ts +11 -3
  24. package/src/enums/build-runtime.ts +20 -3
  25. package/src/enums/email-template-type.ts +4 -4
  26. package/src/enums/o-auth-provider.ts +0 -2
  27. package/src/enums/resource-type.ts +6 -0
  28. package/src/enums/runtime.ts +20 -3
  29. package/src/enums/runtimes.ts +20 -3
  30. package/src/enums/scopes.ts +2 -0
  31. package/src/enums/sms-template-type.ts +1 -1
  32. package/src/index.ts +3 -0
  33. package/src/models.ts +250 -6
  34. package/src/services/account.ts +4 -4
  35. package/src/services/activities.ts +116 -0
  36. package/src/services/databases.ts +56 -28
  37. package/src/services/migrations.ts +2 -2
  38. package/src/services/projects.ts +223 -0
  39. package/src/services/tables-db.ts +56 -28
  40. package/types/channel.d.ts +1 -0
  41. package/types/enums/build-runtime.d.ts +20 -3
  42. package/types/enums/email-template-type.d.ts +4 -4
  43. package/types/enums/o-auth-provider.d.ts +1 -3
  44. package/types/enums/resource-type.d.ts +6 -0
  45. package/types/enums/runtime.d.ts +20 -3
  46. package/types/enums/runtimes.d.ts +20 -3
  47. package/types/enums/scopes.d.ts +2 -0
  48. package/types/enums/sms-template-type.d.ts +1 -1
  49. package/types/index.d.ts +3 -0
  50. package/types/models.d.ts +246 -6
  51. package/types/services/account.d.ts +4 -4
  52. package/types/services/activities.d.ts +46 -0
  53. package/types/services/databases.d.ts +16 -4
  54. package/types/services/migrations.d.ts +2 -2
  55. package/types/services/projects.d.ts +82 -0
  56. package/types/services/tables-db.d.ts +16 -4
package/src/models.ts CHANGED
@@ -594,6 +594,20 @@ export namespace Models {
594
594
  rules: ProxyRule[];
595
595
  }
596
596
 
597
+ /**
598
+ * Schedules List
599
+ */
600
+ export type ScheduleList = {
601
+ /**
602
+ * Total number of schedules that matched your query.
603
+ */
604
+ total: number;
605
+ /**
606
+ * List of schedules.
607
+ */
608
+ schedules: Schedule[];
609
+ }
610
+
597
611
  /**
598
612
  * Locale codes list
599
613
  */
@@ -811,7 +825,7 @@ export namespace Models {
811
825
  /**
812
826
  * Collection attributes.
813
827
  */
814
- attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeString)[];
828
+ attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[];
815
829
  /**
816
830
  * Collection indexes.
817
831
  */
@@ -837,7 +851,7 @@ export namespace Models {
837
851
  /**
838
852
  * List of attributes.
839
853
  */
840
- attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeString)[];
854
+ attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[];
841
855
  }
842
856
 
843
857
  /**
@@ -1498,6 +1512,10 @@ export namespace Models {
1498
1512
  * Default value for attribute when not provided. Cannot be set when attribute is required.
1499
1513
  */
1500
1514
  default?: string;
1515
+ /**
1516
+ * Defines whether this attribute is encrypted or not.
1517
+ */
1518
+ encrypt?: boolean;
1501
1519
  }
1502
1520
 
1503
1521
  /**
@@ -1540,6 +1558,10 @@ export namespace Models {
1540
1558
  * Default value for attribute when not provided. Cannot be set when attribute is required.
1541
1559
  */
1542
1560
  default?: string;
1561
+ /**
1562
+ * Defines whether this attribute is encrypted or not.
1563
+ */
1564
+ encrypt?: boolean;
1543
1565
  }
1544
1566
 
1545
1567
  /**
@@ -1582,6 +1604,10 @@ export namespace Models {
1582
1604
  * Default value for attribute when not provided. Cannot be set when attribute is required.
1583
1605
  */
1584
1606
  default?: string;
1607
+ /**
1608
+ * Defines whether this attribute is encrypted or not.
1609
+ */
1610
+ encrypt?: boolean;
1585
1611
  }
1586
1612
 
1587
1613
  /**
@@ -1624,6 +1650,10 @@ export namespace Models {
1624
1650
  * Default value for attribute when not provided. Cannot be set when attribute is required.
1625
1651
  */
1626
1652
  default?: string;
1653
+ /**
1654
+ * Defines whether this attribute is encrypted or not.
1655
+ */
1656
+ encrypt?: boolean;
1627
1657
  }
1628
1658
 
1629
1659
  /**
@@ -2352,6 +2382,10 @@ export namespace Models {
2352
2382
  * Default value for column when not provided. Cannot be set when column is required.
2353
2383
  */
2354
2384
  default?: string;
2385
+ /**
2386
+ * Defines whether this column is encrypted or not.
2387
+ */
2388
+ encrypt?: boolean;
2355
2389
  }
2356
2390
 
2357
2391
  /**
@@ -2394,6 +2428,10 @@ export namespace Models {
2394
2428
  * Default value for column when not provided. Cannot be set when column is required.
2395
2429
  */
2396
2430
  default?: string;
2431
+ /**
2432
+ * Defines whether this column is encrypted or not.
2433
+ */
2434
+ encrypt?: boolean;
2397
2435
  }
2398
2436
 
2399
2437
  /**
@@ -2436,6 +2474,10 @@ export namespace Models {
2436
2474
  * Default value for column when not provided. Cannot be set when column is required.
2437
2475
  */
2438
2476
  default?: string;
2477
+ /**
2478
+ * Defines whether this column is encrypted or not.
2479
+ */
2480
+ encrypt?: boolean;
2439
2481
  }
2440
2482
 
2441
2483
  /**
@@ -2478,6 +2520,10 @@ export namespace Models {
2478
2520
  * Default value for column when not provided. Cannot be set when column is required.
2479
2521
  */
2480
2522
  default?: string;
2523
+ /**
2524
+ * Defines whether this column is encrypted or not.
2525
+ */
2526
+ encrypt?: boolean;
2481
2527
  }
2482
2528
 
2483
2529
  /**
@@ -4611,6 +4657,10 @@ export namespace Models {
4611
4657
  * Labels for the project.
4612
4658
  */
4613
4659
  labels: string[];
4660
+ /**
4661
+ * Project status
4662
+ */
4663
+ status: string;
4614
4664
  /**
4615
4665
  * Email/Password auth method status
4616
4666
  */
@@ -4695,10 +4745,6 @@ export namespace Models {
4695
4745
  * Project region
4696
4746
  */
4697
4747
  region: string;
4698
- /**
4699
- * Project status
4700
- */
4701
- status: string;
4702
4748
  /**
4703
4749
  * Billing limits reached
4704
4750
  */
@@ -6189,6 +6235,56 @@ export namespace Models {
6189
6235
  renewAt: string;
6190
6236
  }
6191
6237
 
6238
+ /**
6239
+ * Schedule
6240
+ */
6241
+ export type Schedule = {
6242
+ /**
6243
+ * Schedule ID.
6244
+ */
6245
+ $id: string;
6246
+ /**
6247
+ * Schedule creation date in ISO 8601 format.
6248
+ */
6249
+ $createdAt: string;
6250
+ /**
6251
+ * Schedule update date in ISO 8601 format.
6252
+ */
6253
+ $updatedAt: string;
6254
+ /**
6255
+ * The resource type associated with this schedule.
6256
+ */
6257
+ resourceType: string;
6258
+ /**
6259
+ * The resource ID associated with this schedule.
6260
+ */
6261
+ resourceId: string;
6262
+ /**
6263
+ * Change-tracking timestamp used by the scheduler to detect resource changes in ISO 8601 format.
6264
+ */
6265
+ resourceUpdatedAt: string;
6266
+ /**
6267
+ * The project ID associated with this schedule.
6268
+ */
6269
+ projectId: string;
6270
+ /**
6271
+ * The CRON schedule expression.
6272
+ */
6273
+ schedule: string;
6274
+ /**
6275
+ * Schedule data used to store resource-specific context needed for execution.
6276
+ */
6277
+ data: object;
6278
+ /**
6279
+ * Whether the schedule is active.
6280
+ */
6281
+ active: boolean;
6282
+ /**
6283
+ * The region where the schedule is deployed.
6284
+ */
6285
+ region: string;
6286
+ }
6287
+
6192
6288
  /**
6193
6289
  * SmsTemplate
6194
6290
  */
@@ -6727,6 +6823,140 @@ export namespace Models {
6727
6823
  version: string;
6728
6824
  }
6729
6825
 
6826
+ /**
6827
+ * ActivityEvent
6828
+ */
6829
+ export type ActivityEvent = {
6830
+ /**
6831
+ * Event ID.
6832
+ */
6833
+ $id: string;
6834
+ /**
6835
+ * User type.
6836
+ */
6837
+ userType: string;
6838
+ /**
6839
+ * User ID.
6840
+ */
6841
+ userId: string;
6842
+ /**
6843
+ * User Email.
6844
+ */
6845
+ userEmail: string;
6846
+ /**
6847
+ * User Name.
6848
+ */
6849
+ userName: string;
6850
+ /**
6851
+ * Resource parent.
6852
+ */
6853
+ resourceParent: string;
6854
+ /**
6855
+ * Resource type.
6856
+ */
6857
+ resourceType: string;
6858
+ /**
6859
+ * Resource ID.
6860
+ */
6861
+ resourceId: string;
6862
+ /**
6863
+ * Resource.
6864
+ */
6865
+ resource: string;
6866
+ /**
6867
+ * Event name.
6868
+ */
6869
+ event: string;
6870
+ /**
6871
+ * User agent.
6872
+ */
6873
+ userAgent: string;
6874
+ /**
6875
+ * IP address.
6876
+ */
6877
+ ip: string;
6878
+ /**
6879
+ * API mode when event triggered.
6880
+ */
6881
+ mode: string;
6882
+ /**
6883
+ * Location.
6884
+ */
6885
+ country: string;
6886
+ /**
6887
+ * Log creation date in ISO 8601 format.
6888
+ */
6889
+ time: string;
6890
+ /**
6891
+ * Project ID.
6892
+ */
6893
+ projectId: string;
6894
+ /**
6895
+ * Team ID.
6896
+ */
6897
+ teamId: string;
6898
+ /**
6899
+ * Hostname.
6900
+ */
6901
+ hostname: string;
6902
+ /**
6903
+ * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).
6904
+ */
6905
+ osCode: string;
6906
+ /**
6907
+ * Operating system name.
6908
+ */
6909
+ osName: string;
6910
+ /**
6911
+ * Operating system version.
6912
+ */
6913
+ osVersion: string;
6914
+ /**
6915
+ * Client type.
6916
+ */
6917
+ clientType: string;
6918
+ /**
6919
+ * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).
6920
+ */
6921
+ clientCode: string;
6922
+ /**
6923
+ * Client name.
6924
+ */
6925
+ clientName: string;
6926
+ /**
6927
+ * Client version.
6928
+ */
6929
+ clientVersion: string;
6930
+ /**
6931
+ * Client engine name.
6932
+ */
6933
+ clientEngine: string;
6934
+ /**
6935
+ * Client engine name.
6936
+ */
6937
+ clientEngineVersion: string;
6938
+ /**
6939
+ * Device name.
6940
+ */
6941
+ deviceName: string;
6942
+ /**
6943
+ * Device brand name.
6944
+ */
6945
+ deviceBrand: string;
6946
+ /**
6947
+ * Device model name.
6948
+ */
6949
+ deviceModel: string;
6950
+ /**
6951
+ * Country two-character ISO 3166-1 alpha code.
6952
+ */
6953
+ countryCode: string;
6954
+ /**
6955
+ * Country name.
6956
+ */
6957
+ countryName: string;
6958
+ }
6959
+
6730
6960
  /**
6731
6961
  * AdditionalResource
6732
6962
  */
@@ -8645,6 +8875,20 @@ export namespace Models {
8645
8875
  available: boolean;
8646
8876
  }
8647
8877
 
8878
+ /**
8879
+ * Activity event list
8880
+ */
8881
+ export type ActivityEventList = {
8882
+ /**
8883
+ * Total number of events that matched your query.
8884
+ */
8885
+ total: number;
8886
+ /**
8887
+ * List of events.
8888
+ */
8889
+ events: ActivityEvent[];
8890
+ }
8891
+
8648
8892
  /**
8649
8893
  * Aggregation team list
8650
8894
  */
@@ -3042,7 +3042,7 @@ export class Account {
3042
3042
  * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
3043
3043
  *
3044
3044
  *
3045
- * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
3045
+ * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
3046
3046
  * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
3047
3047
  * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
3048
3048
  * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
@@ -3058,7 +3058,7 @@ export class Account {
3058
3058
  * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
3059
3059
  *
3060
3060
  *
3061
- * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
3061
+ * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
3062
3062
  * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
3063
3063
  * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
3064
3064
  * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
@@ -3795,7 +3795,7 @@ export class Account {
3795
3795
  *
3796
3796
  * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
3797
3797
  *
3798
- * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
3798
+ * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
3799
3799
  * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
3800
3800
  * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
3801
3801
  * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
@@ -3810,7 +3810,7 @@ export class Account {
3810
3810
  *
3811
3811
  * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
3812
3812
  *
3813
- * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
3813
+ * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
3814
3814
  * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
3815
3815
  * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
3816
3816
  * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
@@ -0,0 +1,116 @@
1
+ import { Service } from '../service';
2
+ import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
3
+ import type { Models } from '../models';
4
+
5
+
6
+ export class Activities {
7
+ client: Client;
8
+
9
+ constructor(client: Client) {
10
+ this.client = client;
11
+ }
12
+
13
+ /**
14
+ * List all events for selected filters.
15
+ *
16
+ * @param {string} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
17
+ * @throws {AppwriteException}
18
+ * @returns {Promise<Models.ActivityEventList>}
19
+ */
20
+ listEvents(params?: { queries?: string }): Promise<Models.ActivityEventList>;
21
+ /**
22
+ * List all events for selected filters.
23
+ *
24
+ * @param {string} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
25
+ * @throws {AppwriteException}
26
+ * @returns {Promise<Models.ActivityEventList>}
27
+ * @deprecated Use the object parameter style method for a better developer experience.
28
+ */
29
+ listEvents(queries?: string): Promise<Models.ActivityEventList>;
30
+ listEvents(
31
+ paramsOrFirst?: { queries?: string } | string
32
+ ): Promise<Models.ActivityEventList> {
33
+ let params: { queries?: string };
34
+
35
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
36
+ params = (paramsOrFirst || {}) as { queries?: string };
37
+ } else {
38
+ params = {
39
+ queries: paramsOrFirst as string
40
+ };
41
+ }
42
+
43
+ const queries = params.queries;
44
+
45
+
46
+ const apiPath = '/activities/events';
47
+ const payload: Payload = {};
48
+ if (typeof queries !== 'undefined') {
49
+ payload['queries'] = queries;
50
+ }
51
+ const uri = new URL(this.client.config.endpoint + apiPath);
52
+
53
+ const apiHeaders: { [header: string]: string } = {
54
+ }
55
+
56
+ return this.client.call(
57
+ 'get',
58
+ uri,
59
+ apiHeaders,
60
+ payload
61
+ );
62
+ }
63
+
64
+ /**
65
+ * Get event by ID.
66
+ *
67
+ *
68
+ * @param {string} params.eventId - Event ID.
69
+ * @throws {AppwriteException}
70
+ * @returns {Promise<Models.ActivityEvent>}
71
+ */
72
+ getEvent(params: { eventId: string }): Promise<Models.ActivityEvent>;
73
+ /**
74
+ * Get event by ID.
75
+ *
76
+ *
77
+ * @param {string} eventId - Event ID.
78
+ * @throws {AppwriteException}
79
+ * @returns {Promise<Models.ActivityEvent>}
80
+ * @deprecated Use the object parameter style method for a better developer experience.
81
+ */
82
+ getEvent(eventId: string): Promise<Models.ActivityEvent>;
83
+ getEvent(
84
+ paramsOrFirst: { eventId: string } | string
85
+ ): Promise<Models.ActivityEvent> {
86
+ let params: { eventId: string };
87
+
88
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
89
+ params = (paramsOrFirst || {}) as { eventId: string };
90
+ } else {
91
+ params = {
92
+ eventId: paramsOrFirst as string
93
+ };
94
+ }
95
+
96
+ const eventId = params.eventId;
97
+
98
+ if (typeof eventId === 'undefined') {
99
+ throw new AppwriteException('Missing required parameter: "eventId"');
100
+ }
101
+
102
+ const apiPath = '/activities/events/{eventId}'.replace('{eventId}', eventId);
103
+ const payload: Payload = {};
104
+ const uri = new URL(this.client.config.endpoint + apiPath);
105
+
106
+ const apiHeaders: { [header: string]: string } = {
107
+ }
108
+
109
+ return this.client.call(
110
+ 'get',
111
+ uri,
112
+ apiHeaders,
113
+ payload
114
+ );
115
+ }
116
+ }