appwrite 30.3.0 → 30.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 +1 -1
- data/lib/appwrite/enums/o_auth_provider.rb +13 -0
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +13 -0
- data/lib/appwrite/models/o_auth2_atlassian.rb +43 -0
- data/lib/appwrite/models/o_auth2_instagram.rb +43 -0
- data/lib/appwrite/models/o_auth2_line.rb +43 -0
- data/lib/appwrite/models/o_auth2_linear.rb +43 -0
- data/lib/appwrite/models/o_auth2_netlify.rb +43 -0
- data/lib/appwrite/models/o_auth2_patreon.rb +43 -0
- data/lib/appwrite/models/o_auth2_railway.rb +43 -0
- data/lib/appwrite/models/o_auth2_reddit.rb +43 -0
- data/lib/appwrite/models/o_auth2_roblox.rb +43 -0
- data/lib/appwrite/models/o_auth2_strava.rb +43 -0
- data/lib/appwrite/models/o_auth2_vercel.rb +43 -0
- data/lib/appwrite/models/o_auth2_vk.rb +43 -0
- data/lib/appwrite/models/o_auth2_work_os.rb +43 -0
- data/lib/appwrite/services/account.rb +1 -1
- data/lib/appwrite/services/messaging.rb +208 -0
- data/lib/appwrite/services/project.rb +521 -1
- data/lib/appwrite.rb +13 -0
- metadata +15 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class OAuth2WorkOS
|
|
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
|
+
OAuth2WorkOS.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
|
|
@@ -2211,7 +2211,7 @@ module Appwrite
|
|
|
2211
2211
|
# about session
|
|
2212
2212
|
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
2213
2213
|
#
|
|
2214
|
-
# @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, naver, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, vipps, vippsSandbox, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
|
|
2214
|
+
# @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, atlassian, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, instagram, kakao, keycloak, kick, line, linear, linkedin, microsoft, naver, netlify, notion, oidc, okta, patreon, paypal, paypalSandbox, podio, railway, reddit, resend, roblox, salesforce, slack, spotify, strava, stripe, tiktok, tradeshift, tradeshiftBox, twitch, vercel, vipps, vippsSandbox, vk, webflow, wordpress, workos, x, yahoo, yammer, yandex, zoho, zoom.
|
|
2215
2215
|
# @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
2216
2216
|
# @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
2217
2217
|
# @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
|
|
@@ -835,6 +835,214 @@ module Appwrite
|
|
|
835
835
|
)
|
|
836
836
|
end
|
|
837
837
|
|
|
838
|
+
# Create a new Bird email provider. It sends email through Bird's email API
|
|
839
|
+
# with a workspace API key that holds the `emails:write` scope.
|
|
840
|
+
#
|
|
841
|
+
# @param [String] provider_id Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
|
|
842
|
+
# @param [String] name Provider name.
|
|
843
|
+
# @param [String] api_key Bird workspace API key.
|
|
844
|
+
# @param [String] from_name Sender Name.
|
|
845
|
+
# @param [String] from_email Sender email address. Its domain must be verified in the Bird workspace.
|
|
846
|
+
# @param [String] reply_to_name Name set in the reply to field for the mail. Default value is sender name.
|
|
847
|
+
# @param [String] reply_to_email Email set in the reply to field for the mail. Default value is sender email.
|
|
848
|
+
# @param [] enabled Set as enabled.
|
|
849
|
+
#
|
|
850
|
+
# @return [Provider]
|
|
851
|
+
def create_bird_email_provider(
|
|
852
|
+
provider_id:,
|
|
853
|
+
name:,
|
|
854
|
+
api_key: nil,
|
|
855
|
+
from_name: nil,
|
|
856
|
+
from_email: nil,
|
|
857
|
+
reply_to_name: nil,
|
|
858
|
+
reply_to_email: nil,
|
|
859
|
+
enabled: nil
|
|
860
|
+
)
|
|
861
|
+
if provider_id.nil?
|
|
862
|
+
raise Appwrite::Exception.new('Missing required parameter: "providerId"')
|
|
863
|
+
end
|
|
864
|
+
|
|
865
|
+
if name.nil?
|
|
866
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
867
|
+
end
|
|
868
|
+
|
|
869
|
+
api_path = '/messaging/providers/bird-email'
|
|
870
|
+
|
|
871
|
+
api_params = {
|
|
872
|
+
providerId: provider_id,
|
|
873
|
+
name: name,
|
|
874
|
+
apiKey: api_key,
|
|
875
|
+
fromName: from_name,
|
|
876
|
+
fromEmail: from_email,
|
|
877
|
+
replyToName: reply_to_name,
|
|
878
|
+
replyToEmail: reply_to_email,
|
|
879
|
+
enabled: enabled,
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
api_headers = {
|
|
883
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
884
|
+
"content-type": 'application/json',
|
|
885
|
+
"accept": 'application/json',
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
@client.call(
|
|
889
|
+
method: 'POST',
|
|
890
|
+
path: api_path,
|
|
891
|
+
headers: api_headers,
|
|
892
|
+
params: api_params,
|
|
893
|
+
response_type: Models::Provider
|
|
894
|
+
)
|
|
895
|
+
end
|
|
896
|
+
|
|
897
|
+
# Update a Bird email provider by its unique ID.
|
|
898
|
+
#
|
|
899
|
+
# @param [String] provider_id Provider ID.
|
|
900
|
+
# @param [String] name Provider name.
|
|
901
|
+
# @param [] enabled Set as enabled.
|
|
902
|
+
# @param [String] api_key Bird workspace API key.
|
|
903
|
+
# @param [String] from_name Sender Name.
|
|
904
|
+
# @param [String] from_email Sender email address. Its domain must be verified in the Bird workspace.
|
|
905
|
+
# @param [String] reply_to_name Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
906
|
+
# @param [String] reply_to_email Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
907
|
+
#
|
|
908
|
+
# @return [Provider]
|
|
909
|
+
def update_bird_email_provider(
|
|
910
|
+
provider_id:,
|
|
911
|
+
name: nil,
|
|
912
|
+
enabled: nil,
|
|
913
|
+
api_key: nil,
|
|
914
|
+
from_name: nil,
|
|
915
|
+
from_email: nil,
|
|
916
|
+
reply_to_name: nil,
|
|
917
|
+
reply_to_email: nil
|
|
918
|
+
)
|
|
919
|
+
if provider_id.nil? || provider_id == ''
|
|
920
|
+
raise Appwrite::Exception.new('Missing required parameter: "providerId"')
|
|
921
|
+
end
|
|
922
|
+
|
|
923
|
+
api_path = '/messaging/providers/bird-email/{providerId}'
|
|
924
|
+
.gsub('{providerId}', @client.encode_path(provider_id))
|
|
925
|
+
|
|
926
|
+
api_params = {
|
|
927
|
+
name: name,
|
|
928
|
+
enabled: enabled,
|
|
929
|
+
apiKey: api_key,
|
|
930
|
+
fromName: from_name,
|
|
931
|
+
fromEmail: from_email,
|
|
932
|
+
replyToName: reply_to_name,
|
|
933
|
+
replyToEmail: reply_to_email,
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
api_headers = {
|
|
937
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
938
|
+
"content-type": 'application/json',
|
|
939
|
+
"accept": 'application/json',
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
@client.call(
|
|
943
|
+
method: 'PATCH',
|
|
944
|
+
path: api_path,
|
|
945
|
+
headers: api_headers,
|
|
946
|
+
params: api_params,
|
|
947
|
+
response_type: Models::Provider
|
|
948
|
+
)
|
|
949
|
+
end
|
|
950
|
+
|
|
951
|
+
# Create a new Bird SMS provider. It sends SMS through Bird with a workspace
|
|
952
|
+
# API key that holds the `sms:write` scope.
|
|
953
|
+
#
|
|
954
|
+
# @param [String] provider_id Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
|
|
955
|
+
# @param [String] name Provider name.
|
|
956
|
+
# @param [String] from Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212.
|
|
957
|
+
# @param [String] api_key Bird workspace API key.
|
|
958
|
+
# @param [] enabled Set as enabled.
|
|
959
|
+
#
|
|
960
|
+
# @return [Provider]
|
|
961
|
+
def create_bird_sms_provider(
|
|
962
|
+
provider_id:,
|
|
963
|
+
name:,
|
|
964
|
+
from: nil,
|
|
965
|
+
api_key: nil,
|
|
966
|
+
enabled: nil
|
|
967
|
+
)
|
|
968
|
+
if provider_id.nil?
|
|
969
|
+
raise Appwrite::Exception.new('Missing required parameter: "providerId"')
|
|
970
|
+
end
|
|
971
|
+
|
|
972
|
+
if name.nil?
|
|
973
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
974
|
+
end
|
|
975
|
+
|
|
976
|
+
api_path = '/messaging/providers/bird-sms'
|
|
977
|
+
|
|
978
|
+
api_params = {
|
|
979
|
+
providerId: provider_id,
|
|
980
|
+
name: name,
|
|
981
|
+
from: from,
|
|
982
|
+
apiKey: api_key,
|
|
983
|
+
enabled: enabled,
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
api_headers = {
|
|
987
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
988
|
+
"content-type": 'application/json',
|
|
989
|
+
"accept": 'application/json',
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
@client.call(
|
|
993
|
+
method: 'POST',
|
|
994
|
+
path: api_path,
|
|
995
|
+
headers: api_headers,
|
|
996
|
+
params: api_params,
|
|
997
|
+
response_type: Models::Provider
|
|
998
|
+
)
|
|
999
|
+
end
|
|
1000
|
+
|
|
1001
|
+
# Update a Bird SMS provider by its unique ID.
|
|
1002
|
+
#
|
|
1003
|
+
# @param [String] provider_id Provider ID.
|
|
1004
|
+
# @param [String] name Provider name.
|
|
1005
|
+
# @param [] enabled Set as enabled.
|
|
1006
|
+
# @param [String] api_key Bird workspace API key.
|
|
1007
|
+
# @param [String] from Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212.
|
|
1008
|
+
#
|
|
1009
|
+
# @return [Provider]
|
|
1010
|
+
def update_bird_sms_provider(
|
|
1011
|
+
provider_id:,
|
|
1012
|
+
name: nil,
|
|
1013
|
+
enabled: nil,
|
|
1014
|
+
api_key: nil,
|
|
1015
|
+
from: nil
|
|
1016
|
+
)
|
|
1017
|
+
if provider_id.nil? || provider_id == ''
|
|
1018
|
+
raise Appwrite::Exception.new('Missing required parameter: "providerId"')
|
|
1019
|
+
end
|
|
1020
|
+
|
|
1021
|
+
api_path = '/messaging/providers/bird-sms/{providerId}'
|
|
1022
|
+
.gsub('{providerId}', @client.encode_path(provider_id))
|
|
1023
|
+
|
|
1024
|
+
api_params = {
|
|
1025
|
+
name: name,
|
|
1026
|
+
enabled: enabled,
|
|
1027
|
+
apiKey: api_key,
|
|
1028
|
+
from: from,
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
api_headers = {
|
|
1032
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
1033
|
+
"content-type": 'application/json',
|
|
1034
|
+
"accept": 'application/json',
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
@client.call(
|
|
1038
|
+
method: 'PATCH',
|
|
1039
|
+
path: api_path,
|
|
1040
|
+
headers: api_headers,
|
|
1041
|
+
params: api_params,
|
|
1042
|
+
response_type: Models::Provider
|
|
1043
|
+
)
|
|
1044
|
+
end
|
|
1045
|
+
|
|
838
1046
|
# Create a new Firebase Cloud Messaging provider.
|
|
839
1047
|
#
|
|
840
1048
|
# @param [String] provider_id Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
|