react-native-appwrite 0.11.0 → 0.12.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 (125) hide show
  1. package/README.md +84 -3
  2. package/dist/cjs/sdk.js +1741 -1120
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +1741 -1121
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/docs/examples/account/create-email-password-session.md +4 -4
  7. package/docs/examples/account/create-email-token.md +5 -5
  8. package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
  9. package/docs/examples/account/create-mfa-authenticator.md +3 -3
  10. package/docs/examples/account/create-mfa-challenge.md +3 -3
  11. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  12. package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
  13. package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
  14. package/docs/examples/account/create-phone-token.md +4 -4
  15. package/docs/examples/account/create-push-target.md +5 -5
  16. package/docs/examples/account/create-recovery.md +4 -4
  17. package/docs/examples/account/create-session.md +4 -4
  18. package/docs/examples/account/create-verification.md +3 -3
  19. package/docs/examples/account/create.md +6 -6
  20. package/docs/examples/account/delete-identity.md +3 -3
  21. package/docs/examples/account/delete-mfa-authenticator.md +3 -3
  22. package/docs/examples/account/delete-push-target.md +3 -3
  23. package/docs/examples/account/delete-session.md +3 -3
  24. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  25. package/docs/examples/account/get-session.md +3 -3
  26. package/docs/examples/account/list-identities.md +3 -3
  27. package/docs/examples/account/list-logs.md +3 -3
  28. package/docs/examples/account/list-mfa-factors.md +1 -1
  29. package/docs/examples/account/update-email.md +4 -4
  30. package/docs/examples/account/{update-magic-u-r-l-session.md → update-magic-url-session.md} +4 -4
  31. package/docs/examples/account/update-mfa-authenticator.md +4 -4
  32. package/docs/examples/account/update-mfa-challenge.md +4 -4
  33. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  34. package/docs/examples/account/{update-m-f-a.md → update-mfa.md} +3 -3
  35. package/docs/examples/account/update-name.md +3 -3
  36. package/docs/examples/account/update-password.md +4 -4
  37. package/docs/examples/account/update-phone-session.md +4 -4
  38. package/docs/examples/account/update-phone-verification.md +4 -4
  39. package/docs/examples/account/update-phone.md +4 -4
  40. package/docs/examples/account/update-prefs.md +3 -3
  41. package/docs/examples/account/update-push-target.md +4 -4
  42. package/docs/examples/account/update-recovery.md +5 -5
  43. package/docs/examples/account/update-session.md +3 -3
  44. package/docs/examples/account/update-verification.md +4 -4
  45. package/docs/examples/avatars/get-browser.md +6 -6
  46. package/docs/examples/avatars/get-credit-card.md +6 -6
  47. package/docs/examples/avatars/get-favicon.md +3 -3
  48. package/docs/examples/avatars/get-flag.md +6 -6
  49. package/docs/examples/avatars/get-image.md +5 -5
  50. package/docs/examples/avatars/get-initials.md +6 -6
  51. package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
  52. package/docs/examples/databases/create-document.md +7 -7
  53. package/docs/examples/databases/decrement-document-attribute.md +8 -8
  54. package/docs/examples/databases/delete-document.md +5 -5
  55. package/docs/examples/databases/get-document.md +6 -6
  56. package/docs/examples/databases/increment-document-attribute.md +8 -8
  57. package/docs/examples/databases/list-documents.md +5 -5
  58. package/docs/examples/databases/update-document.md +7 -7
  59. package/docs/examples/databases/upsert-document.md +7 -7
  60. package/docs/examples/functions/create-execution.md +9 -9
  61. package/docs/examples/functions/get-execution.md +4 -4
  62. package/docs/examples/functions/list-executions.md +4 -4
  63. package/docs/examples/graphql/mutation.md +3 -3
  64. package/docs/examples/graphql/query.md +3 -3
  65. package/docs/examples/messaging/create-subscriber.md +5 -5
  66. package/docs/examples/messaging/delete-subscriber.md +4 -4
  67. package/docs/examples/storage/create-file.md +6 -6
  68. package/docs/examples/storage/delete-file.md +4 -4
  69. package/docs/examples/storage/get-file-download.md +5 -5
  70. package/docs/examples/storage/get-file-preview.md +16 -16
  71. package/docs/examples/storage/get-file-view.md +5 -5
  72. package/docs/examples/storage/get-file.md +4 -4
  73. package/docs/examples/storage/list-files.md +5 -5
  74. package/docs/examples/storage/update-file.md +6 -6
  75. package/docs/examples/tablesdb/create-row.md +17 -0
  76. package/docs/examples/tablesdb/decrement-row-column.md +18 -0
  77. package/docs/examples/tablesdb/delete-row.md +15 -0
  78. package/docs/examples/tablesdb/get-row.md +16 -0
  79. package/docs/examples/tablesdb/increment-row-column.md +18 -0
  80. package/docs/examples/tablesdb/list-rows.md +15 -0
  81. package/docs/examples/tablesdb/update-row.md +17 -0
  82. package/docs/examples/tablesdb/upsert-row.md +17 -0
  83. package/docs/examples/teams/create-membership.md +9 -9
  84. package/docs/examples/teams/create.md +5 -5
  85. package/docs/examples/teams/delete-membership.md +4 -4
  86. package/docs/examples/teams/delete.md +3 -3
  87. package/docs/examples/teams/get-membership.md +4 -4
  88. package/docs/examples/teams/get-prefs.md +3 -3
  89. package/docs/examples/teams/get.md +3 -3
  90. package/docs/examples/teams/list-memberships.md +5 -5
  91. package/docs/examples/teams/list.md +4 -4
  92. package/docs/examples/teams/update-membership-status.md +6 -6
  93. package/docs/examples/teams/update-membership.md +5 -5
  94. package/docs/examples/teams/update-name.md +4 -4
  95. package/docs/examples/teams/update-prefs.md +4 -4
  96. package/package.json +1 -1
  97. package/src/client.ts +2 -2
  98. package/src/index.ts +1 -0
  99. package/src/models.ts +72 -27
  100. package/src/query.ts +95 -0
  101. package/src/services/account.ts +1469 -315
  102. package/src/services/avatars.ts +289 -80
  103. package/src/services/databases.ts +354 -63
  104. package/src/services/functions.ts +115 -20
  105. package/src/services/graphql.ts +52 -4
  106. package/src/services/locale.ts +8 -19
  107. package/src/services/messaging.ts +66 -7
  108. package/src/services/storage.ts +345 -76
  109. package/src/services/tables-db.ts +621 -0
  110. package/src/services/teams.ts +454 -93
  111. package/types/index.d.ts +1 -0
  112. package/types/models.d.ts +69 -25
  113. package/types/query.d.ts +77 -0
  114. package/types/services/account.d.ts +734 -280
  115. package/types/services/avatars.d.ts +168 -73
  116. package/types/services/databases.d.ts +199 -58
  117. package/types/services/functions.d.ts +62 -17
  118. package/types/services/graphql.d.ts +24 -2
  119. package/types/services/locale.d.ts +8 -19
  120. package/types/services/messaging.d.ts +33 -5
  121. package/types/services/storage.d.ts +201 -68
  122. package/types/services/tables-db.d.ts +245 -0
  123. package/types/services/teams.d.ts +242 -80
  124. /package/docs/examples/account/{create-j-w-t.md → create-jwt.md} +0 -0
  125. /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const avatars = new Avatars(client);
8
8
 
9
- const result = avatars.getInitials(
10
- '<NAME>', // name (optional)
11
- 0, // width (optional)
12
- 0, // height (optional)
13
- '' // background (optional)
14
- );
9
+ const result = avatars.getInitials({
10
+ name: '<NAME>', // optional
11
+ width: 0, // optional
12
+ height: 0, // optional
13
+ background: '' // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const avatars = new Avatars(client);
8
8
 
9
- const result = avatars.getQR(
10
- '<TEXT>', // text
11
- 1, // size (optional)
12
- 0, // margin (optional)
13
- false // download (optional)
14
- );
9
+ const result = avatars.getQR({
10
+ text: '<TEXT>',
11
+ size: 1, // optional
12
+ margin: 0, // optional
13
+ download: false // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,12 +6,12 @@ const client = new Client()
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
9
- const result = await databases.createDocument(
10
- '<DATABASE_ID>', // databaseId
11
- '<COLLECTION_ID>', // collectionId
12
- '<DOCUMENT_ID>', // documentId
13
- {}, // data
14
- ["read("any")"] // permissions (optional)
15
- );
9
+ const result = await databases.createDocument({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ documentId: '<DOCUMENT_ID>',
13
+ data: {},
14
+ permissions: ["read("any")"] // optional
15
+ });
16
16
 
17
17
  console.log(result);
@@ -6,13 +6,13 @@ const client = new Client()
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
9
- const result = await databases.decrementDocumentAttribute(
10
- '<DATABASE_ID>', // databaseId
11
- '<COLLECTION_ID>', // collectionId
12
- '<DOCUMENT_ID>', // documentId
13
- '', // attribute
14
- null, // value (optional)
15
- null // min (optional)
16
- );
9
+ const result = await databases.decrementDocumentAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ documentId: '<DOCUMENT_ID>',
13
+ attribute: '',
14
+ value: null, // optional
15
+ min: null // optional
16
+ });
17
17
 
18
18
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
9
- const result = await databases.deleteDocument(
10
- '<DATABASE_ID>', // databaseId
11
- '<COLLECTION_ID>', // collectionId
12
- '<DOCUMENT_ID>' // documentId
13
- );
9
+ const result = await databases.deleteDocument({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ documentId: '<DOCUMENT_ID>'
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
9
- const result = await databases.getDocument(
10
- '<DATABASE_ID>', // databaseId
11
- '<COLLECTION_ID>', // collectionId
12
- '<DOCUMENT_ID>', // documentId
13
- [] // queries (optional)
14
- );
9
+ const result = await databases.getDocument({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ documentId: '<DOCUMENT_ID>',
13
+ queries: [] // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,13 +6,13 @@ const client = new Client()
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
9
- const result = await databases.incrementDocumentAttribute(
10
- '<DATABASE_ID>', // databaseId
11
- '<COLLECTION_ID>', // collectionId
12
- '<DOCUMENT_ID>', // documentId
13
- '', // attribute
14
- null, // value (optional)
15
- null // max (optional)
16
- );
9
+ const result = await databases.incrementDocumentAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ documentId: '<DOCUMENT_ID>',
13
+ attribute: '',
14
+ value: null, // optional
15
+ max: null // optional
16
+ });
17
17
 
18
18
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
9
- const result = await databases.listDocuments(
10
- '<DATABASE_ID>', // databaseId
11
- '<COLLECTION_ID>', // collectionId
12
- [] // queries (optional)
13
- );
9
+ const result = await databases.listDocuments({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ queries: [] // optional
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,12 +6,12 @@ const client = new Client()
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
9
- const result = await databases.updateDocument(
10
- '<DATABASE_ID>', // databaseId
11
- '<COLLECTION_ID>', // collectionId
12
- '<DOCUMENT_ID>', // documentId
13
- {}, // data (optional)
14
- ["read("any")"] // permissions (optional)
15
- );
9
+ const result = await databases.updateDocument({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ documentId: '<DOCUMENT_ID>',
13
+ data: {}, // optional
14
+ permissions: ["read("any")"] // optional
15
+ });
16
16
 
17
17
  console.log(result);
@@ -6,12 +6,12 @@ const client = new Client()
6
6
 
7
7
  const databases = new Databases(client);
8
8
 
9
- const result = await databases.upsertDocument(
10
- '<DATABASE_ID>', // databaseId
11
- '<COLLECTION_ID>', // collectionId
12
- '<DOCUMENT_ID>', // documentId
13
- {}, // data
14
- ["read("any")"] // permissions (optional)
15
- );
9
+ const result = await databases.upsertDocument({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ documentId: '<DOCUMENT_ID>',
13
+ data: {},
14
+ permissions: ["read("any")"] // optional
15
+ });
16
16
 
17
17
  console.log(result);
@@ -6,14 +6,14 @@ const client = new Client()
6
6
 
7
7
  const functions = new Functions(client);
8
8
 
9
- const result = await functions.createExecution(
10
- '<FUNCTION_ID>', // functionId
11
- '<BODY>', // body (optional)
12
- false, // async (optional)
13
- '<PATH>', // path (optional)
14
- ExecutionMethod.GET, // method (optional)
15
- {}, // headers (optional)
16
- '' // scheduledAt (optional)
17
- );
9
+ const result = await functions.createExecution({
10
+ functionId: '<FUNCTION_ID>',
11
+ body: '<BODY>', // optional
12
+ async: false, // optional
13
+ path: '<PATH>', // optional
14
+ method: ExecutionMethod.GET, // optional
15
+ headers: {}, // optional
16
+ scheduledAt: '<SCHEDULED_AT>' // optional
17
+ });
18
18
 
19
19
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const functions = new Functions(client);
8
8
 
9
- const result = await functions.getExecution(
10
- '<FUNCTION_ID>', // functionId
11
- '<EXECUTION_ID>' // executionId
12
- );
9
+ const result = await functions.getExecution({
10
+ functionId: '<FUNCTION_ID>',
11
+ executionId: '<EXECUTION_ID>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const functions = new Functions(client);
8
8
 
9
- const result = await functions.listExecutions(
10
- '<FUNCTION_ID>', // functionId
11
- [] // queries (optional)
12
- );
9
+ const result = await functions.listExecutions({
10
+ functionId: '<FUNCTION_ID>',
11
+ queries: [] // optional
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const graphql = new Graphql(client);
8
8
 
9
- const result = await graphql.mutation(
10
- {} // query
11
- );
9
+ const result = await graphql.mutation({
10
+ query: {}
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const graphql = new Graphql(client);
8
8
 
9
- const result = await graphql.query(
10
- {} // query
11
- );
9
+ const result = await graphql.query({
10
+ query: {}
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const messaging = new Messaging(client);
8
8
 
9
- const result = await messaging.createSubscriber(
10
- '<TOPIC_ID>', // topicId
11
- '<SUBSCRIBER_ID>', // subscriberId
12
- '<TARGET_ID>' // targetId
13
- );
9
+ const result = await messaging.createSubscriber({
10
+ topicId: '<TOPIC_ID>',
11
+ subscriberId: '<SUBSCRIBER_ID>',
12
+ targetId: '<TARGET_ID>'
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const messaging = new Messaging(client);
8
8
 
9
- const result = await messaging.deleteSubscriber(
10
- '<TOPIC_ID>', // topicId
11
- '<SUBSCRIBER_ID>' // subscriberId
12
- );
9
+ const result = await messaging.deleteSubscriber({
10
+ topicId: '<TOPIC_ID>',
11
+ subscriberId: '<SUBSCRIBER_ID>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const storage = new Storage(client);
8
8
 
9
- const result = await storage.createFile(
10
- '<BUCKET_ID>', // bucketId
11
- '<FILE_ID>', // fileId
12
- await pickSingle(), // file
13
- ["read("any")"] // permissions (optional)
14
- );
9
+ const result = await storage.createFile({
10
+ bucketId: '<BUCKET_ID>',
11
+ fileId: '<FILE_ID>',
12
+ file: await pickSingle(),
13
+ permissions: ["read("any")"] // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const storage = new Storage(client);
8
8
 
9
- const result = await storage.deleteFile(
10
- '<BUCKET_ID>', // bucketId
11
- '<FILE_ID>' // fileId
12
- );
9
+ const result = await storage.deleteFile({
10
+ bucketId: '<BUCKET_ID>',
11
+ fileId: '<FILE_ID>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const storage = new Storage(client);
8
8
 
9
- const result = storage.getFileDownload(
10
- '<BUCKET_ID>', // bucketId
11
- '<FILE_ID>', // fileId
12
- '<TOKEN>' // token (optional)
13
- );
9
+ const result = storage.getFileDownload({
10
+ bucketId: '<BUCKET_ID>',
11
+ fileId: '<FILE_ID>',
12
+ token: '<TOKEN>' // optional
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,21 +6,21 @@ const client = new Client()
6
6
 
7
7
  const storage = new Storage(client);
8
8
 
9
- const result = storage.getFilePreview(
10
- '<BUCKET_ID>', // bucketId
11
- '<FILE_ID>', // fileId
12
- 0, // width (optional)
13
- 0, // height (optional)
14
- ImageGravity.Center, // gravity (optional)
15
- -1, // quality (optional)
16
- 0, // borderWidth (optional)
17
- '', // borderColor (optional)
18
- 0, // borderRadius (optional)
19
- 0, // opacity (optional)
20
- -360, // rotation (optional)
21
- '', // background (optional)
22
- ImageFormat.Jpg, // output (optional)
23
- '<TOKEN>' // token (optional)
24
- );
9
+ const result = storage.getFilePreview({
10
+ bucketId: '<BUCKET_ID>',
11
+ fileId: '<FILE_ID>',
12
+ width: 0, // optional
13
+ height: 0, // optional
14
+ gravity: ImageGravity.Center, // optional
15
+ quality: -1, // optional
16
+ borderWidth: 0, // optional
17
+ borderColor: '', // optional
18
+ borderRadius: 0, // optional
19
+ opacity: 0, // optional
20
+ rotation: -360, // optional
21
+ background: '', // optional
22
+ output: ImageFormat.Jpg, // optional
23
+ token: '<TOKEN>' // optional
24
+ });
25
25
 
26
26
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const storage = new Storage(client);
8
8
 
9
- const result = storage.getFileView(
10
- '<BUCKET_ID>', // bucketId
11
- '<FILE_ID>', // fileId
12
- '<TOKEN>' // token (optional)
13
- );
9
+ const result = storage.getFileView({
10
+ bucketId: '<BUCKET_ID>',
11
+ fileId: '<FILE_ID>',
12
+ token: '<TOKEN>' // optional
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const storage = new Storage(client);
8
8
 
9
- const result = await storage.getFile(
10
- '<BUCKET_ID>', // bucketId
11
- '<FILE_ID>' // fileId
12
- );
9
+ const result = await storage.getFile({
10
+ bucketId: '<BUCKET_ID>',
11
+ fileId: '<FILE_ID>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const storage = new Storage(client);
8
8
 
9
- const result = await storage.listFiles(
10
- '<BUCKET_ID>', // bucketId
11
- [], // queries (optional)
12
- '<SEARCH>' // search (optional)
13
- );
9
+ const result = await storage.listFiles({
10
+ bucketId: '<BUCKET_ID>',
11
+ queries: [], // optional
12
+ search: '<SEARCH>' // optional
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const storage = new Storage(client);
8
8
 
9
- const result = await storage.updateFile(
10
- '<BUCKET_ID>', // bucketId
11
- '<FILE_ID>', // fileId
12
- '<NAME>', // name (optional)
13
- ["read("any")"] // permissions (optional)
14
- );
9
+ const result = await storage.updateFile({
10
+ bucketId: '<BUCKET_ID>',
11
+ fileId: '<FILE_ID>',
12
+ name: '<NAME>', // optional
13
+ permissions: ["read("any")"] // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -0,0 +1,17 @@
1
+ import { Client, TablesDB } from "react-native-appwrite";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const tablesDB = new TablesDB(client);
8
+
9
+ const result = await tablesDB.createRow({
10
+ databaseId: '<DATABASE_ID>',
11
+ tableId: '<TABLE_ID>',
12
+ rowId: '<ROW_ID>',
13
+ data: {},
14
+ permissions: ["read("any")"] // optional
15
+ });
16
+
17
+ console.log(result);
@@ -0,0 +1,18 @@
1
+ import { Client, TablesDB } from "react-native-appwrite";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const tablesDB = new TablesDB(client);
8
+
9
+ const result = await tablesDB.decrementRowColumn({
10
+ databaseId: '<DATABASE_ID>',
11
+ tableId: '<TABLE_ID>',
12
+ rowId: '<ROW_ID>',
13
+ column: '',
14
+ value: null, // optional
15
+ min: null // optional
16
+ });
17
+
18
+ console.log(result);
@@ -0,0 +1,15 @@
1
+ import { Client, TablesDB } from "react-native-appwrite";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const tablesDB = new TablesDB(client);
8
+
9
+ const result = await tablesDB.deleteRow({
10
+ databaseId: '<DATABASE_ID>',
11
+ tableId: '<TABLE_ID>',
12
+ rowId: '<ROW_ID>'
13
+ });
14
+
15
+ console.log(result);
@@ -0,0 +1,16 @@
1
+ import { Client, TablesDB } from "react-native-appwrite";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const tablesDB = new TablesDB(client);
8
+
9
+ const result = await tablesDB.getRow({
10
+ databaseId: '<DATABASE_ID>',
11
+ tableId: '<TABLE_ID>',
12
+ rowId: '<ROW_ID>',
13
+ queries: [] // optional
14
+ });
15
+
16
+ console.log(result);
@@ -0,0 +1,18 @@
1
+ import { Client, TablesDB } from "react-native-appwrite";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const tablesDB = new TablesDB(client);
8
+
9
+ const result = await tablesDB.incrementRowColumn({
10
+ databaseId: '<DATABASE_ID>',
11
+ tableId: '<TABLE_ID>',
12
+ rowId: '<ROW_ID>',
13
+ column: '',
14
+ value: null, // optional
15
+ max: null // optional
16
+ });
17
+
18
+ console.log(result);
@@ -0,0 +1,15 @@
1
+ import { Client, TablesDB } from "react-native-appwrite";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const tablesDB = new TablesDB(client);
8
+
9
+ const result = await tablesDB.listRows({
10
+ databaseId: '<DATABASE_ID>',
11
+ tableId: '<TABLE_ID>',
12
+ queries: [] // optional
13
+ });
14
+
15
+ console.log(result);
@@ -0,0 +1,17 @@
1
+ import { Client, TablesDB } from "react-native-appwrite";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const tablesDB = new TablesDB(client);
8
+
9
+ const result = await tablesDB.updateRow({
10
+ databaseId: '<DATABASE_ID>',
11
+ tableId: '<TABLE_ID>',
12
+ rowId: '<ROW_ID>',
13
+ data: {}, // optional
14
+ permissions: ["read("any")"] // optional
15
+ });
16
+
17
+ console.log(result);
@@ -0,0 +1,17 @@
1
+ import { Client, TablesDB } from "react-native-appwrite";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const tablesDB = new TablesDB(client);
8
+
9
+ const result = await tablesDB.upsertRow({
10
+ databaseId: '<DATABASE_ID>',
11
+ tableId: '<TABLE_ID>',
12
+ rowId: '<ROW_ID>',
13
+ data: {}, // optional
14
+ permissions: ["read("any")"] // optional
15
+ });
16
+
17
+ console.log(result);
@@ -6,14 +6,14 @@ const client = new Client()
6
6
 
7
7
  const teams = new Teams(client);
8
8
 
9
- const result = await teams.createMembership(
10
- '<TEAM_ID>', // teamId
11
- [], // roles
12
- 'email@example.com', // email (optional)
13
- '<USER_ID>', // userId (optional)
14
- '+12065550100', // phone (optional)
15
- 'https://example.com', // url (optional)
16
- '<NAME>' // name (optional)
17
- );
9
+ const result = await teams.createMembership({
10
+ teamId: '<TEAM_ID>',
11
+ roles: [],
12
+ email: 'email@example.com', // optional
13
+ userId: '<USER_ID>', // optional
14
+ phone: '+12065550100', // optional
15
+ url: 'https://example.com', // optional
16
+ name: '<NAME>' // optional
17
+ });
18
18
 
19
19
  console.log(result);