node-appwrite 20.1.0 → 20.3.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 (95) hide show
  1. package/dist/client.js +2 -2
  2. package/dist/client.js.map +1 -1
  3. package/dist/client.mjs +2 -2
  4. package/dist/client.mjs.map +1 -1
  5. package/dist/enums/execution-status.d.mts +2 -1
  6. package/dist/enums/execution-status.d.ts +2 -1
  7. package/dist/enums/execution-status.js +1 -0
  8. package/dist/enums/execution-status.js.map +1 -1
  9. package/dist/enums/execution-status.mjs +1 -0
  10. package/dist/enums/execution-status.mjs.map +1 -1
  11. package/dist/enums/framework.d.mts +1 -0
  12. package/dist/enums/framework.d.ts +1 -0
  13. package/dist/enums/framework.js +1 -0
  14. package/dist/enums/framework.js.map +1 -1
  15. package/dist/enums/framework.mjs +1 -0
  16. package/dist/enums/framework.mjs.map +1 -1
  17. package/dist/index.d.mts +1 -0
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +9 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +1 -0
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/models.d.mts +43 -1
  24. package/dist/models.d.ts +43 -1
  25. package/dist/operator.d.mts +181 -0
  26. package/dist/operator.d.ts +181 -0
  27. package/dist/operator.js +268 -0
  28. package/dist/operator.js.map +1 -0
  29. package/dist/operator.mjs +266 -0
  30. package/dist/operator.mjs.map +1 -0
  31. package/dist/query.js +6 -6
  32. package/dist/query.js.map +1 -1
  33. package/dist/query.mjs +6 -6
  34. package/dist/query.mjs.map +1 -1
  35. package/dist/services/account.d.mts +8 -2
  36. package/dist/services/account.d.ts +8 -2
  37. package/dist/services/account.js +14 -4
  38. package/dist/services/account.js.map +1 -1
  39. package/dist/services/account.mjs +14 -4
  40. package/dist/services/account.mjs.map +1 -1
  41. package/dist/services/databases.d.mts +192 -18
  42. package/dist/services/databases.d.ts +192 -18
  43. package/dist/services/databases.js +268 -16
  44. package/dist/services/databases.js.map +1 -1
  45. package/dist/services/databases.mjs +268 -16
  46. package/dist/services/databases.mjs.map +1 -1
  47. package/dist/services/functions.d.mts +12 -3
  48. package/dist/services/functions.d.ts +12 -3
  49. package/dist/services/functions.js +18 -3
  50. package/dist/services/functions.js.map +1 -1
  51. package/dist/services/functions.mjs +18 -3
  52. package/dist/services/functions.mjs.map +1 -1
  53. package/dist/services/messaging.d.mts +116 -9
  54. package/dist/services/messaging.d.ts +116 -9
  55. package/dist/services/messaging.js +182 -9
  56. package/dist/services/messaging.js.map +1 -1
  57. package/dist/services/messaging.mjs +182 -9
  58. package/dist/services/messaging.mjs.map +1 -1
  59. package/dist/services/sites.d.mts +12 -3
  60. package/dist/services/sites.d.ts +12 -3
  61. package/dist/services/sites.js +18 -3
  62. package/dist/services/sites.js.map +1 -1
  63. package/dist/services/sites.mjs +18 -3
  64. package/dist/services/sites.mjs.map +1 -1
  65. package/dist/services/storage.d.mts +8 -2
  66. package/dist/services/storage.d.ts +8 -2
  67. package/dist/services/storage.js +12 -2
  68. package/dist/services/storage.js.map +1 -1
  69. package/dist/services/storage.mjs +12 -2
  70. package/dist/services/storage.mjs.map +1 -1
  71. package/dist/services/tables-db.d.mts +190 -16
  72. package/dist/services/tables-db.d.ts +190 -16
  73. package/dist/services/tables-db.js +268 -16
  74. package/dist/services/tables-db.js.map +1 -1
  75. package/dist/services/tables-db.mjs +268 -16
  76. package/dist/services/tables-db.mjs.map +1 -1
  77. package/dist/services/teams.d.mts +8 -2
  78. package/dist/services/teams.d.ts +8 -2
  79. package/dist/services/teams.js +12 -2
  80. package/dist/services/teams.js.map +1 -1
  81. package/dist/services/teams.mjs +12 -2
  82. package/dist/services/teams.mjs.map +1 -1
  83. package/dist/services/tokens.d.mts +4 -1
  84. package/dist/services/tokens.d.ts +4 -1
  85. package/dist/services/tokens.js +6 -1
  86. package/dist/services/tokens.js.map +1 -1
  87. package/dist/services/tokens.mjs +6 -1
  88. package/dist/services/tokens.mjs.map +1 -1
  89. package/dist/services/users.d.mts +24 -6
  90. package/dist/services/users.d.ts +24 -6
  91. package/dist/services/users.js +37 -7
  92. package/dist/services/users.js.map +1 -1
  93. package/dist/services/users.mjs +37 -7
  94. package/dist/services/users.mjs.map +1 -1
  95. package/package.json +1 -1
@@ -24,23 +24,26 @@ declare class Functions {
24
24
  *
25
25
  * @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: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
26
26
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
27
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
27
28
  * @throws {AppwriteException}
28
29
  * @returns {Promise<Models.FunctionList>}
29
30
  */
30
31
  list(params?: {
31
32
  queries?: string[];
32
33
  search?: string;
34
+ total?: boolean;
33
35
  }): Promise<Models.FunctionList>;
34
36
  /**
35
37
  * Get a list of all the project's functions. You can use the query params to filter your results.
36
38
  *
37
39
  * @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: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
38
40
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
41
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
39
42
  * @throws {AppwriteException}
40
43
  * @returns {Promise<Models.FunctionList>}
41
44
  * @deprecated Use the object parameter style method for a better developer experience.
42
45
  */
43
- list(queries?: string[], search?: string): Promise<Models.FunctionList>;
46
+ list(queries?: string[], search?: string, total?: boolean): Promise<Models.FunctionList>;
44
47
  /**
45
48
  * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
46
49
  *
@@ -261,6 +264,7 @@ declare class Functions {
261
264
  * @param {string} params.functionId - Function ID.
262
265
  * @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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
263
266
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
267
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
264
268
  * @throws {AppwriteException}
265
269
  * @returns {Promise<Models.DeploymentList>}
266
270
  */
@@ -268,6 +272,7 @@ declare class Functions {
268
272
  functionId: string;
269
273
  queries?: string[];
270
274
  search?: string;
275
+ total?: boolean;
271
276
  }): Promise<Models.DeploymentList>;
272
277
  /**
273
278
  * Get a list of all the function's code deployments. You can use the query params to filter your results.
@@ -275,11 +280,12 @@ declare class Functions {
275
280
  * @param {string} functionId - Function ID.
276
281
  * @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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
277
282
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
283
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
278
284
  * @throws {AppwriteException}
279
285
  * @returns {Promise<Models.DeploymentList>}
280
286
  * @deprecated Use the object parameter style method for a better developer experience.
281
287
  */
282
- listDeployments(functionId: string, queries?: string[], search?: string): Promise<Models.DeploymentList>;
288
+ listDeployments(functionId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
283
289
  /**
284
290
  * Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
285
291
  *
@@ -511,23 +517,26 @@ declare class Functions {
511
517
  *
512
518
  * @param {string} params.functionId - Function ID.
513
519
  * @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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
520
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
514
521
  * @throws {AppwriteException}
515
522
  * @returns {Promise<Models.ExecutionList>}
516
523
  */
517
524
  listExecutions(params: {
518
525
  functionId: string;
519
526
  queries?: string[];
527
+ total?: boolean;
520
528
  }): Promise<Models.ExecutionList>;
521
529
  /**
522
530
  * Get a list of all the current user function execution logs. You can use the query params to filter your results.
523
531
  *
524
532
  * @param {string} functionId - Function ID.
525
533
  * @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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
534
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
526
535
  * @throws {AppwriteException}
527
536
  * @returns {Promise<Models.ExecutionList>}
528
537
  * @deprecated Use the object parameter style method for a better developer experience.
529
538
  */
530
- listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList>;
539
+ listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
531
540
  /**
532
541
  * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
533
542
  *
@@ -24,23 +24,26 @@ declare class Functions {
24
24
  *
25
25
  * @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: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
26
26
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
27
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
27
28
  * @throws {AppwriteException}
28
29
  * @returns {Promise<Models.FunctionList>}
29
30
  */
30
31
  list(params?: {
31
32
  queries?: string[];
32
33
  search?: string;
34
+ total?: boolean;
33
35
  }): Promise<Models.FunctionList>;
34
36
  /**
35
37
  * Get a list of all the project's functions. You can use the query params to filter your results.
36
38
  *
37
39
  * @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: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
38
40
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
41
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
39
42
  * @throws {AppwriteException}
40
43
  * @returns {Promise<Models.FunctionList>}
41
44
  * @deprecated Use the object parameter style method for a better developer experience.
42
45
  */
43
- list(queries?: string[], search?: string): Promise<Models.FunctionList>;
46
+ list(queries?: string[], search?: string, total?: boolean): Promise<Models.FunctionList>;
44
47
  /**
45
48
  * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
46
49
  *
@@ -261,6 +264,7 @@ declare class Functions {
261
264
  * @param {string} params.functionId - Function ID.
262
265
  * @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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
263
266
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
267
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
264
268
  * @throws {AppwriteException}
265
269
  * @returns {Promise<Models.DeploymentList>}
266
270
  */
@@ -268,6 +272,7 @@ declare class Functions {
268
272
  functionId: string;
269
273
  queries?: string[];
270
274
  search?: string;
275
+ total?: boolean;
271
276
  }): Promise<Models.DeploymentList>;
272
277
  /**
273
278
  * Get a list of all the function's code deployments. You can use the query params to filter your results.
@@ -275,11 +280,12 @@ declare class Functions {
275
280
  * @param {string} functionId - Function ID.
276
281
  * @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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
277
282
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
283
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
278
284
  * @throws {AppwriteException}
279
285
  * @returns {Promise<Models.DeploymentList>}
280
286
  * @deprecated Use the object parameter style method for a better developer experience.
281
287
  */
282
- listDeployments(functionId: string, queries?: string[], search?: string): Promise<Models.DeploymentList>;
288
+ listDeployments(functionId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
283
289
  /**
284
290
  * Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
285
291
  *
@@ -511,23 +517,26 @@ declare class Functions {
511
517
  *
512
518
  * @param {string} params.functionId - Function ID.
513
519
  * @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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
520
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
514
521
  * @throws {AppwriteException}
515
522
  * @returns {Promise<Models.ExecutionList>}
516
523
  */
517
524
  listExecutions(params: {
518
525
  functionId: string;
519
526
  queries?: string[];
527
+ total?: boolean;
520
528
  }): Promise<Models.ExecutionList>;
521
529
  /**
522
530
  * Get a list of all the current user function execution logs. You can use the query params to filter your results.
523
531
  *
524
532
  * @param {string} functionId - Function ID.
525
533
  * @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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
534
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
526
535
  * @throws {AppwriteException}
527
536
  * @returns {Promise<Models.ExecutionList>}
528
537
  * @deprecated Use the object parameter style method for a better developer experience.
529
538
  */
530
- listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList>;
539
+ listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
531
540
  /**
532
541
  * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
533
542
  *
@@ -13,11 +13,13 @@ class Functions {
13
13
  } else {
14
14
  params = {
15
15
  queries: paramsOrFirst,
16
- search: rest[0]
16
+ search: rest[0],
17
+ total: rest[1]
17
18
  };
18
19
  }
19
20
  const queries = params.queries;
20
21
  const search = params.search;
22
+ const total = params.total;
21
23
  const apiPath = "/functions";
22
24
  const payload = {};
23
25
  if (typeof queries !== "undefined") {
@@ -26,6 +28,9 @@ class Functions {
26
28
  if (typeof search !== "undefined") {
27
29
  payload["search"] = search;
28
30
  }
31
+ if (typeof total !== "undefined") {
32
+ payload["total"] = total;
33
+ }
29
34
  const uri = new URL(this.client.config.endpoint + apiPath);
30
35
  const apiHeaders = {};
31
36
  return this.client.call(
@@ -397,12 +402,14 @@ class Functions {
397
402
  params = {
398
403
  functionId: paramsOrFirst,
399
404
  queries: rest[0],
400
- search: rest[1]
405
+ search: rest[1],
406
+ total: rest[2]
401
407
  };
402
408
  }
403
409
  const functionId = params.functionId;
404
410
  const queries = params.queries;
405
411
  const search = params.search;
412
+ const total = params.total;
406
413
  if (typeof functionId === "undefined") {
407
414
  throw new client.AppwriteException('Missing required parameter: "functionId"');
408
415
  }
@@ -414,6 +421,9 @@ class Functions {
414
421
  if (typeof search !== "undefined") {
415
422
  payload["search"] = search;
416
423
  }
424
+ if (typeof total !== "undefined") {
425
+ payload["total"] = total;
426
+ }
417
427
  const uri = new URL(this.client.config.endpoint + apiPath);
418
428
  const apiHeaders = {};
419
429
  return this.client.call(
@@ -761,11 +771,13 @@ class Functions {
761
771
  } else {
762
772
  params = {
763
773
  functionId: paramsOrFirst,
764
- queries: rest[0]
774
+ queries: rest[0],
775
+ total: rest[1]
765
776
  };
766
777
  }
767
778
  const functionId = params.functionId;
768
779
  const queries = params.queries;
780
+ const total = params.total;
769
781
  if (typeof functionId === "undefined") {
770
782
  throw new client.AppwriteException('Missing required parameter: "functionId"');
771
783
  }
@@ -774,6 +786,9 @@ class Functions {
774
786
  if (typeof queries !== "undefined") {
775
787
  payload["queries"] = queries;
776
788
  }
789
+ if (typeof total !== "undefined") {
790
+ payload["total"] = total;
791
+ }
777
792
  const uri = new URL(this.client.config.endpoint + apiPath);
778
793
  const apiHeaders = {};
779
794
  return this.client.call(