appwrite 1.0.10 → 2.1.1

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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +16 -0
  3. data/Gemfile +1 -0
  4. data/LICENSE +1 -1
  5. data/README.md +72 -5
  6. data/appwrite.gemspec +3 -5
  7. data/docs/examples/account/create-recovery.md +15 -0
  8. data/docs/examples/account/create-verification.md +15 -0
  9. data/docs/examples/account/delete-session.md +15 -0
  10. data/docs/examples/account/delete-sessions.md +15 -0
  11. data/docs/examples/account/delete.md +15 -0
  12. data/docs/examples/account/get-logs.md +15 -0
  13. data/docs/examples/account/get-prefs.md +15 -0
  14. data/docs/examples/account/get-sessions.md +15 -0
  15. data/docs/examples/account/get.md +15 -0
  16. data/docs/examples/account/update-email.md +15 -0
  17. data/docs/examples/account/update-name.md +15 -0
  18. data/docs/examples/account/update-password.md +15 -0
  19. data/docs/examples/account/update-prefs.md +15 -0
  20. data/docs/examples/account/update-recovery.md +15 -0
  21. data/docs/examples/account/update-verification.md +15 -0
  22. data/docs/examples/avatars/get-browser.md +15 -0
  23. data/docs/examples/avatars/get-credit-card.md +15 -0
  24. data/docs/examples/avatars/get-favicon.md +15 -0
  25. data/docs/examples/avatars/get-flag.md +15 -0
  26. data/docs/examples/avatars/get-image.md +15 -0
  27. data/docs/examples/avatars/get-initials.md +15 -0
  28. data/docs/examples/avatars/get-q-r.md +15 -0
  29. data/docs/examples/database/create-collection.md +15 -0
  30. data/docs/examples/database/create-document.md +15 -0
  31. data/docs/examples/database/delete-collection.md +15 -0
  32. data/docs/examples/database/delete-document.md +15 -0
  33. data/docs/examples/database/get-collection.md +15 -0
  34. data/docs/examples/database/get-document.md +15 -0
  35. data/docs/examples/database/list-collections.md +15 -0
  36. data/docs/examples/database/list-documents.md +15 -0
  37. data/docs/examples/database/update-collection.md +15 -0
  38. data/docs/examples/database/update-document.md +15 -0
  39. data/docs/examples/functions/create-execution.md +15 -0
  40. data/docs/examples/functions/create-tag.md +15 -0
  41. data/docs/examples/functions/create.md +15 -0
  42. data/docs/examples/functions/delete-tag.md +15 -0
  43. data/docs/examples/functions/delete.md +15 -0
  44. data/docs/examples/functions/get-execution.md +15 -0
  45. data/docs/examples/functions/get-tag.md +15 -0
  46. data/docs/examples/functions/get.md +15 -0
  47. data/docs/examples/functions/list-executions.md +15 -0
  48. data/docs/examples/functions/list-tags.md +15 -0
  49. data/docs/examples/functions/list.md +15 -0
  50. data/docs/examples/functions/update-tag.md +15 -0
  51. data/docs/examples/functions/update.md +15 -0
  52. data/docs/examples/health/get-anti-virus.md +15 -0
  53. data/docs/examples/health/get-cache.md +15 -0
  54. data/docs/examples/health/get-d-b.md +15 -0
  55. data/docs/examples/health/get-queue-certificates.md +15 -0
  56. data/docs/examples/health/get-queue-functions.md +15 -0
  57. data/docs/examples/health/get-queue-logs.md +15 -0
  58. data/docs/examples/health/get-queue-tasks.md +15 -0
  59. data/docs/examples/health/get-queue-usage.md +15 -0
  60. data/docs/examples/health/get-queue-webhooks.md +15 -0
  61. data/docs/examples/health/get-storage-local.md +15 -0
  62. data/docs/examples/health/get-time.md +15 -0
  63. data/docs/examples/health/get.md +15 -0
  64. data/docs/examples/locale/get-continents.md +15 -0
  65. data/docs/examples/locale/get-countries-e-u.md +15 -0
  66. data/docs/examples/locale/get-countries-phones.md +15 -0
  67. data/docs/examples/locale/get-countries.md +15 -0
  68. data/docs/examples/locale/get-currencies.md +15 -0
  69. data/docs/examples/locale/get-languages.md +15 -0
  70. data/docs/examples/locale/get.md +15 -0
  71. data/docs/examples/storage/create-file.md +15 -0
  72. data/docs/examples/storage/delete-file.md +15 -0
  73. data/docs/examples/storage/get-file-download.md +15 -0
  74. data/docs/examples/storage/get-file-preview.md +15 -0
  75. data/docs/examples/storage/get-file-view.md +15 -0
  76. data/docs/examples/storage/get-file.md +15 -0
  77. data/docs/examples/storage/list-files.md +15 -0
  78. data/docs/examples/storage/update-file.md +15 -0
  79. data/docs/examples/teams/create-membership.md +15 -0
  80. data/docs/examples/teams/create.md +15 -0
  81. data/docs/examples/teams/delete-membership.md +15 -0
  82. data/docs/examples/teams/delete.md +15 -0
  83. data/docs/examples/teams/get-memberships.md +15 -0
  84. data/docs/examples/teams/get.md +15 -0
  85. data/docs/examples/teams/list.md +15 -0
  86. data/docs/examples/teams/update-membership-roles.md +15 -0
  87. data/docs/examples/teams/update-membership-status.md +15 -0
  88. data/docs/examples/teams/update.md +15 -0
  89. data/docs/examples/users/create.md +15 -0
  90. data/docs/examples/users/delete-session.md +15 -0
  91. data/docs/examples/users/delete-sessions.md +15 -0
  92. data/docs/examples/users/delete.md +15 -0
  93. data/docs/examples/users/get-logs.md +15 -0
  94. data/docs/examples/users/get-prefs.md +15 -0
  95. data/docs/examples/users/get-sessions.md +15 -0
  96. data/docs/examples/users/get.md +15 -0
  97. data/docs/examples/users/list.md +15 -0
  98. data/docs/examples/users/update-prefs.md +15 -0
  99. data/docs/examples/users/update-status.md +15 -0
  100. data/lib/appwrite.rb +5 -0
  101. data/lib/appwrite/client.rb +46 -5
  102. data/lib/appwrite/exception.rb +14 -0
  103. data/lib/appwrite/file.rb +23 -0
  104. data/lib/appwrite/services/account.rb +190 -0
  105. data/lib/appwrite/services/avatars.rb +17 -1
  106. data/lib/appwrite/services/database.rb +17 -31
  107. data/lib/appwrite/services/functions.rb +195 -0
  108. data/lib/appwrite/services/locale.rb +11 -0
  109. data/lib/appwrite/services/storage.rb +14 -10
  110. data/lib/appwrite/services/teams.rb +43 -10
  111. data/lib/appwrite/services/users.rb +21 -9
  112. metadata +104 -10
@@ -67,6 +67,17 @@ module Appwrite
67
67
  }, params);
68
68
  end
69
69
 
70
+ def get_languages()
71
+ path = '/locale/languages'
72
+
73
+ params = {
74
+ }
75
+
76
+ return @client.call('get', path, {
77
+ 'content-type' => 'application/json',
78
+ }, params);
79
+ end
80
+
70
81
 
71
82
  protected
72
83
 
@@ -16,7 +16,7 @@ module Appwrite
16
16
  }, params);
17
17
  end
18
18
 
19
- def create_file(file:, read:, write:)
19
+ def create_file(file:, read: [], write: [])
20
20
  path = '/storage/files'
21
21
 
22
22
  params = {
@@ -32,7 +32,7 @@ module Appwrite
32
32
 
33
33
  def get_file(file_id:)
34
34
  path = '/storage/files/{fileId}'
35
- .gsub('{file_id}', file_id)
35
+ .gsub('{fileId}', file_id)
36
36
 
37
37
  params = {
38
38
  }
@@ -44,7 +44,7 @@ module Appwrite
44
44
 
45
45
  def update_file(file_id:, read:, write:)
46
46
  path = '/storage/files/{fileId}'
47
- .gsub('{file_id}', file_id)
47
+ .gsub('{fileId}', file_id)
48
48
 
49
49
  params = {
50
50
  'read': read,
@@ -58,7 +58,7 @@ module Appwrite
58
58
 
59
59
  def delete_file(file_id:)
60
60
  path = '/storage/files/{fileId}'
61
- .gsub('{file_id}', file_id)
61
+ .gsub('{fileId}', file_id)
62
62
 
63
63
  params = {
64
64
  }
@@ -70,7 +70,7 @@ module Appwrite
70
70
 
71
71
  def get_file_download(file_id:)
72
72
  path = '/storage/files/{fileId}/download'
73
- .gsub('{file_id}', file_id)
73
+ .gsub('{fileId}', file_id)
74
74
 
75
75
  params = {
76
76
  }
@@ -80,14 +80,19 @@ module Appwrite
80
80
  }, params);
81
81
  end
82
82
 
83
- def get_file_preview(file_id:, width: 0, height: 0, quality: 100, background: '', output: '')
83
+ def get_file_preview(file_id:, width: 0, height: 0, quality: 100, border_width: 0, border_color: '', border_radius: 0, opacity: 1, rotation: 0, background: '', output: '')
84
84
  path = '/storage/files/{fileId}/preview'
85
- .gsub('{file_id}', file_id)
85
+ .gsub('{fileId}', file_id)
86
86
 
87
87
  params = {
88
88
  'width': width,
89
89
  'height': height,
90
90
  'quality': quality,
91
+ 'borderWidth': border_width,
92
+ 'borderColor': border_color,
93
+ 'borderRadius': border_radius,
94
+ 'opacity': opacity,
95
+ 'rotation': rotation,
91
96
  'background': background,
92
97
  'output': output
93
98
  }
@@ -97,12 +102,11 @@ module Appwrite
97
102
  }, params);
98
103
  end
99
104
 
100
- def get_file_view(file_id:, as: '')
105
+ def get_file_view(file_id:)
101
106
  path = '/storage/files/{fileId}/view'
102
- .gsub('{file_id}', file_id)
107
+ .gsub('{fileId}', file_id)
103
108
 
104
109
  params = {
105
- 'as': as
106
110
  }
107
111
 
108
112
  return @client.call('get', path, {
@@ -31,7 +31,7 @@ module Appwrite
31
31
 
32
32
  def get(team_id:)
33
33
  path = '/teams/{teamId}'
34
- .gsub('{team_id}', team_id)
34
+ .gsub('{teamId}', team_id)
35
35
 
36
36
  params = {
37
37
  }
@@ -43,7 +43,7 @@ module Appwrite
43
43
 
44
44
  def update(team_id:, name:)
45
45
  path = '/teams/{teamId}'
46
- .gsub('{team_id}', team_id)
46
+ .gsub('{teamId}', team_id)
47
47
 
48
48
  params = {
49
49
  'name': name
@@ -56,7 +56,7 @@ module Appwrite
56
56
 
57
57
  def delete(team_id:)
58
58
  path = '/teams/{teamId}'
59
- .gsub('{team_id}', team_id)
59
+ .gsub('{teamId}', team_id)
60
60
 
61
61
  params = {
62
62
  }
@@ -66,11 +66,15 @@ module Appwrite
66
66
  }, params);
67
67
  end
68
68
 
69
- def get_memberships(team_id:)
69
+ def get_memberships(team_id:, search: '', limit: 25, offset: 0, order_type: 'ASC')
70
70
  path = '/teams/{teamId}/memberships'
71
- .gsub('{team_id}', team_id)
71
+ .gsub('{teamId}', team_id)
72
72
 
73
73
  params = {
74
+ 'search': search,
75
+ 'limit': limit,
76
+ 'offset': offset,
77
+ 'orderType': order_type
74
78
  }
75
79
 
76
80
  return @client.call('get', path, {
@@ -80,7 +84,7 @@ module Appwrite
80
84
 
81
85
  def create_membership(team_id:, email:, roles:, url:, name: '')
82
86
  path = '/teams/{teamId}/memberships'
83
- .gsub('{team_id}', team_id)
87
+ .gsub('{teamId}', team_id)
84
88
 
85
89
  params = {
86
90
  'email': email,
@@ -94,10 +98,24 @@ module Appwrite
94
98
  }, params);
95
99
  end
96
100
 
97
- def delete_membership(team_id:, invite_id:)
98
- path = '/teams/{teamId}/memberships/{inviteId}'
99
- .gsub('{team_id}', team_id)
100
- .gsub('{invite_id}', invite_id)
101
+ def update_membership_roles(team_id:, membership_id:, roles:)
102
+ path = '/teams/{teamId}/memberships/{membershipId}'
103
+ .gsub('{teamId}', team_id)
104
+ .gsub('{membershipId}', membership_id)
105
+
106
+ params = {
107
+ 'roles': roles
108
+ }
109
+
110
+ return @client.call('patch', path, {
111
+ 'content-type' => 'application/json',
112
+ }, params);
113
+ end
114
+
115
+ def delete_membership(team_id:, membership_id:)
116
+ path = '/teams/{teamId}/memberships/{membershipId}'
117
+ .gsub('{teamId}', team_id)
118
+ .gsub('{membershipId}', membership_id)
101
119
 
102
120
  params = {
103
121
  }
@@ -107,6 +125,21 @@ module Appwrite
107
125
  }, params);
108
126
  end
109
127
 
128
+ def update_membership_status(team_id:, membership_id:, user_id:, secret:)
129
+ path = '/teams/{teamId}/memberships/{membershipId}/status'
130
+ .gsub('{teamId}', team_id)
131
+ .gsub('{membershipId}', membership_id)
132
+
133
+ params = {
134
+ 'userId': user_id,
135
+ 'secret': secret
136
+ }
137
+
138
+ return @client.call('patch', path, {
139
+ 'content-type' => 'application/json',
140
+ }, params);
141
+ end
142
+
110
143
 
111
144
  protected
112
145
 
@@ -32,7 +32,7 @@ module Appwrite
32
32
 
33
33
  def get(user_id:)
34
34
  path = '/users/{userId}'
35
- .gsub('{user_id}', user_id)
35
+ .gsub('{userId}', user_id)
36
36
 
37
37
  params = {
38
38
  }
@@ -42,9 +42,21 @@ module Appwrite
42
42
  }, params);
43
43
  end
44
44
 
45
+ def delete(user_id:)
46
+ path = '/users/{userId}'
47
+ .gsub('{userId}', user_id)
48
+
49
+ params = {
50
+ }
51
+
52
+ return @client.call('delete', path, {
53
+ 'content-type' => 'application/json',
54
+ }, params);
55
+ end
56
+
45
57
  def get_logs(user_id:)
46
58
  path = '/users/{userId}/logs'
47
- .gsub('{user_id}', user_id)
59
+ .gsub('{userId}', user_id)
48
60
 
49
61
  params = {
50
62
  }
@@ -56,7 +68,7 @@ module Appwrite
56
68
 
57
69
  def get_prefs(user_id:)
58
70
  path = '/users/{userId}/prefs'
59
- .gsub('{user_id}', user_id)
71
+ .gsub('{userId}', user_id)
60
72
 
61
73
  params = {
62
74
  }
@@ -68,7 +80,7 @@ module Appwrite
68
80
 
69
81
  def update_prefs(user_id:, prefs:)
70
82
  path = '/users/{userId}/prefs'
71
- .gsub('{user_id}', user_id)
83
+ .gsub('{userId}', user_id)
72
84
 
73
85
  params = {
74
86
  'prefs': prefs
@@ -81,7 +93,7 @@ module Appwrite
81
93
 
82
94
  def get_sessions(user_id:)
83
95
  path = '/users/{userId}/sessions'
84
- .gsub('{user_id}', user_id)
96
+ .gsub('{userId}', user_id)
85
97
 
86
98
  params = {
87
99
  }
@@ -93,7 +105,7 @@ module Appwrite
93
105
 
94
106
  def delete_sessions(user_id:)
95
107
  path = '/users/{userId}/sessions'
96
- .gsub('{user_id}', user_id)
108
+ .gsub('{userId}', user_id)
97
109
 
98
110
  params = {
99
111
  }
@@ -105,8 +117,8 @@ module Appwrite
105
117
 
106
118
  def delete_session(user_id:, session_id:)
107
119
  path = '/users/{userId}/sessions/{sessionId}'
108
- .gsub('{user_id}', user_id)
109
- .gsub('{session_id}', session_id)
120
+ .gsub('{userId}', user_id)
121
+ .gsub('{sessionId}', session_id)
110
122
 
111
123
  params = {
112
124
  }
@@ -118,7 +130,7 @@ module Appwrite
118
130
 
119
131
  def update_status(user_id:, status:)
120
132
  path = '/users/{userId}/status'
121
- .gsub('{user_id}', user_id)
133
+ .gsub('{userId}', user_id)
122
134
 
123
135
  params = {
124
136
  'status': status
metadata CHANGED
@@ -1,31 +1,129 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appwrite Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-18 00:00:00.000000000 Z
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
- email: team@localhost.test
14
+ email: team@appwrite.io
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - ".travis.yml"
19
20
  - CHANGELOG.md
20
21
  - Gemfile
21
22
  - LICENSE
22
23
  - README.md
23
24
  - appwrite.gemspec
25
+ - docs/examples/account/create-recovery.md
26
+ - docs/examples/account/create-verification.md
27
+ - docs/examples/account/delete-session.md
28
+ - docs/examples/account/delete-sessions.md
29
+ - docs/examples/account/delete.md
30
+ - docs/examples/account/get-logs.md
31
+ - docs/examples/account/get-prefs.md
32
+ - docs/examples/account/get-sessions.md
33
+ - docs/examples/account/get.md
34
+ - docs/examples/account/update-email.md
35
+ - docs/examples/account/update-name.md
36
+ - docs/examples/account/update-password.md
37
+ - docs/examples/account/update-prefs.md
38
+ - docs/examples/account/update-recovery.md
39
+ - docs/examples/account/update-verification.md
40
+ - docs/examples/avatars/get-browser.md
41
+ - docs/examples/avatars/get-credit-card.md
42
+ - docs/examples/avatars/get-favicon.md
43
+ - docs/examples/avatars/get-flag.md
44
+ - docs/examples/avatars/get-image.md
45
+ - docs/examples/avatars/get-initials.md
46
+ - docs/examples/avatars/get-q-r.md
47
+ - docs/examples/database/create-collection.md
48
+ - docs/examples/database/create-document.md
49
+ - docs/examples/database/delete-collection.md
50
+ - docs/examples/database/delete-document.md
51
+ - docs/examples/database/get-collection.md
52
+ - docs/examples/database/get-document.md
53
+ - docs/examples/database/list-collections.md
54
+ - docs/examples/database/list-documents.md
55
+ - docs/examples/database/update-collection.md
56
+ - docs/examples/database/update-document.md
57
+ - docs/examples/functions/create-execution.md
58
+ - docs/examples/functions/create-tag.md
59
+ - docs/examples/functions/create.md
60
+ - docs/examples/functions/delete-tag.md
61
+ - docs/examples/functions/delete.md
62
+ - docs/examples/functions/get-execution.md
63
+ - docs/examples/functions/get-tag.md
64
+ - docs/examples/functions/get.md
65
+ - docs/examples/functions/list-executions.md
66
+ - docs/examples/functions/list-tags.md
67
+ - docs/examples/functions/list.md
68
+ - docs/examples/functions/update-tag.md
69
+ - docs/examples/functions/update.md
70
+ - docs/examples/health/get-anti-virus.md
71
+ - docs/examples/health/get-cache.md
72
+ - docs/examples/health/get-d-b.md
73
+ - docs/examples/health/get-queue-certificates.md
74
+ - docs/examples/health/get-queue-functions.md
75
+ - docs/examples/health/get-queue-logs.md
76
+ - docs/examples/health/get-queue-tasks.md
77
+ - docs/examples/health/get-queue-usage.md
78
+ - docs/examples/health/get-queue-webhooks.md
79
+ - docs/examples/health/get-storage-local.md
80
+ - docs/examples/health/get-time.md
81
+ - docs/examples/health/get.md
82
+ - docs/examples/locale/get-continents.md
83
+ - docs/examples/locale/get-countries-e-u.md
84
+ - docs/examples/locale/get-countries-phones.md
85
+ - docs/examples/locale/get-countries.md
86
+ - docs/examples/locale/get-currencies.md
87
+ - docs/examples/locale/get-languages.md
88
+ - docs/examples/locale/get.md
89
+ - docs/examples/storage/create-file.md
90
+ - docs/examples/storage/delete-file.md
91
+ - docs/examples/storage/get-file-download.md
92
+ - docs/examples/storage/get-file-preview.md
93
+ - docs/examples/storage/get-file-view.md
94
+ - docs/examples/storage/get-file.md
95
+ - docs/examples/storage/list-files.md
96
+ - docs/examples/storage/update-file.md
97
+ - docs/examples/teams/create-membership.md
98
+ - docs/examples/teams/create.md
99
+ - docs/examples/teams/delete-membership.md
100
+ - docs/examples/teams/delete.md
101
+ - docs/examples/teams/get-memberships.md
102
+ - docs/examples/teams/get.md
103
+ - docs/examples/teams/list.md
104
+ - docs/examples/teams/update-membership-roles.md
105
+ - docs/examples/teams/update-membership-status.md
106
+ - docs/examples/teams/update.md
107
+ - docs/examples/users/create.md
108
+ - docs/examples/users/delete-session.md
109
+ - docs/examples/users/delete-sessions.md
110
+ - docs/examples/users/delete.md
111
+ - docs/examples/users/get-logs.md
112
+ - docs/examples/users/get-prefs.md
113
+ - docs/examples/users/get-sessions.md
114
+ - docs/examples/users/get.md
115
+ - docs/examples/users/list.md
116
+ - docs/examples/users/update-prefs.md
117
+ - docs/examples/users/update-status.md
24
118
  - lib/appwrite.rb
25
119
  - lib/appwrite/client.rb
120
+ - lib/appwrite/exception.rb
121
+ - lib/appwrite/file.rb
26
122
  - lib/appwrite/service.rb
123
+ - lib/appwrite/services/account.rb
27
124
  - lib/appwrite/services/avatars.rb
28
125
  - lib/appwrite/services/database.rb
126
+ - lib/appwrite/services/functions.rb
29
127
  - lib/appwrite/services/health.rb
30
128
  - lib/appwrite/services/locale.rb
31
129
  - lib/appwrite/services/storage.rb
@@ -49,13 +147,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
147
  - !ruby/object:Gem::Version
50
148
  version: '0'
51
149
  requirements: []
52
- rubygems_version: 3.0.3
150
+ rubygems_version: 3.0.8
53
151
  signing_key:
54
152
  specification_version: 4
55
- summary: Appwrite is an open-source backend as a service server that abstract and
56
- simplify complex and repetitive development tasks behind a very simple to use REST
57
- API. Appwrite aims to help you develop your apps faster and in a more secure way.
58
- Use the Ruby SDK to integrate your app with the Appwrite server to easily start
59
- interacting with all of Appwrite backend APIs and tools. For full API documentation
60
- and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
153
+ summary: Appwrite is an open-source self-hosted backend server that abstract and simplify
154
+ complex and repetitive development tasks behind a very simple REST API
61
155
  test_files: []