Skip to content

Commit b92b436

Browse files
authored
Merge pull request #37 from appwrite/dev
fix: pong response & chunked upload
2 parents fdf87cd + ca74091 commit b92b436

File tree

7 files changed

+25
-16
lines changed

7 files changed

+25
-16
lines changed

appwrite.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |spec|
22

33
spec.name = 'appwrite'
4-
spec.version = '13.1.0'
4+
spec.version = '14.0.0'
55
spec.license = 'BSD-3-Clause'
66
spec.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'
77
spec.author = 'Appwrite Team'

lib/appwrite/client.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize
1515
'x-sdk-name'=> 'Ruby',
1616
'x-sdk-platform'=> 'server',
1717
'x-sdk-language'=> 'ruby',
18-
'x-sdk-version'=> '13.1.0',
18+
'x-sdk-version'=> '14.0.0',
1919
'X-Appwrite-Response-Format' => '1.6.0'
2020
}
2121
@endpoint = 'https://cloud.appwrite.io/v1'
@@ -104,7 +104,7 @@ def set_forwarded_user_agent(value)
104104
# @return [self]
105105
def set_endpoint(endpoint)
106106
@endpoint = endpoint
107-
107+
108108
self
109109
end
110110

@@ -187,7 +187,7 @@ def chunked_upload(
187187

188188
offset = 0
189189
id_param_name = id_param_name.to_sym if id_param_name
190-
if id_param_name&.empty? == false && params[id_param_name] != "unique()"
190+
if id_param_name&.empty? == false
191191
# Make a request to check if a file already exists
192192
current = call(
193193
method: "GET",
@@ -257,7 +257,7 @@ def fetch(
257257
@http = Net::HTTP.new(uri.host, uri.port) unless defined? @http
258258
@http.use_ssl = !@self_signed
259259
payload = ''
260-
260+
261261
headers = @headers.merge(headers)
262262

263263
params.compact!
@@ -292,7 +292,7 @@ def fetch(
292292
if response_type == "location"
293293
return location
294294
end
295-
295+
296296
# Handle Redirects
297297
if (response.class == Net::HTTPRedirection || response.class == Net::HTTPMovedPermanently)
298298
uri = URI.parse(uri.scheme + "://" + uri.host + "" + location)
@@ -327,7 +327,7 @@ def fetch(
327327

328328
return response
329329
end
330-
330+
331331
def encode_form_data(value, key=nil)
332332
case value
333333
when Hash
@@ -359,13 +359,13 @@ def encode(value, key = nil)
359359
when Hash then value.map { |k,v| encode(v, append_key(key,k)) }.join('&')
360360
when Array then value.map { |v| encode(v, "#{key}[]") }.join('&')
361361
when nil then ''
362-
else
363-
"#{key}=#{CGI.escape(value.to_s)}"
362+
else
363+
"#{key}=#{CGI.escape(value.to_s)}"
364364
end
365365
end
366366

367367
def append_key(root_key, key)
368368
root_key.nil? ? key : "#{root_key}[#{key.to_s}]"
369369
end
370-
end
370+
end
371371
end

lib/appwrite/enums/image_format.rb

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module ImageFormat
66
GIF = 'gif'
77
PNG = 'png'
88
WEBP = 'webp'
9+
HEIC = 'heic'
910
AVIF = 'avif'
1011
end
1112
end

lib/appwrite/services/account.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def create_mfa_challenge(factor:)
405405
# @param [String] challenge_id ID of the challenge.
406406
# @param [String] otp Valid verification token.
407407
#
408-
# @return []
408+
# @return [Session]
409409
def update_mfa_challenge(challenge_id:, otp:)
410410
api_path = '/account/mfa/challenge'
411411

@@ -431,6 +431,7 @@ def update_mfa_challenge(challenge_id:, otp:)
431431
path: api_path,
432432
headers: api_headers,
433433
params: api_params,
434+
response_type: Models::Session
434435
)
435436
end
436437

lib/appwrite/services/functions.rb

+10-2
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,11 @@ def delete_deployment(function_id:, deployment_id:)
499499
end
500500

501501

502-
#
502+
# Create a new build for an existing function deployment. This endpoint
503+
# allows you to rebuild a deployment with the updated function configuration,
504+
# including its entrypoint and build commands if they have been modified The
505+
# build process will be queued and executed asynchronously. The original
506+
# deployment's code will be preserved and used for the new build.
503507
#
504508
# @param [String] function_id Function ID.
505509
# @param [String] deployment_id Deployment ID.
@@ -536,7 +540,11 @@ def create_build(function_id:, deployment_id:, build_id: nil)
536540
end
537541

538542

539-
#
543+
# Cancel an ongoing function deployment build. If the build is already in
544+
# progress, it will be stopped and marked as canceled. If the build hasn't
545+
# started yet, it will be marked as canceled without executing. You cannot
546+
# cancel builds that have already completed (status 'ready') or failed. The
547+
# response includes the final build status and details.
540548
#
541549
# @param [String] function_id Function ID.
542550
# @param [String] deployment_id Deployment ID.

lib/appwrite/services/messaging.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def create_sms(message_id:, content:, topics: nil, users: nil, targets: nil, dra
327327
end
328328

329329

330-
# Update an email message by its unique ID.
330+
# Update an SMS message by its unique ID.
331331
#
332332
#
333333
# @param [String] message_id Message ID.

lib/appwrite/services/users.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ def update_mfa(user_id:, mfa:)
791791
# @param [String] user_id User ID.
792792
# @param [AuthenticatorType] type Type of authenticator.
793793
#
794-
# @return [User]
794+
# @return []
795795
def delete_mfa_authenticator(user_id:, type:)
796796
api_path = '/users/{userId}/mfa/authenticators/{type}'
797797
.gsub('{userId}', user_id)
@@ -817,7 +817,6 @@ def delete_mfa_authenticator(user_id:, type:)
817817
path: api_path,
818818
headers: api_headers,
819819
params: api_params,
820-
response_type: Models::User
821820
)
822821
end
823822

0 commit comments

Comments
 (0)