appwrite 13.0.1 → 14.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 204a8ccd072fd6ffc1646fa433866343a9af6a36253ff7ceff9f40173c0f01c7
4
- data.tar.gz: 14ee8bc80f69a8c4e0ad36fa27d1ee58b1a71ea41a3a98be71276fa68fa56a48
3
+ metadata.gz: 9c1880b74a4373dc30f610c1edc6153ba4cc1afc40ca5070a0028795b1f1e465
4
+ data.tar.gz: 93655616285c03f1f60c3ea54397f5425ecf804807d7d58a1d7d9ef6258d5eef
5
5
  SHA512:
6
- metadata.gz: 79f2553e43afcfbaa9a7afaaa647d95a733245a55a4b1f4adfc197af31e0c8975dfc2242ab3305ed24cc99f50f0664f4f888f28c1146425a3ed896779326edca
7
- data.tar.gz: e8cf14548158fa30eb56d0b5dd88c6d7b8623292e061c3d246522036350f87188c7c6ed08221e2947552b49ed46fc81b0e70b43ba865727db326e8e0348e57d0
6
+ metadata.gz: e5ddaebf14d25e2f092414d929cb6188bbd061c9d08a9263f698115d42d9fb1e9e94e7df94396eea1e98e4aed58e7d1ebf440b75359f40bdabc16d5b62b12d56
7
+ data.tar.gz: 07dc77005a0776013e695e6317e4673b4757a0cb8cee9d0cf99839839c956b93030c19caaf7d3a46fca55577481b483d28e738da0c0c858efd3435d3eb10a862
@@ -15,7 +15,7 @@ module Appwrite
15
15
  'x-sdk-name'=> 'Ruby',
16
16
  'x-sdk-platform'=> 'server',
17
17
  'x-sdk-language'=> 'ruby',
18
- 'x-sdk-version'=> '13.0.1',
18
+ 'x-sdk-version'=> '14.0.0',
19
19
  'X-Appwrite-Response-Format' => '1.6.0'
20
20
  }
21
21
  @endpoint = 'https://cloud.appwrite.io/v1'
@@ -104,7 +104,7 @@ module Appwrite
104
104
  # @return [self]
105
105
  def set_endpoint(endpoint)
106
106
  @endpoint = endpoint
107
-
107
+
108
108
  self
109
109
  end
110
110
 
@@ -187,7 +187,7 @@ module Appwrite
187
187
 
188
188
  offset = 0
189
189
  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
191
191
  # Make a request to check if a file already exists
192
192
  current = call(
193
193
  method: "GET",
@@ -257,7 +257,7 @@ module Appwrite
257
257
  @http = Net::HTTP.new(uri.host, uri.port) unless defined? @http
258
258
  @http.use_ssl = !@self_signed
259
259
  payload = ''
260
-
260
+
261
261
  headers = @headers.merge(headers)
262
262
 
263
263
  params.compact!
@@ -292,7 +292,7 @@ module Appwrite
292
292
  if response_type == "location"
293
293
  return location
294
294
  end
295
-
295
+
296
296
  # Handle Redirects
297
297
  if (response.class == Net::HTTPRedirection || response.class == Net::HTTPMovedPermanently)
298
298
  uri = URI.parse(uri.scheme + "://" + uri.host + "" + location)
@@ -327,7 +327,7 @@ module Appwrite
327
327
 
328
328
  return response
329
329
  end
330
-
330
+
331
331
  def encode_form_data(value, key=nil)
332
332
  case value
333
333
  when Hash
@@ -359,13 +359,13 @@ module Appwrite
359
359
  when Hash then value.map { |k,v| encode(v, append_key(key,k)) }.join('&')
360
360
  when Array then value.map { |v| encode(v, "#{key}[]") }.join('&')
361
361
  when nil then ''
362
- else
363
- "#{key}=#{CGI.escape(value.to_s)}"
362
+ else
363
+ "#{key}=#{CGI.escape(value.to_s)}"
364
364
  end
365
365
  end
366
366
 
367
367
  def append_key(root_key, key)
368
368
  root_key.nil? ? key : "#{root_key}[#{key.to_s}]"
369
369
  end
370
- end
370
+ end
371
371
  end
@@ -6,6 +6,7 @@ module Appwrite
6
6
  GIF = 'gif'
7
7
  PNG = 'png'
8
8
  WEBP = 'webp'
9
+ HEIC = 'heic'
9
10
  AVIF = 'avif'
10
11
  end
11
12
  end
@@ -0,0 +1,8 @@
1
+ module Appwrite
2
+ module Enums
3
+ module MessagePriority
4
+ NORMAL = 'normal'
5
+ HIGH = 'high'
6
+ end
7
+ end
8
+ end
@@ -59,6 +59,7 @@ module Appwrite
59
59
  BUN_1_1 = 'bun-1.1'
60
60
  GO_1_23 = 'go-1.23'
61
61
  STATIC_1 = 'static-1'
62
+ FLUTTER_3_24 = 'flutter-3.24'
62
63
  end
63
64
  end
64
65
  end
@@ -405,7 +405,7 @@ module Appwrite
405
405
  # @param [String] challenge_id ID of the challenge.
406
406
  # @param [String] otp Valid verification token.
407
407
  #
408
- # @return []
408
+ # @return [Session]
409
409
  def update_mfa_challenge(challenge_id:, otp:)
410
410
  api_path = '/account/mfa/challenge'
411
411
 
@@ -431,6 +431,7 @@ module Appwrite
431
431
  path: api_path,
432
432
  headers: api_headers,
433
433
  params: api_params,
434
+ response_type: Models::Session
434
435
  )
435
436
  end
436
437
 
@@ -1206,9 +1207,7 @@ module Appwrite
1206
1207
  # [POST
1207
1208
  # /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
1208
1209
  # endpoint to complete the login process. The link sent to the user's email
1209
- # address is valid for 1 hour. If you are on a mobile device you can leave
1210
- # the URL parameter empty, so that the login completion will be handled by
1211
- # your Appwrite instance by default.
1210
+ # address is valid for 1 hour.
1212
1211
  #
1213
1212
  # A user is limited to 10 active sessions at a time by default. [Learn more
1214
1213
  # about session
@@ -499,7 +499,11 @@ module Appwrite
499
499
  end
500
500
 
501
501
 
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.
503
507
  #
504
508
  # @param [String] function_id Function ID.
505
509
  # @param [String] deployment_id Deployment ID.
@@ -536,7 +540,11 @@ module Appwrite
536
540
  end
537
541
 
538
542
 
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.
540
548
  #
541
549
  # @param [String] function_id Function ID.
542
550
  # @param [String] deployment_id Deployment ID.
@@ -156,33 +156,28 @@ module Appwrite
156
156
  # @param [Array] topics List of Topic IDs.
157
157
  # @param [Array] users List of User IDs.
158
158
  # @param [Array] targets List of Targets IDs.
159
- # @param [Hash] data Additional Data for push notification.
159
+ # @param [Hash] data Additional key-value pair data for push notification.
160
160
  # @param [String] action Action for push notification.
161
161
  # @param [String] image Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
162
162
  # @param [String] icon Icon for push notification. Available only for Android and Web Platform.
163
- # @param [String] sound Sound for push notification. Available only for Android and IOS Platform.
163
+ # @param [String] sound Sound for push notification. Available only for Android and iOS Platform.
164
164
  # @param [String] color Color for push notification. Available only for Android Platform.
165
165
  # @param [String] tag Tag for push notification. Available only for Android Platform.
166
- # @param [String] badge Badge for push notification. Available only for IOS Platform.
166
+ # @param [Integer] badge Badge for push notification. Available only for iOS Platform.
167
167
  # @param [] draft Is message a draft
168
168
  # @param [String] scheduled_at Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
169
+ # @param [] content_available If set to true, the notification will be delivered in the background. Available only for iOS Platform.
170
+ # @param [] critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
171
+ # @param [MessagePriority] priority Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
169
172
  #
170
173
  # @return [Message]
171
- def create_push(message_id:, title:, body:, topics: nil, users: nil, targets: nil, data: nil, action: nil, image: nil, icon: nil, sound: nil, color: nil, tag: nil, badge: nil, draft: nil, scheduled_at: nil)
174
+ def create_push(message_id:, title: nil, body: nil, topics: nil, users: nil, targets: nil, data: nil, action: nil, image: nil, icon: nil, sound: nil, color: nil, tag: nil, badge: nil, draft: nil, scheduled_at: nil, content_available: nil, critical: nil, priority: nil)
172
175
  api_path = '/messaging/messages/push'
173
176
 
174
177
  if message_id.nil?
175
178
  raise Appwrite::Exception.new('Missing required parameter: "messageId"')
176
179
  end
177
180
 
178
- if title.nil?
179
- raise Appwrite::Exception.new('Missing required parameter: "title"')
180
- end
181
-
182
- if body.nil?
183
- raise Appwrite::Exception.new('Missing required parameter: "body"')
184
- end
185
-
186
181
  api_params = {
187
182
  messageId: message_id,
188
183
  title: title,
@@ -200,6 +195,9 @@ module Appwrite
200
195
  badge: badge,
201
196
  draft: draft,
202
197
  scheduledAt: scheduled_at,
198
+ contentAvailable: content_available,
199
+ critical: critical,
200
+ priority: priority,
203
201
  }
204
202
 
205
203
  api_headers = {
@@ -235,9 +233,12 @@ module Appwrite
235
233
  # @param [Integer] badge Badge for push notification. Available only for iOS platforms.
236
234
  # @param [] draft Is message a draft
237
235
  # @param [String] scheduled_at Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
236
+ # @param [] content_available If set to true, the notification will be delivered in the background. Available only for iOS Platform.
237
+ # @param [] critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
238
+ # @param [MessagePriority] priority Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
238
239
  #
239
240
  # @return [Message]
240
- def update_push(message_id:, topics: nil, users: nil, targets: nil, title: nil, body: nil, data: nil, action: nil, image: nil, icon: nil, sound: nil, color: nil, tag: nil, badge: nil, draft: nil, scheduled_at: nil)
241
+ def update_push(message_id:, topics: nil, users: nil, targets: nil, title: nil, body: nil, data: nil, action: nil, image: nil, icon: nil, sound: nil, color: nil, tag: nil, badge: nil, draft: nil, scheduled_at: nil, content_available: nil, critical: nil, priority: nil)
241
242
  api_path = '/messaging/messages/push/{messageId}'
242
243
  .gsub('{messageId}', message_id)
243
244
 
@@ -261,6 +262,9 @@ module Appwrite
261
262
  badge: badge,
262
263
  draft: draft,
263
264
  scheduledAt: scheduled_at,
265
+ contentAvailable: content_available,
266
+ critical: critical,
267
+ priority: priority,
264
268
  }
265
269
 
266
270
  api_headers = {
@@ -323,7 +327,7 @@ module Appwrite
323
327
  end
324
328
 
325
329
 
326
- # Update an email message by its unique ID.
330
+ # Update an SMS message by its unique ID.
327
331
  #
328
332
  #
329
333
  # @param [String] message_id Message ID.
@@ -791,7 +791,7 @@ module Appwrite
791
791
  # @param [String] user_id User ID.
792
792
  # @param [AuthenticatorType] type Type of authenticator.
793
793
  #
794
- # @return [User]
794
+ # @return []
795
795
  def delete_mfa_authenticator(user_id:, type:)
796
796
  api_path = '/users/{userId}/mfa/authenticators/{type}'
797
797
  .gsub('{userId}', user_id)
@@ -817,7 +817,6 @@ module Appwrite
817
817
  path: api_path,
818
818
  headers: api_headers,
819
819
  params: api_params,
820
- response_type: Models::User
821
820
  )
822
821
  end
823
822
 
data/lib/appwrite.rb CHANGED
@@ -116,6 +116,7 @@ require_relative 'appwrite/enums/index_type'
116
116
  require_relative 'appwrite/enums/runtime'
117
117
  require_relative 'appwrite/enums/execution_method'
118
118
  require_relative 'appwrite/enums/name'
119
+ require_relative 'appwrite/enums/message_priority'
119
120
  require_relative 'appwrite/enums/smtp_encryption'
120
121
  require_relative 'appwrite/enums/compression'
121
122
  require_relative 'appwrite/enums/image_gravity'
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: 13.0.1
4
+ version: 14.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appwrite Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-19 00:00:00.000000000 Z
11
+ date: 2025-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.4.1
27
- description:
27
+ description:
28
28
  email: team@appwrite.io
29
29
  executables: []
30
30
  extensions: []
@@ -42,6 +42,7 @@ files:
42
42
  - lib/appwrite/enums/image_format.rb
43
43
  - lib/appwrite/enums/image_gravity.rb
44
44
  - lib/appwrite/enums/index_type.rb
45
+ - lib/appwrite/enums/message_priority.rb
45
46
  - lib/appwrite/enums/messaging_provider_type.rb
46
47
  - lib/appwrite/enums/name.rb
47
48
  - lib/appwrite/enums/o_auth_provider.rb
@@ -163,7 +164,7 @@ homepage: https://appwrite.io/support
163
164
  licenses:
164
165
  - BSD-3-Clause
165
166
  metadata: {}
166
- post_install_message:
167
+ post_install_message:
167
168
  rdoc_options: []
168
169
  require_paths:
169
170
  - lib
@@ -179,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
180
  version: '0'
180
181
  requirements: []
181
182
  rubygems_version: 3.1.6
182
- signing_key:
183
+ signing_key:
183
184
  specification_version: 4
184
185
  summary: Appwrite is an open-source self-hosted backend server that abstract and simplify
185
186
  complex and repetitive development tasks behind a very simple REST API