appwrite 30.1.0 → 30.3.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/appwrite_migration_resource.rb +1 -0
- data/lib/appwrite/enums/image_format.rb +1 -0
- data/lib/appwrite/enums/o_auth_provider.rb +3 -0
- data/lib/appwrite/enums/project_auth_method_id.rb +1 -0
- data/lib/appwrite/enums/project_key_scopes.rb +12 -0
- data/lib/appwrite/enums/project_ldap_encryption.rb +9 -0
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +3 -0
- data/lib/appwrite/enums/project_policy_id.rb +1 -0
- data/lib/appwrite/models/activity_event.rb +9 -4
- data/lib/appwrite/models/device.rb +58 -0
- data/lib/appwrite/models/domain_price.rb +8 -3
- data/lib/appwrite/models/environment.rb +48 -0
- data/lib/appwrite/models/environment_list.rb +33 -0
- data/lib/appwrite/models/o_auth2_naver.rb +43 -0
- data/lib/appwrite/models/o_auth2_vipps.rb +43 -0
- data/lib/appwrite/models/organization.rb +16 -1
- data/lib/appwrite/models/policy_account_devices.rb +33 -0
- data/lib/appwrite/models/project.rb +91 -1
- data/lib/appwrite/models/project_auth_method.rb +1 -0
- data/lib/appwrite/models/proxy_rule.rb +11 -1
- data/lib/appwrite/models/session.rb +6 -1
- data/lib/appwrite/models/site.rb +14 -4
- data/lib/appwrite/models/waf_rule_bypass.rb +8 -3
- data/lib/appwrite/models/waf_rule_challenge.rb +5 -0
- data/lib/appwrite/models/waf_rule_deny.rb +8 -3
- data/lib/appwrite/models/waf_rule_rate_limit.rb +5 -0
- data/lib/appwrite/models/waf_rule_redirect.rb +5 -0
- data/lib/appwrite/services/account.rb +206 -1
- data/lib/appwrite/services/avatars.rb +5 -2
- data/lib/appwrite/services/domains.rb +7 -6
- data/lib/appwrite/services/project.rb +402 -21
- data/lib/appwrite/services/proxy.rb +154 -1
- data/lib/appwrite/services/sites.rb +44 -0
- data/lib/appwrite/services/storage.rb +7 -4
- data/lib/appwrite/services/waf.rb +40 -10
- data/lib/appwrite.rb +7 -0
- metadata +9 -2
|
@@ -55,7 +55,7 @@ module Appwrite
|
|
|
55
55
|
# Update properties of a specific auth method. Use this endpoint to enable or
|
|
56
56
|
# disable a method in your project.
|
|
57
57
|
#
|
|
58
|
-
# @param [ProjectAuthMethodId] method_id Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone,passkey
|
|
58
|
+
# @param [ProjectAuthMethodId] method_id Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone,passkey,ldap
|
|
59
59
|
# @param [] enabled Auth method status.
|
|
60
60
|
#
|
|
61
61
|
# @return [Project]
|
|
@@ -94,12 +94,13 @@ module Appwrite
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
# Get a list of all environments of the project. You can use the query params
|
|
97
|
-
# to filter your results.
|
|
97
|
+
# to filter your results. An environment is listed by its ID, the one passed
|
|
98
|
+
# in the `X-Appwrite-Environment` header to act in it.
|
|
98
99
|
#
|
|
99
|
-
# @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. You may filter on the following attributes:
|
|
100
|
+
# @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. You may filter on the following attributes: $id, name, search
|
|
100
101
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
101
102
|
#
|
|
102
|
-
# @return [
|
|
103
|
+
# @return [EnvironmentList]
|
|
103
104
|
def list_environments(
|
|
104
105
|
queries: nil,
|
|
105
106
|
total: nil
|
|
@@ -121,13 +122,17 @@ module Appwrite
|
|
|
121
122
|
path: api_path,
|
|
122
123
|
headers: api_headers,
|
|
123
124
|
params: api_params,
|
|
124
|
-
response_type: Models::
|
|
125
|
+
response_type: Models::EnvironmentList
|
|
125
126
|
)
|
|
126
127
|
end
|
|
127
128
|
|
|
128
129
|
# Create a new environment of the project. An environment is a separate
|
|
129
130
|
# project in the same organization and region, with its own resources and
|
|
130
|
-
# users. Its usage is billed under the project it belongs to.
|
|
131
|
+
# users. Its usage is billed under the project it belongs to. Requests act in
|
|
132
|
+
# the environment when they carry the project's ID in the
|
|
133
|
+
# `X-Appwrite-Project` header and the environment's ID in the
|
|
134
|
+
# `X-Appwrite-Environment` header; the environment has no project ID of its
|
|
135
|
+
# own to pass.
|
|
131
136
|
#
|
|
132
137
|
# Pass `resources` to copy the project into the environment. The environment
|
|
133
138
|
# is returned at once and the copy runs as a migration of the environment,
|
|
@@ -137,11 +142,11 @@ module Appwrite
|
|
|
137
142
|
# under its limit of 100 users for test accounts, and the memberships of
|
|
138
143
|
# users left behind are not copied.
|
|
139
144
|
#
|
|
140
|
-
# @param [String] environment_id
|
|
145
|
+
# @param [String] environment_id Environment ID, unique within the project and passed in the `X-Appwrite-Environment` header to act in the environment. Choose a custom ID such as `staging`, or generate a random ID with `ID.unique()`. Valid chars are a-z, 0-9, and hyphen. Can't start with a special char. Max length is 36 chars.
|
|
141
146
|
# @param [String] name Environment name. Max length: 128 chars.
|
|
142
147
|
# @param [Array] resources Resources to copy from the project into the environment, by type. A structural type such as `database`, `table`, `column`, `index`, `bucket`, `team`, `function` or `site` copies the structure and its settings; `row`, `file`, `user`, `membership`, `deployment` and `site-deployment` copy what it holds. A function or site is copied with its active deployment; add `deployment` or `site-deployment` to copy every deployment. Users are copied newest first and at most 90 of them, leaving room under the limit of 100 users of an environment for test accounts; the memberships of users left behind are not copied. Leave empty for an empty environment. Maximum of 100 types.
|
|
143
148
|
#
|
|
144
|
-
# @return [
|
|
149
|
+
# @return [Environment]
|
|
145
150
|
def create_environment(
|
|
146
151
|
environment_id:,
|
|
147
152
|
name:,
|
|
@@ -174,15 +179,16 @@ module Appwrite
|
|
|
174
179
|
path: api_path,
|
|
175
180
|
headers: api_headers,
|
|
176
181
|
params: api_params,
|
|
177
|
-
response_type: Models::
|
|
182
|
+
response_type: Models::Environment
|
|
178
183
|
)
|
|
179
184
|
end
|
|
180
185
|
|
|
181
|
-
# Get an environment of the project by its
|
|
186
|
+
# Get an environment of the project by its ID, the one passed in the
|
|
187
|
+
# `X-Appwrite-Environment` header to act in it.
|
|
182
188
|
#
|
|
183
|
-
# @param [String] environment_id Environment
|
|
189
|
+
# @param [String] environment_id Environment ID.
|
|
184
190
|
#
|
|
185
|
-
# @return [
|
|
191
|
+
# @return [Environment]
|
|
186
192
|
def get_environment(
|
|
187
193
|
environment_id:
|
|
188
194
|
)
|
|
@@ -205,16 +211,17 @@ module Appwrite
|
|
|
205
211
|
path: api_path,
|
|
206
212
|
headers: api_headers,
|
|
207
213
|
params: api_params,
|
|
208
|
-
response_type: Models::
|
|
214
|
+
response_type: Models::Environment
|
|
209
215
|
)
|
|
210
216
|
end
|
|
211
217
|
|
|
212
|
-
# Update the name of an environment of the project.
|
|
218
|
+
# Update the name of an environment of the project. The environment ID cannot
|
|
219
|
+
# be changed.
|
|
213
220
|
#
|
|
214
|
-
# @param [String] environment_id Environment
|
|
221
|
+
# @param [String] environment_id Environment ID.
|
|
215
222
|
# @param [String] name Environment name. Max length: 128 chars.
|
|
216
223
|
#
|
|
217
|
-
# @return [
|
|
224
|
+
# @return [Environment]
|
|
218
225
|
def update_environment(
|
|
219
226
|
environment_id:,
|
|
220
227
|
name:
|
|
@@ -245,13 +252,13 @@ module Appwrite
|
|
|
245
252
|
path: api_path,
|
|
246
253
|
headers: api_headers,
|
|
247
254
|
params: api_params,
|
|
248
|
-
response_type: Models::
|
|
255
|
+
response_type: Models::Environment
|
|
249
256
|
)
|
|
250
257
|
end
|
|
251
258
|
|
|
252
259
|
# Delete an environment of the project, with all of its resources and users.
|
|
253
260
|
#
|
|
254
|
-
# @param [String] environment_id Environment
|
|
261
|
+
# @param [String] environment_id Environment ID.
|
|
255
262
|
#
|
|
256
263
|
# @return []
|
|
257
264
|
def delete_environment(
|
|
@@ -506,6 +513,120 @@ module Appwrite
|
|
|
506
513
|
)
|
|
507
514
|
end
|
|
508
515
|
|
|
516
|
+
# Update the LDAP configuration for your project. Use this endpoint to
|
|
517
|
+
# connect your project to an LDAP directory, such as OpenLDAP or Active
|
|
518
|
+
# Directory, so users can sign in with their directory credentials. Omitted
|
|
519
|
+
# parameters keep their stored value. Enabling LDAP connects to the directory
|
|
520
|
+
# and binds as the service account, so a project cannot be left enabled with
|
|
521
|
+
# a configuration that cannot sign anyone in.
|
|
522
|
+
#
|
|
523
|
+
# @param [] enabled Enable or disable LDAP sign-in. Enabling connects to the directory to validate the configuration.
|
|
524
|
+
# @param [Array] hosts Directory hostnames or IP addresses, tried in order until one answers. IPv6 addresses can be written with or without square brackets. Maximum of 10 hosts are allowed. For example: ["ldap.example.com"]
|
|
525
|
+
# @param [Integer] port Directory port. Defaults to 636 for LDAPS and 389 otherwise.
|
|
526
|
+
# @param [ProjectLDAPEncryption] encryption Transport encryption. Use "ldaps" for TLS from the first byte, "starttls" to upgrade a plain connection, or "none" for a trusted network only. Allowed values are: none, ldaps, starttls. Defaults to ldaps.
|
|
527
|
+
# @param [] verification Certificate verification, false for disabled or true for enabled. Defaults to true. Has no effect when encryption is none.
|
|
528
|
+
# @param [String] certificate Certificate in PEM format of the authority that signed the directory certificate, or the directory certificate itself when it is self-signed. Several certificates can be given one after another. Leave empty to use the system trust store. Pass an empty string to clear a previously set value.
|
|
529
|
+
# @param [Integer] timeout Seconds to wait for the directory to connect and answer each operation. Maximum is 30 seconds. Defaults to 10.
|
|
530
|
+
# @param [String] base_dn Subtree the user search starts from. For example: ou=people,dc=example,dc=com
|
|
531
|
+
# @param [String] bind_dn Service account used to search for users. Pass an empty string if the directory allows anonymous search. For example: cn=appwrite,ou=services,dc=example,dc=com
|
|
532
|
+
# @param [String] bind_password Service account password. This property is stored securely and cannot be read in future (write-only). Required again when hosts, port, encryption, verification, certificate or bindDn change.
|
|
533
|
+
# @param [String] user_filter LDAP filter that finds the user signing in. {username} is replaced with the username they enter and must appear at least once. Pass an empty string to use the default, (uid={username}). For example: (sAMAccountName={username}) on Active Directory, or (|(uid={username})(mail={username})) to accept a username or an email address.
|
|
534
|
+
# @param [String] required_group_dn Group a user must belong to in order to sign in, checked on every sign-in. Pass an empty string to allow every user the directory authenticates. For example: cn=staff,ou=groups,dc=example,dc=com
|
|
535
|
+
# @param [String] id_attribute Attribute holding the identifier that stays the same when an entry is renamed or moved. Defaults to entryUUID; use objectGUID on Active Directory.
|
|
536
|
+
# @param [String] email_attribute Attribute holding the email address. Defaults to mail.
|
|
537
|
+
# @param [String] name_attribute Attribute holding the display name. Defaults to cn.
|
|
538
|
+
# @param [String] phone_attribute Attribute holding the phone number, in international format. Leave empty, the default, to leave the phone unmapped. For example: mobile
|
|
539
|
+
#
|
|
540
|
+
# @return [Project]
|
|
541
|
+
def update_ldap(
|
|
542
|
+
enabled: nil,
|
|
543
|
+
hosts: nil,
|
|
544
|
+
port: nil,
|
|
545
|
+
encryption: nil,
|
|
546
|
+
verification: nil,
|
|
547
|
+
certificate: nil,
|
|
548
|
+
timeout: nil,
|
|
549
|
+
base_dn: nil,
|
|
550
|
+
bind_dn: nil,
|
|
551
|
+
bind_password: nil,
|
|
552
|
+
user_filter: nil,
|
|
553
|
+
required_group_dn: nil,
|
|
554
|
+
id_attribute: nil,
|
|
555
|
+
email_attribute: nil,
|
|
556
|
+
name_attribute: nil,
|
|
557
|
+
phone_attribute: nil
|
|
558
|
+
)
|
|
559
|
+
api_path = '/project/ldap'
|
|
560
|
+
|
|
561
|
+
api_params = {
|
|
562
|
+
enabled: enabled,
|
|
563
|
+
hosts: hosts,
|
|
564
|
+
port: port,
|
|
565
|
+
encryption: encryption,
|
|
566
|
+
verification: verification,
|
|
567
|
+
certificate: certificate,
|
|
568
|
+
timeout: timeout,
|
|
569
|
+
baseDn: base_dn,
|
|
570
|
+
bindDn: bind_dn,
|
|
571
|
+
bindPassword: bind_password,
|
|
572
|
+
userFilter: user_filter,
|
|
573
|
+
requiredGroupDn: required_group_dn,
|
|
574
|
+
idAttribute: id_attribute,
|
|
575
|
+
emailAttribute: email_attribute,
|
|
576
|
+
nameAttribute: name_attribute,
|
|
577
|
+
phoneAttribute: phone_attribute,
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
api_headers = {
|
|
581
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
582
|
+
"content-type": 'application/json',
|
|
583
|
+
"accept": 'application/json',
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
@client.call(
|
|
587
|
+
method: 'PATCH',
|
|
588
|
+
path: api_path,
|
|
589
|
+
headers: api_headers,
|
|
590
|
+
params: api_params,
|
|
591
|
+
response_type: Models::Project
|
|
592
|
+
)
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
# Test the stored LDAP configuration against the directory without signing
|
|
596
|
+
# anyone in. Connects to the directory, binds as the service account and
|
|
597
|
+
# reads the base DN. Pass a username to also look the user up and check the
|
|
598
|
+
# required group, and a password to also verify it. The error names the step
|
|
599
|
+
# that failed.
|
|
600
|
+
#
|
|
601
|
+
# @param [String] username Username to look up in the directory. Leave empty to test the connection and service account only.
|
|
602
|
+
# @param [String] password Password of the user to verify. Only used together with a username.
|
|
603
|
+
#
|
|
604
|
+
# @return []
|
|
605
|
+
def create_ldap_test(
|
|
606
|
+
username: nil,
|
|
607
|
+
password: nil
|
|
608
|
+
)
|
|
609
|
+
api_path = '/project/ldap/tests'
|
|
610
|
+
|
|
611
|
+
api_params = {
|
|
612
|
+
username: username,
|
|
613
|
+
password: password,
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
api_headers = {
|
|
617
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
618
|
+
"content-type": 'application/json',
|
|
619
|
+
"accept": 'application/json',
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
@client.call(
|
|
623
|
+
method: 'POST',
|
|
624
|
+
path: api_path,
|
|
625
|
+
headers: api_headers,
|
|
626
|
+
params: api_params,
|
|
627
|
+
)
|
|
628
|
+
end
|
|
629
|
+
|
|
509
630
|
# Get a list of all mock phones in the project. This endpoint returns an
|
|
510
631
|
# array of all mock phones and their OTPs.
|
|
511
632
|
#
|
|
@@ -1801,6 +1922,41 @@ module Appwrite
|
|
|
1801
1922
|
)
|
|
1802
1923
|
end
|
|
1803
1924
|
|
|
1925
|
+
# Update the project OAuth2 Naver configuration.
|
|
1926
|
+
#
|
|
1927
|
+
# @param [String] client_id 'Client ID' of Naver OAuth2 app. For example: jK8pQ0000000000000Zv
|
|
1928
|
+
# @param [String] client_secret 'Client Secret' of Naver OAuth2 app. For example: 9f42A0000000000c1dEb. Find it under Application > My Applications, on the overview of your app
|
|
1929
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1930
|
+
#
|
|
1931
|
+
# @return [OAuth2Naver]
|
|
1932
|
+
def update_o_auth2_naver(
|
|
1933
|
+
client_id: nil,
|
|
1934
|
+
client_secret: nil,
|
|
1935
|
+
enabled: nil
|
|
1936
|
+
)
|
|
1937
|
+
api_path = '/project/oauth2/naver'
|
|
1938
|
+
|
|
1939
|
+
api_params = {
|
|
1940
|
+
clientId: client_id,
|
|
1941
|
+
clientSecret: client_secret,
|
|
1942
|
+
enabled: enabled,
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
api_headers = {
|
|
1946
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
1947
|
+
"content-type": 'application/json',
|
|
1948
|
+
"accept": 'application/json',
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
@client.call(
|
|
1952
|
+
method: 'PATCH',
|
|
1953
|
+
path: api_path,
|
|
1954
|
+
headers: api_headers,
|
|
1955
|
+
params: api_params,
|
|
1956
|
+
response_type: Models::OAuth2Naver
|
|
1957
|
+
)
|
|
1958
|
+
end
|
|
1959
|
+
|
|
1804
1960
|
# Update the project OAuth2 Notion configuration.
|
|
1805
1961
|
#
|
|
1806
1962
|
# @param [String] oauth_client_id 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3
|
|
@@ -2356,6 +2512,76 @@ module Appwrite
|
|
|
2356
2512
|
)
|
|
2357
2513
|
end
|
|
2358
2514
|
|
|
2515
|
+
# Update the project OAuth2 Vipps MobilePay configuration.
|
|
2516
|
+
#
|
|
2517
|
+
# @param [String] client_id 'Client ID' of Vipps MobilePay OAuth2 app. For example: 9a3a4b3e-0000-0000-0000-0f1a6d1c3b2e
|
|
2518
|
+
# @param [String] client_secret 'Client Secret' of Vipps MobilePay OAuth2 app. For example: Ay1jb000000000000000000000000000000Vx3k
|
|
2519
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
2520
|
+
#
|
|
2521
|
+
# @return [OAuth2Vipps]
|
|
2522
|
+
def update_o_auth2_vipps(
|
|
2523
|
+
client_id: nil,
|
|
2524
|
+
client_secret: nil,
|
|
2525
|
+
enabled: nil
|
|
2526
|
+
)
|
|
2527
|
+
api_path = '/project/oauth2/vipps'
|
|
2528
|
+
|
|
2529
|
+
api_params = {
|
|
2530
|
+
clientId: client_id,
|
|
2531
|
+
clientSecret: client_secret,
|
|
2532
|
+
enabled: enabled,
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
api_headers = {
|
|
2536
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
2537
|
+
"content-type": 'application/json',
|
|
2538
|
+
"accept": 'application/json',
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
@client.call(
|
|
2542
|
+
method: 'PATCH',
|
|
2543
|
+
path: api_path,
|
|
2544
|
+
headers: api_headers,
|
|
2545
|
+
params: api_params,
|
|
2546
|
+
response_type: Models::OAuth2Vipps
|
|
2547
|
+
)
|
|
2548
|
+
end
|
|
2549
|
+
|
|
2550
|
+
# Update the project OAuth2 Vipps MobilePay Sandbox configuration.
|
|
2551
|
+
#
|
|
2552
|
+
# @param [String] client_id 'Client ID' of Vipps MobilePay Sandbox OAuth2 app. For example: 9a3a4b3e-0000-0000-0000-0f1a6d1c3b2e
|
|
2553
|
+
# @param [String] client_secret 'Client Secret' of Vipps MobilePay Sandbox OAuth2 app. For example: Ay1jb000000000000000000000000000000Vx3k
|
|
2554
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
2555
|
+
#
|
|
2556
|
+
# @return [OAuth2Vipps]
|
|
2557
|
+
def update_o_auth2_vipps_sandbox(
|
|
2558
|
+
client_id: nil,
|
|
2559
|
+
client_secret: nil,
|
|
2560
|
+
enabled: nil
|
|
2561
|
+
)
|
|
2562
|
+
api_path = '/project/oauth2/vippsSandbox'
|
|
2563
|
+
|
|
2564
|
+
api_params = {
|
|
2565
|
+
clientId: client_id,
|
|
2566
|
+
clientSecret: client_secret,
|
|
2567
|
+
enabled: enabled,
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
api_headers = {
|
|
2571
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
2572
|
+
"content-type": 'application/json',
|
|
2573
|
+
"accept": 'application/json',
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
@client.call(
|
|
2577
|
+
method: 'PATCH',
|
|
2578
|
+
path: api_path,
|
|
2579
|
+
headers: api_headers,
|
|
2580
|
+
params: api_params,
|
|
2581
|
+
response_type: Models::OAuth2Vipps
|
|
2582
|
+
)
|
|
2583
|
+
end
|
|
2584
|
+
|
|
2359
2585
|
# Update the project OAuth2 Webflow configuration.
|
|
2360
2586
|
#
|
|
2361
2587
|
# @param [String] client_id 'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd
|
|
@@ -2609,7 +2835,7 @@ module Appwrite
|
|
|
2609
2835
|
#
|
|
2610
2836
|
# @param [ProjectOAuthProviderId] provider_id OAuth2 provider key. For example: github, google, apple.
|
|
2611
2837
|
#
|
|
2612
|
-
# @return [OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Webflow, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2HuggingFace, OAuth2Resend, OAuth2Cloudflare, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft, OAuth2TikTok, OAuth2Kakao]
|
|
2838
|
+
# @return [OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Webflow, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2HuggingFace, OAuth2Resend, OAuth2Cloudflare, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft, OAuth2TikTok, OAuth2Kakao, OAuth2Naver, OAuth2Vipps]
|
|
2613
2839
|
def get_o_auth2_provider(
|
|
2614
2840
|
provider_id:
|
|
2615
2841
|
)
|
|
@@ -2798,11 +3024,21 @@ module Appwrite
|
|
|
2798
3024
|
return Models::OAuth2Facebook.from(map: response)
|
|
2799
3025
|
end
|
|
2800
3026
|
|
|
3027
|
+
if response['$id'] == 'tradeshift'
|
|
3028
|
+
|
|
3029
|
+
return Models::OAuth2Tradeshift.from(map: response)
|
|
3030
|
+
end
|
|
3031
|
+
|
|
2801
3032
|
if response['$id'] == 'tradeshiftBox'
|
|
2802
3033
|
|
|
2803
3034
|
return Models::OAuth2Tradeshift.from(map: response)
|
|
2804
3035
|
end
|
|
2805
3036
|
|
|
3037
|
+
if response['$id'] == 'paypal'
|
|
3038
|
+
|
|
3039
|
+
return Models::OAuth2Paypal.from(map: response)
|
|
3040
|
+
end
|
|
3041
|
+
|
|
2806
3042
|
if response['$id'] == 'paypalSandbox'
|
|
2807
3043
|
|
|
2808
3044
|
return Models::OAuth2Paypal.from(map: response)
|
|
@@ -2868,9 +3104,54 @@ module Appwrite
|
|
|
2868
3104
|
return Models::OAuth2Kakao.from(map: response)
|
|
2869
3105
|
end
|
|
2870
3106
|
|
|
3107
|
+
if response['$id'] == 'naver'
|
|
3108
|
+
|
|
3109
|
+
return Models::OAuth2Naver.from(map: response)
|
|
3110
|
+
end
|
|
3111
|
+
|
|
3112
|
+
if response['$id'] == 'vipps'
|
|
3113
|
+
|
|
3114
|
+
return Models::OAuth2Vipps.from(map: response)
|
|
3115
|
+
end
|
|
3116
|
+
|
|
3117
|
+
if response['$id'] == 'vippsSandbox'
|
|
3118
|
+
|
|
3119
|
+
return Models::OAuth2Vipps.from(map: response)
|
|
3120
|
+
end
|
|
3121
|
+
|
|
2871
3122
|
raise Exception, "Unable to match response to any expected response model"
|
|
2872
3123
|
end
|
|
2873
3124
|
|
|
3125
|
+
# Delete all passwords in the project, forcing every user to reset their
|
|
3126
|
+
# password. Any password set before this request stops working for email and
|
|
3127
|
+
# password sign-in immediately: signing in returns a
|
|
3128
|
+
# `user_password_reset_required` error until the user sets a new password
|
|
3129
|
+
# through password recovery, or until a new password is set for them with the
|
|
3130
|
+
# Users API. Existing sessions are not affected; call the delete sessions
|
|
3131
|
+
# endpoint to sign users out as well. Users without a password and API keys
|
|
3132
|
+
# are not affected by this action.
|
|
3133
|
+
#
|
|
3134
|
+
#
|
|
3135
|
+
# @return []
|
|
3136
|
+
def delete_passwords()
|
|
3137
|
+
api_path = '/project/passwords'
|
|
3138
|
+
|
|
3139
|
+
api_params = {}
|
|
3140
|
+
|
|
3141
|
+
api_headers = {
|
|
3142
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
3143
|
+
"content-type": 'application/json',
|
|
3144
|
+
"accept": 'application/json',
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
@client.call(
|
|
3148
|
+
method: 'DELETE',
|
|
3149
|
+
path: api_path,
|
|
3150
|
+
headers: api_headers,
|
|
3151
|
+
params: api_params,
|
|
3152
|
+
)
|
|
3153
|
+
end
|
|
3154
|
+
|
|
2874
3155
|
# Get a list of all platforms in the project. This endpoint returns an array
|
|
2875
3156
|
# of all platforms and their configurations.
|
|
2876
3157
|
#
|
|
@@ -3519,6 +3800,42 @@ module Appwrite
|
|
|
3519
3800
|
)
|
|
3520
3801
|
end
|
|
3521
3802
|
|
|
3803
|
+
# Update whether account devices are enabled for the project. When enabled, a
|
|
3804
|
+
# browser can create an account device that holds multiple sessions and
|
|
3805
|
+
# switch between them. When disabled, account devices can no longer be
|
|
3806
|
+
# created, so each browser is limited to a single active session.
|
|
3807
|
+
#
|
|
3808
|
+
# @param [] enabled Set to true to allow account devices, or false to disable them for this project.
|
|
3809
|
+
#
|
|
3810
|
+
# @return [Project]
|
|
3811
|
+
def update_account_devices_policy(
|
|
3812
|
+
enabled:
|
|
3813
|
+
)
|
|
3814
|
+
if enabled.nil?
|
|
3815
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
3816
|
+
end
|
|
3817
|
+
|
|
3818
|
+
api_path = '/project/policies/account-devices'
|
|
3819
|
+
|
|
3820
|
+
api_params = {
|
|
3821
|
+
enabled: enabled,
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3824
|
+
api_headers = {
|
|
3825
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
3826
|
+
"content-type": 'application/json',
|
|
3827
|
+
"accept": 'application/json',
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
@client.call(
|
|
3831
|
+
method: 'PATCH',
|
|
3832
|
+
path: api_path,
|
|
3833
|
+
headers: api_headers,
|
|
3834
|
+
params: api_params,
|
|
3835
|
+
response_type: Models::Project
|
|
3836
|
+
)
|
|
3837
|
+
end
|
|
3838
|
+
|
|
3522
3839
|
# Configures if aliased emails such as subaddresses and emails with suffixes
|
|
3523
3840
|
# are denied during new users sign-ups and email updates.
|
|
3524
3841
|
#
|
|
@@ -4247,9 +4564,9 @@ module Appwrite
|
|
|
4247
4564
|
# Get a policy by its unique ID. This endpoint returns the current
|
|
4248
4565
|
# configuration for the requested project policy.
|
|
4249
4566
|
#
|
|
4250
|
-
# @param [ProjectPolicyId] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, password-pwned, password-rotation, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email, deny-realtime-guests, passkey.
|
|
4567
|
+
# @param [ProjectPolicyId] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, password-pwned, password-rotation, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email, deny-realtime-guests, passkey, account-devices.
|
|
4251
4568
|
#
|
|
4252
|
-
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicyPasswordPwned, PolicyPasswordRotation, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail, PolicyDenyRealtimeGuests, PolicyPasskey]
|
|
4569
|
+
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicyPasswordPwned, PolicyPasswordRotation, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail, PolicyDenyRealtimeGuests, PolicyPasskey, PolicyAccountDevices]
|
|
4253
4570
|
def get_policy(
|
|
4254
4571
|
policy_id:
|
|
4255
4572
|
)
|
|
@@ -4373,9 +4690,73 @@ module Appwrite
|
|
|
4373
4690
|
return Models::PolicyPasskey.from(map: response)
|
|
4374
4691
|
end
|
|
4375
4692
|
|
|
4693
|
+
if response['$id'] == 'account-devices'
|
|
4694
|
+
|
|
4695
|
+
return Models::PolicyAccountDevices.from(map: response)
|
|
4696
|
+
end
|
|
4697
|
+
|
|
4376
4698
|
raise Exception, "Unable to match response to any expected response model"
|
|
4377
4699
|
end
|
|
4378
4700
|
|
|
4701
|
+
# Get the project preferences. Preferences are a key-value object stored on
|
|
4702
|
+
# the project for anyone working on it.
|
|
4703
|
+
#
|
|
4704
|
+
#
|
|
4705
|
+
# @return [Preferences]
|
|
4706
|
+
def get_prefs()
|
|
4707
|
+
api_path = '/project/prefs'
|
|
4708
|
+
|
|
4709
|
+
api_params = {}
|
|
4710
|
+
|
|
4711
|
+
api_headers = {
|
|
4712
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
4713
|
+
"accept": 'application/json',
|
|
4714
|
+
}
|
|
4715
|
+
|
|
4716
|
+
@client.call(
|
|
4717
|
+
method: 'GET',
|
|
4718
|
+
path: api_path,
|
|
4719
|
+
headers: api_headers,
|
|
4720
|
+
params: api_params,
|
|
4721
|
+
response_type: Models::Preferences
|
|
4722
|
+
)
|
|
4723
|
+
end
|
|
4724
|
+
|
|
4725
|
+
# Update the project preferences. The object you pass is stored as is and
|
|
4726
|
+
# replaces any previous value. The maximum allowed prefs size is 64kB and
|
|
4727
|
+
# throws an error if exceeded.
|
|
4728
|
+
#
|
|
4729
|
+
# @param [Hash] prefs Prefs key-value JSON object.
|
|
4730
|
+
#
|
|
4731
|
+
# @return [Preferences]
|
|
4732
|
+
def update_prefs(
|
|
4733
|
+
prefs:
|
|
4734
|
+
)
|
|
4735
|
+
if prefs.nil?
|
|
4736
|
+
raise Appwrite::Exception.new('Missing required parameter: "prefs"')
|
|
4737
|
+
end
|
|
4738
|
+
|
|
4739
|
+
api_path = '/project/prefs'
|
|
4740
|
+
|
|
4741
|
+
api_params = {
|
|
4742
|
+
prefs: prefs,
|
|
4743
|
+
}
|
|
4744
|
+
|
|
4745
|
+
api_headers = {
|
|
4746
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
4747
|
+
"content-type": 'application/json',
|
|
4748
|
+
"accept": 'application/json',
|
|
4749
|
+
}
|
|
4750
|
+
|
|
4751
|
+
@client.call(
|
|
4752
|
+
method: 'PUT',
|
|
4753
|
+
path: api_path,
|
|
4754
|
+
headers: api_headers,
|
|
4755
|
+
params: api_params,
|
|
4756
|
+
response_type: Models::Preferences
|
|
4757
|
+
)
|
|
4758
|
+
end
|
|
4759
|
+
|
|
4379
4760
|
# Update properties of a specific protocol. Use this endpoint to enable or
|
|
4380
4761
|
# disable a protocol in your project.
|
|
4381
4762
|
#
|