appwrite 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/appwrite.gemspec +1 -1
- data/docs/examples/functions/create.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/lib/appwrite/client.rb +2 -2
- data/lib/appwrite/services/users.rb +69 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 213800ebfb3b9439c2c435494dc283e25110d1747179bd06c60a17041c3fdb6f
|
4
|
+
data.tar.gz: e93c76057871b72b7272798f1dc79001f7850acff9959c735a1cf6b760a23e87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2efe4ce3fd7b0f65933968fc84b3e17ad16c37fc4c3f7a923ff25dccc6e8fcd2f51cb566d30d4e5b2f4b99f387125de50fb694b78914eab15dcfea622eb05581
|
7
|
+
data.tar.gz: fa1f5bfb07204da80ab47d0f293ef97fd2d45c70bbd91aee712957688a8c8bd51a022015c9114f2f2cebf089f34d4f02fa4bc5dbbbd8bae7932ab94b76e59f70
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
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.10.0-blue.svg?style=flat-square)
|
5
5
|
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
|
6
6
|
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
|
7
7
|
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
|
8
8
|
|
9
|
-
**This SDK is compatible with Appwrite server version 0.
|
9
|
+
**This SDK is compatible with Appwrite server version 0.10.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).**
|
10
10
|
|
11
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)
|
12
12
|
|
@@ -80,7 +80,7 @@ end
|
|
80
80
|
```
|
81
81
|
|
82
82
|
### Learn more
|
83
|
-
You can use following resources to learn more and get help
|
83
|
+
You can use the following resources to learn more and get help
|
84
84
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
85
85
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
86
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.
|
4
|
+
s.version = '2.4.0'
|
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'
|
@@ -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
|
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.
|
24
|
-
'X-Appwrite-Response-Format' => '0.
|
23
|
+
'x-sdk-version' => 'appwrite:ruby:2.4.0',
|
24
|
+
'X-Appwrite-Response-Format' => '0.10.0'
|
25
25
|
}
|
26
26
|
@endpoint = 'https://appwrite.io/v1';
|
27
27
|
end
|
@@ -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"')
|
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.
|
4
|
+
version: 2.4.0
|
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-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: team@appwrite.io
|
@@ -114,6 +114,9 @@ files:
|
|
114
114
|
- docs/examples/users/get-sessions.md
|
115
115
|
- docs/examples/users/get.md
|
116
116
|
- docs/examples/users/list.md
|
117
|
+
- docs/examples/users/update-email.md
|
118
|
+
- docs/examples/users/update-name.md
|
119
|
+
- docs/examples/users/update-password.md
|
117
120
|
- docs/examples/users/update-prefs.md
|
118
121
|
- docs/examples/users/update-status.md
|
119
122
|
- docs/examples/users/update-verification.md
|