appwrite 19.2.1 → 20.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 +4 -4
- data/lib/appwrite/client.rb +1 -1
- data/lib/appwrite/enums/build_runtime.rb +2 -0
- data/lib/appwrite/enums/execution_status.rb +1 -0
- data/lib/appwrite/enums/framework.rb +1 -0
- data/lib/appwrite/enums/output.rb +13 -0
- data/lib/appwrite/enums/runtime.rb +2 -0
- data/lib/appwrite/enums/template_reference_type.rb +9 -0
- data/lib/appwrite/enums/theme.rb +8 -0
- data/lib/appwrite/enums/timezone.rb +425 -0
- data/lib/appwrite/enums/{vcs_deployment_type.rb → vcs_reference_type.rb} +1 -1
- data/lib/appwrite/models/bucket.rb +8 -3
- data/lib/appwrite/models/execution.rb +1 -0
- data/lib/appwrite/operator.rb +145 -0
- data/lib/appwrite/query.rb +6 -6
- data/lib/appwrite/services/account.rb +8 -4
- data/lib/appwrite/services/avatars.rb +74 -0
- data/lib/appwrite/services/databases.rb +15 -5
- data/lib/appwrite/services/functions.rb +21 -9
- data/lib/appwrite/services/messaging.rb +117 -9
- data/lib/appwrite/services/sites.rb +22 -10
- data/lib/appwrite/services/storage.rb +13 -5
- data/lib/appwrite/services/tables_db.rb +16 -6
- data/lib/appwrite/services/teams.rb +6 -2
- data/lib/appwrite/services/tokens.rb +3 -1
- data/lib/appwrite/services/users.rb +18 -6
- data/lib/appwrite.rb +16 -1
- metadata +8 -3
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Condition
|
|
5
|
+
EQUAL = "equal"
|
|
6
|
+
NOT_EQUAL = "notEqual"
|
|
7
|
+
GREATER_THAN = "greaterThan"
|
|
8
|
+
GREATER_THAN_EQUAL = "greaterThanEqual"
|
|
9
|
+
LESS_THAN = "lessThan"
|
|
10
|
+
LESS_THAN_EQUAL = "lessThanEqual"
|
|
11
|
+
CONTAINS = "contains"
|
|
12
|
+
IS_NULL = "isNull"
|
|
13
|
+
IS_NOT_NULL = "isNotNull"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class Operator
|
|
17
|
+
def initialize(method, values = nil)
|
|
18
|
+
@method = method
|
|
19
|
+
|
|
20
|
+
if values != nil
|
|
21
|
+
if values.is_a?(Array)
|
|
22
|
+
@values = values
|
|
23
|
+
else
|
|
24
|
+
@values = [values]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def to_json(*args)
|
|
30
|
+
result = { method: @method }
|
|
31
|
+
result[:values] = @values unless @values.nil?
|
|
32
|
+
result.to_json(*args)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def to_s
|
|
36
|
+
return self.to_json
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class << Operator
|
|
40
|
+
def increment(value = 1, max = nil)
|
|
41
|
+
raise ArgumentError, "Value cannot be NaN or Infinity" if value.respond_to?(:nan?) && (value.nan? || value.infinite?)
|
|
42
|
+
raise ArgumentError, "Max cannot be NaN or Infinity" if max != nil && max.respond_to?(:nan?) && (max.nan? || max.infinite?)
|
|
43
|
+
values = [value]
|
|
44
|
+
values << max if max != nil
|
|
45
|
+
return Operator.new("increment", values).to_s
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def decrement(value = 1, min = nil)
|
|
49
|
+
raise ArgumentError, "Value cannot be NaN or Infinity" if value.respond_to?(:nan?) && (value.nan? || value.infinite?)
|
|
50
|
+
raise ArgumentError, "Min cannot be NaN or Infinity" if min != nil && min.respond_to?(:nan?) && (min.nan? || min.infinite?)
|
|
51
|
+
values = [value]
|
|
52
|
+
values << min if min != nil
|
|
53
|
+
return Operator.new("decrement", values).to_s
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def multiply(factor, max = nil)
|
|
57
|
+
raise ArgumentError, "Factor cannot be NaN or Infinity" if factor.respond_to?(:nan?) && (factor.nan? || factor.infinite?)
|
|
58
|
+
raise ArgumentError, "Max cannot be NaN or Infinity" if max != nil && max.respond_to?(:nan?) && (max.nan? || max.infinite?)
|
|
59
|
+
values = [factor]
|
|
60
|
+
values << max if max != nil
|
|
61
|
+
return Operator.new("multiply", values).to_s
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def divide(divisor, min = nil)
|
|
65
|
+
raise ArgumentError, "Divisor cannot be NaN or Infinity" if divisor.respond_to?(:nan?) && (divisor.nan? || divisor.infinite?)
|
|
66
|
+
raise ArgumentError, "Min cannot be NaN or Infinity" if min != nil && min.respond_to?(:nan?) && (min.nan? || min.infinite?)
|
|
67
|
+
raise ArgumentError, "Divisor cannot be zero" if divisor == 0 || divisor == 0.0
|
|
68
|
+
values = [divisor]
|
|
69
|
+
values << min if min != nil
|
|
70
|
+
return Operator.new("divide", values).to_s
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def modulo(divisor)
|
|
74
|
+
raise ArgumentError, "Divisor cannot be NaN or Infinity" if divisor.respond_to?(:nan?) && (divisor.nan? || divisor.infinite?)
|
|
75
|
+
raise ArgumentError, "Divisor cannot be zero" if divisor == 0 || divisor == 0.0
|
|
76
|
+
return Operator.new("modulo", [divisor]).to_s
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def power(exponent, max = nil)
|
|
80
|
+
raise ArgumentError, "Exponent cannot be NaN or Infinity" if exponent.respond_to?(:nan?) && (exponent.nan? || exponent.infinite?)
|
|
81
|
+
raise ArgumentError, "Max cannot be NaN or Infinity" if max != nil && max.respond_to?(:nan?) && (max.nan? || max.infinite?)
|
|
82
|
+
values = [exponent]
|
|
83
|
+
values << max if max != nil
|
|
84
|
+
return Operator.new("power", values).to_s
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def array_append(values)
|
|
88
|
+
return Operator.new("arrayAppend", values).to_s
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def array_prepend(values)
|
|
92
|
+
return Operator.new("arrayPrepend", values).to_s
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def array_insert(index, value)
|
|
96
|
+
return Operator.new("arrayInsert", [index, value]).to_s
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def array_remove(value)
|
|
100
|
+
return Operator.new("arrayRemove", [value]).to_s
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def array_unique()
|
|
104
|
+
return Operator.new("arrayUnique", []).to_s
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def array_intersect(values)
|
|
108
|
+
return Operator.new("arrayIntersect", values).to_s
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def array_diff(values)
|
|
112
|
+
return Operator.new("arrayDiff", values).to_s
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def array_filter(condition, value = nil)
|
|
116
|
+
values = [condition, value]
|
|
117
|
+
return Operator.new("arrayFilter", values).to_s
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def string_concat(value)
|
|
121
|
+
return Operator.new("stringConcat", [value]).to_s
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def string_replace(search, replace)
|
|
125
|
+
return Operator.new("stringReplace", [search, replace]).to_s
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def toggle()
|
|
129
|
+
return Operator.new("toggle", []).to_s
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def date_add_days(days)
|
|
133
|
+
return Operator.new("dateAddDays", [days]).to_s
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def date_sub_days(days)
|
|
137
|
+
return Operator.new("dateSubDays", [days]).to_s
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def date_set_now()
|
|
141
|
+
return Operator.new("dateSetNow", []).to_s
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
data/lib/appwrite/query.rb
CHANGED
|
@@ -133,27 +133,27 @@ module Appwrite
|
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
def created_before(value)
|
|
136
|
-
return
|
|
136
|
+
return less_than("$createdAt", value)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
def created_after(value)
|
|
140
|
-
return
|
|
140
|
+
return greater_than("$createdAt", value)
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
def created_between(start, ending)
|
|
144
|
-
return
|
|
144
|
+
return between("$createdAt", start, ending)
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
def updated_before(value)
|
|
148
|
-
return
|
|
148
|
+
return less_than("$updatedAt", value)
|
|
149
149
|
end
|
|
150
150
|
|
|
151
151
|
def updated_after(value)
|
|
152
|
-
return
|
|
152
|
+
return greater_than("$updatedAt", value)
|
|
153
153
|
end
|
|
154
154
|
|
|
155
155
|
def updated_between(start, ending)
|
|
156
|
-
return
|
|
156
|
+
return between("$updatedAt", start, ending)
|
|
157
157
|
end
|
|
158
158
|
|
|
159
159
|
def or(queries)
|
|
@@ -123,13 +123,15 @@ module Appwrite
|
|
|
123
123
|
# Get the list of identities for the currently logged in user.
|
|
124
124
|
#
|
|
125
125
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
|
|
126
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
126
127
|
#
|
|
127
128
|
# @return [IdentityList]
|
|
128
|
-
def list_identities(queries: nil)
|
|
129
|
+
def list_identities(queries: nil, total: nil)
|
|
129
130
|
api_path = '/account/identities'
|
|
130
131
|
|
|
131
132
|
api_params = {
|
|
132
133
|
queries: queries,
|
|
134
|
+
total: total,
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
api_headers = {
|
|
@@ -203,13 +205,15 @@ module Appwrite
|
|
|
203
205
|
# user. Each log returns user IP address, location and date and time of log.
|
|
204
206
|
#
|
|
205
207
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
208
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
206
209
|
#
|
|
207
210
|
# @return [LogList]
|
|
208
|
-
def list_logs(queries: nil)
|
|
211
|
+
def list_logs(queries: nil, total: nil)
|
|
209
212
|
api_path = '/account/logs'
|
|
210
213
|
|
|
211
214
|
api_params = {
|
|
212
215
|
queries: queries,
|
|
216
|
+
total: total,
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
api_headers = {
|
|
@@ -358,7 +362,7 @@ module Appwrite
|
|
|
358
362
|
#
|
|
359
363
|
# @return [MfaChallenge]
|
|
360
364
|
def create_mfa_challenge(factor:)
|
|
361
|
-
api_path = '/account/mfa/
|
|
365
|
+
api_path = '/account/mfa/challenges'
|
|
362
366
|
|
|
363
367
|
if factor.nil?
|
|
364
368
|
raise Appwrite::Exception.new('Missing required parameter: "factor"')
|
|
@@ -392,7 +396,7 @@ module Appwrite
|
|
|
392
396
|
#
|
|
393
397
|
# @return [Session]
|
|
394
398
|
def update_mfa_challenge(challenge_id:, otp:)
|
|
395
|
-
api_path = '/account/mfa/
|
|
399
|
+
api_path = '/account/mfa/challenges'
|
|
396
400
|
|
|
397
401
|
if challenge_id.nil?
|
|
398
402
|
raise Appwrite::Exception.new('Missing required parameter: "challengeId"')
|
|
@@ -282,5 +282,79 @@ module Appwrite
|
|
|
282
282
|
)
|
|
283
283
|
end
|
|
284
284
|
|
|
285
|
+
# Use this endpoint to capture a screenshot of any website URL. This endpoint
|
|
286
|
+
# uses a headless browser to render the webpage and capture it as an image.
|
|
287
|
+
#
|
|
288
|
+
# You can configure the browser viewport size, theme, user agent,
|
|
289
|
+
# geolocation, permissions, and more. Capture either just the viewport or the
|
|
290
|
+
# full page scroll.
|
|
291
|
+
#
|
|
292
|
+
# When width and height are specified, the image is resized accordingly. If
|
|
293
|
+
# both dimensions are 0, the API provides an image at original size. If
|
|
294
|
+
# dimensions are not specified, the default viewport size is 1280x720px.
|
|
295
|
+
#
|
|
296
|
+
# @param [String] url Website URL which you want to capture.
|
|
297
|
+
# @param [Hash] headers HTTP headers to send with the browser request. Defaults to empty.
|
|
298
|
+
# @param [Integer] viewport_width Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
|
|
299
|
+
# @param [Integer] viewport_height Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
|
|
300
|
+
# @param [Float] scale Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
|
|
301
|
+
# @param [Theme] theme Browser theme. Pass "light" or "dark". Defaults to "light".
|
|
302
|
+
# @param [String] user_agent Custom user agent string. Defaults to browser default.
|
|
303
|
+
# @param [] fullpage Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
|
|
304
|
+
# @param [String] locale Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
|
|
305
|
+
# @param [Timezone] timezone IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default.
|
|
306
|
+
# @param [Float] latitude Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.
|
|
307
|
+
# @param [Float] longitude Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
|
308
|
+
# @param [Float] accuracy Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
|
309
|
+
# @param [] touch Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
|
310
|
+
# @param [Array] permissions Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
|
311
|
+
# @param [Integer] sleep Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
|
312
|
+
# @param [Integer] width Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
|
313
|
+
# @param [Integer] height Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
|
314
|
+
# @param [Integer] quality Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
315
|
+
# @param [Output] output Output format type (jpeg, jpg, png, gif and webp).
|
|
316
|
+
#
|
|
317
|
+
# @return []
|
|
318
|
+
def get_screenshot(url:, headers: nil, viewport_width: nil, viewport_height: nil, scale: nil, theme: nil, user_agent: nil, fullpage: nil, locale: nil, timezone: nil, latitude: nil, longitude: nil, accuracy: nil, touch: nil, permissions: nil, sleep: nil, width: nil, height: nil, quality: nil, output: nil)
|
|
319
|
+
api_path = '/avatars/screenshots'
|
|
320
|
+
|
|
321
|
+
if url.nil?
|
|
322
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
api_params = {
|
|
326
|
+
url: url,
|
|
327
|
+
headers: headers,
|
|
328
|
+
viewportWidth: viewport_width,
|
|
329
|
+
viewportHeight: viewport_height,
|
|
330
|
+
scale: scale,
|
|
331
|
+
theme: theme,
|
|
332
|
+
userAgent: user_agent,
|
|
333
|
+
fullpage: fullpage,
|
|
334
|
+
locale: locale,
|
|
335
|
+
timezone: timezone,
|
|
336
|
+
latitude: latitude,
|
|
337
|
+
longitude: longitude,
|
|
338
|
+
accuracy: accuracy,
|
|
339
|
+
touch: touch,
|
|
340
|
+
permissions: permissions,
|
|
341
|
+
sleep: sleep,
|
|
342
|
+
width: width,
|
|
343
|
+
height: height,
|
|
344
|
+
quality: quality,
|
|
345
|
+
output: output,
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
api_headers = {
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
@client.call(
|
|
352
|
+
method: 'GET',
|
|
353
|
+
path: api_path,
|
|
354
|
+
headers: api_headers,
|
|
355
|
+
params: api_params,
|
|
356
|
+
)
|
|
357
|
+
end
|
|
358
|
+
|
|
285
359
|
end
|
|
286
360
|
end
|
|
@@ -15,14 +15,16 @@ module Appwrite
|
|
|
15
15
|
#
|
|
16
16
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name
|
|
17
17
|
# @param [String] search Search term to filter your list results. Max length: 256 chars.
|
|
18
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
18
19
|
#
|
|
19
20
|
# @return [DatabaseList]
|
|
20
|
-
def list(queries: nil, search: nil)
|
|
21
|
+
def list(queries: nil, search: nil, total: nil)
|
|
21
22
|
api_path = '/databases'
|
|
22
23
|
|
|
23
24
|
api_params = {
|
|
24
25
|
queries: queries,
|
|
25
26
|
search: search,
|
|
27
|
+
total: total,
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
api_headers = {
|
|
@@ -360,9 +362,10 @@ module Appwrite
|
|
|
360
362
|
# @param [String] database_id Database ID.
|
|
361
363
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity
|
|
362
364
|
# @param [String] search Search term to filter your list results. Max length: 256 chars.
|
|
365
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
363
366
|
#
|
|
364
367
|
# @return [CollectionList]
|
|
365
|
-
def list_collections(database_id:, queries: nil, search: nil)
|
|
368
|
+
def list_collections(database_id:, queries: nil, search: nil, total: nil)
|
|
366
369
|
api_path = '/databases/{databaseId}/collections'
|
|
367
370
|
.gsub('{databaseId}', database_id)
|
|
368
371
|
|
|
@@ -373,6 +376,7 @@ module Appwrite
|
|
|
373
376
|
api_params = {
|
|
374
377
|
queries: queries,
|
|
375
378
|
search: search,
|
|
379
|
+
total: total,
|
|
376
380
|
}
|
|
377
381
|
|
|
378
382
|
api_headers = {
|
|
@@ -574,9 +578,10 @@ module Appwrite
|
|
|
574
578
|
# @param [String] database_id Database ID.
|
|
575
579
|
# @param [String] collection_id Collection ID.
|
|
576
580
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error
|
|
581
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
577
582
|
#
|
|
578
583
|
# @return [AttributeList]
|
|
579
|
-
def list_attributes(database_id:, collection_id:, queries: nil)
|
|
584
|
+
def list_attributes(database_id:, collection_id:, queries: nil, total: nil)
|
|
580
585
|
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes'
|
|
581
586
|
.gsub('{databaseId}', database_id)
|
|
582
587
|
.gsub('{collectionId}', collection_id)
|
|
@@ -591,6 +596,7 @@ module Appwrite
|
|
|
591
596
|
|
|
592
597
|
api_params = {
|
|
593
598
|
queries: queries,
|
|
599
|
+
total: total,
|
|
594
600
|
}
|
|
595
601
|
|
|
596
602
|
api_headers = {
|
|
@@ -2204,9 +2210,10 @@ module Appwrite
|
|
|
2204
2210
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
2205
2211
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
2206
2212
|
# @param [String] transaction_id Transaction ID to read uncommitted changes within the transaction.
|
|
2213
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
2207
2214
|
#
|
|
2208
2215
|
# @return [DocumentList]
|
|
2209
|
-
def list_documents(database_id:, collection_id:, queries: nil, transaction_id: nil)
|
|
2216
|
+
def list_documents(database_id:, collection_id:, queries: nil, transaction_id: nil, total: nil)
|
|
2210
2217
|
api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
|
|
2211
2218
|
.gsub('{databaseId}', database_id)
|
|
2212
2219
|
.gsub('{collectionId}', collection_id)
|
|
@@ -2222,6 +2229,7 @@ module Appwrite
|
|
|
2222
2229
|
api_params = {
|
|
2223
2230
|
queries: queries,
|
|
2224
2231
|
transactionId: transaction_id,
|
|
2232
|
+
total: total,
|
|
2225
2233
|
}
|
|
2226
2234
|
|
|
2227
2235
|
api_headers = {
|
|
@@ -2802,9 +2810,10 @@ module Appwrite
|
|
|
2802
2810
|
# @param [String] database_id Database ID.
|
|
2803
2811
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
2804
2812
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error
|
|
2813
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
2805
2814
|
#
|
|
2806
2815
|
# @return [IndexList]
|
|
2807
|
-
def list_indexes(database_id:, collection_id:, queries: nil)
|
|
2816
|
+
def list_indexes(database_id:, collection_id:, queries: nil, total: nil)
|
|
2808
2817
|
api_path = '/databases/{databaseId}/collections/{collectionId}/indexes'
|
|
2809
2818
|
.gsub('{databaseId}', database_id)
|
|
2810
2819
|
.gsub('{collectionId}', collection_id)
|
|
@@ -2819,6 +2828,7 @@ module Appwrite
|
|
|
2819
2828
|
|
|
2820
2829
|
api_params = {
|
|
2821
2830
|
queries: queries,
|
|
2831
|
+
total: total,
|
|
2822
2832
|
}
|
|
2823
2833
|
|
|
2824
2834
|
api_headers = {
|
|
@@ -12,14 +12,16 @@ module Appwrite
|
|
|
12
12
|
#
|
|
13
13
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
|
|
14
14
|
# @param [String] search Search term to filter your list results. Max length: 256 chars.
|
|
15
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
15
16
|
#
|
|
16
17
|
# @return [FunctionList]
|
|
17
|
-
def list(queries: nil, search: nil)
|
|
18
|
+
def list(queries: nil, search: nil, total: nil)
|
|
18
19
|
api_path = '/functions'
|
|
19
20
|
|
|
20
21
|
api_params = {
|
|
21
22
|
queries: queries,
|
|
22
23
|
search: search,
|
|
24
|
+
total: total,
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
api_headers = {
|
|
@@ -317,9 +319,10 @@ module Appwrite
|
|
|
317
319
|
# @param [String] function_id Function ID.
|
|
318
320
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
|
319
321
|
# @param [String] search Search term to filter your list results. Max length: 256 chars.
|
|
322
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
320
323
|
#
|
|
321
324
|
# @return [DeploymentList]
|
|
322
|
-
def list_deployments(function_id:, queries: nil, search: nil)
|
|
325
|
+
def list_deployments(function_id:, queries: nil, search: nil, total: nil)
|
|
323
326
|
api_path = '/functions/{functionId}/deployments'
|
|
324
327
|
.gsub('{functionId}', function_id)
|
|
325
328
|
|
|
@@ -330,6 +333,7 @@ module Appwrite
|
|
|
330
333
|
api_params = {
|
|
331
334
|
queries: queries,
|
|
332
335
|
search: search,
|
|
336
|
+
total: total,
|
|
333
337
|
}
|
|
334
338
|
|
|
335
339
|
api_headers = {
|
|
@@ -454,11 +458,12 @@ module Appwrite
|
|
|
454
458
|
# @param [String] repository Repository name of the template.
|
|
455
459
|
# @param [String] owner The name of the owner of the template.
|
|
456
460
|
# @param [String] root_directory Path to function code in the template repo.
|
|
457
|
-
# @param [
|
|
461
|
+
# @param [TemplateReferenceType] type Type for the reference provided. Can be commit, branch, or tag
|
|
462
|
+
# @param [String] reference Reference value, can be a commit hash, branch name, or release tag
|
|
458
463
|
# @param [] activate Automatically activate the deployment when it is finished building.
|
|
459
464
|
#
|
|
460
465
|
# @return [Deployment]
|
|
461
|
-
def create_template_deployment(function_id:, repository:, owner:, root_directory:,
|
|
466
|
+
def create_template_deployment(function_id:, repository:, owner:, root_directory:, type:, reference:, activate: nil)
|
|
462
467
|
api_path = '/functions/{functionId}/deployments/template'
|
|
463
468
|
.gsub('{functionId}', function_id)
|
|
464
469
|
|
|
@@ -478,15 +483,20 @@ module Appwrite
|
|
|
478
483
|
raise Appwrite::Exception.new('Missing required parameter: "rootDirectory"')
|
|
479
484
|
end
|
|
480
485
|
|
|
481
|
-
if
|
|
482
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
486
|
+
if type.nil?
|
|
487
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
if reference.nil?
|
|
491
|
+
raise Appwrite::Exception.new('Missing required parameter: "reference"')
|
|
483
492
|
end
|
|
484
493
|
|
|
485
494
|
api_params = {
|
|
486
495
|
repository: repository,
|
|
487
496
|
owner: owner,
|
|
488
497
|
rootDirectory: root_directory,
|
|
489
|
-
|
|
498
|
+
type: type,
|
|
499
|
+
reference: reference,
|
|
490
500
|
activate: activate,
|
|
491
501
|
}
|
|
492
502
|
|
|
@@ -508,7 +518,7 @@ module Appwrite
|
|
|
508
518
|
# This endpoint lets you create deployment from a branch, commit, or a tag.
|
|
509
519
|
#
|
|
510
520
|
# @param [String] function_id Function ID.
|
|
511
|
-
# @param [
|
|
521
|
+
# @param [VCSReferenceType] type Type of reference passed. Allowed values are: branch, commit
|
|
512
522
|
# @param [String] reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
|
513
523
|
# @param [] activate Automatically activate the deployment when it is finished building.
|
|
514
524
|
#
|
|
@@ -697,9 +707,10 @@ module Appwrite
|
|
|
697
707
|
#
|
|
698
708
|
# @param [String] function_id Function ID.
|
|
699
709
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
710
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
700
711
|
#
|
|
701
712
|
# @return [ExecutionList]
|
|
702
|
-
def list_executions(function_id:, queries: nil)
|
|
713
|
+
def list_executions(function_id:, queries: nil, total: nil)
|
|
703
714
|
api_path = '/functions/{functionId}/executions'
|
|
704
715
|
.gsub('{functionId}', function_id)
|
|
705
716
|
|
|
@@ -709,6 +720,7 @@ module Appwrite
|
|
|
709
720
|
|
|
710
721
|
api_params = {
|
|
711
722
|
queries: queries,
|
|
723
|
+
total: total,
|
|
712
724
|
}
|
|
713
725
|
|
|
714
726
|
api_headers = {
|