react-native-appwrite 0.16.0 → 0.18.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 (64) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/sdk.js +707 -31
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +707 -32
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/docs/examples/account/list-identities.md +2 -1
  7. package/docs/examples/account/list-logs.md +2 -1
  8. package/docs/examples/databases/create-document.md +3 -2
  9. package/docs/examples/databases/create-operations.md +24 -0
  10. package/docs/examples/databases/create-transaction.md +13 -0
  11. package/docs/examples/databases/decrement-document-attribute.md +2 -1
  12. package/docs/examples/databases/delete-document.md +2 -1
  13. package/docs/examples/databases/delete-transaction.md +13 -0
  14. package/docs/examples/databases/get-document.md +2 -1
  15. package/docs/examples/databases/get-transaction.md +13 -0
  16. package/docs/examples/databases/increment-document-attribute.md +2 -1
  17. package/docs/examples/databases/list-documents.md +3 -1
  18. package/docs/examples/databases/list-transactions.md +13 -0
  19. package/docs/examples/databases/update-document.md +3 -2
  20. package/docs/examples/databases/update-transaction.md +15 -0
  21. package/docs/examples/databases/upsert-document.md +3 -2
  22. package/docs/examples/functions/list-executions.md +2 -1
  23. package/docs/examples/storage/create-file.md +1 -1
  24. package/docs/examples/storage/list-files.md +2 -1
  25. package/docs/examples/storage/update-file.md +1 -1
  26. package/docs/examples/tablesdb/create-operations.md +24 -0
  27. package/docs/examples/tablesdb/create-row.md +3 -2
  28. package/docs/examples/tablesdb/create-transaction.md +13 -0
  29. package/docs/examples/tablesdb/decrement-row-column.md +2 -1
  30. package/docs/examples/tablesdb/delete-row.md +2 -1
  31. package/docs/examples/tablesdb/delete-transaction.md +13 -0
  32. package/docs/examples/tablesdb/get-row.md +2 -1
  33. package/docs/examples/tablesdb/get-transaction.md +13 -0
  34. package/docs/examples/tablesdb/increment-row-column.md +2 -1
  35. package/docs/examples/tablesdb/list-rows.md +3 -1
  36. package/docs/examples/tablesdb/list-transactions.md +13 -0
  37. package/docs/examples/tablesdb/update-row.md +3 -2
  38. package/docs/examples/tablesdb/update-transaction.md +15 -0
  39. package/docs/examples/tablesdb/upsert-row.md +3 -2
  40. package/docs/examples/teams/list-memberships.md +2 -1
  41. package/docs/examples/teams/list.md +2 -1
  42. package/package.json +2 -3
  43. package/src/client.ts +1 -1
  44. package/src/enums/execution-status.ts +1 -0
  45. package/src/index.ts +3 -0
  46. package/src/models.ts +45 -1
  47. package/src/operator.ts +308 -0
  48. package/src/query.ts +6 -6
  49. package/src/services/account.ts +30 -12
  50. package/src/services/databases.ts +422 -56
  51. package/src/services/functions.ts +15 -7
  52. package/src/services/storage.ts +15 -7
  53. package/src/services/tables-db.ts +422 -56
  54. package/src/services/teams.ts +30 -14
  55. package/types/enums/execution-status.d.ts +2 -1
  56. package/types/index.d.ts +3 -0
  57. package/types/models.d.ts +43 -1
  58. package/types/operator.d.ts +180 -0
  59. package/types/services/account.d.ts +8 -2
  60. package/types/services/databases.d.ts +158 -8
  61. package/types/services/functions.d.ts +4 -1
  62. package/types/services/storage.d.ts +4 -1
  63. package/types/services/tables-db.d.ts +158 -8
  64. package/types/services/teams.d.ts +8 -2
@@ -19,37 +19,41 @@ export class Functions extends Service {
19
19
  *
20
20
  * @param {string} params.functionId - Function ID.
21
21
  * @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
22
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
22
23
  * @throws {AppwriteException}
23
24
  * @returns {Promise}
24
25
  */
25
- listExecutions(params: { functionId: string, queries?: string[] }): Promise<Models.ExecutionList>;
26
+ listExecutions(params: { functionId: string, queries?: string[], total?: boolean }): Promise<Models.ExecutionList>;
26
27
  /**
27
28
  * Get a list of all the current user function execution logs. You can use the query params to filter your results.
28
29
  *
29
30
  * @param {string} functionId - Function ID.
30
31
  * @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
32
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
31
33
  * @throws {AppwriteException}
32
34
  * @returns {Promise<Models.ExecutionList>}
33
35
  * @deprecated Use the object parameter style method for a better developer experience.
34
36
  */
35
- listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList>;
37
+ listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
36
38
  listExecutions(
37
- paramsOrFirst: { functionId: string, queries?: string[] } | string,
38
- ...rest: [(string[])?]
39
+ paramsOrFirst: { functionId: string, queries?: string[], total?: boolean } | string,
40
+ ...rest: [(string[])?, (boolean)?]
39
41
  ): Promise<Models.ExecutionList> {
40
- let params: { functionId: string, queries?: string[] };
42
+ let params: { functionId: string, queries?: string[], total?: boolean };
41
43
 
42
44
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
43
- params = (paramsOrFirst || {}) as { functionId: string, queries?: string[] };
45
+ params = (paramsOrFirst || {}) as { functionId: string, queries?: string[], total?: boolean };
44
46
  } else {
45
47
  params = {
46
48
  functionId: paramsOrFirst as string,
47
- queries: rest[0] as string[]
49
+ queries: rest[0] as string[],
50
+ total: rest[1] as boolean
48
51
  };
49
52
  }
50
53
 
51
54
  const functionId = params.functionId;
52
55
  const queries = params.queries;
56
+ const total = params.total;
53
57
 
54
58
  if (typeof functionId === 'undefined') {
55
59
  throw new AppwriteException('Missing required parameter: "functionId"');
@@ -62,6 +66,10 @@ export class Functions extends Service {
62
66
  payload['queries'] = queries;
63
67
  }
64
68
 
69
+ if (typeof total !== 'undefined') {
70
+ payload['total'] = total;
71
+ }
72
+
65
73
  const uri = new URL(this.client.config.endpoint + apiPath);
66
74
  return this.client.call('get', uri, {
67
75
  }, payload);
@@ -21,40 +21,44 @@ export class Storage extends Service {
21
21
  * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
22
22
  * @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, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
23
23
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
24
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
24
25
  * @throws {AppwriteException}
25
26
  * @returns {Promise}
26
27
  */
27
- listFiles(params: { bucketId: string, queries?: string[], search?: string }): Promise<Models.FileList>;
28
+ listFiles(params: { bucketId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.FileList>;
28
29
  /**
29
30
  * Get a list of all the user files. You can use the query params to filter your results.
30
31
  *
31
32
  * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
32
33
  * @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, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
33
34
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
35
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
34
36
  * @throws {AppwriteException}
35
37
  * @returns {Promise<Models.FileList>}
36
38
  * @deprecated Use the object parameter style method for a better developer experience.
37
39
  */
38
- listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>;
40
+ listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.FileList>;
39
41
  listFiles(
40
- paramsOrFirst: { bucketId: string, queries?: string[], search?: string } | string,
41
- ...rest: [(string[])?, (string)?]
42
+ paramsOrFirst: { bucketId: string, queries?: string[], search?: string, total?: boolean } | string,
43
+ ...rest: [(string[])?, (string)?, (boolean)?]
42
44
  ): Promise<Models.FileList> {
43
- let params: { bucketId: string, queries?: string[], search?: string };
45
+ let params: { bucketId: string, queries?: string[], search?: string, total?: boolean };
44
46
 
45
47
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
46
- params = (paramsOrFirst || {}) as { bucketId: string, queries?: string[], search?: string };
48
+ params = (paramsOrFirst || {}) as { bucketId: string, queries?: string[], search?: string, total?: boolean };
47
49
  } else {
48
50
  params = {
49
51
  bucketId: paramsOrFirst as string,
50
52
  queries: rest[0] as string[],
51
- search: rest[1] as string
53
+ search: rest[1] as string,
54
+ total: rest[2] as boolean
52
55
  };
53
56
  }
54
57
 
55
58
  const bucketId = params.bucketId;
56
59
  const queries = params.queries;
57
60
  const search = params.search;
61
+ const total = params.total;
58
62
 
59
63
  if (typeof bucketId === 'undefined') {
60
64
  throw new AppwriteException('Missing required parameter: "bucketId"');
@@ -71,6 +75,10 @@ export class Storage extends Service {
71
75
  payload['search'] = search;
72
76
  }
73
77
 
78
+ if (typeof total !== 'undefined') {
79
+ payload['total'] = total;
80
+ }
81
+
74
82
  const uri = new URL(this.client.config.endpoint + apiPath);
75
83
  return this.client.call('get', uri, {
76
84
  }, payload);