react-native-appwrite 0.18.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.
- package/.github/workflows/publish.yml +9 -8
- package/CHANGELOG.md +11 -0
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/cjs/sdk.js +881 -36
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +877 -37
- 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 +37 -0
- 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 +4 -2
- 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 +4 -2
- package/docs/examples/teams/update-name.md +2 -0
- package/docs/examples/teams/update-prefs.md +2 -0
- package/package.json +7 -4
- package/rollup.config.js +3 -1
- package/src/channel.ts +134 -0
- package/src/client.ts +41 -6
- package/src/enums/browser-permission.ts +22 -0
- package/src/enums/o-auth-provider.ts +0 -1
- package/src/enums/roles.ts +5 -0
- package/src/enums/theme.ts +4 -0
- package/src/enums/timezone.ts +421 -0
- package/src/index.ts +6 -1
- package/src/models.ts +8 -0
- package/src/query.ts +54 -9
- package/src/services/account.ts +34 -5
- package/src/services/avatars.ts +348 -0
- package/src/services/databases.ts +5 -9
- package/src/services/storage.ts +8 -8
- package/src/services/teams.ts +19 -18
- package/types/channel.d.ts +71 -0
- package/types/enums/browser-permission.d.ts +22 -0
- package/types/enums/o-auth-provider.d.ts +1 -2
- package/types/enums/roles.d.ts +5 -0
- package/types/enums/theme.d.ts +4 -0
- package/types/enums/timezone.d.ts +421 -0
- package/types/index.d.ts +6 -1
- package/types/models.d.ts +8 -0
- package/types/query.d.ts +36 -6
- package/types/services/account.d.ts +13 -1
- package/types/services/avatars.d.ts +124 -0
- package/types/services/databases.d.ts +2 -2
- package/types/services/storage.d.ts +8 -8
- package/types/services/teams.d.ts +9 -8
- package/.gitpod.yml +0 -10
|
@@ -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
|
+
```
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
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
|
+
```
|