react-native-appwrite 0.2.2 → 0.3.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 +13 -4
- package/CHANGELOG.md +1 -1
- package/LICENSE +1 -1
- package/README.md +22 -9
- package/dist/cjs/sdk.js +1193 -269
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1193 -270
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-anonymous-session.md +6 -13
- package/docs/examples/account/create-email-password-session.md +14 -0
- package/docs/examples/account/create-email-token.md +15 -0
- package/docs/examples/account/create-j-w-t.md +6 -13
- package/docs/examples/account/create-magic-u-r-l-token.md +16 -0
- package/docs/examples/account/create-mfa-authenticator.md +13 -0
- package/docs/examples/account/create-mfa-challenge.md +13 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/create-o-auth2session.md +10 -9
- package/docs/examples/account/create-o-auth2token.md +15 -0
- package/docs/examples/account/create-phone-token.md +14 -0
- package/docs/examples/account/create-phone-verification.md +6 -13
- package/docs/examples/account/create-push-target.md +15 -0
- package/docs/examples/account/create-recovery.md +9 -13
- package/docs/examples/account/create-session.md +14 -0
- package/docs/examples/account/create-verification.md +8 -13
- package/docs/examples/account/create.md +11 -13
- package/docs/examples/account/delete-identity.md +8 -13
- package/docs/examples/account/delete-mfa-authenticator.md +14 -0
- package/docs/examples/account/delete-push-target.md +13 -0
- package/docs/examples/account/delete-session.md +8 -13
- package/docs/examples/account/delete-sessions.md +6 -13
- package/docs/examples/account/get-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/get-prefs.md +6 -13
- package/docs/examples/account/get-session.md +8 -13
- package/docs/examples/account/get.md +6 -13
- package/docs/examples/account/list-identities.md +8 -13
- package/docs/examples/account/list-logs.md +8 -13
- package/docs/examples/account/list-mfa-factors.md +11 -0
- package/docs/examples/account/list-sessions.md +6 -13
- package/docs/examples/account/update-email.md +9 -13
- package/docs/examples/account/update-m-f-a.md +13 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +9 -13
- package/docs/examples/account/update-mfa-authenticator.md +14 -0
- package/docs/examples/account/update-mfa-challenge.md +14 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/update-name.md +8 -13
- package/docs/examples/account/update-password.md +9 -13
- package/docs/examples/account/update-phone-session.md +9 -13
- package/docs/examples/account/update-phone-verification.md +9 -13
- package/docs/examples/account/update-phone.md +9 -13
- package/docs/examples/account/update-prefs.md +8 -13
- package/docs/examples/account/update-push-target.md +14 -0
- package/docs/examples/account/update-recovery.md +10 -13
- package/docs/examples/account/update-session.md +8 -13
- package/docs/examples/account/update-status.md +6 -13
- package/docs/examples/account/update-verification.md +9 -13
- package/docs/examples/avatars/get-browser.md +11 -9
- package/docs/examples/avatars/get-credit-card.md +11 -9
- package/docs/examples/avatars/get-favicon.md +8 -9
- package/docs/examples/avatars/get-flag.md +11 -9
- package/docs/examples/avatars/get-image.md +10 -9
- package/docs/examples/avatars/get-initials.md +11 -9
- package/docs/examples/avatars/get-q-r.md +11 -9
- package/docs/examples/databases/create-document.md +12 -13
- package/docs/examples/databases/delete-document.md +10 -13
- package/docs/examples/databases/get-document.md +11 -13
- package/docs/examples/databases/list-documents.md +10 -13
- package/docs/examples/databases/update-document.md +12 -13
- package/docs/examples/functions/create-execution.md +13 -13
- package/docs/examples/functions/get-execution.md +9 -13
- package/docs/examples/functions/list-executions.md +10 -13
- package/docs/examples/graphql/mutation.md +8 -13
- package/docs/examples/graphql/query.md +8 -13
- package/docs/examples/locale/get.md +6 -13
- package/docs/examples/locale/list-codes.md +6 -13
- package/docs/examples/locale/list-continents.md +6 -13
- package/docs/examples/locale/list-countries-e-u.md +6 -13
- package/docs/examples/locale/list-countries-phones.md +6 -13
- package/docs/examples/locale/list-countries.md +6 -13
- package/docs/examples/locale/list-currencies.md +6 -13
- package/docs/examples/locale/list-languages.md +6 -13
- package/docs/examples/messaging/create-subscriber.md +15 -0
- package/docs/examples/messaging/delete-subscriber.md +14 -0
- package/docs/examples/storage/create-file.md +11 -13
- package/docs/examples/storage/delete-file.md +9 -13
- package/docs/examples/storage/get-file-download.md +9 -9
- package/docs/examples/storage/get-file-preview.md +20 -9
- package/docs/examples/storage/get-file-view.md +9 -9
- package/docs/examples/storage/get-file.md +9 -13
- package/docs/examples/storage/list-files.md +10 -13
- package/docs/examples/storage/update-file.md +11 -13
- package/docs/examples/teams/create-membership.md +14 -13
- package/docs/examples/teams/create.md +10 -13
- package/docs/examples/teams/delete-membership.md +9 -13
- package/docs/examples/teams/delete.md +8 -13
- package/docs/examples/teams/get-membership.md +9 -13
- package/docs/examples/teams/get-prefs.md +8 -13
- package/docs/examples/teams/get.md +8 -13
- package/docs/examples/teams/list-memberships.md +10 -13
- package/docs/examples/teams/list.md +9 -13
- package/docs/examples/teams/update-membership-status.md +11 -13
- package/docs/examples/teams/update-membership.md +10 -13
- package/docs/examples/teams/update-name.md +9 -13
- package/docs/examples/teams/update-prefs.md +9 -13
- package/package.json +1 -1
- package/src/client.ts +37 -11
- package/src/enums/authentication-factor.ts +6 -0
- package/src/enums/authenticator-type.ts +3 -0
- package/src/enums/browser.ts +16 -0
- package/src/enums/credit-card.ts +18 -0
- package/src/enums/execution-method.ts +8 -0
- package/src/enums/flag.ts +197 -0
- package/src/enums/image-format.ts +7 -0
- package/src/enums/image-gravity.ts +11 -0
- package/src/enums/o-auth-provider.ts +41 -0
- package/src/id.ts +23 -4
- package/src/index.ts +13 -2
- package/src/models.ts +174 -0
- package/src/query.ts +61 -34
- package/src/service.ts +4 -7
- package/src/services/account.ts +643 -119
- package/src/services/avatars.ts +12 -6
- package/src/services/databases.ts +7 -4
- package/src/services/functions.ts +6 -2
- package/src/services/graphql.ts +3 -0
- package/src/services/locale.ts +3 -0
- package/src/services/messaging.ts +84 -0
- package/src/services/storage.ts +12 -6
- package/src/services/teams.ts +3 -0
- package/docs/examples/account/create-email-session.md +0 -18
- package/docs/examples/account/create-magic-u-r-l-session.md +0 -18
- package/docs/examples/account/create-phone-session.md +0 -18
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { Client, Databases } from "appwrite";
|
|
1
|
+
import { Client, Databases } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const databases = new Databases(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const promise = databases.deleteDocument('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]');
|
|
9
|
+
const result = await databases.deleteDocument(
|
|
10
|
+
'<DATABASE_ID>', // databaseId
|
|
11
|
+
'<COLLECTION_ID>', // collectionId
|
|
12
|
+
'<DOCUMENT_ID>' // documentId
|
|
13
|
+
);
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
15
|
+
console.log(response);
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { Client, Databases } from "appwrite";
|
|
1
|
+
import { Client, Databases } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const databases = new Databases(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const result = await databases.getDocument(
|
|
10
|
+
'<DATABASE_ID>', // databaseId
|
|
11
|
+
'<COLLECTION_ID>', // collectionId
|
|
12
|
+
'<DOCUMENT_ID>', // documentId
|
|
13
|
+
[] // queries (optional)
|
|
14
|
+
);
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
16
|
+
console.log(response);
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { Client, Databases } from "appwrite";
|
|
1
|
+
import { Client, Databases } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const databases = new Databases(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const promise = databases.listDocuments('[DATABASE_ID]', '[COLLECTION_ID]');
|
|
9
|
+
const result = await databases.listDocuments(
|
|
10
|
+
'<DATABASE_ID>', // databaseId
|
|
11
|
+
'<COLLECTION_ID>', // collectionId
|
|
12
|
+
[] // queries (optional)
|
|
13
|
+
);
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
15
|
+
console.log(response);
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { Client, Databases } from "appwrite";
|
|
1
|
+
import { Client, Databases } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const databases = new Databases(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
);
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
17
|
+
console.log(response);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Client, Functions } from "appwrite";
|
|
1
|
+
import { Client, Functions, ExecutionMethod } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const functions = new Functions(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
);
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
18
|
+
console.log(response);
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { Client, Functions } from "appwrite";
|
|
1
|
+
import { Client, Functions } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const functions = new Functions(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]');
|
|
9
|
+
const result = await functions.getExecution(
|
|
10
|
+
'<FUNCTION_ID>', // functionId
|
|
11
|
+
'<EXECUTION_ID>' // executionId
|
|
12
|
+
);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
14
|
+
console.log(response);
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { Client, Functions } from "appwrite";
|
|
1
|
+
import { Client, Functions } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const functions = new Functions(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const promise = functions.listExecutions('[FUNCTION_ID]');
|
|
9
|
+
const result = await functions.listExecutions(
|
|
10
|
+
'<FUNCTION_ID>', // functionId
|
|
11
|
+
[], // queries (optional)
|
|
12
|
+
'<SEARCH>' // search (optional)
|
|
13
|
+
);
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
15
|
+
console.log(response);
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { Client, Graphql } from "appwrite";
|
|
1
|
+
import { Client, Graphql } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const graphql = new Graphql(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = graphql.mutation({});
|
|
9
|
+
const result = await graphql.mutation(
|
|
10
|
+
{} // query
|
|
11
|
+
);
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
13
|
+
console.log(response);
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { Client, Graphql } from "appwrite";
|
|
1
|
+
import { Client, Graphql } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const graphql = new Graphql(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = graphql.query({});
|
|
9
|
+
const result = await graphql.query(
|
|
10
|
+
{} // query
|
|
11
|
+
);
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
13
|
+
console.log(response);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { Client, Locale } from "appwrite";
|
|
1
|
+
import { Client, Locale } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const locale = new Locale(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
-
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = locale.get();
|
|
9
|
+
const result = await locale.get();
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
11
|
+
console.log(response);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { Client, Locale } from "appwrite";
|
|
1
|
+
import { Client, Locale } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const locale = new Locale(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
-
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = locale.listCodes();
|
|
9
|
+
const result = await locale.listCodes();
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
11
|
+
console.log(response);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { Client, Locale } from "appwrite";
|
|
1
|
+
import { Client, Locale } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const locale = new Locale(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
-
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = locale.listContinents();
|
|
9
|
+
const result = await locale.listContinents();
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
11
|
+
console.log(response);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { Client, Locale } from "appwrite";
|
|
1
|
+
import { Client, Locale } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const locale = new Locale(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
-
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = locale.listCountriesEU();
|
|
9
|
+
const result = await locale.listCountriesEU();
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
11
|
+
console.log(response);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { Client, Locale } from "appwrite";
|
|
1
|
+
import { Client, Locale } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const locale = new Locale(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
-
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = locale.listCountriesPhones();
|
|
9
|
+
const result = await locale.listCountriesPhones();
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
11
|
+
console.log(response);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { Client, Locale } from "appwrite";
|
|
1
|
+
import { Client, Locale } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const locale = new Locale(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
-
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = locale.listCountries();
|
|
9
|
+
const result = await locale.listCountries();
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
11
|
+
console.log(response);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { Client, Locale } from "appwrite";
|
|
1
|
+
import { Client, Locale } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const locale = new Locale(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
-
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = locale.listCurrencies();
|
|
9
|
+
const result = await locale.listCurrencies();
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
11
|
+
console.log(response);
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { Client, Locale } from "appwrite";
|
|
1
|
+
import { Client, Locale } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const locale = new Locale(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
-
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = locale.listLanguages();
|
|
9
|
+
const result = await locale.listLanguages();
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
11
|
+
console.log(response);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Client, Messaging } from "react-native-appwrite";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const messaging = new Messaging(client);
|
|
8
|
+
|
|
9
|
+
const result = await messaging.createSubscriber(
|
|
10
|
+
'<TOPIC_ID>', // topicId
|
|
11
|
+
'<SUBSCRIBER_ID>', // subscriberId
|
|
12
|
+
'<TARGET_ID>' // targetId
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
console.log(response);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Client, Messaging } from "react-native-appwrite";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const messaging = new Messaging(client);
|
|
8
|
+
|
|
9
|
+
const result = await messaging.deleteSubscriber(
|
|
10
|
+
'<TOPIC_ID>', // topicId
|
|
11
|
+
'<SUBSCRIBER_ID>' // subscriberId
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
console.log(response);
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { Client, Storage } from "appwrite";
|
|
1
|
+
import { Client, Storage } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const storage = new Storage(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const result = await storage.createFile(
|
|
10
|
+
'<BUCKET_ID>', // bucketId
|
|
11
|
+
'<FILE_ID>', // fileId
|
|
12
|
+
await pickSingle(), // file
|
|
13
|
+
["read("any")"] // permissions (optional)
|
|
14
|
+
);
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
16
|
+
console.log(response);
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { Client, Storage } from "appwrite";
|
|
1
|
+
import { Client, Storage } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const storage = new Storage(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const promise = storage.deleteFile('[BUCKET_ID]', '[FILE_ID]');
|
|
9
|
+
const result = await storage.deleteFile(
|
|
10
|
+
'<BUCKET_ID>', // bucketId
|
|
11
|
+
'<FILE_ID>' // fileId
|
|
12
|
+
);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
console.log(response); // Success
|
|
16
|
-
}, function (error) {
|
|
17
|
-
console.log(error); // Failure
|
|
18
|
-
});
|
|
14
|
+
console.log(response);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Client, Storage } from "appwrite";
|
|
1
|
+
import { Client, Storage } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const storage = new Storage(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
const result = storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]');
|
|
9
|
+
const result = storage.getFileDownload(
|
|
10
|
+
'<BUCKET_ID>', // bucketId
|
|
11
|
+
'<FILE_ID>' // fileId
|
|
12
|
+
);
|
|
13
13
|
|
|
14
|
-
console.log(result);
|
|
14
|
+
console.log(result);
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import { Client, Storage } from "appwrite";
|
|
1
|
+
import { Client, Storage, ImageGravity, ImageFormat } from "react-native-appwrite";
|
|
2
2
|
|
|
3
|
-
const client = new Client()
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
4
6
|
|
|
5
7
|
const storage = new Storage(client);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
0, // 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
|
+
);
|
|
13
24
|
|
|
14
|
-
console.log(result);
|
|
25
|
+
console.log(result);
|