react-native-appwrite 0.19.0 → 0.21.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.
- package/.github/workflows/publish.yml +9 -8
- package/CHANGELOG.md +12 -0
- package/LICENSE +1 -1
- package/README.md +3 -3
- package/dist/cjs/sdk.js +254 -64
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +250 -65
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-anonymous-session.md +2 -0
- package/docs/examples/account/create-email-password-session.md +2 -0
- package/docs/examples/account/create-email-token.md +2 -0
- package/docs/examples/account/create-email-verification.md +2 -0
- package/docs/examples/account/create-jwt.md +5 -1
- package/docs/examples/account/create-magic-url-token.md +2 -0
- package/docs/examples/account/create-mfa-authenticator.md +2 -0
- package/docs/examples/account/create-mfa-challenge.md +2 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/create-o-auth-2-session.md +2 -0
- package/docs/examples/account/create-o-auth-2-token.md +2 -0
- package/docs/examples/account/create-phone-token.md +2 -0
- package/docs/examples/account/create-phone-verification.md +2 -0
- package/docs/examples/account/create-push-target.md +2 -0
- package/docs/examples/account/create-recovery.md +2 -0
- package/docs/examples/account/create-session.md +2 -0
- package/docs/examples/account/create-verification.md +2 -0
- package/docs/examples/account/create.md +2 -0
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/delete-mfa-authenticator.md +2 -0
- package/docs/examples/account/delete-push-target.md +2 -0
- package/docs/examples/account/delete-session.md +2 -0
- package/docs/examples/account/delete-sessions.md +2 -0
- package/docs/examples/account/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/get-prefs.md +2 -0
- package/docs/examples/account/get-session.md +2 -0
- package/docs/examples/account/get.md +2 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/account/list-logs.md +2 -0
- package/docs/examples/account/list-mfa-factors.md +2 -0
- package/docs/examples/account/list-sessions.md +2 -0
- package/docs/examples/account/update-email-verification.md +2 -0
- package/docs/examples/account/update-email.md +2 -0
- package/docs/examples/account/update-magic-url-session.md +2 -0
- package/docs/examples/account/update-mfa-authenticator.md +2 -0
- package/docs/examples/account/update-mfa-challenge.md +2 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/update-mfa.md +2 -0
- package/docs/examples/account/update-name.md +2 -0
- package/docs/examples/account/update-password.md +2 -0
- package/docs/examples/account/update-phone-session.md +2 -0
- package/docs/examples/account/update-phone-verification.md +2 -0
- package/docs/examples/account/update-phone.md +2 -0
- package/docs/examples/account/update-prefs.md +2 -0
- package/docs/examples/account/update-push-target.md +2 -0
- package/docs/examples/account/update-recovery.md +2 -0
- package/docs/examples/account/update-session.md +2 -0
- package/docs/examples/account/update-status.md +2 -0
- package/docs/examples/account/update-verification.md +2 -0
- package/docs/examples/avatars/get-browser.md +2 -0
- package/docs/examples/avatars/get-credit-card.md +2 -0
- package/docs/examples/avatars/get-favicon.md +2 -0
- package/docs/examples/avatars/get-flag.md +2 -0
- package/docs/examples/avatars/get-image.md +2 -0
- package/docs/examples/avatars/get-initials.md +2 -0
- package/docs/examples/avatars/get-qr.md +2 -0
- package/docs/examples/avatars/get-screenshot.md +7 -5
- package/docs/examples/databases/create-document.md +2 -0
- package/docs/examples/databases/create-operations.md +2 -0
- package/docs/examples/databases/create-transaction.md +2 -0
- package/docs/examples/databases/decrement-document-attribute.md +2 -0
- package/docs/examples/databases/delete-document.md +2 -0
- package/docs/examples/databases/delete-transaction.md +2 -0
- package/docs/examples/databases/get-document.md +2 -0
- package/docs/examples/databases/get-transaction.md +2 -0
- package/docs/examples/databases/increment-document-attribute.md +2 -0
- package/docs/examples/databases/list-documents.md +2 -0
- package/docs/examples/databases/list-transactions.md +2 -0
- package/docs/examples/databases/update-document.md +9 -1
- package/docs/examples/databases/update-transaction.md +2 -0
- package/docs/examples/databases/upsert-document.md +9 -1
- package/docs/examples/functions/create-execution.md +2 -0
- package/docs/examples/functions/get-execution.md +2 -0
- package/docs/examples/functions/list-executions.md +2 -0
- package/docs/examples/graphql/mutation.md +2 -0
- package/docs/examples/graphql/query.md +2 -0
- package/docs/examples/locale/get.md +2 -0
- package/docs/examples/locale/list-codes.md +2 -0
- package/docs/examples/locale/list-continents.md +2 -0
- package/docs/examples/locale/list-countries-eu.md +2 -0
- package/docs/examples/locale/list-countries-phones.md +2 -0
- package/docs/examples/locale/list-countries.md +2 -0
- package/docs/examples/locale/list-currencies.md +2 -0
- package/docs/examples/locale/list-languages.md +2 -0
- package/docs/examples/messaging/create-subscriber.md +2 -0
- package/docs/examples/messaging/delete-subscriber.md +2 -0
- package/docs/examples/storage/create-file.md +2 -0
- package/docs/examples/storage/delete-file.md +2 -0
- package/docs/examples/storage/get-file-download.md +2 -0
- package/docs/examples/storage/get-file-preview.md +2 -0
- package/docs/examples/storage/get-file-view.md +2 -0
- package/docs/examples/storage/get-file.md +2 -0
- package/docs/examples/storage/list-files.md +2 -0
- package/docs/examples/storage/update-file.md +2 -0
- package/docs/examples/tablesdb/create-operations.md +2 -0
- package/docs/examples/tablesdb/create-row.md +2 -0
- package/docs/examples/tablesdb/create-transaction.md +2 -0
- package/docs/examples/tablesdb/decrement-row-column.md +2 -0
- package/docs/examples/tablesdb/delete-row.md +2 -0
- package/docs/examples/tablesdb/delete-transaction.md +2 -0
- package/docs/examples/tablesdb/get-row.md +2 -0
- package/docs/examples/tablesdb/get-transaction.md +2 -0
- package/docs/examples/tablesdb/increment-row-column.md +2 -0
- package/docs/examples/tablesdb/list-rows.md +2 -0
- package/docs/examples/tablesdb/list-transactions.md +2 -0
- package/docs/examples/tablesdb/update-row.md +9 -1
- package/docs/examples/tablesdb/update-transaction.md +2 -0
- package/docs/examples/tablesdb/upsert-row.md +9 -1
- package/docs/examples/teams/create-membership.md +2 -0
- package/docs/examples/teams/create.md +2 -0
- package/docs/examples/teams/delete-membership.md +2 -0
- package/docs/examples/teams/delete.md +2 -0
- package/docs/examples/teams/get-membership.md +2 -0
- package/docs/examples/teams/get-prefs.md +2 -0
- package/docs/examples/teams/get.md +2 -0
- package/docs/examples/teams/list-memberships.md +2 -0
- package/docs/examples/teams/list.md +2 -0
- package/docs/examples/teams/update-membership-status.md +2 -0
- package/docs/examples/teams/update-membership.md +2 -0
- package/docs/examples/teams/update-name.md +2 -0
- package/docs/examples/teams/update-prefs.md +2 -0
- package/package.json +6 -3
- package/rollup.config.js +3 -1
- package/src/channel.ts +132 -0
- package/src/client.ts +72 -10
- package/src/enums/browser-permission.ts +22 -0
- package/src/enums/o-auth-provider.ts +2 -1
- package/src/index.ts +3 -2
- package/src/models.ts +8 -0
- package/src/query.ts +54 -9
- package/src/services/account.ts +45 -16
- package/src/services/avatars.ts +20 -19
- package/src/services/databases.ts +5 -9
- package/src/services/graphql.ts +2 -2
- package/src/services/storage.ts +8 -8
- package/types/channel.d.ts +71 -0
- package/types/client.d.ts +2 -1
- package/types/enums/browser-permission.d.ts +22 -0
- package/types/enums/o-auth-provider.d.ts +2 -1
- package/types/index.d.ts +3 -2
- package/types/models.d.ts +8 -0
- package/types/query.d.ts +36 -6
- package/types/services/account.d.ts +17 -5
- package/types/services/avatars.d.ts +12 -11
- package/types/services/databases.d.ts +2 -2
- package/types/services/storage.d.ts +8 -8
- package/src/enums/output.ts +0 -9
- package/types/enums/output.d.ts +0 -9
|
@@ -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: {
|
|
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, 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, 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: {
|
|
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, 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: {
|
|
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
|
+
```
|