appwrite 8.0.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +2 -2
  3. data/lib/appwrite/models/attribute_boolean.rb +5 -0
  4. data/lib/appwrite/models/attribute_datetime.rb +5 -0
  5. data/lib/appwrite/models/attribute_email.rb +5 -0
  6. data/lib/appwrite/models/attribute_enum.rb +5 -0
  7. data/lib/appwrite/models/attribute_float.rb +5 -0
  8. data/lib/appwrite/models/attribute_integer.rb +5 -0
  9. data/lib/appwrite/models/attribute_ip.rb +5 -0
  10. data/lib/appwrite/models/attribute_relationship.rb +5 -0
  11. data/lib/appwrite/models/attribute_string.rb +5 -0
  12. data/lib/appwrite/models/attribute_url.rb +5 -0
  13. data/lib/appwrite/models/database.rb +8 -3
  14. data/lib/appwrite/models/deployment.rb +63 -13
  15. data/lib/appwrite/models/execution.rb +40 -20
  16. data/lib/appwrite/models/function.rb +53 -13
  17. data/lib/appwrite/models/headers.rb +32 -0
  18. data/lib/appwrite/models/health_status.rb +5 -0
  19. data/lib/appwrite/models/identity.rb +72 -0
  20. data/lib/appwrite/models/identity_list.rb +32 -0
  21. data/lib/appwrite/models/index.rb +5 -0
  22. data/lib/appwrite/models/locale_code.rb +32 -0
  23. data/lib/appwrite/models/locale_code_list.rb +32 -0
  24. data/lib/appwrite/models/user.rb +13 -3
  25. data/lib/appwrite/models/variable.rb +10 -5
  26. data/lib/appwrite/services/account.rb +105 -50
  27. data/lib/appwrite/services/avatars.rb +14 -14
  28. data/lib/appwrite/services/databases.rb +106 -94
  29. data/lib/appwrite/services/functions.rb +149 -63
  30. data/lib/appwrite/services/graphql.rb +4 -4
  31. data/lib/appwrite/services/health.rb +71 -22
  32. data/lib/appwrite/services/locale.rb +39 -14
  33. data/lib/appwrite/services/storage.rb +33 -31
  34. data/lib/appwrite/services/teams.rb +28 -27
  35. data/lib/appwrite/services/users.rb +148 -50
  36. data/lib/appwrite.rb +5 -0
  37. metadata +7 -2
@@ -10,10 +10,14 @@ module Appwrite
10
10
  attr_reader :function_id
11
11
  attr_reader :trigger
12
12
  attr_reader :status
13
- attr_reader :status_code
14
- attr_reader :response
15
- attr_reader :stdout
16
- attr_reader :stderr
13
+ attr_reader :request_method
14
+ attr_reader :request_path
15
+ attr_reader :request_headers
16
+ attr_reader :response_status_code
17
+ attr_reader :response_body
18
+ attr_reader :response_headers
19
+ attr_reader :logs
20
+ attr_reader :errors
17
21
  attr_reader :duration
18
22
 
19
23
  def initialize(
@@ -24,10 +28,14 @@ module Appwrite
24
28
  function_id:,
25
29
  trigger:,
26
30
  status:,
27
- status_code:,
28
- response:,
29
- stdout:,
30
- stderr:,
31
+ request_method:,
32
+ request_path:,
33
+ request_headers:,
34
+ response_status_code:,
35
+ response_body:,
36
+ response_headers:,
37
+ logs:,
38
+ errors:,
31
39
  duration:
32
40
  )
33
41
  @id = id
@@ -37,10 +45,14 @@ module Appwrite
37
45
  @function_id = function_id
38
46
  @trigger = trigger
39
47
  @status = status
40
- @status_code = status_code
41
- @response = response
42
- @stdout = stdout
43
- @stderr = stderr
48
+ @request_method = request_method
49
+ @request_path = request_path
50
+ @request_headers = request_headers
51
+ @response_status_code = response_status_code
52
+ @response_body = response_body
53
+ @response_headers = response_headers
54
+ @logs = logs
55
+ @errors = errors
44
56
  @duration = duration
45
57
  end
46
58
 
@@ -53,10 +65,14 @@ module Appwrite
53
65
  function_id: map["functionId"],
54
66
  trigger: map["trigger"],
55
67
  status: map["status"],
56
- status_code: map["statusCode"],
57
- response: map["response"],
58
- stdout: map["stdout"],
59
- stderr: map["stderr"],
68
+ request_method: map["requestMethod"],
69
+ request_path: map["requestPath"],
70
+ request_headers: map["requestHeaders"].map { |it| Headers.from(map: it) },
71
+ response_status_code: map["responseStatusCode"],
72
+ response_body: map["responseBody"],
73
+ response_headers: map["responseHeaders"].map { |it| Headers.from(map: it) },
74
+ logs: map["logs"],
75
+ errors: map["errors"],
60
76
  duration: map["duration"]
61
77
  )
62
78
  end
@@ -70,10 +86,14 @@ module Appwrite
70
86
  "functionId": @function_id,
71
87
  "trigger": @trigger,
72
88
  "status": @status,
73
- "statusCode": @status_code,
74
- "response": @response,
75
- "stdout": @stdout,
76
- "stderr": @stderr,
89
+ "requestMethod": @request_method,
90
+ "requestPath": @request_path,
91
+ "requestHeaders": @request_headers.map { |it| it.to_map },
92
+ "responseStatusCode": @response_status_code,
93
+ "responseBody": @response_body,
94
+ "responseHeaders": @response_headers.map { |it| it.to_map },
95
+ "logs": @logs,
96
+ "errors": @errors,
77
97
  "duration": @duration
78
98
  }
79
99
  end
@@ -9,14 +9,22 @@ module Appwrite
9
9
  attr_reader :execute
10
10
  attr_reader :name
11
11
  attr_reader :enabled
12
+ attr_reader :live
13
+ attr_reader :logging
12
14
  attr_reader :runtime
13
15
  attr_reader :deployment
14
16
  attr_reader :vars
15
17
  attr_reader :events
16
18
  attr_reader :schedule
17
- attr_reader :schedule_next
18
- attr_reader :schedule_previous
19
19
  attr_reader :timeout
20
+ attr_reader :entrypoint
21
+ attr_reader :commands
22
+ attr_reader :version
23
+ attr_reader :installation_id
24
+ attr_reader :provider_repository_id
25
+ attr_reader :provider_branch
26
+ attr_reader :provider_root_directory
27
+ attr_reader :provider_silent_mode
20
28
 
21
29
  def initialize(
22
30
  id:,
@@ -25,14 +33,22 @@ module Appwrite
25
33
  execute:,
26
34
  name:,
27
35
  enabled:,
36
+ live:,
37
+ logging:,
28
38
  runtime:,
29
39
  deployment:,
30
40
  vars:,
31
41
  events:,
32
42
  schedule:,
33
- schedule_next:,
34
- schedule_previous:,
35
- timeout:
43
+ timeout:,
44
+ entrypoint:,
45
+ commands:,
46
+ version:,
47
+ installation_id:,
48
+ provider_repository_id:,
49
+ provider_branch:,
50
+ provider_root_directory:,
51
+ provider_silent_mode:
36
52
  )
37
53
  @id = id
38
54
  @created_at = created_at
@@ -40,14 +56,22 @@ module Appwrite
40
56
  @execute = execute
41
57
  @name = name
42
58
  @enabled = enabled
59
+ @live = live
60
+ @logging = logging
43
61
  @runtime = runtime
44
62
  @deployment = deployment
45
63
  @vars = vars
46
64
  @events = events
47
65
  @schedule = schedule
48
- @schedule_next = schedule_next
49
- @schedule_previous = schedule_previous
50
66
  @timeout = timeout
67
+ @entrypoint = entrypoint
68
+ @commands = commands
69
+ @version = version
70
+ @installation_id = installation_id
71
+ @provider_repository_id = provider_repository_id
72
+ @provider_branch = provider_branch
73
+ @provider_root_directory = provider_root_directory
74
+ @provider_silent_mode = provider_silent_mode
51
75
  end
52
76
 
53
77
  def self.from(map:)
@@ -58,14 +82,22 @@ module Appwrite
58
82
  execute: map["execute"],
59
83
  name: map["name"],
60
84
  enabled: map["enabled"],
85
+ live: map["live"],
86
+ logging: map["logging"],
61
87
  runtime: map["runtime"],
62
88
  deployment: map["deployment"],
63
89
  vars: map["vars"].map { |it| Variable.from(map: it) },
64
90
  events: map["events"],
65
91
  schedule: map["schedule"],
66
- schedule_next: map["scheduleNext"],
67
- schedule_previous: map["schedulePrevious"],
68
- timeout: map["timeout"]
92
+ timeout: map["timeout"],
93
+ entrypoint: map["entrypoint"],
94
+ commands: map["commands"],
95
+ version: map["version"],
96
+ installation_id: map["installationId"],
97
+ provider_repository_id: map["providerRepositoryId"],
98
+ provider_branch: map["providerBranch"],
99
+ provider_root_directory: map["providerRootDirectory"],
100
+ provider_silent_mode: map["providerSilentMode"]
69
101
  )
70
102
  end
71
103
 
@@ -77,14 +109,22 @@ module Appwrite
77
109
  "execute": @execute,
78
110
  "name": @name,
79
111
  "enabled": @enabled,
112
+ "live": @live,
113
+ "logging": @logging,
80
114
  "runtime": @runtime,
81
115
  "deployment": @deployment,
82
116
  "vars": @vars.map { |it| it.to_map },
83
117
  "events": @events,
84
118
  "schedule": @schedule,
85
- "scheduleNext": @schedule_next,
86
- "schedulePrevious": @schedule_previous,
87
- "timeout": @timeout
119
+ "timeout": @timeout,
120
+ "entrypoint": @entrypoint,
121
+ "commands": @commands,
122
+ "version": @version,
123
+ "installationId": @installation_id,
124
+ "providerRepositoryId": @provider_repository_id,
125
+ "providerBranch": @provider_branch,
126
+ "providerRootDirectory": @provider_root_directory,
127
+ "providerSilentMode": @provider_silent_mode
88
128
  }
89
129
  end
90
130
  end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Headers
6
+ attr_reader :name
7
+ attr_reader :value
8
+
9
+ def initialize(
10
+ name:,
11
+ value:
12
+ )
13
+ @name = name
14
+ @value = value
15
+ end
16
+
17
+ def self.from(map:)
18
+ Headers.new(
19
+ name: map["name"],
20
+ value: map["value"]
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "name": @name,
27
+ "value": @value
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -3,19 +3,23 @@
3
3
  module Appwrite
4
4
  module Models
5
5
  class HealthStatus
6
+ attr_reader :name
6
7
  attr_reader :ping
7
8
  attr_reader :status
8
9
 
9
10
  def initialize(
11
+ name:,
10
12
  ping:,
11
13
  status:
12
14
  )
15
+ @name = name
13
16
  @ping = ping
14
17
  @status = status
15
18
  end
16
19
 
17
20
  def self.from(map:)
18
21
  HealthStatus.new(
22
+ name: map["name"],
19
23
  ping: map["ping"],
20
24
  status: map["status"]
21
25
  )
@@ -23,6 +27,7 @@ module Appwrite
23
27
 
24
28
  def to_map
25
29
  {
30
+ "name": @name,
26
31
  "ping": @ping,
27
32
  "status": @status
28
33
  }
@@ -0,0 +1,72 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Identity
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :user_id
10
+ attr_reader :provider
11
+ attr_reader :provider_uid
12
+ attr_reader :provider_email
13
+ attr_reader :provider_access_token
14
+ attr_reader :provider_access_token_expiry
15
+ attr_reader :provider_refresh_token
16
+
17
+ def initialize(
18
+ id:,
19
+ created_at:,
20
+ updated_at:,
21
+ user_id:,
22
+ provider:,
23
+ provider_uid:,
24
+ provider_email:,
25
+ provider_access_token:,
26
+ provider_access_token_expiry:,
27
+ provider_refresh_token:
28
+ )
29
+ @id = id
30
+ @created_at = created_at
31
+ @updated_at = updated_at
32
+ @user_id = user_id
33
+ @provider = provider
34
+ @provider_uid = provider_uid
35
+ @provider_email = provider_email
36
+ @provider_access_token = provider_access_token
37
+ @provider_access_token_expiry = provider_access_token_expiry
38
+ @provider_refresh_token = provider_refresh_token
39
+ end
40
+
41
+ def self.from(map:)
42
+ Identity.new(
43
+ id: map["$id"],
44
+ created_at: map["$createdAt"],
45
+ updated_at: map["$updatedAt"],
46
+ user_id: map["userId"],
47
+ provider: map["provider"],
48
+ provider_uid: map["providerUid"],
49
+ provider_email: map["providerEmail"],
50
+ provider_access_token: map["providerAccessToken"],
51
+ provider_access_token_expiry: map["providerAccessTokenExpiry"],
52
+ provider_refresh_token: map["providerRefreshToken"]
53
+ )
54
+ end
55
+
56
+ def to_map
57
+ {
58
+ "$id": @id,
59
+ "$createdAt": @created_at,
60
+ "$updatedAt": @updated_at,
61
+ "userId": @user_id,
62
+ "provider": @provider,
63
+ "providerUid": @provider_uid,
64
+ "providerEmail": @provider_email,
65
+ "providerAccessToken": @provider_access_token,
66
+ "providerAccessTokenExpiry": @provider_access_token_expiry,
67
+ "providerRefreshToken": @provider_refresh_token
68
+ }
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class IdentityList
6
+ attr_reader :total
7
+ attr_reader :identities
8
+
9
+ def initialize(
10
+ total:,
11
+ identities:
12
+ )
13
+ @total = total
14
+ @identities = identities
15
+ end
16
+
17
+ def self.from(map:)
18
+ IdentityList.new(
19
+ total: map["total"],
20
+ identities: map["identities"].map { |it| Identity.from(map: it) }
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "total": @total,
27
+ "identities": @identities.map { |it| it.to_map }
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -6,6 +6,7 @@ module Appwrite
6
6
  attr_reader :key
7
7
  attr_reader :type
8
8
  attr_reader :status
9
+ attr_reader :error
9
10
  attr_reader :attributes
10
11
  attr_reader :orders
11
12
 
@@ -13,12 +14,14 @@ module Appwrite
13
14
  key:,
14
15
  type:,
15
16
  status:,
17
+ error:,
16
18
  attributes:,
17
19
  orders:
18
20
  )
19
21
  @key = key
20
22
  @type = type
21
23
  @status = status
24
+ @error = error
22
25
  @attributes = attributes
23
26
  @orders = orders
24
27
  end
@@ -28,6 +31,7 @@ module Appwrite
28
31
  key: map["key"],
29
32
  type: map["type"],
30
33
  status: map["status"],
34
+ error: map["error"],
31
35
  attributes: map["attributes"],
32
36
  orders: map["orders"]
33
37
  )
@@ -38,6 +42,7 @@ module Appwrite
38
42
  "key": @key,
39
43
  "type": @type,
40
44
  "status": @status,
45
+ "error": @error,
41
46
  "attributes": @attributes,
42
47
  "orders": @orders
43
48
  }
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class LocaleCode
6
+ attr_reader :code
7
+ attr_reader :name
8
+
9
+ def initialize(
10
+ code:,
11
+ name:
12
+ )
13
+ @code = code
14
+ @name = name
15
+ end
16
+
17
+ def self.from(map:)
18
+ LocaleCode.new(
19
+ code: map["code"],
20
+ name: map["name"]
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "code": @code,
27
+ "name": @name
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class LocaleCodeList
6
+ attr_reader :total
7
+ attr_reader :locale_codes
8
+
9
+ def initialize(
10
+ total:,
11
+ locale_codes:
12
+ )
13
+ @total = total
14
+ @locale_codes = locale_codes
15
+ end
16
+
17
+ def self.from(map:)
18
+ LocaleCodeList.new(
19
+ total: map["total"],
20
+ locale_codes: map["localeCodes"].map { |it| LocaleCode.from(map: it) }
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "total": @total,
27
+ "localeCodes": @locale_codes.map { |it| it.to_map }
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -12,12 +12,14 @@ module Appwrite
12
12
  attr_reader :hash_options
13
13
  attr_reader :registration
14
14
  attr_reader :status
15
+ attr_reader :labels
15
16
  attr_reader :password_update
16
17
  attr_reader :email
17
18
  attr_reader :phone
18
19
  attr_reader :email_verification
19
20
  attr_reader :phone_verification
20
21
  attr_reader :prefs
22
+ attr_reader :accessed_at
21
23
 
22
24
  def initialize(
23
25
  id:,
@@ -29,12 +31,14 @@ module Appwrite
29
31
  hash_options: ,
30
32
  registration:,
31
33
  status:,
34
+ labels:,
32
35
  password_update:,
33
36
  email:,
34
37
  phone:,
35
38
  email_verification:,
36
39
  phone_verification:,
37
- prefs:
40
+ prefs:,
41
+ accessed_at:
38
42
  )
39
43
  @id = id
40
44
  @created_at = created_at
@@ -45,12 +49,14 @@ module Appwrite
45
49
  @hash_options = hash_options
46
50
  @registration = registration
47
51
  @status = status
52
+ @labels = labels
48
53
  @password_update = password_update
49
54
  @email = email
50
55
  @phone = phone
51
56
  @email_verification = email_verification
52
57
  @phone_verification = phone_verification
53
58
  @prefs = prefs
59
+ @accessed_at = accessed_at
54
60
  end
55
61
 
56
62
  def self.from(map:)
@@ -64,12 +70,14 @@ module Appwrite
64
70
  hash_options: map["hashOptions"],
65
71
  registration: map["registration"],
66
72
  status: map["status"],
73
+ labels: map["labels"],
67
74
  password_update: map["passwordUpdate"],
68
75
  email: map["email"],
69
76
  phone: map["phone"],
70
77
  email_verification: map["emailVerification"],
71
78
  phone_verification: map["phoneVerification"],
72
- prefs: Preferences.from(map: map["prefs"])
79
+ prefs: Preferences.from(map: map["prefs"]),
80
+ accessed_at: map["accessedAt"]
73
81
  )
74
82
  end
75
83
 
@@ -84,12 +92,14 @@ module Appwrite
84
92
  "hashOptions": @hash_options,
85
93
  "registration": @registration,
86
94
  "status": @status,
95
+ "labels": @labels,
87
96
  "passwordUpdate": @password_update,
88
97
  "email": @email,
89
98
  "phone": @phone,
90
99
  "emailVerification": @email_verification,
91
100
  "phoneVerification": @phone_verification,
92
- "prefs": @prefs.to_map
101
+ "prefs": @prefs.to_map,
102
+ "accessedAt": @accessed_at
93
103
  }
94
104
  end
95
105
  end
@@ -8,7 +8,8 @@ module Appwrite
8
8
  attr_reader :updated_at
9
9
  attr_reader :key
10
10
  attr_reader :value
11
- attr_reader :function_id
11
+ attr_reader :resource_type
12
+ attr_reader :resource_id
12
13
 
13
14
  def initialize(
14
15
  id:,
@@ -16,14 +17,16 @@ module Appwrite
16
17
  updated_at:,
17
18
  key:,
18
19
  value:,
19
- function_id:
20
+ resource_type:,
21
+ resource_id:
20
22
  )
21
23
  @id = id
22
24
  @created_at = created_at
23
25
  @updated_at = updated_at
24
26
  @key = key
25
27
  @value = value
26
- @function_id = function_id
28
+ @resource_type = resource_type
29
+ @resource_id = resource_id
27
30
  end
28
31
 
29
32
  def self.from(map:)
@@ -33,7 +36,8 @@ module Appwrite
33
36
  updated_at: map["$updatedAt"],
34
37
  key: map["key"],
35
38
  value: map["value"],
36
- function_id: map["functionId"]
39
+ resource_type: map["resourceType"],
40
+ resource_id: map["resourceId"]
37
41
  )
38
42
  end
39
43
 
@@ -44,7 +48,8 @@ module Appwrite
44
48
  "$updatedAt": @updated_at,
45
49
  "key": @key,
46
50
  "value": @value,
47
- "functionId": @function_id
51
+ "resourceType": @resource_type,
52
+ "resourceId": @resource_id
48
53
  }
49
54
  end
50
55
  end