From 271db5ce69c5f57705fe2f7dbba513c7d1a32eae Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 10 Mar 2024 02:21:50 +0000 Subject: [PATCH 01/16] react native getting started --- docs/sdks/react-native/CHANGELOG.md | 1 + docs/sdks/react-native/GETTING_STARTED.md | 79 +++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 docs/sdks/react-native/CHANGELOG.md create mode 100644 docs/sdks/react-native/GETTING_STARTED.md diff --git a/docs/sdks/react-native/CHANGELOG.md b/docs/sdks/react-native/CHANGELOG.md new file mode 100644 index 0000000000..21fbe5456c --- /dev/null +++ b/docs/sdks/react-native/CHANGELOG.md @@ -0,0 +1 @@ +# Change log \ No newline at end of file diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md new file mode 100644 index 0000000000..4b0fb082da --- /dev/null +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -0,0 +1,79 @@ + +## Getting Started + +### Add your Platform +For you to init your SDK and interact with Appwrite services you need to add a web platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before and click the 'Add Platform' button. + +From the options, choose to add a **Web** platform and add your client app hostname. By adding your hostname to your project platform you are allowing cross-domain communication between your project and the Appwrite API. + +## Setup + +On `index.js` add import for `react-native-url-polyfill` + +``` +import 'react-native-url-polyfill/auto' +``` + +> If you are building for iOS, don't forget to install pods +> `cd ios && pod install && cd ..` + +### Init your SDK +Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page. + +```js +import { Client } from 'react-native-appwrite'; +// Init your Web SDK +const client = new Client(); + +client + .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint + .setProject('455x34dfkj') // Your project ID + .setPlatform('com.example.myappwriteapp') // YOUR application ID +; +``` + +### Make Your First Request +Once your SDK object is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section. + +```js +const account = new Account(client); + +// Register User +account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') + .then(function (response) { + console.log(response); + }, function (error) { + console.log(error); + }); + +``` + +### Full Example +```js +import { Client, Account } from 'react-native-appwrite'; +// Init your Web SDK +const client = new Client(); + +client + .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint + .setProject('455x34dfkj') + .setPlatform('com.example.myappwriteapp') // YOUR application ID +; + +const account = new Account(client); + +// Register User +account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') + .then(function (response) { + console.log(response); + }, function (error) { + console.log(error); + }); +``` + +### Learn more +You can use the following resources to learn more and get help +- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-react-native) +- 📜 [Appwrite Docs](https://appwrite.io/docs) +- 💬 [Discord Community](https://appwrite.io/discord) +- 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native) \ No newline at end of file From c11a1af99ba9139be5a4d3bfb66b722ac9dcb712 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 10 Mar 2024 02:49:45 +0000 Subject: [PATCH 02/16] react native SDK --- app/config/platforms.php | 18 ++++++++++++++++++ composer.json | 2 +- composer.lock | 18 ++++++++++-------- src/Appwrite/Platform/Tasks/SDKs.php | 5 +++++ 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index deb486ce1f..d54a4ae74f 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -135,6 +135,24 @@ return [ 'Java' => 'java', ], ], + [ + 'key' => 'react-native', + 'name' => 'React Native', + 'version' => '0.2.0', + 'url' => 'https://github.com/appwrite/sdk-for-react-native', + 'package' => 'https://npmjs.com/package/react-native-appwrite', + 'enabled' => true, + 'beta' => false, + 'dev' => false, + 'hidden' => false, + 'family' => APP_PLATFORM_CLIENT, + 'prism' => 'javascript', + 'source' => \realpath(__DIR__ . '/../sdks/client-react-native'), + 'gitUrl' => 'git@github.com:appwrite/sdk-for-react-native.git', + 'gitRepoName' => 'sdk-for-react-native', + 'gitUserName' => 'appwrite', + 'gitBranch' => 'dev', + ], [ 'key' => 'graphql', 'name' => 'GraphQL', diff --git a/composer.json b/composer.json index d2984b5802..111b769ce7 100644 --- a/composer.json +++ b/composer.json @@ -79,7 +79,7 @@ }, "require-dev": { "ext-fileinfo": "*", - "appwrite/sdk-generator": "0.37.*", + "appwrite/sdk-generator": "dev-feat-react-native-sdk", "phpunit/phpunit": "9.5.20", "swoole/ide-helper": "5.0.2", "textalk/websocket": "1.5.7", diff --git a/composer.lock b/composer.lock index 046fc70983..6d223cb1b8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "92244aad23e8d26c034633397692c1fc", + "content-hash": "d7086b9ec8459efdacade57e365f2a24", "packages": [ { "name": "adhocore/jwt", @@ -2731,16 +2731,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.37.7", + "version": "dev-feat-react-native-sdk", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "c9c07e8d96b80f62507bbb5ef90fa0769e560621" + "reference": "9f5760babff345f2aa3fa97b3debfbf27f67b9a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/c9c07e8d96b80f62507bbb5ef90fa0769e560621", - "reference": "c9c07e8d96b80f62507bbb5ef90fa0769e560621", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/9f5760babff345f2aa3fa97b3debfbf27f67b9a9", + "reference": "9f5760babff345f2aa3fa97b3debfbf27f67b9a9", "shasum": "" }, "require": { @@ -2776,9 +2776,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.37.7" + "source": "https://github.com/appwrite/sdk-generator/tree/feat-react-native-sdk" }, - "time": "2024-03-09T16:57:18+00:00" + "time": "2024-03-10T02:17:48+00:00" }, { "name": "doctrine/deprecations", @@ -5446,7 +5446,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "appwrite/sdk-generator": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index d5168ea91c..396698af17 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -19,6 +19,7 @@ use Appwrite\SDK\Language\REST; use Appwrite\SDK\Language\Ruby; use Appwrite\SDK\Language\Swift; use Appwrite\SDK\Language\Web; +use Appwrite\SDK\Language\ReactNative; use Appwrite\SDK\SDK; use Appwrite\Spec\Swagger2; use Utopia\CLI\Console; @@ -159,6 +160,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $config = new Flutter(); $config->setPackageName('appwrite'); break; + case 'react-native': + $config = new ReactNative(); + $config->setNPMPackage('react-native-appwrite'); + break; case 'flutter-dev': $config = new Flutter(); $config->setPackageName('appwrite_dev'); From f3927c3d201d1636825d53f0d1bfceec17a4511b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 10 Mar 2024 03:57:54 +0000 Subject: [PATCH 03/16] fix linter --- src/Appwrite/Platform/Tasks/SDKs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index 396698af17..9a82b48ff1 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -15,11 +15,11 @@ use Appwrite\SDK\Language\Kotlin; use Appwrite\SDK\Language\Node; use Appwrite\SDK\Language\PHP; use Appwrite\SDK\Language\Python; +use Appwrite\SDK\Language\ReactNative; use Appwrite\SDK\Language\REST; use Appwrite\SDK\Language\Ruby; use Appwrite\SDK\Language\Swift; use Appwrite\SDK\Language\Web; -use Appwrite\SDK\Language\ReactNative; use Appwrite\SDK\SDK; use Appwrite\Spec\Swagger2; use Utopia\CLI\Console; From ef61879f5e10f43359f2606047f3d9357f23dece Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 10 Mar 2024 04:20:27 +0000 Subject: [PATCH 04/16] fix import --- src/Appwrite/Platform/Tasks/SDKs.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index 9a82b48ff1..bc829bebfd 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -25,6 +25,7 @@ use Appwrite\Spec\Swagger2; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Platform\Action; +use Exception; class SDKs extends Action { From e03102a112a3fb0c1b3cb146325f93e53398dcde Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 12 Mar 2024 08:34:54 +0545 Subject: [PATCH 05/16] Update docs/sdks/react-native/GETTING_STARTED.md Co-authored-by: Vincent (Wen Yu) Ge --- docs/sdks/react-native/GETTING_STARTED.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md index 4b0fb082da..254beb0412 100644 --- a/docs/sdks/react-native/GETTING_STARTED.md +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -2,9 +2,15 @@ ## Getting Started ### Add your Platform -For you to init your SDK and interact with Appwrite services you need to add a web platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before and click the 'Add Platform' button. +If this is your first time using Appwrite, create an account and create your first project. -From the options, choose to add a **Web** platform and add your client app hostname. By adding your hostname to your project platform you are allowing cross-domain communication between your project and the Appwrite API. +Then, under **Add a platform**, add a **Android app** or a **Apple app**. You can skip optional steps. + +#### iOS steps +Add your app **name** and **Bundle ID**. You can find your **Bundle Identifier** in the **General** tab for your app's primary target in XCode. + +#### Android steps +Add your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level [build.gradle](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/build.gradle#L41) file. ## Setup From cfd7534993247d7febc1663faceaa28d1fcc519c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 12 Mar 2024 08:35:10 +0545 Subject: [PATCH 06/16] Update docs/sdks/react-native/GETTING_STARTED.md Co-authored-by: Vincent (Wen Yu) Ge --- docs/sdks/react-native/GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md index 254beb0412..306f0952d3 100644 --- a/docs/sdks/react-native/GETTING_STARTED.md +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -79,7 +79,7 @@ account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') ### Learn more You can use the following resources to learn more and get help -- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-react-native) +- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/quick-starts/react-native)``` - 📜 [Appwrite Docs](https://appwrite.io/docs) - 💬 [Discord Community](https://appwrite.io/discord) - 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native) \ No newline at end of file From 7c7d09514aa1f365a497094f5af8c3c9ceda186f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 12 Mar 2024 08:35:17 +0545 Subject: [PATCH 07/16] Update docs/sdks/react-native/GETTING_STARTED.md Co-authored-by: Vincent (Wen Yu) Ge --- docs/sdks/react-native/GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md index 306f0952d3..7e238bcf08 100644 --- a/docs/sdks/react-native/GETTING_STARTED.md +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -34,7 +34,7 @@ const client = new Client(); client .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint .setProject('455x34dfkj') // Your project ID - .setPlatform('com.example.myappwriteapp') // YOUR application ID + .setPlatform('com.example.myappwriteapp') // Your application ID or bundle ID. ; ``` From 019408ebcdd69e666d87242957db464c1147596e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 11 Apr 2024 05:05:39 +0000 Subject: [PATCH 08/16] composer update --- composer.lock | 58 +++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/composer.lock b/composer.lock index 294595cc2c..8bcb969159 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "78b9cd75952805a2347578f4fcb96add", + "content-hash": "48bd3130a271bca6ef61b90597a49d2b", "packages": [ { "name": "adhocore/jwt", @@ -2337,16 +2337,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.3", + "version": "0.18.4", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "faa0279519ac14f3501e8b138e0865ad9d12bff6" + "reference": "94ab8758fabcefee5c5fa723616e45719833f922" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/faa0279519ac14f3501e8b138e0865ad9d12bff6", - "reference": "faa0279519ac14f3501e8b138e0865ad9d12bff6", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/94ab8758fabcefee5c5fa723616e45719833f922", + "reference": "94ab8758fabcefee5c5fa723616e45719833f922", "shasum": "" }, "require": { @@ -2386,9 +2386,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.3" + "source": "https://github.com/utopia-php/storage/tree/0.18.4" }, - "time": "2023-12-31T11:45:12+00:00" + "time": "2024-04-02T08:24:09+00:00" }, { "name": "utopia-php/swoole", @@ -2731,16 +2731,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.37.9", + "version": "dev-feat-react-native-sdk", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "ad80d80e18f0cda981e1bddbf0841a805632caa0" + "reference": "db41717ab00274333ce2ba82903d58156e193cd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/ad80d80e18f0cda981e1bddbf0841a805632caa0", - "reference": "ad80d80e18f0cda981e1bddbf0841a805632caa0", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/db41717ab00274333ce2ba82903d58156e193cd4", + "reference": "db41717ab00274333ce2ba82903d58156e193cd4", "shasum": "" }, "require": { @@ -2776,9 +2776,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.37.9" + "source": "https://github.com/appwrite/sdk-generator/tree/feat-react-native-sdk" }, - "time": "2024-03-24T05:40:55+00:00" + "time": "2024-04-11T04:43:47+00:00" }, { "name": "doctrine/deprecations", @@ -2899,16 +2899,16 @@ }, { "name": "laravel/pint", - "version": "v1.15.0", + "version": "v1.15.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "c52de679b3ac01207016c179d7ce173e4be128c4" + "reference": "5f288b5e79938cc72f5c298d384e639de87507c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/c52de679b3ac01207016c179d7ce173e4be128c4", - "reference": "c52de679b3ac01207016c179d7ce173e4be128c4", + "url": "https://api.github.com/repos/laravel/pint/zipball/5f288b5e79938cc72f5c298d384e639de87507c6", + "reference": "5f288b5e79938cc72f5c298d384e639de87507c6", "shasum": "" }, "require": { @@ -2919,13 +2919,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.49.0", - "illuminate/view": "^10.43.0", - "larastan/larastan": "^2.8.1", + "friendsofphp/php-cs-fixer": "^3.52.1", + "illuminate/view": "^10.48.4", + "larastan/larastan": "^2.9.2", "laravel-zero/framework": "^10.3.0", - "mockery/mockery": "^1.6.7", + "mockery/mockery": "^1.6.11", "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.33.6" + "pestphp/pest": "^2.34.5" }, "bin": [ "builds/pint" @@ -2961,7 +2961,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-03-26T16:40:24+00:00" + "time": "2024-04-02T14:28:47+00:00" }, { "name": "matthiasmullie/minify", @@ -3561,16 +3561,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.27.0", + "version": "1.28.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "86e4d5a4b036f8f0be1464522f4c6b584c452757" + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/86e4d5a4b036f8f0be1464522f4c6b584c452757", - "reference": "86e4d5a4b036f8f0be1464522f4c6b584c452757", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", "shasum": "" }, "require": { @@ -3602,9 +3602,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.27.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.28.0" }, - "time": "2024-03-21T13:14:53+00:00" + "time": "2024-04-03T18:51:33+00:00" }, { "name": "phpunit/php-code-coverage", From 3f43e239c0082db5ab6f504dd17a93eb52fe9f17 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 11 Apr 2024 05:06:37 +0000 Subject: [PATCH 09/16] fixed --- src/Appwrite/Platform/Tasks/SDKs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index bc829bebfd..4010410bd0 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -22,10 +22,10 @@ use Appwrite\SDK\Language\Swift; use Appwrite\SDK\Language\Web; use Appwrite\SDK\SDK; use Appwrite\Spec\Swagger2; +use Exception; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Platform\Action; -use Exception; class SDKs extends Action { From f7249741954e2378249a29cc0d549443c24679e8 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 11 Apr 2024 05:07:38 +0000 Subject: [PATCH 10/16] update version --- app/config/platforms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index d54a4ae74f..fe332bf9ed 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -138,7 +138,7 @@ return [ [ 'key' => 'react-native', 'name' => 'React Native', - 'version' => '0.2.0', + 'version' => '0.3.0', 'url' => 'https://github.com/appwrite/sdk-for-react-native', 'package' => 'https://npmjs.com/package/react-native-appwrite', 'enabled' => true, From 5976295051101a235f2c948a8491b50e1579a96d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 11 Apr 2024 05:15:10 +0000 Subject: [PATCH 11/16] sdk docs --- app/config/platforms.php | 2 +- .../account/create-anonymous-session.md | 11 ++++++++ .../account/create-email-password-session.md | 14 +++++++++++ .../examples/account/create-email-token.md | 15 +++++++++++ .../examples/account/create-j-w-t.md | 11 ++++++++ .../account/create-magic-u-r-l-token.md | 16 ++++++++++++ .../account/create-mfa-authenticator.md | 13 ++++++++++ .../examples/account/create-mfa-challenge.md | 13 ++++++++++ .../account/create-mfa-recovery-codes.md | 11 ++++++++ .../examples/account/create-o-auth2session.md | 15 +++++++++++ .../examples/account/create-o-auth2token.md | 15 +++++++++++ .../examples/account/create-phone-token.md | 14 +++++++++++ .../account/create-phone-verification.md | 11 ++++++++ .../examples/account/create-push-target.md | 15 +++++++++++ .../examples/account/create-recovery.md | 14 +++++++++++ .../examples/account/create-session.md | 14 +++++++++++ .../examples/account/create-verification.md | 13 ++++++++++ .../examples/account/create.md | 16 ++++++++++++ .../examples/account/delete-identity.md | 13 ++++++++++ .../account/delete-mfa-authenticator.md | 14 +++++++++++ .../examples/account/delete-push-target.md | 13 ++++++++++ .../examples/account/delete-session.md | 13 ++++++++++ .../examples/account/delete-sessions.md | 11 ++++++++ .../account/get-mfa-recovery-codes.md | 11 ++++++++ .../examples/account/get-prefs.md | 11 ++++++++ .../examples/account/get-session.md | 13 ++++++++++ .../examples/account/get.md | 11 ++++++++ .../examples/account/list-identities.md | 13 ++++++++++ .../examples/account/list-logs.md | 13 ++++++++++ .../examples/account/list-mfa-factors.md | 11 ++++++++ .../examples/account/list-sessions.md | 11 ++++++++ .../examples/account/update-email.md | 14 +++++++++++ .../examples/account/update-m-f-a.md | 13 ++++++++++ .../account/update-magic-u-r-l-session.md | 14 +++++++++++ .../account/update-mfa-authenticator.md | 14 +++++++++++ .../examples/account/update-mfa-challenge.md | 14 +++++++++++ .../account/update-mfa-recovery-codes.md | 11 ++++++++ .../examples/account/update-name.md | 13 ++++++++++ .../examples/account/update-password.md | 14 +++++++++++ .../examples/account/update-phone-session.md | 14 +++++++++++ .../account/update-phone-verification.md | 14 +++++++++++ .../examples/account/update-phone.md | 14 +++++++++++ .../examples/account/update-prefs.md | 13 ++++++++++ .../examples/account/update-push-target.md | 14 +++++++++++ .../examples/account/update-recovery.md | 15 +++++++++++ .../examples/account/update-session.md | 13 ++++++++++ .../examples/account/update-status.md | 11 ++++++++ .../examples/account/update-verification.md | 14 +++++++++++ .../examples/avatars/get-browser.md | 16 ++++++++++++ .../examples/avatars/get-credit-card.md | 16 ++++++++++++ .../examples/avatars/get-favicon.md | 13 ++++++++++ .../examples/avatars/get-flag.md | 16 ++++++++++++ .../examples/avatars/get-image.md | 15 +++++++++++ .../examples/avatars/get-initials.md | 16 ++++++++++++ .../examples/avatars/get-q-r.md | 16 ++++++++++++ .../examples/databases/create-document.md | 17 +++++++++++++ .../examples/databases/delete-document.md | 15 +++++++++++ .../examples/databases/get-document.md | 16 ++++++++++++ .../examples/databases/list-documents.md | 15 +++++++++++ .../examples/databases/update-document.md | 17 +++++++++++++ .../examples/functions/create-execution.md | 18 +++++++++++++ .../examples/functions/get-execution.md | 14 +++++++++++ .../examples/functions/list-executions.md | 15 +++++++++++ .../examples/graphql/mutation.md | 13 ++++++++++ .../examples/graphql/query.md | 13 ++++++++++ .../examples/locale/get.md | 11 ++++++++ .../examples/locale/list-codes.md | 11 ++++++++ .../examples/locale/list-continents.md | 11 ++++++++ .../examples/locale/list-countries-e-u.md | 11 ++++++++ .../examples/locale/list-countries-phones.md | 11 ++++++++ .../examples/locale/list-countries.md | 11 ++++++++ .../examples/locale/list-currencies.md | 11 ++++++++ .../examples/locale/list-languages.md | 11 ++++++++ .../examples/messaging/create-subscriber.md | 15 +++++++++++ .../examples/messaging/delete-subscriber.md | 14 +++++++++++ .../examples/storage/create-file.md | 16 ++++++++++++ .../examples/storage/delete-file.md | 14 +++++++++++ .../examples/storage/get-file-download.md | 14 +++++++++++ .../examples/storage/get-file-preview.md | 25 +++++++++++++++++++ .../examples/storage/get-file-view.md | 14 +++++++++++ .../examples/storage/get-file.md | 14 +++++++++++ .../examples/storage/list-files.md | 15 +++++++++++ .../examples/storage/update-file.md | 16 ++++++++++++ .../examples/teams/create-membership.md | 19 ++++++++++++++ .../examples/teams/create.md | 15 +++++++++++ .../examples/teams/delete-membership.md | 14 +++++++++++ .../examples/teams/delete.md | 13 ++++++++++ .../examples/teams/get-membership.md | 14 +++++++++++ .../examples/teams/get-prefs.md | 13 ++++++++++ .../client-react-native/examples/teams/get.md | 13 ++++++++++ .../examples/teams/list-memberships.md | 15 +++++++++++ .../examples/teams/list.md | 14 +++++++++++ .../teams/update-membership-status.md | 16 ++++++++++++ .../examples/teams/update-membership.md | 15 +++++++++++ .../examples/teams/update-name.md | 14 +++++++++++ .../examples/teams/update-prefs.md | 14 +++++++++++ 96 files changed, 1314 insertions(+), 1 deletion(-) create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-anonymous-session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-email-password-session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-email-token.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-j-w-t.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-magic-u-r-l-token.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-mfa-authenticator.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-mfa-challenge.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-mfa-recovery-codes.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2token.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-phone-token.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-phone-verification.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-push-target.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-recovery.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create-verification.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/create.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/delete-identity.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/delete-mfa-authenticator.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/delete-push-target.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/delete-session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/delete-sessions.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/get-mfa-recovery-codes.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/get-prefs.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/get-session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/get.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/list-identities.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/list-logs.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/list-mfa-factors.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/list-sessions.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-email.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-m-f-a.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-magic-u-r-l-session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-mfa-authenticator.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-mfa-challenge.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-mfa-recovery-codes.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-name.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-password.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-phone-session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-phone-verification.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-phone.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-prefs.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-push-target.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-recovery.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-session.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-status.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/account/update-verification.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/avatars/get-browser.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/avatars/get-credit-card.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/avatars/get-favicon.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/avatars/get-flag.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/avatars/get-image.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/avatars/get-initials.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/avatars/get-q-r.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/databases/create-document.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/databases/delete-document.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/databases/get-document.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/databases/list-documents.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/databases/update-document.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/functions/create-execution.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/functions/get-execution.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/functions/list-executions.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/graphql/mutation.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/graphql/query.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/locale/get.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/locale/list-codes.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/locale/list-continents.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/locale/list-countries-e-u.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/locale/list-countries-phones.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/locale/list-countries.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/locale/list-currencies.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/locale/list-languages.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/messaging/create-subscriber.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/messaging/delete-subscriber.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/storage/create-file.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/storage/delete-file.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/storage/get-file-download.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/storage/get-file-preview.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/storage/get-file-view.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/storage/get-file.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/storage/list-files.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/storage/update-file.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/create-membership.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/create.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/delete-membership.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/delete.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/get-membership.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/get-prefs.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/get.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/list-memberships.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/list.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/update-membership-status.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/update-membership.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/update-name.md create mode 100644 docs/examples/1.5.x/client-react-native/examples/teams/update-prefs.md diff --git a/app/config/platforms.php b/app/config/platforms.php index fe332bf9ed..7db00e87ee 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -148,7 +148,7 @@ return [ 'family' => APP_PLATFORM_CLIENT, 'prism' => 'javascript', 'source' => \realpath(__DIR__ . '/../sdks/client-react-native'), - 'gitUrl' => 'git@github.com:appwrite/sdk-for-react-native.git', + 'gitUrl' => 'https://github.com/appwrite/sdk-for-react-native.git', 'gitRepoName' => 'sdk-for-react-native', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-anonymous-session.md b/docs/examples/1.5.x/client-react-native/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..1c807bdc96 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createAnonymousSession(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-email-password-session.md b/docs/examples/1.5.x/client-react-native/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..d338cbe233 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-email-password-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailPasswordSession( + 'email@example.com', // email + 'password' // password +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-email-token.md b/docs/examples/1.5.x/client-react-native/examples/account/create-email-token.md new file mode 100644 index 0000000000..cb2a31145b --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-email-token.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailToken( + '', // userId + 'email@example.com', // email + false // phrase (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-j-w-t.md b/docs/examples/1.5.x/client-react-native/examples/account/create-j-w-t.md new file mode 100644 index 0000000000..88ea31c5a3 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-j-w-t.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createJWT(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-magic-u-r-l-token.md b/docs/examples/1.5.x/client-react-native/examples/account/create-magic-u-r-l-token.md new file mode 100644 index 0000000000..f2e7e8faf6 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-magic-u-r-l-token.md @@ -0,0 +1,16 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createMagicURLToken( + '', // userId + 'email@example.com', // email + 'https://example.com', // url (optional) + false // phrase (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-authenticator.md b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..88bc313a88 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createMfaAuthenticator( + AuthenticatorType.Totp // type +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-challenge.md b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..119a204f0b --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-challenge.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticationFactor } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createMfaChallenge( + AuthenticationFactor.Email // factor +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..4ffd8a39a1 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createMfaRecoveryCodes(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2session.md b/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2session.md new file mode 100644 index 0000000000..2302aaaa1e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2session.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Session( + OAuthProvider.Amazon, // provider + 'https://example.com', // success (optional) + 'https://example.com', // failure (optional) + [] // scopes (optional) +); + diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2token.md b/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2token.md new file mode 100644 index 0000000000..3479924e64 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2token.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token( + OAuthProvider.Amazon, // provider + 'https://example.com', // success (optional) + 'https://example.com', // failure (optional) + [] // scopes (optional) +); + diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-phone-token.md b/docs/examples/1.5.x/client-react-native/examples/account/create-phone-token.md new file mode 100644 index 0000000000..93fc1b7f51 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-phone-token.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneToken( + '', // userId + '+12065550100' // phone +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-phone-verification.md b/docs/examples/1.5.x/client-react-native/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..28833c1806 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-phone-verification.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneVerification(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-push-target.md b/docs/examples/1.5.x/client-react-native/examples/account/create-push-target.md new file mode 100644 index 0000000000..dd15821eaa --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-push-target.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createPushTarget( + '', // targetId + '', // identifier + '' // providerId (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-recovery.md b/docs/examples/1.5.x/client-react-native/examples/account/create-recovery.md new file mode 100644 index 0000000000..5d2855486b --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createRecovery( + 'email@example.com', // email + 'https://example.com' // url +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-session.md b/docs/examples/1.5.x/client-react-native/examples/account/create-session.md new file mode 100644 index 0000000000..f8a9f109a7 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createSession( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-verification.md b/docs/examples/1.5.x/client-react-native/examples/account/create-verification.md new file mode 100644 index 0000000000..d072126c4e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-verification.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createVerification( + 'https://example.com' // url +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create.md b/docs/examples/1.5.x/client-react-native/examples/account/create.md new file mode 100644 index 0000000000..300f59b219 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create.md @@ -0,0 +1,16 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.create( + '', // userId + 'email@example.com', // email + '', // password + '' // name (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-identity.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-identity.md new file mode 100644 index 0000000000..9ff1bbd35d --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-identity.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteIdentity( + '' // identityId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-mfa-authenticator.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..c5f5695ddf --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,14 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteMfaAuthenticator( + AuthenticatorType.Totp, // type + '' // otp +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-push-target.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-push-target.md new file mode 100644 index 0000000000..351b933bd0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-push-target.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deletePushTarget( + '' // targetId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-session.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-session.md new file mode 100644 index 0000000000..22966495c1 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSession( + '' // sessionId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-sessions.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-sessions.md new file mode 100644 index 0000000000..b0967bf019 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSessions(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.5.x/client-react-native/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..d1c38fdde0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.getMfaRecoveryCodes(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/get-prefs.md b/docs/examples/1.5.x/client-react-native/examples/account/get-prefs.md new file mode 100644 index 0000000000..b2502d7b19 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/get-prefs.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.getPrefs(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/get-session.md b/docs/examples/1.5.x/client-react-native/examples/account/get-session.md new file mode 100644 index 0000000000..3ecb79feee --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/get-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.getSession( + '' // sessionId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/get.md b/docs/examples/1.5.x/client-react-native/examples/account/get.md new file mode 100644 index 0000000000..94f0779d53 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/get.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.get(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/list-identities.md b/docs/examples/1.5.x/client-react-native/examples/account/list-identities.md new file mode 100644 index 0000000000..e7ca637afe --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/list-identities.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.listIdentities( + [] // queries (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/list-logs.md b/docs/examples/1.5.x/client-react-native/examples/account/list-logs.md new file mode 100644 index 0000000000..424f8d76af --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/list-logs.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.listLogs( + [] // queries (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/list-mfa-factors.md b/docs/examples/1.5.x/client-react-native/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..c6343a732e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.listMfaFactors(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/list-sessions.md b/docs/examples/1.5.x/client-react-native/examples/account/list-sessions.md new file mode 100644 index 0000000000..b0840c59e3 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/list-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.listSessions(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-email.md b/docs/examples/1.5.x/client-react-native/examples/account/update-email.md new file mode 100644 index 0000000000..560581e63c --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-email.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmail( + 'email@example.com', // email + 'password' // password +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-m-f-a.md b/docs/examples/1.5.x/client-react-native/examples/account/update-m-f-a.md new file mode 100644 index 0000000000..38fd716c6a --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-m-f-a.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFA( + false // mfa +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.5.x/client-react-native/examples/account/update-magic-u-r-l-session.md new file mode 100644 index 0000000000..bb0c000126 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-magic-u-r-l-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMagicURLSession( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-authenticator.md b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..d8ec7aed65 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-authenticator.md @@ -0,0 +1,14 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMfaAuthenticator( + AuthenticatorType.Totp, // type + '' // otp +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-challenge.md b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..7d87506457 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMfaChallenge( + '', // challengeId + '' // otp +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..cfbbf6f3c8 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMfaRecoveryCodes(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-name.md b/docs/examples/1.5.x/client-react-native/examples/account/update-name.md new file mode 100644 index 0000000000..8a403f2ab1 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-name.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateName( + '' // name +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-password.md b/docs/examples/1.5.x/client-react-native/examples/account/update-password.md new file mode 100644 index 0000000000..09edf09182 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-password.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePassword( + '', // password + 'password' // oldPassword (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-phone-session.md b/docs/examples/1.5.x/client-react-native/examples/account/update-phone-session.md new file mode 100644 index 0000000000..cf026227fc --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-phone-verification.md b/docs/examples/1.5.x/client-react-native/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..8467309a06 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-phone-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneVerification( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-phone.md b/docs/examples/1.5.x/client-react-native/examples/account/update-phone.md new file mode 100644 index 0000000000..46efc14142 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-phone.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhone( + '+12065550100', // phone + 'password' // password +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-prefs.md b/docs/examples/1.5.x/client-react-native/examples/account/update-prefs.md new file mode 100644 index 0000000000..a3ff8c3408 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-prefs.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePrefs( + {} // prefs +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-push-target.md b/docs/examples/1.5.x/client-react-native/examples/account/update-push-target.md new file mode 100644 index 0000000000..8096568d55 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-push-target.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePushTarget( + '', // targetId + '' // identifier +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-recovery.md b/docs/examples/1.5.x/client-react-native/examples/account/update-recovery.md new file mode 100644 index 0000000000..1ee93d35f9 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateRecovery( + '', // userId + '', // secret + '' // password +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-session.md b/docs/examples/1.5.x/client-react-native/examples/account/update-session.md new file mode 100644 index 0000000000..397e07edc2 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateSession( + '' // sessionId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-status.md b/docs/examples/1.5.x/client-react-native/examples/account/update-status.md new file mode 100644 index 0000000000..27ce518621 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-status.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateStatus(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-verification.md b/docs/examples/1.5.x/client-react-native/examples/account/update-verification.md new file mode 100644 index 0000000000..0007335fa5 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateVerification( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-browser.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-browser.md new file mode 100644 index 0000000000..9ceb1a39cf --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-browser.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Browser } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getBrowser( + Browser.AvantBrowser, // code + 0, // width (optional) + 0, // height (optional) + 0 // quality (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-credit-card.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..0de631974a --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-credit-card.md @@ -0,0 +1,16 @@ +import { Client, Avatars, CreditCard } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard( + CreditCard.AmericanExpress, // code + 0, // width (optional) + 0, // height (optional) + 0 // quality (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-favicon.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..6e23a774c0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-favicon.md @@ -0,0 +1,13 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFavicon( + 'https://example.com' // url +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-flag.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-flag.md new file mode 100644 index 0000000000..6761052394 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-flag.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Flag } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFlag( + Flag.Afghanistan, // code + 0, // width (optional) + 0, // height (optional) + 0 // quality (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-image.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-image.md new file mode 100644 index 0000000000..b4956df8f1 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getImage( + 'https://example.com', // url + 0, // width (optional) + 0 // height (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-initials.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-initials.md new file mode 100644 index 0000000000..ba70a9cb03 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getInitials( + '', // name (optional) + 0, // width (optional) + 0, // height (optional) + '' // background (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-q-r.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..d4f2db2df8 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-q-r.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getQR( + '', // text + 1, // size (optional) + 0, // margin (optional) + false // download (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/create-document.md b/docs/examples/1.5.x/client-react-native/examples/databases/create-document.md new file mode 100644 index 0000000000..15d1afcdc3 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/create-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocument( + '', // databaseId + '', // collectionId + '', // documentId + {}, // data + ["read("any")"] // permissions (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/delete-document.md b/docs/examples/1.5.x/client-react-native/examples/databases/delete-document.md new file mode 100644 index 0000000000..f6fef3bcdf --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/delete-document.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocument( + '', // databaseId + '', // collectionId + '' // documentId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/get-document.md b/docs/examples/1.5.x/client-react-native/examples/databases/get-document.md new file mode 100644 index 0000000000..502f2f4640 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/get-document.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getDocument( + '', // databaseId + '', // collectionId + '', // documentId + [] // queries (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/list-documents.md b/docs/examples/1.5.x/client-react-native/examples/databases/list-documents.md new file mode 100644 index 0000000000..90dcd6318c --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/list-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocuments( + '', // databaseId + '', // collectionId + [] // queries (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/update-document.md b/docs/examples/1.5.x/client-react-native/examples/databases/update-document.md new file mode 100644 index 0000000000..fa04f2134a --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/update-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocument( + '', // databaseId + '', // collectionId + '', // documentId + {}, // data (optional) + ["read("any")"] // permissions (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/functions/create-execution.md b/docs/examples/1.5.x/client-react-native/examples/functions/create-execution.md new file mode 100644 index 0000000000..1b4bfaa609 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/functions/create-execution.md @@ -0,0 +1,18 @@ +import { Client, Functions, ExecutionMethod } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createExecution( + '', // functionId + '', // body (optional) + false, // async (optional) + '', // path (optional) + ExecutionMethod.GET, // method (optional) + {} // headers (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/functions/get-execution.md b/docs/examples/1.5.x/client-react-native/examples/functions/get-execution.md new file mode 100644 index 0000000000..adda043543 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/functions/get-execution.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getExecution( + '', // functionId + '' // executionId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/functions/list-executions.md b/docs/examples/1.5.x/client-react-native/examples/functions/list-executions.md new file mode 100644 index 0000000000..b1fdd6bd6f --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/functions/list-executions.md @@ -0,0 +1,15 @@ +import { Client, Functions } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listExecutions( + '', // functionId + [], // queries (optional) + '' // search (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/graphql/mutation.md b/docs/examples/1.5.x/client-react-native/examples/graphql/mutation.md new file mode 100644 index 0000000000..b3c3583804 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.mutation( + {} // query +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/graphql/query.md b/docs/examples/1.5.x/client-react-native/examples/graphql/query.md new file mode 100644 index 0000000000..e15400d05d --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/graphql/query.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.query( + {} // query +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/get.md b/docs/examples/1.5.x/client-react-native/examples/locale/get.md new file mode 100644 index 0000000000..4af9df39bc --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/get.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.get(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-codes.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-codes.md new file mode 100644 index 0000000000..8737fde873 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCodes(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-continents.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-continents.md new file mode 100644 index 0000000000..e8c3920a17 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listContinents(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-e-u.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-e-u.md new file mode 100644 index 0000000000..0a2abc53c7 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-e-u.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesEU(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-phones.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..d4d00ae394 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesPhones(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-countries.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries.md new file mode 100644 index 0000000000..8839b6f039 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountries(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-currencies.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-currencies.md new file mode 100644 index 0000000000..6700ef1292 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-currencies.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCurrencies(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-languages.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-languages.md new file mode 100644 index 0000000000..db9b17294e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-languages.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listLanguages(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/messaging/create-subscriber.md b/docs/examples/1.5.x/client-react-native/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..bf5a0cec1d --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSubscriber( + '', // topicId + '', // subscriberId + '' // targetId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/messaging/delete-subscriber.md b/docs/examples/1.5.x/client-react-native/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..da995fc419 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteSubscriber( + '', // topicId + '' // subscriberId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/create-file.md b/docs/examples/1.5.x/client-react-native/examples/storage/create-file.md new file mode 100644 index 0000000000..73908c6de0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/create-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createFile( + '', // bucketId + '', // fileId + await pickSingle(), // file + ["read("any")"] // permissions (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/delete-file.md b/docs/examples/1.5.x/client-react-native/examples/storage/delete-file.md new file mode 100644 index 0000000000..4373ebec04 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteFile( + '', // bucketId + '' // fileId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/get-file-download.md b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-download.md new file mode 100644 index 0000000000..943bf9dd76 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-download.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileDownload( + '', // bucketId + '' // fileId +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/get-file-preview.md b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..76713c8694 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-preview.md @@ -0,0 +1,25 @@ +import { Client, Storage, ImageGravity, ImageFormat } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFilePreview( + '', // bucketId + '', // fileId + 0, // width (optional) + 0, // height (optional) + ImageGravity.Center, // gravity (optional) + 0, // quality (optional) + 0, // borderWidth (optional) + '', // borderColor (optional) + 0, // borderRadius (optional) + 0, // opacity (optional) + -360, // rotation (optional) + '', // background (optional) + ImageFormat.Jpg // output (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/get-file-view.md b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-view.md new file mode 100644 index 0000000000..b551e02405 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-view.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileView( + '', // bucketId + '' // fileId +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/get-file.md b/docs/examples/1.5.x/client-react-native/examples/storage/get-file.md new file mode 100644 index 0000000000..8731c8463d --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/get-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getFile( + '', // bucketId + '' // fileId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/list-files.md b/docs/examples/1.5.x/client-react-native/examples/storage/list-files.md new file mode 100644 index 0000000000..c72b9ba8a5 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/list-files.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listFiles( + '', // bucketId + [], // queries (optional) + '' // search (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/update-file.md b/docs/examples/1.5.x/client-react-native/examples/storage/update-file.md new file mode 100644 index 0000000000..87f81ab038 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/update-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateFile( + '', // bucketId + '', // fileId + '', // name (optional) + ["read("any")"] // permissions (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/create-membership.md b/docs/examples/1.5.x/client-react-native/examples/teams/create-membership.md new file mode 100644 index 0000000000..a5d6fa043e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.createMembership( + '', // teamId + [], // roles + 'email@example.com', // email (optional) + '', // userId (optional) + '+12065550100', // phone (optional) + 'https://example.com', // url (optional) + '' // name (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/create.md b/docs/examples/1.5.x/client-react-native/examples/teams/create.md new file mode 100644 index 0000000000..f61df435a2 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/create.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.create( + '', // teamId + '', // name + [] // roles (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/delete-membership.md b/docs/examples/1.5.x/client-react-native/examples/teams/delete-membership.md new file mode 100644 index 0000000000..f5ed1bcf9c --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteMembership( + '', // teamId + '' // membershipId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/delete.md b/docs/examples/1.5.x/client-react-native/examples/teams/delete.md new file mode 100644 index 0000000000..77dac565b0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/delete.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.delete( + '' // teamId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/get-membership.md b/docs/examples/1.5.x/client-react-native/examples/teams/get-membership.md new file mode 100644 index 0000000000..44a664c5db --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/get-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getMembership( + '', // teamId + '' // membershipId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/get-prefs.md b/docs/examples/1.5.x/client-react-native/examples/teams/get-prefs.md new file mode 100644 index 0000000000..5f7cf16921 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/get-prefs.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getPrefs( + '' // teamId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/get.md b/docs/examples/1.5.x/client-react-native/examples/teams/get.md new file mode 100644 index 0000000000..28d8895c9c --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/get.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.get( + '' // teamId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/list-memberships.md b/docs/examples/1.5.x/client-react-native/examples/teams/list-memberships.md new file mode 100644 index 0000000000..afc2e39d20 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/list-memberships.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listMemberships( + '', // teamId + [], // queries (optional) + '' // search (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/list.md b/docs/examples/1.5.x/client-react-native/examples/teams/list.md new file mode 100644 index 0000000000..cd97431d14 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/list.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.list( + [], // queries (optional) + '' // search (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/update-membership-status.md b/docs/examples/1.5.x/client-react-native/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..85eecb9320 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/update-membership-status.md @@ -0,0 +1,16 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembershipStatus( + '', // teamId + '', // membershipId + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/update-membership.md b/docs/examples/1.5.x/client-react-native/examples/teams/update-membership.md new file mode 100644 index 0000000000..684c40a2d0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/update-membership.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembership( + '', // teamId + '', // membershipId + [] // roles +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/update-name.md b/docs/examples/1.5.x/client-react-native/examples/teams/update-name.md new file mode 100644 index 0000000000..75f3fda4ef --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/update-name.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateName( + '', // teamId + '' // name +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/update-prefs.md b/docs/examples/1.5.x/client-react-native/examples/teams/update-prefs.md new file mode 100644 index 0000000000..f9c4c21623 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/update-prefs.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updatePrefs( + '', // teamId + {} // prefs +); + +console.log(response); From b76f91218c191339349acb431f78fb18340a3541 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 25 Apr 2024 08:56:17 +0000 Subject: [PATCH 12/16] fixes --- app/config/platforms.php | 2 +- src/Appwrite/Platform/Tasks/SDKs.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index a62717744f..d839345056 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -148,7 +148,7 @@ return [ 'family' => APP_PLATFORM_CLIENT, 'prism' => 'javascript', 'source' => \realpath(__DIR__ . '/../sdks/client-react-native'), - 'gitUrl' => 'https://github.com/appwrite/sdk-for-react-native.git', + 'gitUrl' => 'git@github.com:appwrite/sdk-for-react-native.git', 'gitRepoName' => 'sdk-for-react-native', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index d2d8642d84..22b3234027 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -22,7 +22,6 @@ use Appwrite\SDK\Language\Swift; use Appwrite\SDK\Language\Web; use Appwrite\SDK\SDK; use Appwrite\Spec\Swagger2; -use Exception; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Platform\Action; From 3451dd3f4b3d324af2b131371f8587db191a7149 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 28 Apr 2024 01:38:21 +0000 Subject: [PATCH 13/16] fix typo --- docs/sdks/react-native/GETTING_STARTED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md index 7e238bcf08..1cb971e9c2 100644 --- a/docs/sdks/react-native/GETTING_STARTED.md +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -28,7 +28,7 @@ Initialize your SDK with your Appwrite server API endpoint and project ID which ```js import { Client } from 'react-native-appwrite'; -// Init your Web SDK +// Init your React Native SDK const client = new Client(); client @@ -57,7 +57,7 @@ account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') ### Full Example ```js import { Client, Account } from 'react-native-appwrite'; -// Init your Web SDK +// Init your React Native SDK const client = new Client(); client From 665812c28ba94db44fecb5bc2e71003e4c7ed1ac Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 28 Apr 2024 01:38:46 +0000 Subject: [PATCH 14/16] fix typo --- docs/sdks/react-native/GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md index 1cb971e9c2..0f3695040d 100644 --- a/docs/sdks/react-native/GETTING_STARTED.md +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -79,7 +79,7 @@ account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') ### Learn more You can use the following resources to learn more and get help -- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/quick-starts/react-native)``` +- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/quick-starts/react-native) - 📜 [Appwrite Docs](https://appwrite.io/docs) - 💬 [Discord Community](https://appwrite.io/discord) - 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native) \ No newline at end of file From ef0b27840ccd8bd51a7349efe8802898e98dccaf Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 30 Apr 2024 11:51:36 +0000 Subject: [PATCH 15/16] update readme --- docs/sdks/react-native/GETTING_STARTED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md index 0f3695040d..9d07eec54a 100644 --- a/docs/sdks/react-native/GETTING_STARTED.md +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -7,10 +7,10 @@ If this is your first time using Appwrite, create an account and create your fir Then, under **Add a platform**, add a **Android app** or a **Apple app**. You can skip optional steps. #### iOS steps -Add your app **name** and **Bundle ID**. You can find your **Bundle Identifier** in the **General** tab for your app's primary target in XCode. +Add your app **name** and **Bundle ID**. You can find your **Bundle Identifier** in the **General** tab for your app's primary target in XCode. For Expo projects you can set or find it on **app.json** file at your project's root directory. #### Android steps -Add your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level [build.gradle](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/build.gradle#L41) file. +Add your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level **build.gradle** file. For Expo projects you can set or find it on **app.json** file at your project's root directory. ## Setup From 64d4ede05dc9433c1d368c4cc0bc88575cc14459 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 1 May 2024 08:55:45 +0000 Subject: [PATCH 16/16] mark beta --- app/config/platforms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index d839345056..28ad9e2f37 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -142,7 +142,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-react-native', 'package' => 'https://npmjs.com/package/react-native-appwrite', 'enabled' => true, - 'beta' => false, + 'beta' => true, 'dev' => false, 'hidden' => false, 'family' => APP_PLATFORM_CLIENT,