appwrite 2.1.2 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug.yaml +82 -0
- data/.github/ISSUE_TEMPLATE/documentation.yaml +32 -0
- data/.github/ISSUE_TEMPLATE/feature.yaml +40 -0
- data/Gemfile +1 -1
- data/README.md +7 -8
- data/appwrite.gemspec +1 -1
- data/docs/examples/account/create-recovery.md +1 -1
- data/docs/examples/account/create-verification.md +1 -1
- data/docs/examples/account/delete-session.md +1 -1
- data/docs/examples/account/delete-sessions.md +1 -1
- data/docs/examples/account/delete.md +1 -1
- data/docs/examples/account/get-logs.md +1 -1
- data/docs/examples/account/get-prefs.md +1 -1
- data/docs/examples/account/get-session.md +15 -0
- data/docs/examples/account/get-sessions.md +1 -1
- data/docs/examples/account/get.md +1 -1
- data/docs/examples/account/update-email.md +1 -1
- data/docs/examples/account/update-name.md +1 -1
- data/docs/examples/account/update-password.md +1 -1
- data/docs/examples/account/update-prefs.md +1 -1
- data/docs/examples/account/update-recovery.md +1 -1
- data/docs/examples/account/update-verification.md +1 -1
- data/docs/examples/avatars/get-q-r.md +1 -1
- data/docs/examples/functions/create.md +1 -1
- data/docs/examples/health/get-d-b.md +1 -1
- data/docs/examples/locale/get-countries-e-u.md +1 -1
- data/docs/examples/teams/update-membership-status.md +1 -1
- data/docs/examples/users/update-email.md +15 -0
- data/docs/examples/users/update-name.md +15 -0
- data/docs/examples/users/update-password.md +15 -0
- data/docs/examples/users/update-verification.md +15 -0
- data/lib/appwrite/client.rb +3 -3
- data/lib/appwrite/services/account.rb +15 -0
- data/lib/appwrite/services/avatars.rb +1 -1
- data/lib/appwrite/services/functions.rb +5 -5
- data/lib/appwrite/services/health.rb +1 -1
- data/lib/appwrite/services/locale.rb +1 -1
- data/lib/appwrite/services/storage.rb +5 -1
- data/lib/appwrite/services/teams.rb +4 -4
- data/lib/appwrite/services/users.rb +92 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c1eb3f808d7681c19fb3ce67089478bd8407225953e985602d375e2826cebd5
|
4
|
+
data.tar.gz: be200991cd57aa18f7de0ea66ba32cddb0362475098799a177fb6b4e3614e063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc95e5305739fbcb2ca092a48d7b03f821d75fa686c853d1dd1110aef3e806e331e7df1cc91280ed7bfb8950878de61471100fb68c0fde0768a2faad13de040e
|
7
|
+
data.tar.gz: 5952f3051e0a25aa4913b9b64d8de94f3490d984e54139a6b76e5a139ed795358de993836ec63e3eb6660cb47881bad3e7608c18dee49d1054b57450746d1f89
|
@@ -0,0 +1,82 @@
|
|
1
|
+
name: "🐛 Bug Report"
|
2
|
+
description: "Submit a bug report to help us improve"
|
3
|
+
title: "🐛 Bug Report: "
|
4
|
+
labels: [bug]
|
5
|
+
body:
|
6
|
+
- type: markdown
|
7
|
+
attributes:
|
8
|
+
value: |
|
9
|
+
Thanks for taking the time to fill out our bug report form 🙏
|
10
|
+
- type: textarea
|
11
|
+
id: steps-to-reproduce
|
12
|
+
validations:
|
13
|
+
required: true
|
14
|
+
attributes:
|
15
|
+
label: "👟 Reproduction steps"
|
16
|
+
description: "How do you trigger this bug? Please walk us through it step by step."
|
17
|
+
placeholder: "When I ..."
|
18
|
+
- type: textarea
|
19
|
+
id: expected-behavior
|
20
|
+
validations:
|
21
|
+
required: true
|
22
|
+
attributes:
|
23
|
+
label: "👍 Expected behavior"
|
24
|
+
description: "What did you think would happen?"
|
25
|
+
placeholder: "It should ..."
|
26
|
+
- type: textarea
|
27
|
+
id: actual-behavior
|
28
|
+
validations:
|
29
|
+
required: true
|
30
|
+
attributes:
|
31
|
+
label: "👎 Actual Behavior"
|
32
|
+
description: "What did actually happen? Add screenshots, if applicable."
|
33
|
+
placeholder: "It actually ..."
|
34
|
+
- type: dropdown
|
35
|
+
id: appwrite-version
|
36
|
+
attributes:
|
37
|
+
label: "🎲 Appwrite version"
|
38
|
+
description: "What version of Appwrite are you running?"
|
39
|
+
options:
|
40
|
+
- Version 0.10.x
|
41
|
+
- Version 0.9.x
|
42
|
+
- Version 0.8.x
|
43
|
+
- Version 0.7.x
|
44
|
+
- Version 0.6.x
|
45
|
+
- Different version (specify in environment)
|
46
|
+
validations:
|
47
|
+
required: true
|
48
|
+
- type: dropdown
|
49
|
+
id: operating-system
|
50
|
+
attributes:
|
51
|
+
label: "💻 Operating system"
|
52
|
+
description: "What OS is your server / device running on?"
|
53
|
+
options:
|
54
|
+
- Linux
|
55
|
+
- MacOS
|
56
|
+
- Windows
|
57
|
+
- Something else
|
58
|
+
validations:
|
59
|
+
required: true
|
60
|
+
- type: textarea
|
61
|
+
id: environment
|
62
|
+
validations:
|
63
|
+
required: false
|
64
|
+
attributes:
|
65
|
+
label: "🧱 Your Environment"
|
66
|
+
description: "Is your environment customized in any way?"
|
67
|
+
placeholder: "I use Cloudflare for ..."
|
68
|
+
- type: checkboxes
|
69
|
+
id: no-duplicate-issues
|
70
|
+
attributes:
|
71
|
+
label: "👀 Have you spent some time to check if this issue has been raised before?"
|
72
|
+
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
|
73
|
+
options:
|
74
|
+
- label: "I checked and didn't find similar issue"
|
75
|
+
required: true
|
76
|
+
- type: checkboxes
|
77
|
+
id: read-code-of-conduct
|
78
|
+
attributes:
|
79
|
+
label: "🏢 Have you read the Code of Conduct?"
|
80
|
+
options:
|
81
|
+
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
|
82
|
+
required: true
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: "📚 Documentation"
|
2
|
+
description: "Report an issue related to documentation"
|
3
|
+
title: "📚 Documentation: "
|
4
|
+
labels: [documentation]
|
5
|
+
body:
|
6
|
+
- type: markdown
|
7
|
+
attributes:
|
8
|
+
value: |
|
9
|
+
Thanks for taking the time to make our documentation better 🙏
|
10
|
+
- type: textarea
|
11
|
+
id: issue-description
|
12
|
+
validations:
|
13
|
+
required: true
|
14
|
+
attributes:
|
15
|
+
label: "💭 Description"
|
16
|
+
description: "A clear and concise description of what the issue is."
|
17
|
+
placeholder: "Documentation should not ..."
|
18
|
+
- type: checkboxes
|
19
|
+
id: no-duplicate-issues
|
20
|
+
attributes:
|
21
|
+
label: "👀 Have you spent some time to check if this issue has been raised before?"
|
22
|
+
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
|
23
|
+
options:
|
24
|
+
- label: "I checked and didn't find similar issue"
|
25
|
+
required: true
|
26
|
+
- type: checkboxes
|
27
|
+
id: read-code-of-conduct
|
28
|
+
attributes:
|
29
|
+
label: "🏢 Have you read the Code of Conduct?"
|
30
|
+
options:
|
31
|
+
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
|
32
|
+
required: true
|
@@ -0,0 +1,40 @@
|
|
1
|
+
name: 🚀 Feature
|
2
|
+
description: "Submit a proposal for a new feature"
|
3
|
+
title: "🚀 Feature: "
|
4
|
+
labels: [feature]
|
5
|
+
body:
|
6
|
+
- type: markdown
|
7
|
+
attributes:
|
8
|
+
value: |
|
9
|
+
Thanks for taking the time to fill out our feature request form 🙏
|
10
|
+
- type: textarea
|
11
|
+
id: feature-description
|
12
|
+
validations:
|
13
|
+
required: true
|
14
|
+
attributes:
|
15
|
+
label: "🔖 Feature description"
|
16
|
+
description: "A clear and concise description of what the feature is."
|
17
|
+
placeholder: "You should add ..."
|
18
|
+
- type: textarea
|
19
|
+
id: pitch
|
20
|
+
validations:
|
21
|
+
required: true
|
22
|
+
attributes:
|
23
|
+
label: "🎤 Pitch"
|
24
|
+
description: "Please explain why this feature should be implemented and how it would be used. Add examples, if applicable."
|
25
|
+
placeholder: "In my use-case, ..."
|
26
|
+
- type: checkboxes
|
27
|
+
id: no-duplicate-issues
|
28
|
+
attributes:
|
29
|
+
label: "👀 Have you spent some time to check if this issue has been raised before?"
|
30
|
+
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
|
31
|
+
options:
|
32
|
+
- label: "I checked and didn't find similar issue"
|
33
|
+
required: true
|
34
|
+
- type: checkboxes
|
35
|
+
id: read-code-of-conduct
|
36
|
+
attributes:
|
37
|
+
label: "🏢 Have you read the Code of Conduct?"
|
38
|
+
options:
|
39
|
+
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
|
40
|
+
required: true
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
# Appwrite Ruby SDK
|
2
2
|
|
3
3
|
![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square)
|
4
|
-
![Version](https://img.shields.io/badge/api%20version-0.
|
4
|
+
![Version](https://img.shields.io/badge/api%20version-0.11.0-blue.svg?style=flat-square)
|
5
|
+
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
|
5
6
|
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
|
6
7
|
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
|
7
8
|
|
8
|
-
**This SDK is compatible with Appwrite server version 0.
|
9
|
+
**This SDK is compatible with Appwrite server version 0.11.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).**
|
9
10
|
|
10
|
-
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.
|
11
|
-
Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
|
12
|
-
For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
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 Ruby 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)
|
13
12
|
|
14
13
|
![Appwrite](https://appwrite.io/images/github.png)
|
15
14
|
|
@@ -25,7 +24,7 @@ gem install appwrite --save
|
|
25
24
|
## Getting Started
|
26
25
|
|
27
26
|
### Init your SDK
|
28
|
-
Initialize your SDK
|
27
|
+
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
|
29
28
|
|
30
29
|
```ruby
|
31
30
|
require 'appwrite'
|
@@ -41,7 +40,7 @@ client
|
|
41
40
|
```
|
42
41
|
|
43
42
|
### Make Your First Request
|
44
|
-
Once your SDK object is set, create any of the Appwrite service objects 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 section.
|
43
|
+
Once your SDK object is set, create any of the Appwrite service objects 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.
|
45
44
|
|
46
45
|
```ruby
|
47
46
|
users = Appwrite::Users.new(client);
|
@@ -81,7 +80,7 @@ end
|
|
81
80
|
```
|
82
81
|
|
83
82
|
### Learn more
|
84
|
-
You can use
|
83
|
+
You can use the following resources to learn more and get help
|
85
84
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
86
85
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
87
86
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
data/appwrite.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'appwrite'
|
4
|
-
s.version = '2.1
|
4
|
+
s.version = '2.4.1'
|
5
5
|
s.summary = "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API"
|
6
6
|
s.author = 'Appwrite Team'
|
7
7
|
s.homepage = 'https://appwrite.io/support'
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'appwrite'
|
2
|
+
|
3
|
+
client = Appwrite::Client.new()
|
4
|
+
|
5
|
+
client
|
6
|
+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
|
+
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
|
+
;
|
10
|
+
|
11
|
+
account = Appwrite::Account.new(client);
|
12
|
+
|
13
|
+
response = account.get_session(session_id: '[SESSION_ID]');
|
14
|
+
|
15
|
+
puts response
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
account = Appwrite::Account.new(client);
|
@@ -5,7 +5,7 @@ client = Appwrite::Client.new()
|
|
5
5
|
client
|
6
6
|
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
7
|
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
-
.
|
8
|
+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
|
9
9
|
;
|
10
10
|
|
11
11
|
teams = Appwrite::Teams.new(client);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'appwrite'
|
2
|
+
|
3
|
+
client = Appwrite::Client.new()
|
4
|
+
|
5
|
+
client
|
6
|
+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
|
+
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
|
9
|
+
;
|
10
|
+
|
11
|
+
users = Appwrite::Users.new(client);
|
12
|
+
|
13
|
+
response = users.update_email(user_id: '[USER_ID]', email: 'email@example.com');
|
14
|
+
|
15
|
+
puts response
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'appwrite'
|
2
|
+
|
3
|
+
client = Appwrite::Client.new()
|
4
|
+
|
5
|
+
client
|
6
|
+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
|
+
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
|
9
|
+
;
|
10
|
+
|
11
|
+
users = Appwrite::Users.new(client);
|
12
|
+
|
13
|
+
response = users.update_name(user_id: '[USER_ID]', name: '[NAME]');
|
14
|
+
|
15
|
+
puts response
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'appwrite'
|
2
|
+
|
3
|
+
client = Appwrite::Client.new()
|
4
|
+
|
5
|
+
client
|
6
|
+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
|
+
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
|
9
|
+
;
|
10
|
+
|
11
|
+
users = Appwrite::Users.new(client);
|
12
|
+
|
13
|
+
response = users.update_password(user_id: '[USER_ID]', password: 'password');
|
14
|
+
|
15
|
+
puts response
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'appwrite'
|
2
|
+
|
3
|
+
client = Appwrite::Client.new()
|
4
|
+
|
5
|
+
client
|
6
|
+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
|
7
|
+
.set_project('5df5acd0d48c2') # Your project ID
|
8
|
+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
|
9
|
+
;
|
10
|
+
|
11
|
+
users = Appwrite::Users.new(client);
|
12
|
+
|
13
|
+
response = users.update_verification(user_id: '[USER_ID]', email_verification: false);
|
14
|
+
|
15
|
+
puts response
|
data/lib/appwrite/client.rb
CHANGED
@@ -20,8 +20,8 @@ module Appwrite
|
|
20
20
|
@headers = {
|
21
21
|
'content-type' => '',
|
22
22
|
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
|
23
|
-
'x-sdk-version' => 'appwrite:ruby:2.1
|
24
|
-
'X-Appwrite-Response-Format' => '0.
|
23
|
+
'x-sdk-version' => 'appwrite:ruby:2.4.1',
|
24
|
+
'X-Appwrite-Response-Format' => '0.11.0'
|
25
25
|
}
|
26
26
|
@endpoint = 'https://appwrite.io/v1';
|
27
27
|
end
|
@@ -38,7 +38,7 @@ module Appwrite
|
|
38
38
|
return self
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
41
|
+
def set_jwt(value)
|
42
42
|
add_header('x-appwrite-jwt', value)
|
43
43
|
|
44
44
|
return self
|
@@ -213,6 +213,21 @@ module Appwrite
|
|
213
213
|
}, params);
|
214
214
|
end
|
215
215
|
|
216
|
+
def get_session(session_id:)
|
217
|
+
if session_id.nil?
|
218
|
+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
219
|
+
end
|
220
|
+
|
221
|
+
path = '/account/sessions/{sessionId}'
|
222
|
+
.gsub('{sessionId}', session_id)
|
223
|
+
|
224
|
+
params = {}
|
225
|
+
|
226
|
+
return @client.call('get', path, {
|
227
|
+
'content-type' => 'application/json',
|
228
|
+
}, params);
|
229
|
+
end
|
230
|
+
|
216
231
|
def delete_session(session_id:)
|
217
232
|
if session_id.nil?
|
218
233
|
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
@@ -156,7 +156,7 @@ module Appwrite
|
|
156
156
|
}, params);
|
157
157
|
end
|
158
158
|
|
159
|
-
def
|
159
|
+
def get_qr(text:, size: nil, margin: nil, download: nil)
|
160
160
|
if text.nil?
|
161
161
|
raise Appwrite::Exception.new('Missing required parameter: "text"')
|
162
162
|
end
|
@@ -27,7 +27,7 @@ module Appwrite
|
|
27
27
|
}, params);
|
28
28
|
end
|
29
29
|
|
30
|
-
def create(name:, execute:,
|
30
|
+
def create(name:, execute:, runtime:, vars: nil, events: nil, schedule: nil, timeout: nil)
|
31
31
|
if name.nil?
|
32
32
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
33
33
|
end
|
@@ -36,8 +36,8 @@ module Appwrite
|
|
36
36
|
raise Appwrite::Exception.new('Missing required parameter: "execute"')
|
37
37
|
end
|
38
38
|
|
39
|
-
if
|
40
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
39
|
+
if runtime.nil?
|
40
|
+
raise Appwrite::Exception.new('Missing required parameter: "runtime"')
|
41
41
|
end
|
42
42
|
|
43
43
|
path = '/functions'
|
@@ -52,8 +52,8 @@ module Appwrite
|
|
52
52
|
params[:execute] = execute
|
53
53
|
end
|
54
54
|
|
55
|
-
if !
|
56
|
-
params[:
|
55
|
+
if !runtime.nil?
|
56
|
+
params[:runtime] = runtime
|
57
57
|
end
|
58
58
|
|
59
59
|
if !vars.nil?
|
@@ -129,7 +129,7 @@ module Appwrite
|
|
129
129
|
}, params);
|
130
130
|
end
|
131
131
|
|
132
|
-
def get_file_preview(file_id:, width: nil, height: nil, quality: nil, border_width: nil, border_color: nil, border_radius: nil, opacity: nil, rotation: nil, background: nil, output: nil)
|
132
|
+
def get_file_preview(file_id:, width: nil, height: nil, gravity: nil, quality: nil, border_width: nil, border_color: nil, border_radius: nil, opacity: nil, rotation: nil, background: nil, output: nil)
|
133
133
|
if file_id.nil?
|
134
134
|
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
|
135
135
|
end
|
@@ -147,6 +147,10 @@ module Appwrite
|
|
147
147
|
params[:height] = height
|
148
148
|
end
|
149
149
|
|
150
|
+
if !gravity.nil?
|
151
|
+
params[:gravity] = gravity
|
152
|
+
end
|
153
|
+
|
150
154
|
if !quality.nil?
|
151
155
|
params[:quality] = quality
|
152
156
|
end
|
@@ -159,10 +159,6 @@ module Appwrite
|
|
159
159
|
params[:email] = email
|
160
160
|
end
|
161
161
|
|
162
|
-
if !name.nil?
|
163
|
-
params[:name] = name
|
164
|
-
end
|
165
|
-
|
166
162
|
if !roles.nil?
|
167
163
|
params[:roles] = roles
|
168
164
|
end
|
@@ -171,6 +167,10 @@ module Appwrite
|
|
171
167
|
params[:url] = url
|
172
168
|
end
|
173
169
|
|
170
|
+
if !name.nil?
|
171
|
+
params[:name] = name
|
172
|
+
end
|
173
|
+
|
174
174
|
return @client.call('post', path, {
|
175
175
|
'content-type' => 'application/json',
|
176
176
|
}, params);
|
@@ -87,6 +87,29 @@ module Appwrite
|
|
87
87
|
}, params);
|
88
88
|
end
|
89
89
|
|
90
|
+
def update_email(user_id:, email:)
|
91
|
+
if user_id.nil?
|
92
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
93
|
+
end
|
94
|
+
|
95
|
+
if email.nil?
|
96
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
97
|
+
end
|
98
|
+
|
99
|
+
path = '/users/{userId}/email'
|
100
|
+
.gsub('{userId}', user_id)
|
101
|
+
|
102
|
+
params = {}
|
103
|
+
|
104
|
+
if !email.nil?
|
105
|
+
params[:email] = email
|
106
|
+
end
|
107
|
+
|
108
|
+
return @client.call('patch', path, {
|
109
|
+
'content-type' => 'application/json',
|
110
|
+
}, params);
|
111
|
+
end
|
112
|
+
|
90
113
|
def get_logs(user_id:)
|
91
114
|
if user_id.nil?
|
92
115
|
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
@@ -102,6 +125,52 @@ module Appwrite
|
|
102
125
|
}, params);
|
103
126
|
end
|
104
127
|
|
128
|
+
def update_name(user_id:, name:)
|
129
|
+
if user_id.nil?
|
130
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
131
|
+
end
|
132
|
+
|
133
|
+
if name.nil?
|
134
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
135
|
+
end
|
136
|
+
|
137
|
+
path = '/users/{userId}/name'
|
138
|
+
.gsub('{userId}', user_id)
|
139
|
+
|
140
|
+
params = {}
|
141
|
+
|
142
|
+
if !name.nil?
|
143
|
+
params[:name] = name
|
144
|
+
end
|
145
|
+
|
146
|
+
return @client.call('patch', path, {
|
147
|
+
'content-type' => 'application/json',
|
148
|
+
}, params);
|
149
|
+
end
|
150
|
+
|
151
|
+
def update_password(user_id:, password:)
|
152
|
+
if user_id.nil?
|
153
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
154
|
+
end
|
155
|
+
|
156
|
+
if password.nil?
|
157
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
158
|
+
end
|
159
|
+
|
160
|
+
path = '/users/{userId}/password'
|
161
|
+
.gsub('{userId}', user_id)
|
162
|
+
|
163
|
+
params = {}
|
164
|
+
|
165
|
+
if !password.nil?
|
166
|
+
params[:password] = password
|
167
|
+
end
|
168
|
+
|
169
|
+
return @client.call('patch', path, {
|
170
|
+
'content-type' => 'application/json',
|
171
|
+
}, params);
|
172
|
+
end
|
173
|
+
|
105
174
|
def get_prefs(user_id:)
|
106
175
|
if user_id.nil?
|
107
176
|
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
@@ -213,6 +282,29 @@ module Appwrite
|
|
213
282
|
}, params);
|
214
283
|
end
|
215
284
|
|
285
|
+
def update_verification(user_id:, email_verification:)
|
286
|
+
if user_id.nil?
|
287
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
288
|
+
end
|
289
|
+
|
290
|
+
if email_verification.nil?
|
291
|
+
raise Appwrite::Exception.new('Missing required parameter: "emailVerification"')
|
292
|
+
end
|
293
|
+
|
294
|
+
path = '/users/{userId}/verification'
|
295
|
+
.gsub('{userId}', user_id)
|
296
|
+
|
297
|
+
params = {}
|
298
|
+
|
299
|
+
if !email_verification.nil?
|
300
|
+
params[:emailVerification] = email_verification
|
301
|
+
end
|
302
|
+
|
303
|
+
return @client.call('patch', path, {
|
304
|
+
'content-type' => 'application/json',
|
305
|
+
}, params);
|
306
|
+
end
|
307
|
+
|
216
308
|
|
217
309
|
protected
|
218
310
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appwrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Appwrite Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: team@appwrite.io
|
@@ -16,6 +16,9 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- ".github/ISSUE_TEMPLATE/bug.yaml"
|
20
|
+
- ".github/ISSUE_TEMPLATE/documentation.yaml"
|
21
|
+
- ".github/ISSUE_TEMPLATE/feature.yaml"
|
19
22
|
- ".travis.yml"
|
20
23
|
- CHANGELOG.md
|
21
24
|
- Gemfile
|
@@ -29,6 +32,7 @@ files:
|
|
29
32
|
- docs/examples/account/delete.md
|
30
33
|
- docs/examples/account/get-logs.md
|
31
34
|
- docs/examples/account/get-prefs.md
|
35
|
+
- docs/examples/account/get-session.md
|
32
36
|
- docs/examples/account/get-sessions.md
|
33
37
|
- docs/examples/account/get.md
|
34
38
|
- docs/examples/account/update-email.md
|
@@ -113,8 +117,12 @@ files:
|
|
113
117
|
- docs/examples/users/get-sessions.md
|
114
118
|
- docs/examples/users/get.md
|
115
119
|
- docs/examples/users/list.md
|
120
|
+
- docs/examples/users/update-email.md
|
121
|
+
- docs/examples/users/update-name.md
|
122
|
+
- docs/examples/users/update-password.md
|
116
123
|
- docs/examples/users/update-prefs.md
|
117
124
|
- docs/examples/users/update-status.md
|
125
|
+
- docs/examples/users/update-verification.md
|
118
126
|
- lib/appwrite.rb
|
119
127
|
- lib/appwrite/client.rb
|
120
128
|
- lib/appwrite/exception.rb
|