appwrite 11.0.2 → 13.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e424b9f2d47290e383c32b18e244a3a49847d6f65c4d208336271dd8c84cd66
4
- data.tar.gz: 5472a16fc5f3c5b37ae116e73752aaf096804c9e06103003bf47f02d93e16b3b
3
+ metadata.gz: 204a8ccd072fd6ffc1646fa433866343a9af6a36253ff7ceff9f40173c0f01c7
4
+ data.tar.gz: 14ee8bc80f69a8c4e0ad36fa27d1ee58b1a71ea41a3a98be71276fa68fa56a48
5
5
  SHA512:
6
- metadata.gz: 67c94728750e2116841b3f4292d00c40ab277e11a1083e58e5e813b5444953ce55ddfdd0873a782e03c9e3a2b1c16d8b2c74fbafe4b5c7b0f4990f923b376566
7
- data.tar.gz: 0e6d5bcca03322aa2f6353695615a802e045018502fb65a6cbe0178d0a1f9ee038a9e1367c8017fa094dd841d9be80a86f30bfcfb7808ee8d840ec60000cc8bb
6
+ metadata.gz: 79f2553e43afcfbaa9a7afaaa647d95a733245a55a4b1f4adfc197af31e0c8975dfc2242ab3305ed24cc99f50f0664f4f888f28c1146425a3ed896779326edca
7
+ data.tar.gz: e8cf14548158fa30eb56d0b5dd88c6d7b8623292e061c3d246522036350f87188c7c6ed08221e2947552b49ed46fc81b0e70b43ba865727db326e8e0348e57d0
@@ -15,8 +15,8 @@ module Appwrite
15
15
  'x-sdk-name'=> 'Ruby',
16
16
  'x-sdk-platform'=> 'server',
17
17
  'x-sdk-language'=> 'ruby',
18
- 'x-sdk-version'=> '11.0.2',
19
- 'X-Appwrite-Response-Format' => '1.5.0'
18
+ 'x-sdk-version'=> '13.0.1',
19
+ 'X-Appwrite-Response-Format' => '1.6.0'
20
20
  }
21
21
  @endpoint = 'https://cloud.appwrite.io/v1'
22
22
  end
@@ -268,7 +268,7 @@ module Appwrite
268
268
  when 'application/json'
269
269
  payload = params.to_json
270
270
  when 'multipart/form-data'
271
- payload = "--#{@boundary}\r\n" + encode_form_data(params)
271
+ payload = encode_form_data(params) + "--#{@boundary}--\r\n"
272
272
  headers[:'content-type'] = "multipart/form-data; boundary=#{@boundary}"
273
273
  else
274
274
  payload = encode(params)
@@ -281,6 +281,13 @@ module Appwrite
281
281
  raise Appwrite::Exception.new(error.message)
282
282
  end
283
283
 
284
+ warnings = response['x-appwrite-warning']
285
+ if warnings
286
+ warnings.split(';').each do |warning|
287
+ warn "Warning: #{warning}"
288
+ end
289
+ end
290
+
284
291
  location = response['location']
285
292
  if response_type == "location"
286
293
  return location
@@ -332,16 +339,18 @@ module Appwrite
332
339
  else
333
340
  post_body = []
334
341
  if value.instance_of? InputFile
335
- post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.filename}\"\r\n"
336
- post_body << "Content-Type: #{value.mime_type}\r\n\r\n"
342
+ post_body << "--#{@boundary}"
343
+ post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.filename}\""
344
+ post_body << "Content-Type: #{value.mime_type}"
345
+ post_body << ""
337
346
  post_body << value.data
338
- post_body << "\r\n--#{@boundary}--\r\n"
339
- else
340
- post_body << "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n"
341
- post_body << "#{value.to_s}"
342
- post_body << "\r\n--#{@boundary}\r\n"
347
+ else
348
+ post_body << "--#{@boundary}"
349
+ post_body << "Content-Disposition: form-data; name=\"#{key}\""
350
+ post_body << ""
351
+ post_body << value.to_s
343
352
  end
344
- post_body.join
353
+ post_body.join("\r\n") + "\r\n"
345
354
  end
346
355
  end
347
356
 
@@ -6,6 +6,7 @@ module Appwrite
6
6
  GIF = 'gif'
7
7
  PNG = 'png'
8
8
  WEBP = 'webp'
9
+ AVIF = 'avif'
9
10
  end
10
11
  end
11
12
  end
@@ -8,12 +8,11 @@ module Appwrite
8
8
  V1_FUNCTIONS = 'v1-functions'
9
9
  V1_USAGE = 'v1-usage'
10
10
  V1_USAGE_DUMP = 'v1-usage-dump'
11
- WEBHOOKSV1 = 'webhooksv1'
11
+ V1_WEBHOOKS = 'v1-webhooks'
12
12
  V1_CERTIFICATES = 'v1-certificates'
13
13
  V1_BUILDS = 'v1-builds'
14
14
  V1_MESSAGING = 'v1-messaging'
15
15
  V1_MIGRATIONS = 'v1-migrations'
16
- HAMSTERV1 = 'hamsterv1'
17
16
  end
18
17
  end
19
18
  end
@@ -7,6 +7,7 @@ module Appwrite
7
7
  NODE_19_0 = 'node-19.0'
8
8
  NODE_20_0 = 'node-20.0'
9
9
  NODE_21_0 = 'node-21.0'
10
+ NODE_22 = 'node-22'
10
11
  PHP_8_0 = 'php-8.0'
11
12
  PHP_8_1 = 'php-8.1'
12
13
  PHP_8_2 = 'php-8.2'
@@ -21,7 +22,12 @@ module Appwrite
21
22
  PYTHON_3_11 = 'python-3.11'
22
23
  PYTHON_3_12 = 'python-3.12'
23
24
  PYTHON_ML_3_11 = 'python-ml-3.11'
25
+ DENO_1_21 = 'deno-1.21'
26
+ DENO_1_24 = 'deno-1.24'
27
+ DENO_1_35 = 'deno-1.35'
24
28
  DENO_1_40 = 'deno-1.40'
29
+ DENO_1_46 = 'deno-1.46'
30
+ DENO_2_0 = 'deno-2.0'
25
31
  DART_2_15 = 'dart-2.15'
26
32
  DART_2_16 = 'dart-2.16'
27
33
  DART_2_17 = 'dart-2.17'
@@ -29,23 +35,30 @@ module Appwrite
29
35
  DART_3_0 = 'dart-3.0'
30
36
  DART_3_1 = 'dart-3.1'
31
37
  DART_3_3 = 'dart-3.3'
32
- DOTNET_3_1 = 'dotnet-3.1'
38
+ DART_3_5 = 'dart-3.5'
33
39
  DOTNET_6_0 = 'dotnet-6.0'
34
40
  DOTNET_7_0 = 'dotnet-7.0'
41
+ DOTNET_8_0 = 'dotnet-8.0'
35
42
  JAVA_8_0 = 'java-8.0'
36
43
  JAVA_11_0 = 'java-11.0'
37
44
  JAVA_17_0 = 'java-17.0'
38
45
  JAVA_18_0 = 'java-18.0'
39
46
  JAVA_21_0 = 'java-21.0'
47
+ JAVA_22 = 'java-22'
40
48
  SWIFT_5_5 = 'swift-5.5'
41
49
  SWIFT_5_8 = 'swift-5.8'
42
50
  SWIFT_5_9 = 'swift-5.9'
51
+ SWIFT_5_10 = 'swift-5.10'
43
52
  KOTLIN_1_6 = 'kotlin-1.6'
44
53
  KOTLIN_1_8 = 'kotlin-1.8'
45
54
  KOTLIN_1_9 = 'kotlin-1.9'
55
+ KOTLIN_2_0 = 'kotlin-2.0'
46
56
  CPP_17 = 'cpp-17'
47
57
  CPP_20 = 'cpp-20'
48
58
  BUN_1_0 = 'bun-1.0'
59
+ BUN_1_1 = 'bun-1.1'
60
+ GO_1_23 = 'go-1.23'
61
+ STATIC_1 = 'static-1'
49
62
  end
50
63
  end
51
64
  end
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :default
13
15
 
14
16
  def initialize(
@@ -18,6 +20,8 @@ module Appwrite
18
20
  error:,
19
21
  required:,
20
22
  array: ,
23
+ created_at:,
24
+ updated_at:,
21
25
  default:
22
26
  )
23
27
  @key = key
@@ -26,6 +30,8 @@ module Appwrite
26
30
  @error = error
27
31
  @required = required
28
32
  @array = array
33
+ @created_at = created_at
34
+ @updated_at = updated_at
29
35
  @default = default
30
36
  end
31
37
 
@@ -37,6 +43,8 @@ module Appwrite
37
43
  error: map["error"],
38
44
  required: map["required"],
39
45
  array: map["array"],
46
+ created_at: map["$createdAt"],
47
+ updated_at: map["$updatedAt"],
40
48
  default: map["default"]
41
49
  )
42
50
  end
@@ -49,6 +57,8 @@ module Appwrite
49
57
  "error": @error,
50
58
  "required": @required,
51
59
  "array": @array,
60
+ "$createdAt": @created_at,
61
+ "$updatedAt": @updated_at,
52
62
  "default": @default
53
63
  }
54
64
  end
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :format
13
15
  attr_reader :default
14
16
 
@@ -19,6 +21,8 @@ module Appwrite
19
21
  error:,
20
22
  required:,
21
23
  array: ,
24
+ created_at:,
25
+ updated_at:,
22
26
  format:,
23
27
  default:
24
28
  )
@@ -28,6 +32,8 @@ module Appwrite
28
32
  @error = error
29
33
  @required = required
30
34
  @array = array
35
+ @created_at = created_at
36
+ @updated_at = updated_at
31
37
  @format = format
32
38
  @default = default
33
39
  end
@@ -40,6 +46,8 @@ module Appwrite
40
46
  error: map["error"],
41
47
  required: map["required"],
42
48
  array: map["array"],
49
+ created_at: map["$createdAt"],
50
+ updated_at: map["$updatedAt"],
43
51
  format: map["format"],
44
52
  default: map["default"]
45
53
  )
@@ -53,6 +61,8 @@ module Appwrite
53
61
  "error": @error,
54
62
  "required": @required,
55
63
  "array": @array,
64
+ "$createdAt": @created_at,
65
+ "$updatedAt": @updated_at,
56
66
  "format": @format,
57
67
  "default": @default
58
68
  }
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :format
13
15
  attr_reader :default
14
16
 
@@ -19,6 +21,8 @@ module Appwrite
19
21
  error:,
20
22
  required:,
21
23
  array: ,
24
+ created_at:,
25
+ updated_at:,
22
26
  format:,
23
27
  default:
24
28
  )
@@ -28,6 +32,8 @@ module Appwrite
28
32
  @error = error
29
33
  @required = required
30
34
  @array = array
35
+ @created_at = created_at
36
+ @updated_at = updated_at
31
37
  @format = format
32
38
  @default = default
33
39
  end
@@ -40,6 +46,8 @@ module Appwrite
40
46
  error: map["error"],
41
47
  required: map["required"],
42
48
  array: map["array"],
49
+ created_at: map["$createdAt"],
50
+ updated_at: map["$updatedAt"],
43
51
  format: map["format"],
44
52
  default: map["default"]
45
53
  )
@@ -53,6 +61,8 @@ module Appwrite
53
61
  "error": @error,
54
62
  "required": @required,
55
63
  "array": @array,
64
+ "$createdAt": @created_at,
65
+ "$updatedAt": @updated_at,
56
66
  "format": @format,
57
67
  "default": @default
58
68
  }
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :elements
13
15
  attr_reader :format
14
16
  attr_reader :default
@@ -20,6 +22,8 @@ module Appwrite
20
22
  error:,
21
23
  required:,
22
24
  array: ,
25
+ created_at:,
26
+ updated_at:,
23
27
  elements:,
24
28
  format:,
25
29
  default:
@@ -30,6 +34,8 @@ module Appwrite
30
34
  @error = error
31
35
  @required = required
32
36
  @array = array
37
+ @created_at = created_at
38
+ @updated_at = updated_at
33
39
  @elements = elements
34
40
  @format = format
35
41
  @default = default
@@ -43,6 +49,8 @@ module Appwrite
43
49
  error: map["error"],
44
50
  required: map["required"],
45
51
  array: map["array"],
52
+ created_at: map["$createdAt"],
53
+ updated_at: map["$updatedAt"],
46
54
  elements: map["elements"],
47
55
  format: map["format"],
48
56
  default: map["default"]
@@ -57,6 +65,8 @@ module Appwrite
57
65
  "error": @error,
58
66
  "required": @required,
59
67
  "array": @array,
68
+ "$createdAt": @created_at,
69
+ "$updatedAt": @updated_at,
60
70
  "elements": @elements,
61
71
  "format": @format,
62
72
  "default": @default
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :min
13
15
  attr_reader :max
14
16
  attr_reader :default
@@ -20,6 +22,8 @@ module Appwrite
20
22
  error:,
21
23
  required:,
22
24
  array: ,
25
+ created_at:,
26
+ updated_at:,
23
27
  min: ,
24
28
  max: ,
25
29
  default:
@@ -30,6 +34,8 @@ module Appwrite
30
34
  @error = error
31
35
  @required = required
32
36
  @array = array
37
+ @created_at = created_at
38
+ @updated_at = updated_at
33
39
  @min = min
34
40
  @max = max
35
41
  @default = default
@@ -43,6 +49,8 @@ module Appwrite
43
49
  error: map["error"],
44
50
  required: map["required"],
45
51
  array: map["array"],
52
+ created_at: map["$createdAt"],
53
+ updated_at: map["$updatedAt"],
46
54
  min: map["min"],
47
55
  max: map["max"],
48
56
  default: map["default"]
@@ -57,6 +65,8 @@ module Appwrite
57
65
  "error": @error,
58
66
  "required": @required,
59
67
  "array": @array,
68
+ "$createdAt": @created_at,
69
+ "$updatedAt": @updated_at,
60
70
  "min": @min,
61
71
  "max": @max,
62
72
  "default": @default
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :min
13
15
  attr_reader :max
14
16
  attr_reader :default
@@ -20,6 +22,8 @@ module Appwrite
20
22
  error:,
21
23
  required:,
22
24
  array: ,
25
+ created_at:,
26
+ updated_at:,
23
27
  min: ,
24
28
  max: ,
25
29
  default:
@@ -30,6 +34,8 @@ module Appwrite
30
34
  @error = error
31
35
  @required = required
32
36
  @array = array
37
+ @created_at = created_at
38
+ @updated_at = updated_at
33
39
  @min = min
34
40
  @max = max
35
41
  @default = default
@@ -43,6 +49,8 @@ module Appwrite
43
49
  error: map["error"],
44
50
  required: map["required"],
45
51
  array: map["array"],
52
+ created_at: map["$createdAt"],
53
+ updated_at: map["$updatedAt"],
46
54
  min: map["min"],
47
55
  max: map["max"],
48
56
  default: map["default"]
@@ -57,6 +65,8 @@ module Appwrite
57
65
  "error": @error,
58
66
  "required": @required,
59
67
  "array": @array,
68
+ "$createdAt": @created_at,
69
+ "$updatedAt": @updated_at,
60
70
  "min": @min,
61
71
  "max": @max,
62
72
  "default": @default
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :format
13
15
  attr_reader :default
14
16
 
@@ -19,6 +21,8 @@ module Appwrite
19
21
  error:,
20
22
  required:,
21
23
  array: ,
24
+ created_at:,
25
+ updated_at:,
22
26
  format:,
23
27
  default:
24
28
  )
@@ -28,6 +32,8 @@ module Appwrite
28
32
  @error = error
29
33
  @required = required
30
34
  @array = array
35
+ @created_at = created_at
36
+ @updated_at = updated_at
31
37
  @format = format
32
38
  @default = default
33
39
  end
@@ -40,6 +46,8 @@ module Appwrite
40
46
  error: map["error"],
41
47
  required: map["required"],
42
48
  array: map["array"],
49
+ created_at: map["$createdAt"],
50
+ updated_at: map["$updatedAt"],
43
51
  format: map["format"],
44
52
  default: map["default"]
45
53
  )
@@ -53,6 +61,8 @@ module Appwrite
53
61
  "error": @error,
54
62
  "required": @required,
55
63
  "array": @array,
64
+ "$createdAt": @created_at,
65
+ "$updatedAt": @updated_at,
56
66
  "format": @format,
57
67
  "default": @default
58
68
  }
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :related_collection
13
15
  attr_reader :relation_type
14
16
  attr_reader :two_way
@@ -23,6 +25,8 @@ module Appwrite
23
25
  error:,
24
26
  required:,
25
27
  array: ,
28
+ created_at:,
29
+ updated_at:,
26
30
  related_collection:,
27
31
  relation_type:,
28
32
  two_way:,
@@ -36,6 +40,8 @@ module Appwrite
36
40
  @error = error
37
41
  @required = required
38
42
  @array = array
43
+ @created_at = created_at
44
+ @updated_at = updated_at
39
45
  @related_collection = related_collection
40
46
  @relation_type = relation_type
41
47
  @two_way = two_way
@@ -52,6 +58,8 @@ module Appwrite
52
58
  error: map["error"],
53
59
  required: map["required"],
54
60
  array: map["array"],
61
+ created_at: map["$createdAt"],
62
+ updated_at: map["$updatedAt"],
55
63
  related_collection: map["relatedCollection"],
56
64
  relation_type: map["relationType"],
57
65
  two_way: map["twoWay"],
@@ -69,6 +77,8 @@ module Appwrite
69
77
  "error": @error,
70
78
  "required": @required,
71
79
  "array": @array,
80
+ "$createdAt": @created_at,
81
+ "$updatedAt": @updated_at,
72
82
  "relatedCollection": @related_collection,
73
83
  "relationType": @relation_type,
74
84
  "twoWay": @two_way,
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :size
13
15
  attr_reader :default
14
16
 
@@ -19,6 +21,8 @@ module Appwrite
19
21
  error:,
20
22
  required:,
21
23
  array: ,
24
+ created_at:,
25
+ updated_at:,
22
26
  size:,
23
27
  default:
24
28
  )
@@ -28,6 +32,8 @@ module Appwrite
28
32
  @error = error
29
33
  @required = required
30
34
  @array = array
35
+ @created_at = created_at
36
+ @updated_at = updated_at
31
37
  @size = size
32
38
  @default = default
33
39
  end
@@ -40,6 +46,8 @@ module Appwrite
40
46
  error: map["error"],
41
47
  required: map["required"],
42
48
  array: map["array"],
49
+ created_at: map["$createdAt"],
50
+ updated_at: map["$updatedAt"],
43
51
  size: map["size"],
44
52
  default: map["default"]
45
53
  )
@@ -53,6 +61,8 @@ module Appwrite
53
61
  "error": @error,
54
62
  "required": @required,
55
63
  "array": @array,
64
+ "$createdAt": @created_at,
65
+ "$updatedAt": @updated_at,
56
66
  "size": @size,
57
67
  "default": @default
58
68
  }
@@ -9,6 +9,8 @@ module Appwrite
9
9
  attr_reader :error
10
10
  attr_reader :required
11
11
  attr_reader :array
12
+ attr_reader :created_at
13
+ attr_reader :updated_at
12
14
  attr_reader :format
13
15
  attr_reader :default
14
16
 
@@ -19,6 +21,8 @@ module Appwrite
19
21
  error:,
20
22
  required:,
21
23
  array: ,
24
+ created_at:,
25
+ updated_at:,
22
26
  format:,
23
27
  default:
24
28
  )
@@ -28,6 +32,8 @@ module Appwrite
28
32
  @error = error
29
33
  @required = required
30
34
  @array = array
35
+ @created_at = created_at
36
+ @updated_at = updated_at
31
37
  @format = format
32
38
  @default = default
33
39
  end
@@ -40,6 +46,8 @@ module Appwrite
40
46
  error: map["error"],
41
47
  required: map["required"],
42
48
  array: map["array"],
49
+ created_at: map["$createdAt"],
50
+ updated_at: map["$updatedAt"],
43
51
  format: map["format"],
44
52
  default: map["default"]
45
53
  )
@@ -53,6 +61,8 @@ module Appwrite
53
61
  "error": @error,
54
62
  "required": @required,
55
63
  "array": @array,
64
+ "$createdAt": @created_at,
65
+ "$updatedAt": @updated_at,
56
66
  "format": @format,
57
67
  "default": @default
58
68
  }
@@ -0,0 +1,67 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Build
6
+ attr_reader :id
7
+ attr_reader :deployment_id
8
+ attr_reader :status
9
+ attr_reader :stdout
10
+ attr_reader :stderr
11
+ attr_reader :start_time
12
+ attr_reader :end_time
13
+ attr_reader :duration
14
+ attr_reader :size
15
+
16
+ def initialize(
17
+ id:,
18
+ deployment_id:,
19
+ status:,
20
+ stdout:,
21
+ stderr:,
22
+ start_time:,
23
+ end_time:,
24
+ duration:,
25
+ size:
26
+ )
27
+ @id = id
28
+ @deployment_id = deployment_id
29
+ @status = status
30
+ @stdout = stdout
31
+ @stderr = stderr
32
+ @start_time = start_time
33
+ @end_time = end_time
34
+ @duration = duration
35
+ @size = size
36
+ end
37
+
38
+ def self.from(map:)
39
+ Build.new(
40
+ id: map["$id"],
41
+ deployment_id: map["deploymentId"],
42
+ status: map["status"],
43
+ stdout: map["stdout"],
44
+ stderr: map["stderr"],
45
+ start_time: map["startTime"],
46
+ end_time: map["endTime"],
47
+ duration: map["duration"],
48
+ size: map["size"]
49
+ )
50
+ end
51
+
52
+ def to_map
53
+ {
54
+ "$id": @id,
55
+ "deploymentId": @deployment_id,
56
+ "status": @status,
57
+ "stdout": @stdout,
58
+ "stderr": @stderr,
59
+ "startTime": @start_time,
60
+ "endTime": @end_time,
61
+ "duration": @duration,
62
+ "size": @size
63
+ }
64
+ end
65
+ end
66
+ end
67
+ end