@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
@@ -2801,10 +2801,11 @@ export class Databases {
2801
2801
  * @param {boolean} params.required - Is attribute required?
2802
2802
  * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
2803
2803
  * @param {boolean} params.array - Is attribute an array?
2804
+ * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
2804
2805
  * @throws {AppwriteException}
2805
2806
  * @returns {Promise<Models.AttributeLongtext>}
2806
2807
  */
2807
- createLongtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeLongtext>;
2808
+ createLongtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.AttributeLongtext>;
2808
2809
  /**
2809
2810
  * Create a longtext attribute.
2810
2811
  *
@@ -2815,19 +2816,20 @@ export class Databases {
2815
2816
  * @param {boolean} required - Is attribute required?
2816
2817
  * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
2817
2818
  * @param {boolean} array - Is attribute an array?
2819
+ * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
2818
2820
  * @throws {AppwriteException}
2819
2821
  * @returns {Promise<Models.AttributeLongtext>}
2820
2822
  * @deprecated Use the object parameter style method for a better developer experience.
2821
2823
  */
2822
- createLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeLongtext>;
2824
+ createLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeLongtext>;
2823
2825
  createLongtextAttribute(
2824
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
2825
- ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
2826
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
2827
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
2826
2828
  ): Promise<Models.AttributeLongtext> {
2827
- let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
2829
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
2828
2830
 
2829
2831
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2830
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
2832
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
2831
2833
  } else {
2832
2834
  params = {
2833
2835
  databaseId: paramsOrFirst as string,
@@ -2835,7 +2837,8 @@ export class Databases {
2835
2837
  key: rest[1] as string,
2836
2838
  required: rest[2] as boolean,
2837
2839
  xdefault: rest[3] as string,
2838
- array: rest[4] as boolean
2840
+ array: rest[4] as boolean,
2841
+ encrypt: rest[5] as boolean
2839
2842
  };
2840
2843
  }
2841
2844
 
@@ -2845,6 +2848,7 @@ export class Databases {
2845
2848
  const required = params.required;
2846
2849
  const xdefault = params.xdefault;
2847
2850
  const array = params.array;
2851
+ const encrypt = params.encrypt;
2848
2852
 
2849
2853
  if (typeof databaseId === 'undefined') {
2850
2854
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -2873,6 +2877,9 @@ export class Databases {
2873
2877
  if (typeof array !== 'undefined') {
2874
2878
  payload['array'] = array;
2875
2879
  }
2880
+ if (typeof encrypt !== 'undefined') {
2881
+ payload['encrypt'] = encrypt;
2882
+ }
2876
2883
  const uri = new URL(this.client.config.endpoint + apiPath);
2877
2884
 
2878
2885
  const apiHeaders: { [header: string]: string } = {
@@ -2993,10 +3000,11 @@ export class Databases {
2993
3000
  * @param {boolean} params.required - Is attribute required?
2994
3001
  * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
2995
3002
  * @param {boolean} params.array - Is attribute an array?
3003
+ * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
2996
3004
  * @throws {AppwriteException}
2997
3005
  * @returns {Promise<Models.AttributeMediumtext>}
2998
3006
  */
2999
- createMediumtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeMediumtext>;
3007
+ createMediumtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.AttributeMediumtext>;
3000
3008
  /**
3001
3009
  * Create a mediumtext attribute.
3002
3010
  *
@@ -3007,19 +3015,20 @@ export class Databases {
3007
3015
  * @param {boolean} required - Is attribute required?
3008
3016
  * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3009
3017
  * @param {boolean} array - Is attribute an array?
3018
+ * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
3010
3019
  * @throws {AppwriteException}
3011
3020
  * @returns {Promise<Models.AttributeMediumtext>}
3012
3021
  * @deprecated Use the object parameter style method for a better developer experience.
3013
3022
  */
3014
- createMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeMediumtext>;
3023
+ createMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeMediumtext>;
3015
3024
  createMediumtextAttribute(
3016
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
3017
- ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
3025
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
3026
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
3018
3027
  ): Promise<Models.AttributeMediumtext> {
3019
- let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
3028
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
3020
3029
 
3021
3030
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3022
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
3031
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
3023
3032
  } else {
3024
3033
  params = {
3025
3034
  databaseId: paramsOrFirst as string,
@@ -3027,7 +3036,8 @@ export class Databases {
3027
3036
  key: rest[1] as string,
3028
3037
  required: rest[2] as boolean,
3029
3038
  xdefault: rest[3] as string,
3030
- array: rest[4] as boolean
3039
+ array: rest[4] as boolean,
3040
+ encrypt: rest[5] as boolean
3031
3041
  };
3032
3042
  }
3033
3043
 
@@ -3037,6 +3047,7 @@ export class Databases {
3037
3047
  const required = params.required;
3038
3048
  const xdefault = params.xdefault;
3039
3049
  const array = params.array;
3050
+ const encrypt = params.encrypt;
3040
3051
 
3041
3052
  if (typeof databaseId === 'undefined') {
3042
3053
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -3065,6 +3076,9 @@ export class Databases {
3065
3076
  if (typeof array !== 'undefined') {
3066
3077
  payload['array'] = array;
3067
3078
  }
3079
+ if (typeof encrypt !== 'undefined') {
3080
+ payload['encrypt'] = encrypt;
3081
+ }
3068
3082
  const uri = new URL(this.client.config.endpoint + apiPath);
3069
3083
 
3070
3084
  const apiHeaders: { [header: string]: string } = {
@@ -3874,10 +3888,11 @@ export class Databases {
3874
3888
  * @param {boolean} params.required - Is attribute required?
3875
3889
  * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3876
3890
  * @param {boolean} params.array - Is attribute an array?
3891
+ * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
3877
3892
  * @throws {AppwriteException}
3878
3893
  * @returns {Promise<Models.AttributeText>}
3879
3894
  */
3880
- createTextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeText>;
3895
+ createTextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.AttributeText>;
3881
3896
  /**
3882
3897
  * Create a text attribute.
3883
3898
  *
@@ -3888,19 +3903,20 @@ export class Databases {
3888
3903
  * @param {boolean} required - Is attribute required?
3889
3904
  * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
3890
3905
  * @param {boolean} array - Is attribute an array?
3906
+ * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
3891
3907
  * @throws {AppwriteException}
3892
3908
  * @returns {Promise<Models.AttributeText>}
3893
3909
  * @deprecated Use the object parameter style method for a better developer experience.
3894
3910
  */
3895
- createTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeText>;
3911
+ createTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeText>;
3896
3912
  createTextAttribute(
3897
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
3898
- ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
3913
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
3914
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
3899
3915
  ): Promise<Models.AttributeText> {
3900
- let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
3916
+ let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
3901
3917
 
3902
3918
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3903
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
3919
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
3904
3920
  } else {
3905
3921
  params = {
3906
3922
  databaseId: paramsOrFirst as string,
@@ -3908,7 +3924,8 @@ export class Databases {
3908
3924
  key: rest[1] as string,
3909
3925
  required: rest[2] as boolean,
3910
3926
  xdefault: rest[3] as string,
3911
- array: rest[4] as boolean
3927
+ array: rest[4] as boolean,
3928
+ encrypt: rest[5] as boolean
3912
3929
  };
3913
3930
  }
3914
3931
 
@@ -3918,6 +3935,7 @@ export class Databases {
3918
3935
  const required = params.required;
3919
3936
  const xdefault = params.xdefault;
3920
3937
  const array = params.array;
3938
+ const encrypt = params.encrypt;
3921
3939
 
3922
3940
  if (typeof databaseId === 'undefined') {
3923
3941
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -3946,6 +3964,9 @@ export class Databases {
3946
3964
  if (typeof array !== 'undefined') {
3947
3965
  payload['array'] = array;
3948
3966
  }
3967
+ if (typeof encrypt !== 'undefined') {
3968
+ payload['encrypt'] = encrypt;
3969
+ }
3949
3970
  const uri = new URL(this.client.config.endpoint + apiPath);
3950
3971
 
3951
3972
  const apiHeaders: { [header: string]: string } = {
@@ -4261,10 +4282,11 @@ export class Databases {
4261
4282
  * @param {boolean} params.required - Is attribute required?
4262
4283
  * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
4263
4284
  * @param {boolean} params.array - Is attribute an array?
4285
+ * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
4264
4286
  * @throws {AppwriteException}
4265
4287
  * @returns {Promise<Models.AttributeVarchar>}
4266
4288
  */
4267
- createVarcharAttribute(params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.AttributeVarchar>;
4289
+ createVarcharAttribute(params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.AttributeVarchar>;
4268
4290
  /**
4269
4291
  * Create a varchar attribute.
4270
4292
  *
@@ -4276,19 +4298,20 @@ export class Databases {
4276
4298
  * @param {boolean} required - Is attribute required?
4277
4299
  * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
4278
4300
  * @param {boolean} array - Is attribute an array?
4301
+ * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
4279
4302
  * @throws {AppwriteException}
4280
4303
  * @returns {Promise<Models.AttributeVarchar>}
4281
4304
  * @deprecated Use the object parameter style method for a better developer experience.
4282
4305
  */
4283
- createVarcharAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeVarchar>;
4306
+ createVarcharAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeVarchar>;
4284
4307
  createVarcharAttribute(
4285
- paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean } | string,
4286
- ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?]
4308
+ paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
4309
+ ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
4287
4310
  ): Promise<Models.AttributeVarchar> {
4288
- let params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean };
4311
+ let params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
4289
4312
 
4290
4313
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4291
- params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean };
4314
+ params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
4292
4315
  } else {
4293
4316
  params = {
4294
4317
  databaseId: paramsOrFirst as string,
@@ -4297,7 +4320,8 @@ export class Databases {
4297
4320
  size: rest[2] as number,
4298
4321
  required: rest[3] as boolean,
4299
4322
  xdefault: rest[4] as string,
4300
- array: rest[5] as boolean
4323
+ array: rest[5] as boolean,
4324
+ encrypt: rest[6] as boolean
4301
4325
  };
4302
4326
  }
4303
4327
 
@@ -4308,6 +4332,7 @@ export class Databases {
4308
4332
  const required = params.required;
4309
4333
  const xdefault = params.xdefault;
4310
4334
  const array = params.array;
4335
+ const encrypt = params.encrypt;
4311
4336
 
4312
4337
  if (typeof databaseId === 'undefined') {
4313
4338
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -4342,6 +4367,9 @@ export class Databases {
4342
4367
  if (typeof array !== 'undefined') {
4343
4368
  payload['array'] = array;
4344
4369
  }
4370
+ if (typeof encrypt !== 'undefined') {
4371
+ payload['encrypt'] = encrypt;
4372
+ }
4345
4373
  const uri = new URL(this.client.config.endpoint + apiPath);
4346
4374
 
4347
4375
  const apiHeaders: { [header: string]: string } = {
@@ -14,7 +14,7 @@ export class Migrations {
14
14
  /**
15
15
  * List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.
16
16
  *
17
- * @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 the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors
17
+ * @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 the following attributes: status, stage, source, destination, resources, resourceId, resourceType, statusCounters, resourceData, errors
18
18
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
19
19
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
20
20
  * @throws {AppwriteException}
@@ -24,7 +24,7 @@ export class Migrations {
24
24
  /**
25
25
  * List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.
26
26
  *
27
- * @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 the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors
27
+ * @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 the following attributes: status, stage, source, destination, resources, resourceId, resourceType, statusCounters, resourceData, errors
28
28
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
29
29
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
30
30
  * @throws {AppwriteException}
@@ -8,6 +8,7 @@ import { AuthMethod } from '../enums/auth-method';
8
8
  import { Scopes } from '../enums/scopes';
9
9
  import { OAuthProvider } from '../enums/o-auth-provider';
10
10
  import { PlatformType } from '../enums/platform-type';
11
+ import { ResourceType } from '../enums/resource-type';
11
12
  import { ApiService } from '../enums/api-service';
12
13
  import { SMTPSecure } from '../enums/smtp-secure';
13
14
  import { EmailTemplateType } from '../enums/email-template-type';
@@ -2727,6 +2728,228 @@ export class Projects {
2727
2728
  );
2728
2729
  }
2729
2730
 
2731
+ /**
2732
+ * Get a list of all the project's schedules. You can use the query params to filter your results.
2733
+ *
2734
+ * @param {string} params.projectId - Project unique ID.
2735
+ * @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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: resourceType, resourceId, projectId, schedule, active, region
2736
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
2737
+ * @throws {AppwriteException}
2738
+ * @returns {Promise<Models.ScheduleList>}
2739
+ */
2740
+ listSchedules(params: { projectId: string, queries?: string[], total?: boolean }): Promise<Models.ScheduleList>;
2741
+ /**
2742
+ * Get a list of all the project's schedules. You can use the query params to filter your results.
2743
+ *
2744
+ * @param {string} projectId - Project unique ID.
2745
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: resourceType, resourceId, projectId, schedule, active, region
2746
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
2747
+ * @throws {AppwriteException}
2748
+ * @returns {Promise<Models.ScheduleList>}
2749
+ * @deprecated Use the object parameter style method for a better developer experience.
2750
+ */
2751
+ listSchedules(projectId: string, queries?: string[], total?: boolean): Promise<Models.ScheduleList>;
2752
+ listSchedules(
2753
+ paramsOrFirst: { projectId: string, queries?: string[], total?: boolean } | string,
2754
+ ...rest: [(string[])?, (boolean)?]
2755
+ ): Promise<Models.ScheduleList> {
2756
+ let params: { projectId: string, queries?: string[], total?: boolean };
2757
+
2758
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2759
+ params = (paramsOrFirst || {}) as { projectId: string, queries?: string[], total?: boolean };
2760
+ } else {
2761
+ params = {
2762
+ projectId: paramsOrFirst as string,
2763
+ queries: rest[0] as string[],
2764
+ total: rest[1] as boolean
2765
+ };
2766
+ }
2767
+
2768
+ const projectId = params.projectId;
2769
+ const queries = params.queries;
2770
+ const total = params.total;
2771
+
2772
+ if (typeof projectId === 'undefined') {
2773
+ throw new AppwriteException('Missing required parameter: "projectId"');
2774
+ }
2775
+
2776
+ const apiPath = '/projects/{projectId}/schedules'.replace('{projectId}', projectId);
2777
+ const payload: Payload = {};
2778
+ if (typeof queries !== 'undefined') {
2779
+ payload['queries'] = queries;
2780
+ }
2781
+ if (typeof total !== 'undefined') {
2782
+ payload['total'] = total;
2783
+ }
2784
+ const uri = new URL(this.client.config.endpoint + apiPath);
2785
+
2786
+ const apiHeaders: { [header: string]: string } = {
2787
+ }
2788
+
2789
+ return this.client.call(
2790
+ 'get',
2791
+ uri,
2792
+ apiHeaders,
2793
+ payload
2794
+ );
2795
+ }
2796
+
2797
+ /**
2798
+ * Create a new schedule for a resource.
2799
+ *
2800
+ * @param {string} params.projectId - Project unique ID.
2801
+ * @param {ResourceType} params.resourceType - The resource type for the schedule. Possible values: function, execution, message, backup.
2802
+ * @param {string} params.resourceId - The resource ID to associate with this schedule.
2803
+ * @param {string} params.schedule - Schedule CRON expression.
2804
+ * @param {boolean} params.active - Whether the schedule is active.
2805
+ * @param {object} params.data - Schedule data as a JSON string. Used to store resource-specific context needed for execution.
2806
+ * @throws {AppwriteException}
2807
+ * @returns {Promise<Models.Schedule>}
2808
+ */
2809
+ createSchedule(params: { projectId: string, resourceType: ResourceType, resourceId: string, schedule: string, active?: boolean, data?: object }): Promise<Models.Schedule>;
2810
+ /**
2811
+ * Create a new schedule for a resource.
2812
+ *
2813
+ * @param {string} projectId - Project unique ID.
2814
+ * @param {ResourceType} resourceType - The resource type for the schedule. Possible values: function, execution, message, backup.
2815
+ * @param {string} resourceId - The resource ID to associate with this schedule.
2816
+ * @param {string} schedule - Schedule CRON expression.
2817
+ * @param {boolean} active - Whether the schedule is active.
2818
+ * @param {object} data - Schedule data as a JSON string. Used to store resource-specific context needed for execution.
2819
+ * @throws {AppwriteException}
2820
+ * @returns {Promise<Models.Schedule>}
2821
+ * @deprecated Use the object parameter style method for a better developer experience.
2822
+ */
2823
+ createSchedule(projectId: string, resourceType: ResourceType, resourceId: string, schedule: string, active?: boolean, data?: object): Promise<Models.Schedule>;
2824
+ createSchedule(
2825
+ paramsOrFirst: { projectId: string, resourceType: ResourceType, resourceId: string, schedule: string, active?: boolean, data?: object } | string,
2826
+ ...rest: [(ResourceType)?, (string)?, (string)?, (boolean)?, (object)?]
2827
+ ): Promise<Models.Schedule> {
2828
+ let params: { projectId: string, resourceType: ResourceType, resourceId: string, schedule: string, active?: boolean, data?: object };
2829
+
2830
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2831
+ params = (paramsOrFirst || {}) as { projectId: string, resourceType: ResourceType, resourceId: string, schedule: string, active?: boolean, data?: object };
2832
+ } else {
2833
+ params = {
2834
+ projectId: paramsOrFirst as string,
2835
+ resourceType: rest[0] as ResourceType,
2836
+ resourceId: rest[1] as string,
2837
+ schedule: rest[2] as string,
2838
+ active: rest[3] as boolean,
2839
+ data: rest[4] as object
2840
+ };
2841
+ }
2842
+
2843
+ const projectId = params.projectId;
2844
+ const resourceType = params.resourceType;
2845
+ const resourceId = params.resourceId;
2846
+ const schedule = params.schedule;
2847
+ const active = params.active;
2848
+ const data = params.data;
2849
+
2850
+ if (typeof projectId === 'undefined') {
2851
+ throw new AppwriteException('Missing required parameter: "projectId"');
2852
+ }
2853
+ if (typeof resourceType === 'undefined') {
2854
+ throw new AppwriteException('Missing required parameter: "resourceType"');
2855
+ }
2856
+ if (typeof resourceId === 'undefined') {
2857
+ throw new AppwriteException('Missing required parameter: "resourceId"');
2858
+ }
2859
+ if (typeof schedule === 'undefined') {
2860
+ throw new AppwriteException('Missing required parameter: "schedule"');
2861
+ }
2862
+
2863
+ const apiPath = '/projects/{projectId}/schedules'.replace('{projectId}', projectId);
2864
+ const payload: Payload = {};
2865
+ if (typeof resourceType !== 'undefined') {
2866
+ payload['resourceType'] = resourceType;
2867
+ }
2868
+ if (typeof resourceId !== 'undefined') {
2869
+ payload['resourceId'] = resourceId;
2870
+ }
2871
+ if (typeof schedule !== 'undefined') {
2872
+ payload['schedule'] = schedule;
2873
+ }
2874
+ if (typeof active !== 'undefined') {
2875
+ payload['active'] = active;
2876
+ }
2877
+ if (typeof data !== 'undefined') {
2878
+ payload['data'] = data;
2879
+ }
2880
+ const uri = new URL(this.client.config.endpoint + apiPath);
2881
+
2882
+ const apiHeaders: { [header: string]: string } = {
2883
+ 'content-type': 'application/json',
2884
+ }
2885
+
2886
+ return this.client.call(
2887
+ 'post',
2888
+ uri,
2889
+ apiHeaders,
2890
+ payload
2891
+ );
2892
+ }
2893
+
2894
+ /**
2895
+ * Get a schedule by its unique ID.
2896
+ *
2897
+ * @param {string} params.projectId - Project unique ID.
2898
+ * @param {string} params.scheduleId - Schedule ID.
2899
+ * @throws {AppwriteException}
2900
+ * @returns {Promise<Models.Schedule>}
2901
+ */
2902
+ getSchedule(params: { projectId: string, scheduleId: string }): Promise<Models.Schedule>;
2903
+ /**
2904
+ * Get a schedule by its unique ID.
2905
+ *
2906
+ * @param {string} projectId - Project unique ID.
2907
+ * @param {string} scheduleId - Schedule ID.
2908
+ * @throws {AppwriteException}
2909
+ * @returns {Promise<Models.Schedule>}
2910
+ * @deprecated Use the object parameter style method for a better developer experience.
2911
+ */
2912
+ getSchedule(projectId: string, scheduleId: string): Promise<Models.Schedule>;
2913
+ getSchedule(
2914
+ paramsOrFirst: { projectId: string, scheduleId: string } | string,
2915
+ ...rest: [(string)?]
2916
+ ): Promise<Models.Schedule> {
2917
+ let params: { projectId: string, scheduleId: string };
2918
+
2919
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2920
+ params = (paramsOrFirst || {}) as { projectId: string, scheduleId: string };
2921
+ } else {
2922
+ params = {
2923
+ projectId: paramsOrFirst as string,
2924
+ scheduleId: rest[0] as string
2925
+ };
2926
+ }
2927
+
2928
+ const projectId = params.projectId;
2929
+ const scheduleId = params.scheduleId;
2930
+
2931
+ if (typeof projectId === 'undefined') {
2932
+ throw new AppwriteException('Missing required parameter: "projectId"');
2933
+ }
2934
+ if (typeof scheduleId === 'undefined') {
2935
+ throw new AppwriteException('Missing required parameter: "scheduleId"');
2936
+ }
2937
+
2938
+ const apiPath = '/projects/{projectId}/schedules/{scheduleId}'.replace('{projectId}', projectId).replace('{scheduleId}', scheduleId);
2939
+ const payload: Payload = {};
2940
+ const uri = new URL(this.client.config.endpoint + apiPath);
2941
+
2942
+ const apiHeaders: { [header: string]: string } = {
2943
+ }
2944
+
2945
+ return this.client.call(
2946
+ 'get',
2947
+ uri,
2948
+ apiHeaders,
2949
+ payload
2950
+ );
2951
+ }
2952
+
2730
2953
  /**
2731
2954
  * Update the status of a specific service. Use this endpoint to enable or disable a service in your project.
2732
2955
  *