appwrite 26.1.0 → 27.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 +16 -2
- data/lib/appwrite/enums/authentication_factor.rb +1 -0
- data/lib/appwrite/enums/build_runtime.rb +1 -0
- data/lib/appwrite/enums/embedding_model.rb +10 -0
- data/lib/appwrite/enums/invalidation_type.rb +9 -0
- data/lib/appwrite/enums/project_key_scopes.rb +2 -0
- data/lib/appwrite/enums/project_policy_id.rb +1 -0
- data/lib/appwrite/enums/runtime.rb +1 -0
- data/lib/appwrite/models/billing_plan.rb +4 -4
- data/lib/appwrite/models/billing_plan_addon.rb +6 -6
- data/lib/appwrite/models/billing_plan_addon_details.rb +1 -1
- data/lib/appwrite/models/database_migration.rb +102 -0
- data/lib/appwrite/models/database_migration_list.rb +32 -0
- data/lib/appwrite/models/database_status.rb +30 -0
- data/lib/appwrite/models/dedicated_database.rb +0 -5
- data/lib/appwrite/models/dedicated_database_member.rb +1 -1
- data/lib/appwrite/models/dedicated_database_operation.rb +77 -0
- data/lib/appwrite/models/dedicated_database_operation_list.rb +32 -0
- data/lib/appwrite/models/dedicated_database_replicas.rb +25 -0
- data/lib/appwrite/models/dedicated_database_specification_pricing.rb +0 -5
- data/lib/appwrite/models/embedding.rb +42 -0
- data/lib/appwrite/models/embedding_list.rb +32 -0
- data/lib/appwrite/models/file.rb +10 -0
- data/lib/appwrite/models/mfa_challenge_secret.rb +47 -0
- data/lib/appwrite/models/mfa_factors.rb +8 -3
- data/lib/appwrite/models/organization.rb +12 -12
- data/lib/appwrite/models/policy_mfa_factors.rb +47 -0
- data/lib/appwrite/models/project.rb +5 -0
- data/lib/appwrite/models/proxy_invalidation.rb +42 -0
- data/lib/appwrite/models/usage_billing_plan.rb +9 -9
- data/lib/appwrite/services/account.rb +1 -33
- data/lib/appwrite/services/activities.rb +1 -1
- data/lib/appwrite/services/apps.rb +52 -10
- data/lib/appwrite/services/backups.rb +13 -7
- data/lib/appwrite/services/databases.rb +4 -4
- data/lib/appwrite/services/embeddings.rb +48 -0
- data/lib/appwrite/services/functions.rb +1 -1
- data/lib/appwrite/services/project.rb +52 -57
- data/lib/appwrite/services/proxy.rb +44 -0
- data/lib/appwrite/services/sites.rb +1 -1
- data/lib/appwrite/services/storage.rb +4 -2
- data/lib/appwrite/services/tables_db.rb +247 -7
- data/lib/appwrite/services/users.rb +38 -0
- data/lib/appwrite.rb +12 -0
- metadata +14 -2
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class Embedding
|
|
6
|
+
attr_reader :model
|
|
7
|
+
attr_reader :dimension
|
|
8
|
+
attr_reader :embedding
|
|
9
|
+
attr_reader :error
|
|
10
|
+
|
|
11
|
+
def initialize(
|
|
12
|
+
model:,
|
|
13
|
+
dimension:,
|
|
14
|
+
embedding:,
|
|
15
|
+
error:
|
|
16
|
+
)
|
|
17
|
+
@model = model
|
|
18
|
+
@dimension = dimension
|
|
19
|
+
@embedding = embedding
|
|
20
|
+
@error = error
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from(map:)
|
|
24
|
+
Embedding.new(
|
|
25
|
+
model: map["model"],
|
|
26
|
+
dimension: map["dimension"],
|
|
27
|
+
embedding: map["embedding"],
|
|
28
|
+
error: map["error"]
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def to_map
|
|
33
|
+
{
|
|
34
|
+
"model": @model,
|
|
35
|
+
"dimension": @dimension,
|
|
36
|
+
"embedding": @embedding,
|
|
37
|
+
"error": @error
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class EmbeddingList
|
|
6
|
+
attr_reader :total
|
|
7
|
+
attr_reader :embeddings
|
|
8
|
+
|
|
9
|
+
def initialize(
|
|
10
|
+
total:,
|
|
11
|
+
embeddings:
|
|
12
|
+
)
|
|
13
|
+
@total = total
|
|
14
|
+
@embeddings = embeddings
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.from(map:)
|
|
18
|
+
EmbeddingList.new(
|
|
19
|
+
total: map["total"],
|
|
20
|
+
embeddings: map["embeddings"].map { |it| Embedding.from(map: it) }
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def to_map
|
|
25
|
+
{
|
|
26
|
+
"total": @total,
|
|
27
|
+
"embeddings": @embeddings.map { |it| it.to_map }
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
data/lib/appwrite/models/file.rb
CHANGED
|
@@ -9,6 +9,8 @@ module Appwrite
|
|
|
9
9
|
attr_reader :updated_at
|
|
10
10
|
attr_reader :permissions
|
|
11
11
|
attr_reader :name
|
|
12
|
+
attr_reader :folder
|
|
13
|
+
attr_reader :key
|
|
12
14
|
attr_reader :signature
|
|
13
15
|
attr_reader :mime_type
|
|
14
16
|
attr_reader :size_original
|
|
@@ -25,6 +27,8 @@ module Appwrite
|
|
|
25
27
|
updated_at:,
|
|
26
28
|
permissions:,
|
|
27
29
|
name:,
|
|
30
|
+
folder:,
|
|
31
|
+
key:,
|
|
28
32
|
signature:,
|
|
29
33
|
mime_type:,
|
|
30
34
|
size_original:,
|
|
@@ -40,6 +44,8 @@ module Appwrite
|
|
|
40
44
|
@updated_at = updated_at
|
|
41
45
|
@permissions = permissions
|
|
42
46
|
@name = name
|
|
47
|
+
@folder = folder
|
|
48
|
+
@key = key
|
|
43
49
|
@signature = signature
|
|
44
50
|
@mime_type = mime_type
|
|
45
51
|
@size_original = size_original
|
|
@@ -58,6 +64,8 @@ module Appwrite
|
|
|
58
64
|
updated_at: map["$updatedAt"],
|
|
59
65
|
permissions: map["$permissions"],
|
|
60
66
|
name: map["name"],
|
|
67
|
+
folder: map["folder"],
|
|
68
|
+
key: map["key"],
|
|
61
69
|
signature: map["signature"],
|
|
62
70
|
mime_type: map["mimeType"],
|
|
63
71
|
size_original: map["sizeOriginal"],
|
|
@@ -77,6 +85,8 @@ module Appwrite
|
|
|
77
85
|
"$updatedAt": @updated_at,
|
|
78
86
|
"$permissions": @permissions,
|
|
79
87
|
"name": @name,
|
|
88
|
+
"folder": @folder,
|
|
89
|
+
"key": @key,
|
|
80
90
|
"signature": @signature,
|
|
81
91
|
"mimeType": @mime_type,
|
|
82
92
|
"sizeOriginal": @size_original,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class MfaChallengeSecret
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :created_at
|
|
8
|
+
attr_reader :user_id
|
|
9
|
+
attr_reader :expire
|
|
10
|
+
attr_reader :code
|
|
11
|
+
|
|
12
|
+
def initialize(
|
|
13
|
+
id:,
|
|
14
|
+
created_at:,
|
|
15
|
+
user_id:,
|
|
16
|
+
expire:,
|
|
17
|
+
code:
|
|
18
|
+
)
|
|
19
|
+
@id = id
|
|
20
|
+
@created_at = created_at
|
|
21
|
+
@user_id = user_id
|
|
22
|
+
@expire = expire
|
|
23
|
+
@code = code
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from(map:)
|
|
27
|
+
MfaChallengeSecret.new(
|
|
28
|
+
id: map["$id"],
|
|
29
|
+
created_at: map["$createdAt"],
|
|
30
|
+
user_id: map["userId"],
|
|
31
|
+
expire: map["expire"],
|
|
32
|
+
code: map["code"]
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def to_map
|
|
37
|
+
{
|
|
38
|
+
"$id": @id,
|
|
39
|
+
"$createdAt": @created_at,
|
|
40
|
+
"userId": @user_id,
|
|
41
|
+
"expire": @expire,
|
|
42
|
+
"code": @code
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -7,17 +7,20 @@ module Appwrite
|
|
|
7
7
|
attr_reader :phone
|
|
8
8
|
attr_reader :email
|
|
9
9
|
attr_reader :recovery_code
|
|
10
|
+
attr_reader :custom
|
|
10
11
|
|
|
11
12
|
def initialize(
|
|
12
13
|
totp:,
|
|
13
14
|
phone:,
|
|
14
15
|
email:,
|
|
15
|
-
recovery_code
|
|
16
|
+
recovery_code:,
|
|
17
|
+
custom:
|
|
16
18
|
)
|
|
17
19
|
@totp = totp
|
|
18
20
|
@phone = phone
|
|
19
21
|
@email = email
|
|
20
22
|
@recovery_code = recovery_code
|
|
23
|
+
@custom = custom
|
|
21
24
|
end
|
|
22
25
|
|
|
23
26
|
def self.from(map:)
|
|
@@ -25,7 +28,8 @@ module Appwrite
|
|
|
25
28
|
totp: map["totp"],
|
|
26
29
|
phone: map["phone"],
|
|
27
30
|
email: map["email"],
|
|
28
|
-
recovery_code: map["recoveryCode"]
|
|
31
|
+
recovery_code: map["recoveryCode"],
|
|
32
|
+
custom: map["custom"]
|
|
29
33
|
)
|
|
30
34
|
end
|
|
31
35
|
|
|
@@ -34,7 +38,8 @@ module Appwrite
|
|
|
34
38
|
"totp": @totp,
|
|
35
39
|
"phone": @phone,
|
|
36
40
|
"email": @email,
|
|
37
|
-
"recoveryCode": @recovery_code
|
|
41
|
+
"recoveryCode": @recovery_code,
|
|
42
|
+
"custom": @custom
|
|
38
43
|
}
|
|
39
44
|
end
|
|
40
45
|
end
|
|
@@ -46,7 +46,7 @@ module Appwrite
|
|
|
46
46
|
name:,
|
|
47
47
|
total:,
|
|
48
48
|
prefs:,
|
|
49
|
-
billing_budget
|
|
49
|
+
billing_budget: ,
|
|
50
50
|
budget_alerts:,
|
|
51
51
|
billing_plan:,
|
|
52
52
|
billing_plan_id:,
|
|
@@ -55,23 +55,23 @@ module Appwrite
|
|
|
55
55
|
billing_start_date:,
|
|
56
56
|
billing_current_invoice_date:,
|
|
57
57
|
billing_next_invoice_date:,
|
|
58
|
-
billing_trial_start_date
|
|
58
|
+
billing_trial_start_date: ,
|
|
59
59
|
billing_trial_days:,
|
|
60
60
|
billing_aggregation_id:,
|
|
61
61
|
billing_invoice_id:,
|
|
62
62
|
payment_method_id:,
|
|
63
|
-
billing_address_id
|
|
64
|
-
backup_payment_method_id
|
|
63
|
+
billing_address_id: ,
|
|
64
|
+
backup_payment_method_id: ,
|
|
65
65
|
status:,
|
|
66
|
-
remarks
|
|
67
|
-
agreement_baa
|
|
68
|
-
program_manager_name
|
|
69
|
-
program_manager_calendar
|
|
70
|
-
program_discord_channel_name
|
|
71
|
-
program_discord_channel_url
|
|
66
|
+
remarks: ,
|
|
67
|
+
agreement_baa: ,
|
|
68
|
+
program_manager_name: ,
|
|
69
|
+
program_manager_calendar: ,
|
|
70
|
+
program_discord_channel_name: ,
|
|
71
|
+
program_discord_channel_url: ,
|
|
72
72
|
billing_limits: ,
|
|
73
|
-
billing_plan_downgrade
|
|
74
|
-
billing_tax_id
|
|
73
|
+
billing_plan_downgrade: ,
|
|
74
|
+
billing_tax_id: ,
|
|
75
75
|
marked_for_deletion:,
|
|
76
76
|
platform:,
|
|
77
77
|
projects:
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class PolicyMfaFactors
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :totp
|
|
8
|
+
attr_reader :email
|
|
9
|
+
attr_reader :phone
|
|
10
|
+
attr_reader :custom
|
|
11
|
+
|
|
12
|
+
def initialize(
|
|
13
|
+
id:,
|
|
14
|
+
totp:,
|
|
15
|
+
email:,
|
|
16
|
+
phone:,
|
|
17
|
+
custom:
|
|
18
|
+
)
|
|
19
|
+
@id = id
|
|
20
|
+
@totp = totp
|
|
21
|
+
@email = email
|
|
22
|
+
@phone = phone
|
|
23
|
+
@custom = custom
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from(map:)
|
|
27
|
+
PolicyMfaFactors.new(
|
|
28
|
+
id: map["$id"],
|
|
29
|
+
totp: map["totp"],
|
|
30
|
+
email: map["email"],
|
|
31
|
+
phone: map["phone"],
|
|
32
|
+
custom: map["custom"]
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def to_map
|
|
37
|
+
{
|
|
38
|
+
"$id": @id,
|
|
39
|
+
"totp": @totp,
|
|
40
|
+
"email": @email,
|
|
41
|
+
"phone": @phone,
|
|
42
|
+
"custom": @custom
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -36,6 +36,7 @@ module Appwrite
|
|
|
36
36
|
attr_reader :o_auth2_server_authorization_url
|
|
37
37
|
attr_reader :o_auth2_server_scopes
|
|
38
38
|
attr_reader :o_auth2_server_default_scopes
|
|
39
|
+
attr_reader :o_auth2_server_installation_scopes
|
|
39
40
|
attr_reader :o_auth2_server_authorization_details_types
|
|
40
41
|
attr_reader :o_auth2_server_access_token_duration
|
|
41
42
|
attr_reader :o_auth2_server_refresh_token_duration
|
|
@@ -83,6 +84,7 @@ module Appwrite
|
|
|
83
84
|
o_auth2_server_authorization_url: ,
|
|
84
85
|
o_auth2_server_scopes: ,
|
|
85
86
|
o_auth2_server_default_scopes: ,
|
|
87
|
+
o_auth2_server_installation_scopes: ,
|
|
86
88
|
o_auth2_server_authorization_details_types: ,
|
|
87
89
|
o_auth2_server_access_token_duration: ,
|
|
88
90
|
o_auth2_server_refresh_token_duration: ,
|
|
@@ -129,6 +131,7 @@ module Appwrite
|
|
|
129
131
|
@o_auth2_server_authorization_url = o_auth2_server_authorization_url
|
|
130
132
|
@o_auth2_server_scopes = o_auth2_server_scopes
|
|
131
133
|
@o_auth2_server_default_scopes = o_auth2_server_default_scopes
|
|
134
|
+
@o_auth2_server_installation_scopes = o_auth2_server_installation_scopes
|
|
132
135
|
@o_auth2_server_authorization_details_types = o_auth2_server_authorization_details_types
|
|
133
136
|
@o_auth2_server_access_token_duration = o_auth2_server_access_token_duration
|
|
134
137
|
@o_auth2_server_refresh_token_duration = o_auth2_server_refresh_token_duration
|
|
@@ -178,6 +181,7 @@ module Appwrite
|
|
|
178
181
|
o_auth2_server_authorization_url: map["oAuth2ServerAuthorizationUrl"],
|
|
179
182
|
o_auth2_server_scopes: map["oAuth2ServerScopes"],
|
|
180
183
|
o_auth2_server_default_scopes: map["oAuth2ServerDefaultScopes"],
|
|
184
|
+
o_auth2_server_installation_scopes: map["oAuth2ServerInstallationScopes"],
|
|
181
185
|
o_auth2_server_authorization_details_types: map["oAuth2ServerAuthorizationDetailsTypes"],
|
|
182
186
|
o_auth2_server_access_token_duration: map["oAuth2ServerAccessTokenDuration"],
|
|
183
187
|
o_auth2_server_refresh_token_duration: map["oAuth2ServerRefreshTokenDuration"],
|
|
@@ -228,6 +232,7 @@ module Appwrite
|
|
|
228
232
|
"oAuth2ServerAuthorizationUrl": @o_auth2_server_authorization_url,
|
|
229
233
|
"oAuth2ServerScopes": @o_auth2_server_scopes,
|
|
230
234
|
"oAuth2ServerDefaultScopes": @o_auth2_server_default_scopes,
|
|
235
|
+
"oAuth2ServerInstallationScopes": @o_auth2_server_installation_scopes,
|
|
231
236
|
"oAuth2ServerAuthorizationDetailsTypes": @o_auth2_server_authorization_details_types,
|
|
232
237
|
"oAuth2ServerAccessTokenDuration": @o_auth2_server_access_token_duration,
|
|
233
238
|
"oAuth2ServerRefreshTokenDuration": @o_auth2_server_refresh_token_duration,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class ProxyInvalidation
|
|
6
|
+
attr_reader :domain
|
|
7
|
+
attr_reader :type
|
|
8
|
+
attr_reader :reference
|
|
9
|
+
attr_reader :status
|
|
10
|
+
|
|
11
|
+
def initialize(
|
|
12
|
+
domain:,
|
|
13
|
+
type:,
|
|
14
|
+
reference:,
|
|
15
|
+
status:
|
|
16
|
+
)
|
|
17
|
+
@domain = domain
|
|
18
|
+
@type = type
|
|
19
|
+
@reference = reference
|
|
20
|
+
@status = status
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from(map:)
|
|
24
|
+
ProxyInvalidation.new(
|
|
25
|
+
domain: map["domain"],
|
|
26
|
+
type: map["type"],
|
|
27
|
+
reference: map["reference"],
|
|
28
|
+
status: map["status"]
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def to_map
|
|
33
|
+
{
|
|
34
|
+
"domain": @domain,
|
|
35
|
+
"type": @type,
|
|
36
|
+
"reference": @reference,
|
|
37
|
+
"status": @status
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -18,15 +18,15 @@ module Appwrite
|
|
|
18
18
|
def initialize(
|
|
19
19
|
bandwidth:,
|
|
20
20
|
executions:,
|
|
21
|
-
member
|
|
21
|
+
member: ,
|
|
22
22
|
realtime:,
|
|
23
23
|
realtime_messages:,
|
|
24
|
-
realtime_bandwidth
|
|
24
|
+
realtime_bandwidth: ,
|
|
25
25
|
storage:,
|
|
26
26
|
users:,
|
|
27
27
|
gb_hours:,
|
|
28
28
|
image_transformations:,
|
|
29
|
-
credits:
|
|
29
|
+
credits:
|
|
30
30
|
)
|
|
31
31
|
@bandwidth = bandwidth
|
|
32
32
|
@executions = executions
|
|
@@ -45,15 +45,15 @@ module Appwrite
|
|
|
45
45
|
UsageBillingPlan.new(
|
|
46
46
|
bandwidth: AdditionalResource.from(map: map["bandwidth"]),
|
|
47
47
|
executions: AdditionalResource.from(map: map["executions"]),
|
|
48
|
-
member: AdditionalResource.from(map: map["member"]),
|
|
48
|
+
member: map["member"].nil? ? nil : AdditionalResource.from(map: map["member"]),
|
|
49
49
|
realtime: AdditionalResource.from(map: map["realtime"]),
|
|
50
50
|
realtime_messages: AdditionalResource.from(map: map["realtimeMessages"]),
|
|
51
|
-
realtime_bandwidth: AdditionalResource.from(map: map["realtimeBandwidth"]),
|
|
51
|
+
realtime_bandwidth: map["realtimeBandwidth"].nil? ? nil : AdditionalResource.from(map: map["realtimeBandwidth"]),
|
|
52
52
|
storage: AdditionalResource.from(map: map["storage"]),
|
|
53
53
|
users: AdditionalResource.from(map: map["users"]),
|
|
54
54
|
gb_hours: AdditionalResource.from(map: map["GBHours"]),
|
|
55
55
|
image_transformations: AdditionalResource.from(map: map["imageTransformations"]),
|
|
56
|
-
credits: AdditionalResource.from(map: map["credits"])
|
|
56
|
+
credits: map["credits"].nil? ? nil : AdditionalResource.from(map: map["credits"])
|
|
57
57
|
)
|
|
58
58
|
end
|
|
59
59
|
|
|
@@ -61,15 +61,15 @@ module Appwrite
|
|
|
61
61
|
{
|
|
62
62
|
"bandwidth": @bandwidth.to_map,
|
|
63
63
|
"executions": @executions.to_map,
|
|
64
|
-
"member": @member
|
|
64
|
+
"member": @member&.to_map,
|
|
65
65
|
"realtime": @realtime.to_map,
|
|
66
66
|
"realtimeMessages": @realtime_messages.to_map,
|
|
67
|
-
"realtimeBandwidth": @realtime_bandwidth
|
|
67
|
+
"realtimeBandwidth": @realtime_bandwidth&.to_map,
|
|
68
68
|
"storage": @storage.to_map,
|
|
69
69
|
"users": @users.to_map,
|
|
70
70
|
"GBHours": @gb_hours.to_map,
|
|
71
71
|
"imageTransformations": @image_transformations.to_map,
|
|
72
|
-
"credits": @credits
|
|
72
|
+
"credits": @credits&.to_map
|
|
73
73
|
}
|
|
74
74
|
end
|
|
75
75
|
end
|
|
@@ -397,38 +397,6 @@ module Appwrite
|
|
|
397
397
|
|
|
398
398
|
end
|
|
399
399
|
|
|
400
|
-
# Use this endpoint to create a JSON Web Token. You can use the resulting JWT
|
|
401
|
-
# to authenticate on behalf of the current user when working with the
|
|
402
|
-
# Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes
|
|
403
|
-
# from its creation and will be invalid if the user will logout in that time
|
|
404
|
-
# frame.
|
|
405
|
-
#
|
|
406
|
-
# @param [Integer] duration Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
407
|
-
#
|
|
408
|
-
# @return [Jwt]
|
|
409
|
-
def create_jwt(duration: nil)
|
|
410
|
-
api_path = '/account/jwts'
|
|
411
|
-
|
|
412
|
-
api_params = {
|
|
413
|
-
duration: duration,
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
api_headers = {
|
|
417
|
-
"X-Appwrite-Project": @client.get_config('project'),
|
|
418
|
-
"content-type": 'application/json',
|
|
419
|
-
"accept": 'application/json',
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
@client.call(
|
|
423
|
-
method: 'POST',
|
|
424
|
-
path: api_path,
|
|
425
|
-
headers: api_headers,
|
|
426
|
-
params: api_params,
|
|
427
|
-
response_type: Models::Jwt
|
|
428
|
-
)
|
|
429
|
-
|
|
430
|
-
end
|
|
431
|
-
|
|
432
400
|
# Get the list of latest security activity logs for the currently logged in
|
|
433
401
|
# user. Each log returns user IP address, location and date and time of log.
|
|
434
402
|
#
|
|
@@ -600,7 +568,7 @@ module Appwrite
|
|
|
600
568
|
# [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
601
569
|
# method.
|
|
602
570
|
#
|
|
603
|
-
# @param [AuthenticationFactor] factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
|
|
571
|
+
# @param [AuthenticationFactor] factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.
|
|
604
572
|
#
|
|
605
573
|
# @return [MfaChallenge]
|
|
606
574
|
def create_mfa_challenge(factor:)
|
|
@@ -9,7 +9,7 @@ module Appwrite
|
|
|
9
9
|
|
|
10
10
|
# List all events for selected filters.
|
|
11
11
|
#
|
|
12
|
-
# @param [
|
|
12
|
+
# @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). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
|
|
13
13
|
#
|
|
14
14
|
# @return [ActivityEventList]
|
|
15
15
|
def list_events(queries: nil)
|
|
@@ -164,7 +164,7 @@ module Appwrite
|
|
|
164
164
|
|
|
165
165
|
# Get an application by its unique ID.
|
|
166
166
|
#
|
|
167
|
-
# @param [String] app_id Application unique ID
|
|
167
|
+
# @param [String] app_id Application unique ID.
|
|
168
168
|
#
|
|
169
169
|
# @return [App]
|
|
170
170
|
def get(app_id:)
|
|
@@ -213,7 +213,7 @@ module Appwrite
|
|
|
213
213
|
# @param [Array] post_logout_redirect_uris Post-logout redirect URIs for OpenID Connect RP-Initiated Logout. Each must be an https URL, an http loopback URL, or a private-use scheme URI, and must not contain a fragment. After ending the user session, the logout endpoint only redirects to URIs in this list.
|
|
214
214
|
# @param [String] type OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`.
|
|
215
215
|
# @param [] device_flow Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false.
|
|
216
|
-
# @param [Array] installation_scopes Scopes the application requests when installed on a team.
|
|
216
|
+
# @param [Array] installation_scopes Scopes the application requests when installed on a team. Only scopes allowed by the project's OAuth2 server installation scopes configuration are accepted; use the list installation scopes endpoint to discover available values. Maximum of 100 scopes are allowed.
|
|
217
217
|
# @param [String] installation_redirect_url URL users are redirected to after creating or updating an installation of this application. Must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI, and must not contain a fragment. Leave empty for no redirect.
|
|
218
218
|
#
|
|
219
219
|
# @return [App]
|
|
@@ -299,7 +299,8 @@ module Appwrite
|
|
|
299
299
|
end
|
|
300
300
|
|
|
301
301
|
# List installations of an application. Requires an app key sent in the
|
|
302
|
-
# `X-Appwrite-Key` header alongside the `X-Appwrite-App` header
|
|
302
|
+
# `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller
|
|
303
|
+
# with update access to the app.
|
|
303
304
|
#
|
|
304
305
|
# @param [String] app_id Application unique ID.
|
|
305
306
|
# @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.
|
|
@@ -335,7 +336,8 @@ module Appwrite
|
|
|
335
336
|
end
|
|
336
337
|
|
|
337
338
|
# Get an installation of an application by its unique ID. Requires an app key
|
|
338
|
-
# sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header
|
|
339
|
+
# sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header,
|
|
340
|
+
# or a caller with update access to the app.
|
|
339
341
|
#
|
|
340
342
|
# @param [String] app_id Application unique ID.
|
|
341
343
|
# @param [String] installation_id Installation unique ID.
|
|
@@ -372,13 +374,53 @@ module Appwrite
|
|
|
372
374
|
|
|
373
375
|
end
|
|
374
376
|
|
|
377
|
+
# Delete an installation of an application by its unique ID. Requires a
|
|
378
|
+
# caller with update access to the app. Previously issued installation access
|
|
379
|
+
# tokens are revoked.
|
|
380
|
+
#
|
|
381
|
+
# @param [String] app_id Application unique ID.
|
|
382
|
+
# @param [String] installation_id Installation unique ID.
|
|
383
|
+
#
|
|
384
|
+
# @return []
|
|
385
|
+
def delete_installation(app_id:, installation_id:)
|
|
386
|
+
api_path = '/apps/{appId}/installations/{installationId}'
|
|
387
|
+
.gsub('{appId}', app_id)
|
|
388
|
+
.gsub('{installationId}', installation_id)
|
|
389
|
+
|
|
390
|
+
if app_id.nil?
|
|
391
|
+
raise Appwrite::Exception.new('Missing required parameter: "appId"')
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
if installation_id.nil?
|
|
395
|
+
raise Appwrite::Exception.new('Missing required parameter: "installationId"')
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
api_params = {
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
api_headers = {
|
|
402
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
403
|
+
"content-type": 'application/json',
|
|
404
|
+
"accept": 'application/json',
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
@client.call(
|
|
408
|
+
method: 'DELETE',
|
|
409
|
+
path: api_path,
|
|
410
|
+
headers: api_headers,
|
|
411
|
+
params: api_params,
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
end
|
|
415
|
+
|
|
375
416
|
# Create a token for an installation of an application. Requires an app key
|
|
376
|
-
# sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header
|
|
377
|
-
#
|
|
378
|
-
# the installation, and can be
|
|
379
|
-
#
|
|
380
|
-
#
|
|
381
|
-
# or the installation is
|
|
417
|
+
# sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header,
|
|
418
|
+
# or a caller with update access to the app. The returned token carries the
|
|
419
|
+
# scopes and authorization details granted to the installation, and can be
|
|
420
|
+
# used as an `Authorization: Bearer` header everywhere OAuth2 access tokens
|
|
421
|
+
# are accepted. Multiple tokens can be active for the same installation at
|
|
422
|
+
# once; each token stays valid until it expires or the installation is
|
|
423
|
+
# updated or deleted.
|
|
382
424
|
#
|
|
383
425
|
# @param [String] app_id Application unique ID.
|
|
384
426
|
# @param [String] installation_id Installation unique ID.
|
|
@@ -318,9 +318,10 @@ module Appwrite
|
|
|
318
318
|
# Create and trigger a new restoration for a backup on a project.
|
|
319
319
|
#
|
|
320
320
|
# For a backup of one database, the restoration resolves its destination
|
|
321
|
-
# before it is queued.
|
|
322
|
-
#
|
|
323
|
-
#
|
|
321
|
+
# before it is queued. When `newResourceId` is omitted, the archived database
|
|
322
|
+
# is restored in place and its own ID is returned in `options`. Pass a
|
|
323
|
+
# different `newResourceId` to restore alongside it as a new database
|
|
324
|
+
# instead.
|
|
324
325
|
#
|
|
325
326
|
# The restoration migration records the archived database in `resourceId` and
|
|
326
327
|
# `resourceType`, and the resolved database in `destinationResourceId` and
|
|
@@ -337,14 +338,19 @@ module Appwrite
|
|
|
337
338
|
# operational `resourceType` of a table migration is not rewritten to
|
|
338
339
|
# `tablesdb`.
|
|
339
340
|
#
|
|
340
|
-
# When restoring a DocumentsDB or VectorsDB database
|
|
341
|
-
#
|
|
342
|
-
#
|
|
341
|
+
# When restoring a DocumentsDB or VectorsDB database from a dedicated source,
|
|
342
|
+
# the restore provisions a fresh dedicated backing database at the source
|
|
343
|
+
# database's own specification and lands the data there. An in-place restore
|
|
344
|
+
# swaps the database onto that backing only once the restore has succeeded,
|
|
345
|
+
# and retires the backing it displaced only once that swap is confirmed, so
|
|
346
|
+
# the source keeps serving its own data until the restored data is in place
|
|
347
|
+
# and any failure leaves it untouched. A serverless source has no dedicated
|
|
348
|
+
# backing to clone and restores onto the archived database instead.
|
|
343
349
|
#
|
|
344
350
|
#
|
|
345
351
|
# @param [String] archive_id Backup archive ID to restore
|
|
346
352
|
# @param [Array] services Array of services to restore
|
|
347
|
-
# @param [String] new_resource_id Destination resource ID. Omit to
|
|
353
|
+
# @param [String] new_resource_id Destination resource ID. Omit to restore the archived resource in place, or pass a different ID to restore alongside it as a new resource. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
348
354
|
# @param [String] new_resource_name Database name. Max length: 128 chars.
|
|
349
355
|
#
|
|
350
356
|
# @return [BackupRestoration]
|