appwrite 28.3.1 → 28.4.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 +20 -4
- data/lib/appwrite/enums/billing_plan_group.rb +2 -0
- data/lib/appwrite/enums/build_runtime.rb +2 -0
- data/lib/appwrite/enums/databases_index_type.rb +1 -0
- data/lib/appwrite/enums/domain_registration_type.rb +10 -0
- data/lib/appwrite/enums/domain_transfer_status_enum.rb +14 -0
- data/lib/appwrite/enums/framework.rb +1 -0
- data/lib/appwrite/enums/id_token_provider.rb +8 -0
- data/lib/appwrite/enums/image_gravity.rb +1 -0
- data/lib/appwrite/enums/o_auth2_auth0_prompt.rb +9 -0
- data/lib/appwrite/enums/o_auth2_discord_prompt.rb +8 -0
- data/lib/appwrite/enums/o_auth2_github_prompt.rb +7 -0
- data/lib/appwrite/enums/o_auth2_kakao_prompt.rb +10 -0
- data/lib/appwrite/enums/o_auth2_microsoft_prompt.rb +10 -0
- data/lib/appwrite/enums/o_auth2_okta_prompt.rb +9 -0
- data/lib/appwrite/enums/o_auth2_salesforce_prompt.rb +8 -0
- data/lib/appwrite/enums/o_auth2_zoho_prompt.rb +7 -0
- data/lib/appwrite/enums/o_auth_provider.rb +3 -0
- data/lib/appwrite/enums/project_email_template_id.rb +2 -0
- data/lib/appwrite/enums/project_key_scopes.rb +4 -0
- data/lib/appwrite/enums/project_o_auth2_auth0_prompt.rb +9 -0
- data/lib/appwrite/enums/project_o_auth2_discord_prompt.rb +8 -0
- data/lib/appwrite/enums/project_o_auth2_git_hub_prompt.rb +7 -0
- data/lib/appwrite/enums/project_o_auth2_kakao_prompt.rb +10 -0
- data/lib/appwrite/enums/project_o_auth2_microsoft_prompt.rb +10 -0
- data/lib/appwrite/enums/project_o_auth2_okta_prompt.rb +9 -0
- data/lib/appwrite/enums/project_o_auth2_salesforce_prompt.rb +8 -0
- data/lib/appwrite/enums/project_o_auth2_zoho_prompt.rb +7 -0
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +3 -0
- data/lib/appwrite/enums/project_policy_id.rb +2 -0
- data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +1 -0
- data/lib/appwrite/enums/runtime.rb +2 -0
- data/lib/appwrite/enums/tables_db_index_type.rb +1 -0
- data/lib/appwrite/enums/waf_rule_action.rb +11 -0
- data/lib/appwrite/models/account.rb +143 -0
- data/lib/appwrite/models/billing_plan.rb +12 -0
- data/lib/appwrite/models/dedicated_database.rb +15 -0
- data/lib/appwrite/models/dedicated_database_specification.rb +20 -0
- data/lib/appwrite/models/dns_record.rb +83 -0
- data/lib/appwrite/models/dns_records_list.rb +33 -0
- data/lib/appwrite/models/domain.rb +109 -0
- data/lib/appwrite/models/domain_price.rb +63 -0
- data/lib/appwrite/models/domain_prices_list.rb +33 -0
- data/lib/appwrite/models/domain_transfer_status.rb +59 -0
- data/lib/appwrite/models/domains_list.rb +33 -0
- data/lib/appwrite/models/identity.rb +8 -3
- data/lib/appwrite/models/o_auth2_apple.rb +13 -3
- data/lib/appwrite/models/o_auth2_auth0.rb +23 -0
- data/lib/appwrite/models/o_auth2_discord.rb +25 -3
- data/lib/appwrite/models/o_auth2_github.rb +24 -3
- data/lib/appwrite/models/o_auth2_google.rb +17 -5
- data/lib/appwrite/models/o_auth2_kakao.rb +67 -0
- data/lib/appwrite/models/o_auth2_microsoft.rb +24 -0
- data/lib/appwrite/models/o_auth2_oidc.rb +4 -2
- data/lib/appwrite/models/o_auth2_okta.rb +23 -0
- data/lib/appwrite/models/o_auth2_salesforce.rb +25 -3
- data/lib/appwrite/models/o_auth2_tik_tok.rb +43 -0
- data/lib/appwrite/models/o_auth2_webflow.rb +43 -0
- data/lib/appwrite/models/o_auth2_zoho.rb +24 -3
- data/lib/appwrite/models/oauth2_introspection.rb +83 -0
- data/lib/appwrite/models/platform_android.rb +8 -3
- data/lib/appwrite/models/policy_password_pwned.rb +43 -0
- data/lib/appwrite/models/policy_password_rotation.rb +38 -0
- data/lib/appwrite/models/project.rb +15 -0
- data/lib/appwrite/models/project_service.rb +1 -0
- data/lib/appwrite/models/proxy_rule.rb +1 -0
- data/lib/appwrite/models/topic.rb +13 -3
- data/lib/appwrite/models/user.rb +5 -0
- data/lib/appwrite/models/waf_rule_bypass.rb +111 -0
- data/lib/appwrite/models/waf_rule_challenge.rb +126 -0
- data/lib/appwrite/models/waf_rule_deny.rb +111 -0
- data/lib/appwrite/models/waf_rule_list.rb +33 -0
- data/lib/appwrite/models/waf_rule_rate_limit.rb +136 -0
- data/lib/appwrite/models/waf_rule_redirect.rb +121 -0
- data/lib/appwrite/services/account.rb +301 -5
- data/lib/appwrite/services/avatars.rb +71 -0
- data/lib/appwrite/services/databases.rb +4 -1
- data/lib/appwrite/services/documents_db.rb +4 -1
- data/lib/appwrite/services/domains.rb +2318 -0
- data/lib/appwrite/services/functions.rb +11 -3
- data/lib/appwrite/services/locale.rb +49 -14
- data/lib/appwrite/services/messaging.rb +130 -6
- data/lib/appwrite/services/oauth2.rb +45 -0
- data/lib/appwrite/services/organization.rb +225 -0
- data/lib/appwrite/services/project.rb +439 -15
- data/lib/appwrite/services/sites.rb +11 -3
- data/lib/appwrite/services/tables_db.rb +4 -1
- data/lib/appwrite/services/teams.rb +4 -1
- data/lib/appwrite/services/vectors_db.rb +4 -1
- data/lib/appwrite/services/waf.rb +859 -0
- data/lib/appwrite.rb +42 -0
- metadata +44 -2
|
@@ -9,6 +9,8 @@ module Appwrite
|
|
|
9
9
|
attr_reader :key_id
|
|
10
10
|
attr_reader :team_id
|
|
11
11
|
attr_reader :p8_file
|
|
12
|
+
attr_reader :native_enabled
|
|
13
|
+
attr_reader :native_client_ids
|
|
12
14
|
|
|
13
15
|
def initialize(
|
|
14
16
|
id:,
|
|
@@ -16,7 +18,9 @@ module Appwrite
|
|
|
16
18
|
service_id:,
|
|
17
19
|
key_id:,
|
|
18
20
|
team_id:,
|
|
19
|
-
p8_file
|
|
21
|
+
p8_file:,
|
|
22
|
+
native_enabled:,
|
|
23
|
+
native_client_ids:
|
|
20
24
|
)
|
|
21
25
|
@id = id
|
|
22
26
|
@enabled = enabled
|
|
@@ -24,6 +28,8 @@ module Appwrite
|
|
|
24
28
|
@key_id = key_id
|
|
25
29
|
@team_id = team_id
|
|
26
30
|
@p8_file = p8_file
|
|
31
|
+
@native_enabled = native_enabled
|
|
32
|
+
@native_client_ids = native_client_ids
|
|
27
33
|
end
|
|
28
34
|
|
|
29
35
|
def self.from(map:)
|
|
@@ -33,7 +39,9 @@ module Appwrite
|
|
|
33
39
|
service_id: map["serviceId"],
|
|
34
40
|
key_id: map["keyId"],
|
|
35
41
|
team_id: map["teamId"],
|
|
36
|
-
p8_file: map["p8File"]
|
|
42
|
+
p8_file: map["p8File"],
|
|
43
|
+
native_enabled: map["nativeEnabled"],
|
|
44
|
+
native_client_ids: map["nativeClientIds"]
|
|
37
45
|
)
|
|
38
46
|
end
|
|
39
47
|
|
|
@@ -44,7 +52,9 @@ module Appwrite
|
|
|
44
52
|
"serviceId": @service_id,
|
|
45
53
|
"keyId": @key_id,
|
|
46
54
|
"teamId": @team_id,
|
|
47
|
-
"p8File": @p8_file
|
|
55
|
+
"p8File": @p8_file,
|
|
56
|
+
"nativeEnabled": @native_enabled,
|
|
57
|
+
"nativeClientIds": @native_client_ids
|
|
48
58
|
}
|
|
49
59
|
end
|
|
50
60
|
end
|
|
@@ -7,6 +7,7 @@ module Appwrite
|
|
|
7
7
|
attr_reader :enabled
|
|
8
8
|
attr_reader :client_id
|
|
9
9
|
attr_reader :client_secret
|
|
10
|
+
attr_reader :prompt
|
|
10
11
|
attr_reader :endpoint
|
|
11
12
|
|
|
12
13
|
def initialize(
|
|
@@ -14,12 +15,14 @@ module Appwrite
|
|
|
14
15
|
enabled:,
|
|
15
16
|
client_id:,
|
|
16
17
|
client_secret:,
|
|
18
|
+
prompt:,
|
|
17
19
|
endpoint:
|
|
18
20
|
)
|
|
19
21
|
@id = id
|
|
20
22
|
@enabled = enabled
|
|
21
23
|
@client_id = client_id
|
|
22
24
|
@client_secret = client_secret
|
|
25
|
+
@prompt = prompt.nil? ? prompt : validate_prompt(prompt)
|
|
23
26
|
@endpoint = endpoint
|
|
24
27
|
end
|
|
25
28
|
|
|
@@ -29,6 +32,7 @@ module Appwrite
|
|
|
29
32
|
enabled: map["enabled"],
|
|
30
33
|
client_id: map["clientId"],
|
|
31
34
|
client_secret: map["clientSecret"],
|
|
35
|
+
prompt: map["prompt"],
|
|
32
36
|
endpoint: map["endpoint"]
|
|
33
37
|
)
|
|
34
38
|
end
|
|
@@ -39,9 +43,28 @@ module Appwrite
|
|
|
39
43
|
"enabled": @enabled,
|
|
40
44
|
"clientId": @client_id,
|
|
41
45
|
"clientSecret": @client_secret,
|
|
46
|
+
"prompt": @prompt,
|
|
42
47
|
"endpoint": @endpoint
|
|
43
48
|
}
|
|
44
49
|
end
|
|
50
|
+
|
|
51
|
+
private
|
|
52
|
+
|
|
53
|
+
def validate_prompt(prompt)
|
|
54
|
+
valid_prompt = [
|
|
55
|
+
Appwrite::Enums::OAuth2Auth0Prompt::NONE,
|
|
56
|
+
Appwrite::Enums::OAuth2Auth0Prompt::LOGIN,
|
|
57
|
+
Appwrite::Enums::OAuth2Auth0Prompt::CONSENT,
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
(prompt || []).each do |value|
|
|
61
|
+
unless valid_prompt.include?(value)
|
|
62
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
prompt
|
|
67
|
+
end
|
|
45
68
|
end
|
|
46
69
|
end
|
|
47
70
|
end
|
|
@@ -7,17 +7,20 @@ module Appwrite
|
|
|
7
7
|
attr_reader :enabled
|
|
8
8
|
attr_reader :client_id
|
|
9
9
|
attr_reader :client_secret
|
|
10
|
+
attr_reader :prompt
|
|
10
11
|
|
|
11
12
|
def initialize(
|
|
12
13
|
id:,
|
|
13
14
|
enabled:,
|
|
14
15
|
client_id:,
|
|
15
|
-
client_secret
|
|
16
|
+
client_secret:,
|
|
17
|
+
prompt:
|
|
16
18
|
)
|
|
17
19
|
@id = id
|
|
18
20
|
@enabled = enabled
|
|
19
21
|
@client_id = client_id
|
|
20
22
|
@client_secret = client_secret
|
|
23
|
+
@prompt = prompt.nil? ? prompt : validate_prompt(prompt)
|
|
21
24
|
end
|
|
22
25
|
|
|
23
26
|
def self.from(map:)
|
|
@@ -25,7 +28,8 @@ module Appwrite
|
|
|
25
28
|
id: map["$id"],
|
|
26
29
|
enabled: map["enabled"],
|
|
27
30
|
client_id: map["clientId"],
|
|
28
|
-
client_secret: map["clientSecret"]
|
|
31
|
+
client_secret: map["clientSecret"],
|
|
32
|
+
prompt: map["prompt"]
|
|
29
33
|
)
|
|
30
34
|
end
|
|
31
35
|
|
|
@@ -34,9 +38,27 @@ module Appwrite
|
|
|
34
38
|
"$id": @id,
|
|
35
39
|
"enabled": @enabled,
|
|
36
40
|
"clientId": @client_id,
|
|
37
|
-
"clientSecret": @client_secret
|
|
41
|
+
"clientSecret": @client_secret,
|
|
42
|
+
"prompt": @prompt
|
|
38
43
|
}
|
|
39
44
|
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
def validate_prompt(prompt)
|
|
49
|
+
valid_prompt = [
|
|
50
|
+
Appwrite::Enums::OAuth2DiscordPrompt::NONE,
|
|
51
|
+
Appwrite::Enums::OAuth2DiscordPrompt::CONSENT,
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
(prompt || []).each do |value|
|
|
55
|
+
unless valid_prompt.include?(value)
|
|
56
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
prompt
|
|
61
|
+
end
|
|
40
62
|
end
|
|
41
63
|
end
|
|
42
64
|
end
|
|
@@ -7,17 +7,20 @@ module Appwrite
|
|
|
7
7
|
attr_reader :enabled
|
|
8
8
|
attr_reader :client_id
|
|
9
9
|
attr_reader :client_secret
|
|
10
|
+
attr_reader :prompt
|
|
10
11
|
|
|
11
12
|
def initialize(
|
|
12
13
|
id:,
|
|
13
14
|
enabled:,
|
|
14
15
|
client_id:,
|
|
15
|
-
client_secret
|
|
16
|
+
client_secret:,
|
|
17
|
+
prompt:
|
|
16
18
|
)
|
|
17
19
|
@id = id
|
|
18
20
|
@enabled = enabled
|
|
19
21
|
@client_id = client_id
|
|
20
22
|
@client_secret = client_secret
|
|
23
|
+
@prompt = prompt.nil? ? prompt : validate_prompt(prompt)
|
|
21
24
|
end
|
|
22
25
|
|
|
23
26
|
def self.from(map:)
|
|
@@ -25,7 +28,8 @@ module Appwrite
|
|
|
25
28
|
id: map["$id"],
|
|
26
29
|
enabled: map["enabled"],
|
|
27
30
|
client_id: map["clientId"],
|
|
28
|
-
client_secret: map["clientSecret"]
|
|
31
|
+
client_secret: map["clientSecret"],
|
|
32
|
+
prompt: map["prompt"]
|
|
29
33
|
)
|
|
30
34
|
end
|
|
31
35
|
|
|
@@ -34,9 +38,26 @@ module Appwrite
|
|
|
34
38
|
"$id": @id,
|
|
35
39
|
"enabled": @enabled,
|
|
36
40
|
"clientId": @client_id,
|
|
37
|
-
"clientSecret": @client_secret
|
|
41
|
+
"clientSecret": @client_secret,
|
|
42
|
+
"prompt": @prompt
|
|
38
43
|
}
|
|
39
44
|
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
def validate_prompt(prompt)
|
|
49
|
+
valid_prompt = [
|
|
50
|
+
Appwrite::Enums::OAuth2GithubPrompt::SELECT_ACCOUNT,
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
(prompt || []).each do |value|
|
|
54
|
+
unless valid_prompt.include?(value)
|
|
55
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
prompt
|
|
60
|
+
end
|
|
40
61
|
end
|
|
41
62
|
end
|
|
42
63
|
end
|
|
@@ -8,19 +8,25 @@ module Appwrite
|
|
|
8
8
|
attr_reader :client_id
|
|
9
9
|
attr_reader :client_secret
|
|
10
10
|
attr_reader :prompt
|
|
11
|
+
attr_reader :native_enabled
|
|
12
|
+
attr_reader :native_client_ids
|
|
11
13
|
|
|
12
14
|
def initialize(
|
|
13
15
|
id:,
|
|
14
16
|
enabled:,
|
|
15
17
|
client_id:,
|
|
16
18
|
client_secret:,
|
|
17
|
-
prompt
|
|
19
|
+
prompt:,
|
|
20
|
+
native_enabled:,
|
|
21
|
+
native_client_ids:
|
|
18
22
|
)
|
|
19
23
|
@id = id
|
|
20
24
|
@enabled = enabled
|
|
21
25
|
@client_id = client_id
|
|
22
26
|
@client_secret = client_secret
|
|
23
27
|
@prompt = validate_prompt(prompt)
|
|
28
|
+
@native_enabled = native_enabled
|
|
29
|
+
@native_client_ids = native_client_ids
|
|
24
30
|
end
|
|
25
31
|
|
|
26
32
|
def self.from(map:)
|
|
@@ -29,7 +35,9 @@ module Appwrite
|
|
|
29
35
|
enabled: map["enabled"],
|
|
30
36
|
client_id: map["clientId"],
|
|
31
37
|
client_secret: map["clientSecret"],
|
|
32
|
-
prompt: map["prompt"]
|
|
38
|
+
prompt: map["prompt"],
|
|
39
|
+
native_enabled: map["nativeEnabled"],
|
|
40
|
+
native_client_ids: map["nativeClientIds"]
|
|
33
41
|
)
|
|
34
42
|
end
|
|
35
43
|
|
|
@@ -39,7 +47,9 @@ module Appwrite
|
|
|
39
47
|
"enabled": @enabled,
|
|
40
48
|
"clientId": @client_id,
|
|
41
49
|
"clientSecret": @client_secret,
|
|
42
|
-
"prompt": @prompt
|
|
50
|
+
"prompt": @prompt,
|
|
51
|
+
"nativeEnabled": @native_enabled,
|
|
52
|
+
"nativeClientIds": @native_client_ids
|
|
43
53
|
}
|
|
44
54
|
end
|
|
45
55
|
|
|
@@ -52,8 +62,10 @@ module Appwrite
|
|
|
52
62
|
Appwrite::Enums::OAuth2GooglePrompt::SELECT_ACCOUNT,
|
|
53
63
|
]
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
(prompt || []).each do |value|
|
|
66
|
+
unless valid_prompt.include?(value)
|
|
67
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
68
|
+
end
|
|
57
69
|
end
|
|
58
70
|
|
|
59
71
|
prompt
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class OAuth2Kakao
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :enabled
|
|
8
|
+
attr_reader :client_id
|
|
9
|
+
attr_reader :client_secret
|
|
10
|
+
attr_reader :prompt
|
|
11
|
+
|
|
12
|
+
def initialize(
|
|
13
|
+
id:,
|
|
14
|
+
enabled:,
|
|
15
|
+
client_id:,
|
|
16
|
+
client_secret:,
|
|
17
|
+
prompt:
|
|
18
|
+
)
|
|
19
|
+
@id = id
|
|
20
|
+
@enabled = enabled
|
|
21
|
+
@client_id = client_id
|
|
22
|
+
@client_secret = client_secret
|
|
23
|
+
@prompt = validate_prompt(prompt)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from(map:)
|
|
27
|
+
map = { "$id" => "", "enabled" => false, "clientId" => "", "clientSecret" => "", "prompt" => [] }.merge(map)
|
|
28
|
+
OAuth2Kakao.new(
|
|
29
|
+
id: map["$id"],
|
|
30
|
+
enabled: map["enabled"],
|
|
31
|
+
client_id: map["clientId"],
|
|
32
|
+
client_secret: map["clientSecret"],
|
|
33
|
+
prompt: map["prompt"]
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def to_map
|
|
38
|
+
{
|
|
39
|
+
"$id": @id,
|
|
40
|
+
"enabled": @enabled,
|
|
41
|
+
"clientId": @client_id,
|
|
42
|
+
"clientSecret": @client_secret,
|
|
43
|
+
"prompt": @prompt
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def validate_prompt(prompt)
|
|
50
|
+
valid_prompt = [
|
|
51
|
+
Appwrite::Enums::OAuth2KakaoPrompt::NONE,
|
|
52
|
+
Appwrite::Enums::OAuth2KakaoPrompt::LOGIN,
|
|
53
|
+
Appwrite::Enums::OAuth2KakaoPrompt::CREATE,
|
|
54
|
+
Appwrite::Enums::OAuth2KakaoPrompt::SELECT_ACCOUNT,
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
(prompt || []).each do |value|
|
|
58
|
+
unless valid_prompt.include?(value)
|
|
59
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
prompt
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -7,6 +7,7 @@ module Appwrite
|
|
|
7
7
|
attr_reader :enabled
|
|
8
8
|
attr_reader :application_id
|
|
9
9
|
attr_reader :application_secret
|
|
10
|
+
attr_reader :prompt
|
|
10
11
|
attr_reader :tenant
|
|
11
12
|
|
|
12
13
|
def initialize(
|
|
@@ -14,12 +15,14 @@ module Appwrite
|
|
|
14
15
|
enabled:,
|
|
15
16
|
application_id:,
|
|
16
17
|
application_secret:,
|
|
18
|
+
prompt:,
|
|
17
19
|
tenant:
|
|
18
20
|
)
|
|
19
21
|
@id = id
|
|
20
22
|
@enabled = enabled
|
|
21
23
|
@application_id = application_id
|
|
22
24
|
@application_secret = application_secret
|
|
25
|
+
@prompt = prompt.nil? ? prompt : validate_prompt(prompt)
|
|
23
26
|
@tenant = tenant
|
|
24
27
|
end
|
|
25
28
|
|
|
@@ -29,6 +32,7 @@ module Appwrite
|
|
|
29
32
|
enabled: map["enabled"],
|
|
30
33
|
application_id: map["applicationId"],
|
|
31
34
|
application_secret: map["applicationSecret"],
|
|
35
|
+
prompt: map["prompt"],
|
|
32
36
|
tenant: map["tenant"]
|
|
33
37
|
)
|
|
34
38
|
end
|
|
@@ -39,9 +43,29 @@ module Appwrite
|
|
|
39
43
|
"enabled": @enabled,
|
|
40
44
|
"applicationId": @application_id,
|
|
41
45
|
"applicationSecret": @application_secret,
|
|
46
|
+
"prompt": @prompt,
|
|
42
47
|
"tenant": @tenant
|
|
43
48
|
}
|
|
44
49
|
end
|
|
50
|
+
|
|
51
|
+
private
|
|
52
|
+
|
|
53
|
+
def validate_prompt(prompt)
|
|
54
|
+
valid_prompt = [
|
|
55
|
+
Appwrite::Enums::OAuth2MicrosoftPrompt::NONE,
|
|
56
|
+
Appwrite::Enums::OAuth2MicrosoftPrompt::LOGIN,
|
|
57
|
+
Appwrite::Enums::OAuth2MicrosoftPrompt::CONSENT,
|
|
58
|
+
Appwrite::Enums::OAuth2MicrosoftPrompt::SELECT_ACCOUNT,
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
(prompt || []).each do |value|
|
|
62
|
+
unless valid_prompt.include?(value)
|
|
63
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
prompt
|
|
68
|
+
end
|
|
45
69
|
end
|
|
46
70
|
end
|
|
47
71
|
end
|
|
@@ -78,8 +78,10 @@ module Appwrite
|
|
|
78
78
|
Appwrite::Enums::OAuth2OidcPrompt::SELECT_ACCOUNT,
|
|
79
79
|
]
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
(prompt || []).each do |value|
|
|
82
|
+
unless valid_prompt.include?(value)
|
|
83
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
84
|
+
end
|
|
83
85
|
end
|
|
84
86
|
|
|
85
87
|
prompt
|
|
@@ -7,6 +7,7 @@ module Appwrite
|
|
|
7
7
|
attr_reader :enabled
|
|
8
8
|
attr_reader :client_id
|
|
9
9
|
attr_reader :client_secret
|
|
10
|
+
attr_reader :prompt
|
|
10
11
|
attr_reader :domain
|
|
11
12
|
attr_reader :authorization_server_id
|
|
12
13
|
|
|
@@ -15,6 +16,7 @@ module Appwrite
|
|
|
15
16
|
enabled:,
|
|
16
17
|
client_id:,
|
|
17
18
|
client_secret:,
|
|
19
|
+
prompt:,
|
|
18
20
|
domain:,
|
|
19
21
|
authorization_server_id:
|
|
20
22
|
)
|
|
@@ -22,6 +24,7 @@ module Appwrite
|
|
|
22
24
|
@enabled = enabled
|
|
23
25
|
@client_id = client_id
|
|
24
26
|
@client_secret = client_secret
|
|
27
|
+
@prompt = prompt.nil? ? prompt : validate_prompt(prompt)
|
|
25
28
|
@domain = domain
|
|
26
29
|
@authorization_server_id = authorization_server_id
|
|
27
30
|
end
|
|
@@ -32,6 +35,7 @@ module Appwrite
|
|
|
32
35
|
enabled: map["enabled"],
|
|
33
36
|
client_id: map["clientId"],
|
|
34
37
|
client_secret: map["clientSecret"],
|
|
38
|
+
prompt: map["prompt"],
|
|
35
39
|
domain: map["domain"],
|
|
36
40
|
authorization_server_id: map["authorizationServerId"]
|
|
37
41
|
)
|
|
@@ -43,10 +47,29 @@ module Appwrite
|
|
|
43
47
|
"enabled": @enabled,
|
|
44
48
|
"clientId": @client_id,
|
|
45
49
|
"clientSecret": @client_secret,
|
|
50
|
+
"prompt": @prompt,
|
|
46
51
|
"domain": @domain,
|
|
47
52
|
"authorizationServerId": @authorization_server_id
|
|
48
53
|
}
|
|
49
54
|
end
|
|
55
|
+
|
|
56
|
+
private
|
|
57
|
+
|
|
58
|
+
def validate_prompt(prompt)
|
|
59
|
+
valid_prompt = [
|
|
60
|
+
Appwrite::Enums::OAuth2OktaPrompt::NONE,
|
|
61
|
+
Appwrite::Enums::OAuth2OktaPrompt::LOGIN,
|
|
62
|
+
Appwrite::Enums::OAuth2OktaPrompt::CONSENT,
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
(prompt || []).each do |value|
|
|
66
|
+
unless valid_prompt.include?(value)
|
|
67
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
prompt
|
|
72
|
+
end
|
|
50
73
|
end
|
|
51
74
|
end
|
|
52
75
|
end
|
|
@@ -7,17 +7,20 @@ module Appwrite
|
|
|
7
7
|
attr_reader :enabled
|
|
8
8
|
attr_reader :customer_key
|
|
9
9
|
attr_reader :customer_secret
|
|
10
|
+
attr_reader :prompt
|
|
10
11
|
|
|
11
12
|
def initialize(
|
|
12
13
|
id:,
|
|
13
14
|
enabled:,
|
|
14
15
|
customer_key:,
|
|
15
|
-
customer_secret
|
|
16
|
+
customer_secret:,
|
|
17
|
+
prompt:
|
|
16
18
|
)
|
|
17
19
|
@id = id
|
|
18
20
|
@enabled = enabled
|
|
19
21
|
@customer_key = customer_key
|
|
20
22
|
@customer_secret = customer_secret
|
|
23
|
+
@prompt = prompt.nil? ? prompt : validate_prompt(prompt)
|
|
21
24
|
end
|
|
22
25
|
|
|
23
26
|
def self.from(map:)
|
|
@@ -25,7 +28,8 @@ module Appwrite
|
|
|
25
28
|
id: map["$id"],
|
|
26
29
|
enabled: map["enabled"],
|
|
27
30
|
customer_key: map["customerKey"],
|
|
28
|
-
customer_secret: map["customerSecret"]
|
|
31
|
+
customer_secret: map["customerSecret"],
|
|
32
|
+
prompt: map["prompt"]
|
|
29
33
|
)
|
|
30
34
|
end
|
|
31
35
|
|
|
@@ -34,9 +38,27 @@ module Appwrite
|
|
|
34
38
|
"$id": @id,
|
|
35
39
|
"enabled": @enabled,
|
|
36
40
|
"customerKey": @customer_key,
|
|
37
|
-
"customerSecret": @customer_secret
|
|
41
|
+
"customerSecret": @customer_secret,
|
|
42
|
+
"prompt": @prompt
|
|
38
43
|
}
|
|
39
44
|
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
def validate_prompt(prompt)
|
|
49
|
+
valid_prompt = [
|
|
50
|
+
Appwrite::Enums::OAuth2SalesforcePrompt::LOGIN,
|
|
51
|
+
Appwrite::Enums::OAuth2SalesforcePrompt::CONSENT,
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
(prompt || []).each do |value|
|
|
55
|
+
unless valid_prompt.include?(value)
|
|
56
|
+
raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_prompt.join(', ')
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
prompt
|
|
61
|
+
end
|
|
40
62
|
end
|
|
41
63
|
end
|
|
42
64
|
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class OAuth2TikTok
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :enabled
|
|
8
|
+
attr_reader :client_id
|
|
9
|
+
attr_reader :client_secret
|
|
10
|
+
|
|
11
|
+
def initialize(
|
|
12
|
+
id:,
|
|
13
|
+
enabled:,
|
|
14
|
+
client_id:,
|
|
15
|
+
client_secret:
|
|
16
|
+
)
|
|
17
|
+
@id = id
|
|
18
|
+
@enabled = enabled
|
|
19
|
+
@client_id = client_id
|
|
20
|
+
@client_secret = client_secret
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from(map:)
|
|
24
|
+
map = { "$id" => "", "enabled" => false, "clientId" => "", "clientSecret" => "" }.merge(map)
|
|
25
|
+
OAuth2TikTok.new(
|
|
26
|
+
id: map["$id"],
|
|
27
|
+
enabled: map["enabled"],
|
|
28
|
+
client_id: map["clientId"],
|
|
29
|
+
client_secret: map["clientSecret"]
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def to_map
|
|
34
|
+
{
|
|
35
|
+
"$id": @id,
|
|
36
|
+
"enabled": @enabled,
|
|
37
|
+
"clientId": @client_id,
|
|
38
|
+
"clientSecret": @client_secret
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class OAuth2Webflow
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :enabled
|
|
8
|
+
attr_reader :client_id
|
|
9
|
+
attr_reader :client_secret
|
|
10
|
+
|
|
11
|
+
def initialize(
|
|
12
|
+
id:,
|
|
13
|
+
enabled:,
|
|
14
|
+
client_id:,
|
|
15
|
+
client_secret:
|
|
16
|
+
)
|
|
17
|
+
@id = id
|
|
18
|
+
@enabled = enabled
|
|
19
|
+
@client_id = client_id
|
|
20
|
+
@client_secret = client_secret
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from(map:)
|
|
24
|
+
map = { "$id" => "", "enabled" => false, "clientId" => "", "clientSecret" => "" }.merge(map)
|
|
25
|
+
OAuth2Webflow.new(
|
|
26
|
+
id: map["$id"],
|
|
27
|
+
enabled: map["enabled"],
|
|
28
|
+
client_id: map["clientId"],
|
|
29
|
+
client_secret: map["clientSecret"]
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def to_map
|
|
34
|
+
{
|
|
35
|
+
"$id": @id,
|
|
36
|
+
"enabled": @enabled,
|
|
37
|
+
"clientId": @client_id,
|
|
38
|
+
"clientSecret": @client_secret
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|