appwrite 7.0.0.pre.RC2 → 7.1.0

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: db30162a2dac2692eeebf378f4cea8089b30d382cb5b156cbcdad545493cd73a
4
- data.tar.gz: 5ebf76520c1ca461bdad5b634bd20c6c20d1c73ea823b06bae536379e33a9dd4
3
+ metadata.gz: f9c3d25be26a97e54c8ecc5e8a720686d689729149e99529eeef7ce54765d416
4
+ data.tar.gz: e5b5c93b14bb662596df240b23c8365c0893f87667790d10e4af6785db15cc0d
5
5
  SHA512:
6
- metadata.gz: 6b9d5a7f32ae74e0522f123ab55396219dbbbef748ec4eb8f728f15ad8da9f0ead7c5c0f65be89842e2415ce37ab1edfa7c095fb349978f7abd5828e5e5dfabe
7
- data.tar.gz: 93bd9893306bf165137705f65cd43ec04d4f314177b4e24f129cb077ec91e88068a9262602cc5d6a6d6d6e9851e1eb933a7dc0719980336eba1435df6ffd902b
6
+ metadata.gz: 8a8507b528da0601820b8503c9660cf26544cc7b8d5930d9eb24458d31eaebc949a3e0b294797606109249135bfba9b72730c92d0dccb0451e484bdacf585672
7
+ data.tar.gz: 29d0880a597928c0d3c6d9a09dc92e994c1c62eb12ad86eaf564c40a6430772136124ed26f7e4af454f5f9dbba3ddc0e42b361633947e339cb9f4e5176c1bd5d
@@ -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'=> '7.0.0-RC2',
19
- 'X-Appwrite-Response-Format' => '1.0.0-RC1'
18
+ 'x-sdk-version'=> '7.1.0',
19
+ 'X-Appwrite-Response-Format' => '1.0.0'
20
20
  }
21
21
  @endpoint = 'https://HOSTNAME/v1'
22
22
  end
@@ -4,21 +4,24 @@ module Appwrite
4
4
  module Models
5
5
  class Document
6
6
  attr_reader :id
7
- attr_reader :collection
7
+ attr_reader :collection_id
8
+ attr_reader :database_id
8
9
  attr_reader :created_at
9
10
  attr_reader :updated_at
10
11
  attr_reader :permissions
11
12
 
12
13
  def initialize(
13
14
  id:,
14
- collection:,
15
+ collection_id:,
16
+ database_id:,
15
17
  created_at:,
16
18
  updated_at:,
17
19
  permissions:,
18
20
  data:
19
21
  )
20
22
  @id = id
21
- @collection = collection
23
+ @collection_id = collection_id
24
+ @database_id = database_id
22
25
  @created_at = created_at
23
26
  @updated_at = updated_at
24
27
  @permissions = permissions
@@ -28,7 +31,8 @@ module Appwrite
28
31
  def self.from(map:)
29
32
  Document.new(
30
33
  id: map["$id"],
31
- collection: map["$collection"],
34
+ collection_id: map["$collectionId"],
35
+ database_id: map["$databaseId"],
32
36
  created_at: map["$createdAt"],
33
37
  updated_at: map["$updatedAt"],
34
38
  permissions: map["$permissions"],
@@ -39,7 +43,8 @@ module Appwrite
39
43
  def to_map
40
44
  {
41
45
  "$id": @id,
42
- "$collection": @collection,
46
+ "$collectionId": @collection_id,
47
+ "$databaseId": @database_id,
43
48
  "$createdAt": @created_at,
44
49
  "$updatedAt": @updated_at,
45
50
  "$permissions": @permissions,
@@ -14,7 +14,7 @@ module Appwrite
14
14
  attr_reader :response
15
15
  attr_reader :stdout
16
16
  attr_reader :stderr
17
- attr_reader :time
17
+ attr_reader :duration
18
18
 
19
19
  def initialize(
20
20
  id:,
@@ -28,7 +28,7 @@ module Appwrite
28
28
  response:,
29
29
  stdout:,
30
30
  stderr:,
31
- time:
31
+ duration:
32
32
  )
33
33
  @id = id
34
34
  @created_at = created_at
@@ -41,7 +41,7 @@ module Appwrite
41
41
  @response = response
42
42
  @stdout = stdout
43
43
  @stderr = stderr
44
- @time = time
44
+ @duration = duration
45
45
  end
46
46
 
47
47
  def self.from(map:)
@@ -57,7 +57,7 @@ module Appwrite
57
57
  response: map["response"],
58
58
  stdout: map["stdout"],
59
59
  stderr: map["stderr"],
60
- time: map["time"]
60
+ duration: map["duration"]
61
61
  )
62
62
  end
63
63
 
@@ -74,7 +74,7 @@ module Appwrite
74
74
  "response": @response,
75
75
  "stdout": @stdout,
76
76
  "stderr": @stderr,
77
- "time": @time
77
+ "duration": @duration
78
78
  }
79
79
  end
80
80
  end
@@ -8,7 +8,7 @@ module Appwrite
8
8
  attr_reader :updated_at
9
9
  attr_reader :execute
10
10
  attr_reader :name
11
- attr_reader :status
11
+ attr_reader :enabled
12
12
  attr_reader :runtime
13
13
  attr_reader :deployment
14
14
  attr_reader :vars
@@ -24,7 +24,7 @@ module Appwrite
24
24
  updated_at:,
25
25
  execute:,
26
26
  name:,
27
- status:,
27
+ enabled:,
28
28
  runtime:,
29
29
  deployment:,
30
30
  vars:,
@@ -39,7 +39,7 @@ module Appwrite
39
39
  @updated_at = updated_at
40
40
  @execute = execute
41
41
  @name = name
42
- @status = status
42
+ @enabled = enabled
43
43
  @runtime = runtime
44
44
  @deployment = deployment
45
45
  @vars = vars
@@ -57,7 +57,7 @@ module Appwrite
57
57
  updated_at: map["$updatedAt"],
58
58
  execute: map["execute"],
59
59
  name: map["name"],
60
- status: map["status"],
60
+ enabled: map["enabled"],
61
61
  runtime: map["runtime"],
62
62
  deployment: map["deployment"],
63
63
  vars: map["vars"].map { |it| Variable.from(map: it) },
@@ -76,7 +76,7 @@ module Appwrite
76
76
  "$updatedAt": @updated_at,
77
77
  "execute": @execute,
78
78
  "name": @name,
79
- "status": @status,
79
+ "enabled": @enabled,
80
80
  "runtime": @runtime,
81
81
  "deployment": @deployment,
82
82
  "vars": @vars.map { |it| it.to_map },
data/lib/appwrite/role.rb CHANGED
@@ -4,12 +4,20 @@ module Appwrite
4
4
  'any'
5
5
  end
6
6
 
7
- def self.user(id)
8
- "user:#{id}"
7
+ def self.user(id, status = "")
8
+ if(status.empty?)
9
+ "user:#{id}"
10
+ else
11
+ "user:#{id}/#{status}"
12
+ end
9
13
  end
10
14
 
11
- def self.users
12
- 'users'
15
+ def self.users(status = "")
16
+ if(status.empty?)
17
+ 'users'
18
+ else
19
+ "users/#{status}"
20
+ end
13
21
  end
14
22
 
15
23
  def self.guests
@@ -23,9 +31,9 @@ module Appwrite
23
31
  "team:#{id}/#{role}"
24
32
  end
25
33
  end
26
-
27
- def self.status(status)
28
- "status:#{status}"
34
+
35
+ def self.member(id)
36
+ "member:#{id}"
29
37
  end
30
38
  end
31
39
  end
@@ -12,7 +12,6 @@ module Appwrite
12
12
  #
13
13
  # @return [Account]
14
14
  def get()
15
-
16
15
  path = '/account'
17
16
 
18
17
  params = {
@@ -46,9 +45,16 @@ module Appwrite
46
45
  #
47
46
  # @return [Account]
48
47
  def update_email(email:, password:)
49
-
50
48
  path = '/account/email'
51
49
 
50
+ if email.nil?
51
+ raise Appwrite::Exception.new('Missing required parameter: "email"')
52
+ end
53
+
54
+ if password.nil?
55
+ raise Appwrite::Exception.new('Missing required parameter: "password"')
56
+ end
57
+
52
58
  params = {
53
59
  email: email,
54
60
  password: password,
@@ -57,14 +63,6 @@ module Appwrite
57
63
  headers = {
58
64
  "content-type": 'application/json',
59
65
  }
60
- if email.nil?
61
- raise Appwrite::Exception.new('Missing required parameter: "email"')
62
- end
63
-
64
- if password.nil?
65
- raise Appwrite::Exception.new('Missing required parameter: "password"')
66
- end
67
-
68
66
 
69
67
  @client.call(
70
68
  method: 'PATCH',
@@ -82,8 +80,7 @@ module Appwrite
82
80
  # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset
83
81
  #
84
82
  # @return [LogList]
85
- def get_logs(queries: nil)
86
-
83
+ def list_logs(queries: nil)
87
84
  path = '/account/logs'
88
85
 
89
86
  params = {
@@ -110,9 +107,12 @@ module Appwrite
110
107
  #
111
108
  # @return [Account]
112
109
  def update_name(name:)
113
-
114
110
  path = '/account/name'
115
111
 
112
+ if name.nil?
113
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
114
+ end
115
+
116
116
  params = {
117
117
  name: name,
118
118
  }
@@ -120,10 +120,6 @@ module Appwrite
120
120
  headers = {
121
121
  "content-type": 'application/json',
122
122
  }
123
- if name.nil?
124
- raise Appwrite::Exception.new('Missing required parameter: "name"')
125
- end
126
-
127
123
 
128
124
  @client.call(
129
125
  method: 'PATCH',
@@ -144,9 +140,12 @@ module Appwrite
144
140
  #
145
141
  # @return [Account]
146
142
  def update_password(password:, old_password: nil)
147
-
148
143
  path = '/account/password'
149
144
 
145
+ if password.nil?
146
+ raise Appwrite::Exception.new('Missing required parameter: "password"')
147
+ end
148
+
150
149
  params = {
151
150
  password: password,
152
151
  oldPassword: old_password,
@@ -155,10 +154,6 @@ module Appwrite
155
154
  headers = {
156
155
  "content-type": 'application/json',
157
156
  }
158
- if password.nil?
159
- raise Appwrite::Exception.new('Missing required parameter: "password"')
160
- end
161
-
162
157
 
163
158
  @client.call(
164
159
  method: 'PATCH',
@@ -181,9 +176,16 @@ module Appwrite
181
176
  #
182
177
  # @return [Account]
183
178
  def update_phone(phone:, password:)
184
-
185
179
  path = '/account/phone'
186
180
 
181
+ if phone.nil?
182
+ raise Appwrite::Exception.new('Missing required parameter: "phone"')
183
+ end
184
+
185
+ if password.nil?
186
+ raise Appwrite::Exception.new('Missing required parameter: "password"')
187
+ end
188
+
187
189
  params = {
188
190
  phone: phone,
189
191
  password: password,
@@ -192,14 +194,6 @@ module Appwrite
192
194
  headers = {
193
195
  "content-type": 'application/json',
194
196
  }
195
- if phone.nil?
196
- raise Appwrite::Exception.new('Missing required parameter: "phone"')
197
- end
198
-
199
- if password.nil?
200
- raise Appwrite::Exception.new('Missing required parameter: "password"')
201
- end
202
-
203
197
 
204
198
  @client.call(
205
199
  method: 'PATCH',
@@ -216,7 +210,6 @@ module Appwrite
216
210
  #
217
211
  # @return [Preferences]
218
212
  def get_prefs()
219
-
220
213
  path = '/account/prefs'
221
214
 
222
215
  params = {
@@ -244,9 +237,12 @@ module Appwrite
244
237
  #
245
238
  # @return [Account]
246
239
  def update_prefs(prefs:)
247
-
248
240
  path = '/account/prefs'
249
241
 
242
+ if prefs.nil?
243
+ raise Appwrite::Exception.new('Missing required parameter: "prefs"')
244
+ end
245
+
250
246
  params = {
251
247
  prefs: prefs,
252
248
  }
@@ -254,10 +250,6 @@ module Appwrite
254
250
  headers = {
255
251
  "content-type": 'application/json',
256
252
  }
257
- if prefs.nil?
258
- raise Appwrite::Exception.new('Missing required parameter: "prefs"')
259
- end
260
-
261
253
 
262
254
  @client.call(
263
255
  method: 'PATCH',
@@ -283,9 +275,16 @@ module Appwrite
283
275
  #
284
276
  # @return [Token]
285
277
  def create_recovery(email:, url:)
286
-
287
278
  path = '/account/recovery'
288
279
 
280
+ if email.nil?
281
+ raise Appwrite::Exception.new('Missing required parameter: "email"')
282
+ end
283
+
284
+ if url.nil?
285
+ raise Appwrite::Exception.new('Missing required parameter: "url"')
286
+ end
287
+
289
288
  params = {
290
289
  email: email,
291
290
  url: url,
@@ -294,14 +293,6 @@ module Appwrite
294
293
  headers = {
295
294
  "content-type": 'application/json',
296
295
  }
297
- if email.nil?
298
- raise Appwrite::Exception.new('Missing required parameter: "email"')
299
- end
300
-
301
- if url.nil?
302
- raise Appwrite::Exception.new('Missing required parameter: "url"')
303
- end
304
-
305
296
 
306
297
  @client.call(
307
298
  method: 'POST',
@@ -330,35 +321,34 @@ module Appwrite
330
321
  #
331
322
  # @return [Token]
332
323
  def update_recovery(user_id:, secret:, password:, password_again:)
333
-
334
324
  path = '/account/recovery'
335
325
 
336
- params = {
337
- userId: user_id,
338
- secret: secret,
339
- password: password,
340
- passwordAgain: password_again,
341
- }
342
-
343
- headers = {
344
- "content-type": 'application/json',
345
- }
346
326
  if user_id.nil?
347
- raise Appwrite::Exception.new('Missing required parameter: "userId"')
327
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
348
328
  end
349
329
 
350
330
  if secret.nil?
351
- raise Appwrite::Exception.new('Missing required parameter: "secret"')
331
+ raise Appwrite::Exception.new('Missing required parameter: "secret"')
352
332
  end
353
333
 
354
334
  if password.nil?
355
- raise Appwrite::Exception.new('Missing required parameter: "password"')
335
+ raise Appwrite::Exception.new('Missing required parameter: "password"')
356
336
  end
357
337
 
358
338
  if password_again.nil?
359
- raise Appwrite::Exception.new('Missing required parameter: "passwordAgain"')
339
+ raise Appwrite::Exception.new('Missing required parameter: "passwordAgain"')
360
340
  end
361
341
 
342
+ params = {
343
+ userId: user_id,
344
+ secret: secret,
345
+ password: password,
346
+ passwordAgain: password_again,
347
+ }
348
+
349
+ headers = {
350
+ "content-type": 'application/json',
351
+ }
362
352
 
363
353
  @client.call(
364
354
  method: 'PUT',
@@ -375,8 +365,7 @@ module Appwrite
375
365
  #
376
366
  #
377
367
  # @return [SessionList]
378
- def get_sessions()
379
-
368
+ def list_sessions()
380
369
  path = '/account/sessions'
381
370
 
382
371
  params = {
@@ -402,7 +391,6 @@ module Appwrite
402
391
  #
403
392
  # @return []
404
393
  def delete_sessions()
405
-
406
394
  path = '/account/sessions'
407
395
 
408
396
  params = {
@@ -428,8 +416,12 @@ module Appwrite
428
416
  #
429
417
  # @return [Session]
430
418
  def get_session(session_id:)
431
-
432
419
  path = '/account/sessions/{sessionId}'
420
+ .gsub('{sessionId}', session_id)
421
+
422
+ if session_id.nil?
423
+ raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
424
+ end
433
425
 
434
426
  params = {
435
427
  }
@@ -437,11 +429,6 @@ module Appwrite
437
429
  headers = {
438
430
  "content-type": 'application/json',
439
431
  }
440
- if session_id.nil?
441
- raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
442
- end
443
-
444
- .gsub('{sessionId}', session_id)
445
432
 
446
433
  @client.call(
447
434
  method: 'GET',
@@ -461,8 +448,12 @@ module Appwrite
461
448
  #
462
449
  # @return [Session]
463
450
  def update_session(session_id:)
464
-
465
451
  path = '/account/sessions/{sessionId}'
452
+ .gsub('{sessionId}', session_id)
453
+
454
+ if session_id.nil?
455
+ raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
456
+ end
466
457
 
467
458
  params = {
468
459
  }
@@ -470,11 +461,6 @@ module Appwrite
470
461
  headers = {
471
462
  "content-type": 'application/json',
472
463
  }
473
- if session_id.nil?
474
- raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
475
- end
476
-
477
- .gsub('{sessionId}', session_id)
478
464
 
479
465
  @client.call(
480
466
  method: 'PATCH',
@@ -495,8 +481,12 @@ module Appwrite
495
481
  #
496
482
  # @return []
497
483
  def delete_session(session_id:)
498
-
499
484
  path = '/account/sessions/{sessionId}'
485
+ .gsub('{sessionId}', session_id)
486
+
487
+ if session_id.nil?
488
+ raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
489
+ end
500
490
 
501
491
  params = {
502
492
  }
@@ -504,11 +494,6 @@ module Appwrite
504
494
  headers = {
505
495
  "content-type": 'application/json',
506
496
  }
507
- if session_id.nil?
508
- raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
509
- end
510
-
511
- .gsub('{sessionId}', session_id)
512
497
 
513
498
  @client.call(
514
499
  method: 'DELETE',
@@ -526,7 +511,6 @@ module Appwrite
526
511
  #
527
512
  # @return [Account]
528
513
  def update_status()
529
-
530
514
  path = '/account/status'
531
515
 
532
516
  params = {
@@ -566,9 +550,12 @@ module Appwrite
566
550
  #
567
551
  # @return [Token]
568
552
  def create_verification(url:)
569
-
570
553
  path = '/account/verification'
571
554
 
555
+ if url.nil?
556
+ raise Appwrite::Exception.new('Missing required parameter: "url"')
557
+ end
558
+
572
559
  params = {
573
560
  url: url,
574
561
  }
@@ -576,10 +563,6 @@ module Appwrite
576
563
  headers = {
577
564
  "content-type": 'application/json',
578
565
  }
579
- if url.nil?
580
- raise Appwrite::Exception.new('Missing required parameter: "url"')
581
- end
582
-
583
566
 
584
567
  @client.call(
585
568
  method: 'POST',
@@ -601,9 +584,16 @@ module Appwrite
601
584
  #
602
585
  # @return [Token]
603
586
  def update_verification(user_id:, secret:)
604
-
605
587
  path = '/account/verification'
606
588
 
589
+ if user_id.nil?
590
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
591
+ end
592
+
593
+ if secret.nil?
594
+ raise Appwrite::Exception.new('Missing required parameter: "secret"')
595
+ end
596
+
607
597
  params = {
608
598
  userId: user_id,
609
599
  secret: secret,
@@ -612,14 +602,6 @@ module Appwrite
612
602
  headers = {
613
603
  "content-type": 'application/json',
614
604
  }
615
- if user_id.nil?
616
- raise Appwrite::Exception.new('Missing required parameter: "userId"')
617
- end
618
-
619
- if secret.nil?
620
- raise Appwrite::Exception.new('Missing required parameter: "secret"')
621
- end
622
-
623
605
 
624
606
  @client.call(
625
607
  method: 'PUT',
@@ -641,7 +623,6 @@ module Appwrite
641
623
  #
642
624
  # @return [Token]
643
625
  def create_phone_verification()
644
-
645
626
  path = '/account/verification/phone'
646
627
 
647
628
  params = {
@@ -671,9 +652,16 @@ module Appwrite
671
652
  #
672
653
  # @return [Token]
673
654
  def update_phone_verification(user_id:, secret:)
674
-
675
655
  path = '/account/verification/phone'
676
656
 
657
+ if user_id.nil?
658
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
659
+ end
660
+
661
+ if secret.nil?
662
+ raise Appwrite::Exception.new('Missing required parameter: "secret"')
663
+ end
664
+
677
665
  params = {
678
666
  userId: user_id,
679
667
  secret: secret,
@@ -682,14 +670,6 @@ module Appwrite
682
670
  headers = {
683
671
  "content-type": 'application/json',
684
672
  }
685
- if user_id.nil?
686
- raise Appwrite::Exception.new('Missing required parameter: "userId"')
687
- end
688
-
689
- if secret.nil?
690
- raise Appwrite::Exception.new('Missing required parameter: "secret"')
691
- end
692
-
693
673
 
694
674
  @client.call(
695
675
  method: 'PUT',