react-native-appwrite 0.19.0 → 0.20.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 (158) hide show
  1. package/.github/workflows/publish.yml +9 -8
  2. package/CHANGELOG.md +6 -0
  3. package/LICENSE +1 -1
  4. package/README.md +2 -2
  5. package/dist/cjs/sdk.js +223 -44
  6. package/dist/cjs/sdk.js.map +1 -1
  7. package/dist/esm/sdk.js +219 -45
  8. package/dist/esm/sdk.js.map +1 -1
  9. package/docs/examples/account/create-anonymous-session.md +2 -0
  10. package/docs/examples/account/create-email-password-session.md +2 -0
  11. package/docs/examples/account/create-email-token.md +2 -0
  12. package/docs/examples/account/create-email-verification.md +2 -0
  13. package/docs/examples/account/create-jwt.md +5 -1
  14. package/docs/examples/account/create-magic-url-token.md +2 -0
  15. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  16. package/docs/examples/account/create-mfa-challenge.md +2 -0
  17. package/docs/examples/account/create-mfa-recovery-codes.md +2 -0
  18. package/docs/examples/account/create-o-auth-2-session.md +2 -0
  19. package/docs/examples/account/create-o-auth-2-token.md +2 -0
  20. package/docs/examples/account/create-phone-token.md +2 -0
  21. package/docs/examples/account/create-phone-verification.md +2 -0
  22. package/docs/examples/account/create-push-target.md +2 -0
  23. package/docs/examples/account/create-recovery.md +2 -0
  24. package/docs/examples/account/create-session.md +2 -0
  25. package/docs/examples/account/create-verification.md +2 -0
  26. package/docs/examples/account/create.md +2 -0
  27. package/docs/examples/account/delete-identity.md +2 -0
  28. package/docs/examples/account/delete-mfa-authenticator.md +2 -0
  29. package/docs/examples/account/delete-push-target.md +2 -0
  30. package/docs/examples/account/delete-session.md +2 -0
  31. package/docs/examples/account/delete-sessions.md +2 -0
  32. package/docs/examples/account/get-mfa-recovery-codes.md +2 -0
  33. package/docs/examples/account/get-prefs.md +2 -0
  34. package/docs/examples/account/get-session.md +2 -0
  35. package/docs/examples/account/get.md +2 -0
  36. package/docs/examples/account/list-identities.md +2 -0
  37. package/docs/examples/account/list-logs.md +2 -0
  38. package/docs/examples/account/list-mfa-factors.md +2 -0
  39. package/docs/examples/account/list-sessions.md +2 -0
  40. package/docs/examples/account/update-email-verification.md +2 -0
  41. package/docs/examples/account/update-email.md +2 -0
  42. package/docs/examples/account/update-magic-url-session.md +2 -0
  43. package/docs/examples/account/update-mfa-authenticator.md +2 -0
  44. package/docs/examples/account/update-mfa-challenge.md +2 -0
  45. package/docs/examples/account/update-mfa-recovery-codes.md +2 -0
  46. package/docs/examples/account/update-mfa.md +2 -0
  47. package/docs/examples/account/update-name.md +2 -0
  48. package/docs/examples/account/update-password.md +2 -0
  49. package/docs/examples/account/update-phone-session.md +2 -0
  50. package/docs/examples/account/update-phone-verification.md +2 -0
  51. package/docs/examples/account/update-phone.md +2 -0
  52. package/docs/examples/account/update-prefs.md +2 -0
  53. package/docs/examples/account/update-push-target.md +2 -0
  54. package/docs/examples/account/update-recovery.md +2 -0
  55. package/docs/examples/account/update-session.md +2 -0
  56. package/docs/examples/account/update-status.md +2 -0
  57. package/docs/examples/account/update-verification.md +2 -0
  58. package/docs/examples/avatars/get-browser.md +2 -0
  59. package/docs/examples/avatars/get-credit-card.md +2 -0
  60. package/docs/examples/avatars/get-favicon.md +2 -0
  61. package/docs/examples/avatars/get-flag.md +2 -0
  62. package/docs/examples/avatars/get-image.md +2 -0
  63. package/docs/examples/avatars/get-initials.md +2 -0
  64. package/docs/examples/avatars/get-qr.md +2 -0
  65. package/docs/examples/avatars/get-screenshot.md +7 -5
  66. package/docs/examples/databases/create-document.md +2 -0
  67. package/docs/examples/databases/create-operations.md +2 -0
  68. package/docs/examples/databases/create-transaction.md +2 -0
  69. package/docs/examples/databases/decrement-document-attribute.md +2 -0
  70. package/docs/examples/databases/delete-document.md +2 -0
  71. package/docs/examples/databases/delete-transaction.md +2 -0
  72. package/docs/examples/databases/get-document.md +2 -0
  73. package/docs/examples/databases/get-transaction.md +2 -0
  74. package/docs/examples/databases/increment-document-attribute.md +2 -0
  75. package/docs/examples/databases/list-documents.md +2 -0
  76. package/docs/examples/databases/list-transactions.md +2 -0
  77. package/docs/examples/databases/update-document.md +9 -1
  78. package/docs/examples/databases/update-transaction.md +2 -0
  79. package/docs/examples/databases/upsert-document.md +9 -1
  80. package/docs/examples/functions/create-execution.md +2 -0
  81. package/docs/examples/functions/get-execution.md +2 -0
  82. package/docs/examples/functions/list-executions.md +2 -0
  83. package/docs/examples/graphql/mutation.md +2 -0
  84. package/docs/examples/graphql/query.md +2 -0
  85. package/docs/examples/locale/get.md +2 -0
  86. package/docs/examples/locale/list-codes.md +2 -0
  87. package/docs/examples/locale/list-continents.md +2 -0
  88. package/docs/examples/locale/list-countries-eu.md +2 -0
  89. package/docs/examples/locale/list-countries-phones.md +2 -0
  90. package/docs/examples/locale/list-countries.md +2 -0
  91. package/docs/examples/locale/list-currencies.md +2 -0
  92. package/docs/examples/locale/list-languages.md +2 -0
  93. package/docs/examples/messaging/create-subscriber.md +2 -0
  94. package/docs/examples/messaging/delete-subscriber.md +2 -0
  95. package/docs/examples/storage/create-file.md +2 -0
  96. package/docs/examples/storage/delete-file.md +2 -0
  97. package/docs/examples/storage/get-file-download.md +2 -0
  98. package/docs/examples/storage/get-file-preview.md +2 -0
  99. package/docs/examples/storage/get-file-view.md +2 -0
  100. package/docs/examples/storage/get-file.md +2 -0
  101. package/docs/examples/storage/list-files.md +2 -0
  102. package/docs/examples/storage/update-file.md +2 -0
  103. package/docs/examples/tablesdb/create-operations.md +2 -0
  104. package/docs/examples/tablesdb/create-row.md +2 -0
  105. package/docs/examples/tablesdb/create-transaction.md +2 -0
  106. package/docs/examples/tablesdb/decrement-row-column.md +2 -0
  107. package/docs/examples/tablesdb/delete-row.md +2 -0
  108. package/docs/examples/tablesdb/delete-transaction.md +2 -0
  109. package/docs/examples/tablesdb/get-row.md +2 -0
  110. package/docs/examples/tablesdb/get-transaction.md +2 -0
  111. package/docs/examples/tablesdb/increment-row-column.md +2 -0
  112. package/docs/examples/tablesdb/list-rows.md +2 -0
  113. package/docs/examples/tablesdb/list-transactions.md +2 -0
  114. package/docs/examples/tablesdb/update-row.md +9 -1
  115. package/docs/examples/tablesdb/update-transaction.md +2 -0
  116. package/docs/examples/tablesdb/upsert-row.md +9 -1
  117. package/docs/examples/teams/create-membership.md +4 -2
  118. package/docs/examples/teams/create.md +2 -0
  119. package/docs/examples/teams/delete-membership.md +2 -0
  120. package/docs/examples/teams/delete.md +2 -0
  121. package/docs/examples/teams/get-membership.md +2 -0
  122. package/docs/examples/teams/get-prefs.md +2 -0
  123. package/docs/examples/teams/get.md +2 -0
  124. package/docs/examples/teams/list-memberships.md +2 -0
  125. package/docs/examples/teams/list.md +2 -0
  126. package/docs/examples/teams/update-membership-status.md +2 -0
  127. package/docs/examples/teams/update-membership.md +4 -2
  128. package/docs/examples/teams/update-name.md +2 -0
  129. package/docs/examples/teams/update-prefs.md +2 -0
  130. package/package.json +6 -3
  131. package/rollup.config.js +3 -1
  132. package/src/channel.ts +134 -0
  133. package/src/client.ts +41 -6
  134. package/src/enums/browser-permission.ts +22 -0
  135. package/src/enums/o-auth-provider.ts +0 -1
  136. package/src/enums/roles.ts +5 -0
  137. package/src/index.ts +4 -2
  138. package/src/models.ts +8 -0
  139. package/src/query.ts +54 -9
  140. package/src/services/account.ts +30 -1
  141. package/src/services/avatars.ts +17 -16
  142. package/src/services/databases.ts +5 -9
  143. package/src/services/storage.ts +8 -8
  144. package/src/services/teams.ts +19 -18
  145. package/types/channel.d.ts +71 -0
  146. package/types/enums/browser-permission.d.ts +22 -0
  147. package/types/enums/o-auth-provider.d.ts +1 -2
  148. package/types/enums/roles.d.ts +5 -0
  149. package/types/index.d.ts +4 -2
  150. package/types/models.d.ts +8 -0
  151. package/types/query.d.ts +36 -6
  152. package/types/services/account.d.ts +13 -1
  153. package/types/services/avatars.d.ts +12 -11
  154. package/types/services/databases.d.ts +2 -2
  155. package/types/services/storage.d.ts +8 -8
  156. package/types/services/teams.d.ts +9 -8
  157. package/src/enums/output.ts +0 -9
  158. package/types/enums/output.d.ts +0 -9
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await databases.createTransaction({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -17,3 +18,4 @@ const result = await databases.decrementDocumentAttribute({
17
18
  });
18
19
 
19
20
  console.log(result);
21
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -14,3 +15,4 @@ const result = await databases.deleteDocument({
14
15
  });
15
16
 
16
17
  console.log(result);
18
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await databases.deleteTransaction({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -15,3 +16,4 @@ const result = await databases.getDocument({
15
16
  });
16
17
 
17
18
  console.log(result);
19
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await databases.getTransaction({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -17,3 +18,4 @@ const result = await databases.incrementDocumentAttribute({
17
18
  });
18
19
 
19
20
  console.log(result);
21
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -15,3 +16,4 @@ const result = await databases.listDocuments({
15
16
  });
16
17
 
17
18
  console.log(result);
19
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await databases.listTransactions({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases, Permission, Role } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -10,9 +11,16 @@ const result = await databases.updateDocument({
10
11
  databaseId: '<DATABASE_ID>',
11
12
  collectionId: '<COLLECTION_ID>',
12
13
  documentId: '<DOCUMENT_ID>',
13
- data: {}, // optional
14
+ data: {
15
+ "username": "walter.obrien",
16
+ "email": "walter.obrien@example.com",
17
+ "fullName": "Walter O'Brien",
18
+ "age": 33,
19
+ "isAdmin": false
20
+ }, // optional
14
21
  permissions: ["read("any")"], // optional
15
22
  transactionId: '<TRANSACTION_ID>' // optional
16
23
  });
17
24
 
18
25
  console.log(result);
26
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -13,3 +14,4 @@ const result = await databases.updateTransaction({
13
14
  });
14
15
 
15
16
  console.log(result);
17
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Databases, Permission, Role } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -10,9 +11,16 @@ const result = await databases.upsertDocument({
10
11
  databaseId: '<DATABASE_ID>',
11
12
  collectionId: '<COLLECTION_ID>',
12
13
  documentId: '<DOCUMENT_ID>',
13
- data: {},
14
+ data: {
15
+ "username": "walter.obrien",
16
+ "email": "walter.obrien@example.com",
17
+ "fullName": "Walter O'Brien",
18
+ "age": 30,
19
+ "isAdmin": false
20
+ }, // optional
14
21
  permissions: ["read("any")"], // optional
15
22
  transactionId: '<TRANSACTION_ID>' // optional
16
23
  });
17
24
 
18
25
  console.log(result);
26
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Functions, ExecutionMethod } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -17,3 +18,4 @@ const result = await functions.createExecution({
17
18
  });
18
19
 
19
20
  console.log(result);
21
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Functions } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -12,3 +13,4 @@ const result = await functions.getExecution({
12
13
  });
13
14
 
14
15
  console.log(result);
16
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Functions } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -13,3 +14,4 @@ const result = await functions.listExecutions({
13
14
  });
14
15
 
15
16
  console.log(result);
17
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Graphql } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await graphql.mutation({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Graphql } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await graphql.query({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Locale } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -9,3 +10,4 @@ const locale = new Locale(client);
9
10
  const result = await locale.get();
10
11
 
11
12
  console.log(result);
13
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Locale } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -9,3 +10,4 @@ const locale = new Locale(client);
9
10
  const result = await locale.listCodes();
10
11
 
11
12
  console.log(result);
13
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Locale } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -9,3 +10,4 @@ const locale = new Locale(client);
9
10
  const result = await locale.listContinents();
10
11
 
11
12
  console.log(result);
13
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Locale } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -9,3 +10,4 @@ const locale = new Locale(client);
9
10
  const result = await locale.listCountriesEU();
10
11
 
11
12
  console.log(result);
13
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Locale } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -9,3 +10,4 @@ const locale = new Locale(client);
9
10
  const result = await locale.listCountriesPhones();
10
11
 
11
12
  console.log(result);
13
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Locale } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -9,3 +10,4 @@ const locale = new Locale(client);
9
10
  const result = await locale.listCountries();
10
11
 
11
12
  console.log(result);
13
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Locale } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -9,3 +10,4 @@ const locale = new Locale(client);
9
10
  const result = await locale.listCurrencies();
10
11
 
11
12
  console.log(result);
13
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Locale } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -9,3 +10,4 @@ const locale = new Locale(client);
9
10
  const result = await locale.listLanguages();
10
11
 
11
12
  console.log(result);
13
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Messaging } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -13,3 +14,4 @@ const result = await messaging.createSubscriber({
13
14
  });
14
15
 
15
16
  console.log(result);
17
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Messaging } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -12,3 +13,4 @@ const result = await messaging.deleteSubscriber({
12
13
  });
13
14
 
14
15
  console.log(result);
16
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Storage, Permission, Role } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -14,3 +15,4 @@ const result = await storage.createFile({
14
15
  });
15
16
 
16
17
  console.log(result);
18
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Storage } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -12,3 +13,4 @@ const result = await storage.deleteFile({
12
13
  });
13
14
 
14
15
  console.log(result);
16
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Storage } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -13,3 +14,4 @@ const result = storage.getFileDownload({
13
14
  });
14
15
 
15
16
  console.log(result);
17
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Storage, ImageGravity, ImageFormat } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -24,3 +25,4 @@ const result = storage.getFilePreview({
24
25
  });
25
26
 
26
27
  console.log(result);
28
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Storage } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -13,3 +14,4 @@ const result = storage.getFileView({
13
14
  });
14
15
 
15
16
  console.log(result);
17
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Storage } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -12,3 +13,4 @@ const result = await storage.getFile({
12
13
  });
13
14
 
14
15
  console.log(result);
16
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Storage } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -14,3 +15,4 @@ const result = await storage.listFiles({
14
15
  });
15
16
 
16
17
  console.log(result);
18
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Storage, Permission, Role } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -14,3 +15,4 @@ const result = await storage.updateFile({
14
15
  });
15
16
 
16
17
  console.log(result);
18
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -22,3 +23,4 @@ const result = await tablesDB.createOperations({
22
23
  });
23
24
 
24
25
  console.log(result);
26
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB, Permission, Role } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -22,3 +23,4 @@ const result = await tablesDB.createRow({
22
23
  });
23
24
 
24
25
  console.log(result);
26
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await tablesDB.createTransaction({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -17,3 +18,4 @@ const result = await tablesDB.decrementRowColumn({
17
18
  });
18
19
 
19
20
  console.log(result);
21
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -14,3 +15,4 @@ const result = await tablesDB.deleteRow({
14
15
  });
15
16
 
16
17
  console.log(result);
18
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await tablesDB.deleteTransaction({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -15,3 +16,4 @@ const result = await tablesDB.getRow({
15
16
  });
16
17
 
17
18
  console.log(result);
19
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await tablesDB.getTransaction({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -17,3 +18,4 @@ const result = await tablesDB.incrementRowColumn({
17
18
  });
18
19
 
19
20
  console.log(result);
21
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -15,3 +16,4 @@ const result = await tablesDB.listRows({
15
16
  });
16
17
 
17
18
  console.log(result);
19
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await tablesDB.listTransactions({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB, Permission, Role } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -10,9 +11,16 @@ const result = await tablesDB.updateRow({
10
11
  databaseId: '<DATABASE_ID>',
11
12
  tableId: '<TABLE_ID>',
12
13
  rowId: '<ROW_ID>',
13
- data: {}, // optional
14
+ data: {
15
+ "username": "walter.obrien",
16
+ "email": "walter.obrien@example.com",
17
+ "fullName": "Walter O'Brien",
18
+ "age": 33,
19
+ "isAdmin": false
20
+ }, // optional
14
21
  permissions: ["read("any")"], // optional
15
22
  transactionId: '<TRANSACTION_ID>' // optional
16
23
  });
17
24
 
18
25
  console.log(result);
26
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -13,3 +14,4 @@ const result = await tablesDB.updateTransaction({
13
14
  });
14
15
 
15
16
  console.log(result);
17
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, TablesDB, Permission, Role } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -10,9 +11,16 @@ const result = await tablesDB.upsertRow({
10
11
  databaseId: '<DATABASE_ID>',
11
12
  tableId: '<TABLE_ID>',
12
13
  rowId: '<ROW_ID>',
13
- data: {}, // optional
14
+ data: {
15
+ "username": "walter.obrien",
16
+ "email": "walter.obrien@example.com",
17
+ "fullName": "Walter O'Brien",
18
+ "age": 33,
19
+ "isAdmin": false
20
+ }, // optional
14
21
  permissions: ["read("any")"], // optional
15
22
  transactionId: '<TRANSACTION_ID>' // optional
16
23
  });
17
24
 
18
25
  console.log(result);
26
+ ```
@@ -1,4 +1,5 @@
1
- import { Client, Teams } from "react-native-appwrite";
1
+ ```javascript
2
+ import { Client, Teams, Roles } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
4
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +9,7 @@ const teams = new Teams(client);
8
9
 
9
10
  const result = await teams.createMembership({
10
11
  teamId: '<TEAM_ID>',
11
- roles: [],
12
+ roles: [Roles.Admin],
12
13
  email: 'email@example.com', // optional
13
14
  userId: '<USER_ID>', // optional
14
15
  phone: '+12065550100', // optional
@@ -17,3 +18,4 @@ const result = await teams.createMembership({
17
18
  });
18
19
 
19
20
  console.log(result);
21
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Teams } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -13,3 +14,4 @@ const result = await teams.create({
13
14
  });
14
15
 
15
16
  console.log(result);
17
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Teams } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -12,3 +13,4 @@ const result = await teams.deleteMembership({
12
13
  });
13
14
 
14
15
  console.log(result);
16
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Teams } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await teams.delete({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Teams } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -12,3 +13,4 @@ const result = await teams.getMembership({
12
13
  });
13
14
 
14
15
  console.log(result);
16
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Teams } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await teams.getPrefs({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```
@@ -1,3 +1,4 @@
1
+ ```javascript
1
2
  import { Client, Teams } from "react-native-appwrite";
2
3
 
3
4
  const client = new Client()
@@ -11,3 +12,4 @@ const result = await teams.get({
11
12
  });
12
13
 
13
14
  console.log(result);
15
+ ```