@appwrite.io/console 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +18 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE +12 -0
- package/README.md +111 -0
- package/dist/cjs/package.json +3 -0
- package/dist/esm/package.json +3 -0
- package/docs/examples/account/create-anonymous-session.md +18 -0
- package/docs/examples/account/create-email-session.md +18 -0
- package/docs/examples/account/create-j-w-t.md +18 -0
- package/docs/examples/account/create-magic-u-r-l-session.md +18 -0
- package/docs/examples/account/create-o-auth2session.md +14 -0
- package/docs/examples/account/create-phone-session.md +18 -0
- package/docs/examples/account/create-phone-verification.md +18 -0
- package/docs/examples/account/create-recovery.md +18 -0
- package/docs/examples/account/create-verification.md +18 -0
- package/docs/examples/account/create.md +18 -0
- package/docs/examples/account/delete-session.md +18 -0
- package/docs/examples/account/delete-sessions.md +18 -0
- package/docs/examples/account/get-prefs.md +18 -0
- package/docs/examples/account/get-session.md +18 -0
- package/docs/examples/account/get.md +18 -0
- package/docs/examples/account/list-logs.md +18 -0
- package/docs/examples/account/list-sessions.md +18 -0
- package/docs/examples/account/update-email.md +18 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +18 -0
- package/docs/examples/account/update-name.md +18 -0
- package/docs/examples/account/update-password.md +18 -0
- package/docs/examples/account/update-phone-session.md +18 -0
- package/docs/examples/account/update-phone-verification.md +18 -0
- package/docs/examples/account/update-phone.md +18 -0
- package/docs/examples/account/update-prefs.md +18 -0
- package/docs/examples/account/update-recovery.md +18 -0
- package/docs/examples/account/update-session.md +18 -0
- package/docs/examples/account/update-status.md +18 -0
- package/docs/examples/account/update-verification.md +18 -0
- package/docs/examples/avatars/get-browser.md +14 -0
- package/docs/examples/avatars/get-credit-card.md +14 -0
- package/docs/examples/avatars/get-favicon.md +14 -0
- package/docs/examples/avatars/get-flag.md +14 -0
- package/docs/examples/avatars/get-image.md +14 -0
- package/docs/examples/avatars/get-initials.md +14 -0
- package/docs/examples/avatars/get-q-r.md +14 -0
- package/docs/examples/databases/create-boolean-attribute.md +18 -0
- package/docs/examples/databases/create-collection.md +18 -0
- package/docs/examples/databases/create-datetime-attribute.md +18 -0
- package/docs/examples/databases/create-document.md +18 -0
- package/docs/examples/databases/create-email-attribute.md +18 -0
- package/docs/examples/databases/create-enum-attribute.md +18 -0
- package/docs/examples/databases/create-float-attribute.md +18 -0
- package/docs/examples/databases/create-index.md +18 -0
- package/docs/examples/databases/create-integer-attribute.md +18 -0
- package/docs/examples/databases/create-ip-attribute.md +18 -0
- package/docs/examples/databases/create-string-attribute.md +18 -0
- package/docs/examples/databases/create-url-attribute.md +18 -0
- package/docs/examples/databases/create.md +18 -0
- package/docs/examples/databases/delete-attribute.md +18 -0
- package/docs/examples/databases/delete-collection.md +18 -0
- package/docs/examples/databases/delete-document.md +18 -0
- package/docs/examples/databases/delete-index.md +18 -0
- package/docs/examples/databases/delete.md +18 -0
- package/docs/examples/databases/get-attribute.md +18 -0
- package/docs/examples/databases/get-collection-usage.md +18 -0
- package/docs/examples/databases/get-collection.md +18 -0
- package/docs/examples/databases/get-database-usage.md +18 -0
- package/docs/examples/databases/get-document.md +18 -0
- package/docs/examples/databases/get-index.md +18 -0
- package/docs/examples/databases/get-usage.md +18 -0
- package/docs/examples/databases/get.md +18 -0
- package/docs/examples/databases/list-attributes.md +18 -0
- package/docs/examples/databases/list-collection-logs.md +18 -0
- package/docs/examples/databases/list-collections.md +18 -0
- package/docs/examples/databases/list-document-logs.md +18 -0
- package/docs/examples/databases/list-documents.md +18 -0
- package/docs/examples/databases/list-indexes.md +18 -0
- package/docs/examples/databases/list-logs.md +18 -0
- package/docs/examples/databases/list.md +18 -0
- package/docs/examples/databases/update-collection.md +18 -0
- package/docs/examples/databases/update-document.md +18 -0
- package/docs/examples/databases/update.md +18 -0
- package/docs/examples/functions/create-build.md +18 -0
- package/docs/examples/functions/create-deployment.md +18 -0
- package/docs/examples/functions/create-execution.md +18 -0
- package/docs/examples/functions/create-variable.md +18 -0
- package/docs/examples/functions/create.md +18 -0
- package/docs/examples/functions/delete-deployment.md +18 -0
- package/docs/examples/functions/delete-variable.md +18 -0
- package/docs/examples/functions/delete.md +18 -0
- package/docs/examples/functions/get-deployment.md +18 -0
- package/docs/examples/functions/get-execution.md +18 -0
- package/docs/examples/functions/get-function-usage.md +18 -0
- package/docs/examples/functions/get-usage.md +18 -0
- package/docs/examples/functions/get-variable.md +18 -0
- package/docs/examples/functions/get.md +18 -0
- package/docs/examples/functions/list-deployments.md +18 -0
- package/docs/examples/functions/list-executions.md +18 -0
- package/docs/examples/functions/list-runtimes.md +18 -0
- package/docs/examples/functions/list-variables.md +18 -0
- package/docs/examples/functions/list.md +18 -0
- package/docs/examples/functions/update-deployment.md +18 -0
- package/docs/examples/functions/update-variable.md +18 -0
- package/docs/examples/functions/update.md +18 -0
- package/docs/examples/graphql/mutation.md +18 -0
- package/docs/examples/graphql/query.md +18 -0
- package/docs/examples/health/get-antivirus.md +18 -0
- package/docs/examples/health/get-cache.md +18 -0
- package/docs/examples/health/get-d-b.md +18 -0
- package/docs/examples/health/get-queue-certificates.md +18 -0
- package/docs/examples/health/get-queue-functions.md +18 -0
- package/docs/examples/health/get-queue-logs.md +18 -0
- package/docs/examples/health/get-queue-webhooks.md +18 -0
- package/docs/examples/health/get-storage-local.md +18 -0
- package/docs/examples/health/get-time.md +18 -0
- package/docs/examples/health/get.md +18 -0
- package/docs/examples/locale/get.md +18 -0
- package/docs/examples/locale/list-continents.md +18 -0
- package/docs/examples/locale/list-countries-e-u.md +18 -0
- package/docs/examples/locale/list-countries-phones.md +18 -0
- package/docs/examples/locale/list-countries.md +18 -0
- package/docs/examples/locale/list-currencies.md +18 -0
- package/docs/examples/locale/list-languages.md +18 -0
- package/docs/examples/projects/create-domain.md +18 -0
- package/docs/examples/projects/create-key.md +18 -0
- package/docs/examples/projects/create-platform.md +18 -0
- package/docs/examples/projects/create-webhook.md +18 -0
- package/docs/examples/projects/create.md +18 -0
- package/docs/examples/projects/delete-domain.md +18 -0
- package/docs/examples/projects/delete-key.md +18 -0
- package/docs/examples/projects/delete-platform.md +18 -0
- package/docs/examples/projects/delete-webhook.md +18 -0
- package/docs/examples/projects/delete.md +18 -0
- package/docs/examples/projects/get-domain.md +18 -0
- package/docs/examples/projects/get-key.md +18 -0
- package/docs/examples/projects/get-platform.md +18 -0
- package/docs/examples/projects/get-usage.md +18 -0
- package/docs/examples/projects/get-webhook.md +18 -0
- package/docs/examples/projects/get.md +18 -0
- package/docs/examples/projects/list-domains.md +18 -0
- package/docs/examples/projects/list-keys.md +18 -0
- package/docs/examples/projects/list-platforms.md +18 -0
- package/docs/examples/projects/list-webhooks.md +18 -0
- package/docs/examples/projects/list.md +18 -0
- package/docs/examples/projects/update-auth-duration.md +18 -0
- package/docs/examples/projects/update-auth-limit.md +18 -0
- package/docs/examples/projects/update-auth-sessions-limit.md +18 -0
- package/docs/examples/projects/update-auth-status.md +18 -0
- package/docs/examples/projects/update-domain-verification.md +18 -0
- package/docs/examples/projects/update-key.md +18 -0
- package/docs/examples/projects/update-o-auth2.md +18 -0
- package/docs/examples/projects/update-platform.md +18 -0
- package/docs/examples/projects/update-service-status.md +18 -0
- package/docs/examples/projects/update-webhook-signature.md +18 -0
- package/docs/examples/projects/update-webhook.md +18 -0
- package/docs/examples/projects/update.md +18 -0
- package/docs/examples/storage/create-bucket.md +18 -0
- package/docs/examples/storage/create-file.md +18 -0
- package/docs/examples/storage/delete-bucket.md +18 -0
- package/docs/examples/storage/delete-file.md +18 -0
- package/docs/examples/storage/get-bucket-usage.md +18 -0
- package/docs/examples/storage/get-bucket.md +18 -0
- package/docs/examples/storage/get-file-download.md +14 -0
- package/docs/examples/storage/get-file-preview.md +14 -0
- package/docs/examples/storage/get-file-view.md +14 -0
- package/docs/examples/storage/get-file.md +18 -0
- package/docs/examples/storage/get-usage.md +18 -0
- package/docs/examples/storage/list-buckets.md +18 -0
- package/docs/examples/storage/list-files.md +18 -0
- package/docs/examples/storage/update-bucket.md +18 -0
- package/docs/examples/storage/update-file.md +18 -0
- package/docs/examples/teams/create-membership.md +18 -0
- package/docs/examples/teams/create.md +18 -0
- package/docs/examples/teams/delete-membership.md +18 -0
- package/docs/examples/teams/delete.md +18 -0
- package/docs/examples/teams/get-membership.md +18 -0
- package/docs/examples/teams/get.md +18 -0
- package/docs/examples/teams/list-logs.md +18 -0
- package/docs/examples/teams/list-memberships.md +18 -0
- package/docs/examples/teams/list.md +18 -0
- package/docs/examples/teams/update-membership-roles.md +18 -0
- package/docs/examples/teams/update-membership-status.md +18 -0
- package/docs/examples/teams/update.md +18 -0
- package/docs/examples/users/create-argon2user.md +18 -0
- package/docs/examples/users/create-bcrypt-user.md +18 -0
- package/docs/examples/users/create-m-d5user.md +18 -0
- package/docs/examples/users/create-p-h-pass-user.md +18 -0
- package/docs/examples/users/create-s-h-a-user.md +18 -0
- package/docs/examples/users/create-scrypt-modified-user.md +18 -0
- package/docs/examples/users/create-scrypt-user.md +18 -0
- package/docs/examples/users/create.md +18 -0
- package/docs/examples/users/delete-session.md +18 -0
- package/docs/examples/users/delete-sessions.md +18 -0
- package/docs/examples/users/delete.md +18 -0
- package/docs/examples/users/get-prefs.md +18 -0
- package/docs/examples/users/get-usage.md +18 -0
- package/docs/examples/users/get.md +18 -0
- package/docs/examples/users/list-logs.md +18 -0
- package/docs/examples/users/list-memberships.md +18 -0
- package/docs/examples/users/list-sessions.md +18 -0
- package/docs/examples/users/list.md +18 -0
- package/docs/examples/users/update-email-verification.md +18 -0
- package/docs/examples/users/update-email.md +18 -0
- package/docs/examples/users/update-name.md +18 -0
- package/docs/examples/users/update-password.md +18 -0
- package/docs/examples/users/update-phone-verification.md +18 -0
- package/docs/examples/users/update-phone.md +18 -0
- package/docs/examples/users/update-prefs.md +18 -0
- package/docs/examples/users/update-status.md +18 -0
- package/package.json +40 -0
- package/rollup.config.js +31 -0
- package/src/client.ts +472 -0
- package/src/id.ts +9 -0
- package/src/index.ts +17 -0
- package/src/models.ts +2540 -0
- package/src/permission.ts +22 -0
- package/src/query.ts +56 -0
- package/src/role.ts +34 -0
- package/src/service.ts +30 -0
- package/src/services/account.ts +1009 -0
- package/src/services/avatars.ts +351 -0
- package/src/services/databases.ts +1525 -0
- package/src/services/functions.ts +814 -0
- package/src/services/graphql.ts +68 -0
- package/src/services/health.ts +202 -0
- package/src/services/locale.ts +150 -0
- package/src/services/projects.ts +1235 -0
- package/src/services/storage.ts +691 -0
- package/src/services/teams.ts +445 -0
- package/src/services/users.ts +1020 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Publish Package to npmjs
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v3
|
|
10
|
+
- uses: actions/setup-node@v3
|
|
11
|
+
with:
|
|
12
|
+
node-version: "16.x"
|
|
13
|
+
registry-url: "https://registry.npmjs.org"
|
|
14
|
+
- run: npm install
|
|
15
|
+
- run: npm run build
|
|
16
|
+
- run: npm publish --access public
|
|
17
|
+
env:
|
|
18
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Change Log
|
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Appwrite Console SDK
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+
[](https://travis-ci.com/appwrite/sdk-generator)
|
|
6
|
+
[](https://twitter.com/appwrite)
|
|
7
|
+
[](https://appwrite.io/discord)
|
|
8
|
+
|
|
9
|
+
**This SDK is compatible with Appwrite server version 1.2.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**
|
|
10
|
+
|
|
11
|
+
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### NPM
|
|
18
|
+
|
|
19
|
+
To install via [NPM](https://www.npmjs.com/):
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @appwrite.io/console --save
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If you're using a bundler (like [Rollup](https://rollupjs.org/) or [webpack](https://webpack.js.org/)), you can import the Appwrite module when you need it:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### CDN
|
|
32
|
+
|
|
33
|
+
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@0.0.1"></script>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Getting Started
|
|
41
|
+
|
|
42
|
+
### Add your Web Platform
|
|
43
|
+
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.
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
47
|
+
### Init your SDK
|
|
48
|
+
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page.
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
// Init your Web SDK
|
|
52
|
+
const client = new Client();
|
|
53
|
+
|
|
54
|
+
client
|
|
55
|
+
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
|
|
56
|
+
.setProject('455x34dfkj') // Your project ID
|
|
57
|
+
;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Make Your First Request
|
|
61
|
+
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.
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
const account = new Account(client);
|
|
65
|
+
|
|
66
|
+
// Register User
|
|
67
|
+
account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')
|
|
68
|
+
.then(function (response) {
|
|
69
|
+
console.log(response);
|
|
70
|
+
}, function (error) {
|
|
71
|
+
console.log(error);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Full Example
|
|
77
|
+
```js
|
|
78
|
+
// Init your Web SDK
|
|
79
|
+
const client = new Client();
|
|
80
|
+
|
|
81
|
+
client
|
|
82
|
+
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
|
|
83
|
+
.setProject('455x34dfkj')
|
|
84
|
+
;
|
|
85
|
+
|
|
86
|
+
const account = new Account(client);
|
|
87
|
+
|
|
88
|
+
// Register User
|
|
89
|
+
account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')
|
|
90
|
+
.then(function (response) {
|
|
91
|
+
console.log(response);
|
|
92
|
+
}, function (error) {
|
|
93
|
+
console.log(error);
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Learn more
|
|
98
|
+
You can use the following resources to learn more and get help
|
|
99
|
+
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
|
|
100
|
+
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
|
101
|
+
- 💬 [Discord Community](https://appwrite.io/discord)
|
|
102
|
+
- 🚂 [Appwrite Flutter Playground](https://github.com/appwrite/playground-for-flutter)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## Contribution
|
|
106
|
+
|
|
107
|
+
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.createAnonymousSession();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.createEmailSession('email@example.com', 'password');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.createJWT();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.createMagicURLSession('[USER_ID]', 'email@example.com');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
// Go to OAuth provider login page
|
|
13
|
+
account.createOAuth2Session('amazon');
|
|
14
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.createPhoneSession('[USER_ID]', '+12065550100');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.createPhoneVerification();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.createRecovery('email@example.com', 'https://example.com');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.createVerification('https://example.com');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.create('[USER_ID]', 'email@example.com', 'password');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.deleteSession('[SESSION_ID]');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.deleteSessions();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.getPrefs();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.getSession('[SESSION_ID]');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.get();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.listLogs();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.listSessions();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updateEmail('email@example.com', 'password');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updateMagicURLSession('[USER_ID]', '[SECRET]');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updateName('[NAME]');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updatePassword('password');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updatePhoneSession('[USER_ID]', '[SECRET]');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updatePhoneVerification('[USER_ID]', '[SECRET]');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updatePhone('+12065550100', 'password');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updatePrefs({});
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|