appwrite 28.1.0 → 28.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e15cd2c962b2b82ef5d5c50f34ead2b2a377effbe51a369b60a9139b17c02bd6
4
- data.tar.gz: e9b8cf19f745d77069fe5b0eaaa3300a4ef5b087e48f2e4d3386c4072f06ee42
3
+ metadata.gz: 117e36ad1ffcd37311f0383d6bf88f5cd597ce856a407b1119e08d27426d6197
4
+ data.tar.gz: b865749bebaf9e553195ca9aa5d8eb6b5e3b8f9dd3cb0e00c760e335f3690478
5
5
  SHA512:
6
- metadata.gz: b6ff3376532ad00e55b4591013679415df9b34794df9d478aae4df0912686e8a6175e70d3edeb230516ff50e0567cf81607357a6ac75baf578b2bb64439a93bf
7
- data.tar.gz: 7bb52f4c1aa74c69c0799124e180ae5b4a1582d53b51aace26c101d77ca61f1d327c25eca6e00d327ec82af9af7be6ecfe8071aff1005db077a878d3b47b9e68
6
+ metadata.gz: dfc7b897f6eff35f2c2488d9147f2f46626f526acce61f8e3875322d18730499df11c54637b0d15c6f9278ac2f5694f1f6e5af7812ab5c88c1cdc2f452dcd034
7
+ data.tar.gz: 6754b78082299b1f430b78e49acd863f9e04a76e37eb6352250471ca2eb17005891dbe9fb81955e828aba1f76791d6b6c390bea0e6f289f575cb2499f62a546b
@@ -14,7 +14,7 @@ module Appwrite
14
14
  'x-sdk-name' => 'Ruby',
15
15
  'x-sdk-platform' => 'server',
16
16
  'x-sdk-language' => 'ruby',
17
- 'x-sdk-version' => '28.1.0',
17
+ 'x-sdk-version' => '28.3.0',
18
18
  'X-Appwrite-Response-Format' => '2.0.0'
19
19
  }
20
20
  @endpoint = 'https://cloud.appwrite.io/v1'
@@ -69,6 +69,7 @@ module Appwrite
69
69
  attr_reader :backup_policies
70
70
  attr_reader :deployment_size
71
71
  attr_reader :build_size
72
+ attr_reader :functions_interval_minimum
72
73
  attr_reader :databases_allow_encrypt
73
74
  attr_reader :limits
74
75
  attr_reader :group
@@ -143,6 +144,7 @@ module Appwrite
143
144
  backup_policies:,
144
145
  deployment_size:,
145
146
  build_size:,
147
+ functions_interval_minimum:,
146
148
  databases_allow_encrypt:,
147
149
  limits:,
148
150
  group:,
@@ -216,6 +218,7 @@ module Appwrite
216
218
  @backup_policies = backup_policies
217
219
  @deployment_size = deployment_size
218
220
  @build_size = build_size
221
+ @functions_interval_minimum = functions_interval_minimum
219
222
  @databases_allow_encrypt = databases_allow_encrypt
220
223
  @limits = limits
221
224
  @group = validate_group(group)
@@ -292,6 +295,7 @@ module Appwrite
292
295
  backup_policies: map["backupPolicies"],
293
296
  deployment_size: map["deploymentSize"],
294
297
  build_size: map["buildSize"],
298
+ functions_interval_minimum: map["functionsIntervalMinimum"],
295
299
  databases_allow_encrypt: map["databasesAllowEncrypt"],
296
300
  limits: map["limits"].nil? ? nil : BillingPlanLimits.from(map: map["limits"]),
297
301
  group: map["group"],
@@ -369,6 +373,7 @@ module Appwrite
369
373
  "backupPolicies": @backup_policies,
370
374
  "deploymentSize": @deployment_size,
371
375
  "buildSize": @build_size,
376
+ "functionsIntervalMinimum": @functions_interval_minimum,
372
377
  "databasesAllowEncrypt": @databases_allow_encrypt,
373
378
  "limits": @limits&.to_map,
374
379
  "group": @group,
@@ -22,6 +22,7 @@ module Appwrite
22
22
  attr_reader :vars
23
23
  attr_reader :events
24
24
  attr_reader :schedule
25
+ attr_reader :interval
25
26
  attr_reader :timeout
26
27
  attr_reader :entrypoint
27
28
  attr_reader :commands
@@ -56,6 +57,7 @@ module Appwrite
56
57
  vars:,
57
58
  events:,
58
59
  schedule:,
60
+ interval:,
59
61
  timeout:,
60
62
  entrypoint:,
61
63
  commands:,
@@ -89,6 +91,7 @@ module Appwrite
89
91
  @vars = vars
90
92
  @events = events
91
93
  @schedule = schedule
94
+ @interval = interval
92
95
  @timeout = timeout
93
96
  @entrypoint = entrypoint
94
97
  @commands = commands
@@ -125,6 +128,7 @@ module Appwrite
125
128
  vars: map["vars"].map { |it| Variable.from(map: it) },
126
129
  events: map["events"],
127
130
  schedule: map["schedule"],
131
+ interval: map["interval"],
128
132
  timeout: map["timeout"],
129
133
  entrypoint: map["entrypoint"],
130
134
  commands: map["commands"],
@@ -162,6 +166,7 @@ module Appwrite
162
166
  "vars": @vars.map { |it| it.to_map },
163
167
  "events": @events,
164
168
  "schedule": @schedule,
169
+ "interval": @interval,
165
170
  "timeout": @timeout,
166
171
  "entrypoint": @entrypoint,
167
172
  "commands": @commands,
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Passkey
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :name
10
+ attr_reader :accessed_at
11
+
12
+ def initialize(
13
+ id:,
14
+ created_at:,
15
+ updated_at:,
16
+ name:,
17
+ accessed_at:
18
+ )
19
+ @id = id
20
+ @created_at = created_at
21
+ @updated_at = updated_at
22
+ @name = name
23
+ @accessed_at = accessed_at
24
+ end
25
+
26
+ def self.from(map:)
27
+ Passkey.new(
28
+ id: map["$id"],
29
+ created_at: map["$createdAt"],
30
+ updated_at: map["$updatedAt"],
31
+ name: map["name"],
32
+ accessed_at: map["accessedAt"]
33
+ )
34
+ end
35
+
36
+ def to_map
37
+ {
38
+ "$id": @id,
39
+ "$createdAt": @created_at,
40
+ "$updatedAt": @updated_at,
41
+ "name": @name,
42
+ "accessedAt": @accessed_at
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class PasskeyChallenge
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :passkey_id
9
+ attr_reader :expire
10
+ attr_reader :public_key
11
+
12
+ def initialize(
13
+ id:,
14
+ created_at:,
15
+ passkey_id:,
16
+ expire:,
17
+ public_key:
18
+ )
19
+ @id = id
20
+ @created_at = created_at
21
+ @passkey_id = passkey_id
22
+ @expire = expire
23
+ @public_key = public_key
24
+ end
25
+
26
+ def self.from(map:)
27
+ PasskeyChallenge.new(
28
+ id: map["$id"],
29
+ created_at: map["$createdAt"],
30
+ passkey_id: map["passkeyId"],
31
+ expire: map["expire"],
32
+ public_key: map["publicKey"]
33
+ )
34
+ end
35
+
36
+ def to_map
37
+ {
38
+ "$id": @id,
39
+ "$createdAt": @created_at,
40
+ "passkeyId": @passkey_id,
41
+ "expire": @expire,
42
+ "publicKey": @public_key
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class PasskeyList
6
+ attr_reader :total
7
+ attr_reader :passkeys
8
+
9
+ def initialize(
10
+ total:,
11
+ passkeys:
12
+ )
13
+ @total = total
14
+ @passkeys = passkeys
15
+ end
16
+
17
+ def self.from(map:)
18
+ PasskeyList.new(
19
+ total: map["total"],
20
+ passkeys: map["passkeys"].map { |it| Passkey.from(map: it) }
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "total": @total,
27
+ "passkeys": @passkeys.map { |it| it.to_map }
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class TokenSecret
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :user_id
9
+ attr_reader :secret
10
+ attr_reader :expire
11
+ attr_reader :phrase
12
+
13
+ def initialize(
14
+ id:,
15
+ created_at:,
16
+ user_id:,
17
+ secret:,
18
+ expire:,
19
+ phrase:
20
+ )
21
+ @id = id
22
+ @created_at = created_at
23
+ @user_id = user_id
24
+ @secret = secret
25
+ @expire = expire
26
+ @phrase = phrase
27
+ end
28
+
29
+ def self.from(map:)
30
+ TokenSecret.new(
31
+ id: map["$id"],
32
+ created_at: map["$createdAt"],
33
+ user_id: map["userId"],
34
+ secret: map["secret"],
35
+ expire: map["expire"],
36
+ phrase: map["phrase"]
37
+ )
38
+ end
39
+
40
+ def to_map
41
+ {
42
+ "$id": @id,
43
+ "$createdAt": @created_at,
44
+ "userId": @user_id,
45
+ "secret": @secret,
46
+ "expire": @expire,
47
+ "phrase": @phrase
48
+ }
49
+ end
50
+ end
51
+ end
52
+ end
@@ -797,6 +797,226 @@ module Appwrite
797
797
  )
798
798
  end
799
799
 
800
+ # Get the list of verified passkeys registered by the currently logged in
801
+ # user.
802
+ #
803
+ # @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 and order on the following attributes: $id, $createdAt, $updatedAt, name, accessedAt
804
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
805
+ #
806
+ # @return [PasskeyList]
807
+ def list_passkeys(
808
+ queries: nil,
809
+ total: nil
810
+ )
811
+ api_path = '/account/passkeys'
812
+
813
+ api_params = {
814
+ queries: queries,
815
+ total: total,
816
+ }
817
+
818
+ api_headers = {
819
+ "X-Appwrite-Project": @client.get_config('project'),
820
+ "accept": 'application/json',
821
+ }
822
+
823
+ @client.call(
824
+ method: 'GET',
825
+ path: api_path,
826
+ headers: api_headers,
827
+ params: api_params,
828
+ response_type: Models::PasskeyList
829
+ )
830
+ end
831
+
832
+ # Start registering a passkey for the currently logged in user. The session
833
+ # must have signed in or completed an MFA challenge within the last 10
834
+ # minutes. Pass the returned `publicKey` options to
835
+ # `navigator.credentials.create()`, then complete the registration with
836
+ # [Update passkey
837
+ # verification](/docs/references/cloud/client-web/account#updatePasskeyVerification).
838
+ # The passkey stays pending until verified, and the challenge expires after 5
839
+ # minutes.
840
+ #
841
+ # @param [String] passkey_id Passkey 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 Passkey name, shown when listing passkeys. Max length: 128 chars.
843
+ #
844
+ # @return [PasskeyChallenge]
845
+ def create_passkey(
846
+ passkey_id: nil,
847
+ name: nil
848
+ )
849
+ api_path = '/account/passkeys'
850
+
851
+ api_params = {
852
+ passkeyId: passkey_id,
853
+ name: name,
854
+ }
855
+
856
+ api_headers = {
857
+ "X-Appwrite-Project": @client.get_config('project'),
858
+ "content-type": 'application/json',
859
+ "accept": 'application/json',
860
+ }
861
+
862
+ @client.call(
863
+ method: 'POST',
864
+ path: api_path,
865
+ headers: api_headers,
866
+ params: api_params,
867
+ response_type: Models::PasskeyChallenge
868
+ )
869
+ end
870
+
871
+ # Get a verified passkey of the currently logged in user by its unique ID.
872
+ #
873
+ # @param [String] passkey_id Passkey ID.
874
+ #
875
+ # @return [Passkey]
876
+ def get_passkey(
877
+ passkey_id:
878
+ )
879
+ if passkey_id.nil? || passkey_id == ''
880
+ raise Appwrite::Exception.new('Missing required parameter: "passkeyId"')
881
+ end
882
+
883
+ api_path = '/account/passkeys/{passkeyId}'
884
+ .gsub('{passkeyId}', passkey_id)
885
+
886
+ api_params = {}
887
+
888
+ api_headers = {
889
+ "X-Appwrite-Project": @client.get_config('project'),
890
+ "accept": 'application/json',
891
+ }
892
+
893
+ @client.call(
894
+ method: 'GET',
895
+ path: api_path,
896
+ headers: api_headers,
897
+ params: api_params,
898
+ response_type: Models::Passkey
899
+ )
900
+ end
901
+
902
+ # Rename a passkey of the currently logged in user.
903
+ #
904
+ # @param [String] passkey_id Passkey ID.
905
+ # @param [String] name Passkey name. Max length: 128 chars.
906
+ #
907
+ # @return [Passkey]
908
+ def update_passkey(
909
+ passkey_id:,
910
+ name:
911
+ )
912
+ if passkey_id.nil? || passkey_id == ''
913
+ raise Appwrite::Exception.new('Missing required parameter: "passkeyId"')
914
+ end
915
+
916
+ if name.nil?
917
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
918
+ end
919
+
920
+ api_path = '/account/passkeys/{passkeyId}'
921
+ .gsub('{passkeyId}', passkey_id)
922
+
923
+ api_params = {
924
+ name: name,
925
+ }
926
+
927
+ api_headers = {
928
+ "X-Appwrite-Project": @client.get_config('project'),
929
+ "content-type": 'application/json',
930
+ "accept": 'application/json',
931
+ }
932
+
933
+ @client.call(
934
+ method: 'PATCH',
935
+ path: api_path,
936
+ headers: api_headers,
937
+ params: api_params,
938
+ response_type: Models::Passkey
939
+ )
940
+ end
941
+
942
+ # Delete a passkey from the currently logged in user. The passkey can no
943
+ # longer be used to sign in, although it may remain stored on the user's
944
+ # device. The session must have signed in or completed an MFA challenge
945
+ # within the last 10 minutes.
946
+ #
947
+ # @param [String] passkey_id Passkey ID.
948
+ #
949
+ # @return []
950
+ def delete_passkey(
951
+ passkey_id:
952
+ )
953
+ if passkey_id.nil? || passkey_id == ''
954
+ raise Appwrite::Exception.new('Missing required parameter: "passkeyId"')
955
+ end
956
+
957
+ api_path = '/account/passkeys/{passkeyId}'
958
+ .gsub('{passkeyId}', passkey_id)
959
+
960
+ api_params = {}
961
+
962
+ api_headers = {
963
+ "X-Appwrite-Project": @client.get_config('project'),
964
+ "content-type": 'application/json',
965
+ "accept": 'application/json',
966
+ }
967
+
968
+ @client.call(
969
+ method: 'DELETE',
970
+ path: api_path,
971
+ headers: api_headers,
972
+ params: api_params,
973
+ )
974
+ end
975
+
976
+ # Complete a passkey registration started with [Create
977
+ # passkey](/docs/references/cloud/client-web/account#createPasskey). Pass the
978
+ # JSON form of the credential returned by `navigator.credentials.create()`,
979
+ # for example `credential.toJSON()`. Each registration can be verified once;
980
+ # a failed attempt requires starting it again.
981
+ #
982
+ # @param [String] passkey_id Passkey ID.
983
+ # @param [Hash] credential Registration credential returned by the authenticator, in the JSON form produced by `PublicKeyCredential.toJSON()`.
984
+ #
985
+ # @return [Passkey]
986
+ def update_passkey_verification(
987
+ passkey_id:,
988
+ credential:
989
+ )
990
+ if passkey_id.nil? || passkey_id == ''
991
+ raise Appwrite::Exception.new('Missing required parameter: "passkeyId"')
992
+ end
993
+
994
+ if credential.nil?
995
+ raise Appwrite::Exception.new('Missing required parameter: "credential"')
996
+ end
997
+
998
+ api_path = '/account/passkeys/{passkeyId}/verification'
999
+ .gsub('{passkeyId}', passkey_id)
1000
+
1001
+ api_params = {
1002
+ credential: credential,
1003
+ }
1004
+
1005
+ api_headers = {
1006
+ "X-Appwrite-Project": @client.get_config('project'),
1007
+ "content-type": 'application/json',
1008
+ "accept": 'application/json',
1009
+ }
1010
+
1011
+ @client.call(
1012
+ method: 'PUT',
1013
+ path: api_path,
1014
+ headers: api_headers,
1015
+ params: api_params,
1016
+ response_type: Models::Passkey
1017
+ )
1018
+ end
1019
+
800
1020
  # Update currently logged in user password. For validation, user is required
801
1021
  # to pass in the new password, and the old password. For users created with
802
1022
  # OAuth, Team Invites and Magic URL, oldPassword is optional.
@@ -1592,6 +1812,84 @@ module Appwrite
1592
1812
  )
1593
1813
  end
1594
1814
 
1815
+ # Start signing in with a passkey. No email or user ID is needed: pass the
1816
+ # returned `publicKey` options to `navigator.credentials.get()` and the user
1817
+ # picks one of their passkeys. Then call [Update passkey
1818
+ # token](/docs/references/cloud/client-web/account#updatePasskeyToken) with
1819
+ # the credential to receive a token, and exchange it with [Create
1820
+ # session](/docs/references/cloud/client-web/account#createSession). The
1821
+ # challenge expires after 5 minutes.
1822
+ #
1823
+ #
1824
+ # @return [PasskeyChallenge]
1825
+ def create_passkey_token()
1826
+ api_path = '/account/tokens/passkey'
1827
+
1828
+ api_params = {}
1829
+
1830
+ api_headers = {
1831
+ "X-Appwrite-Project": @client.get_config('project'),
1832
+ "content-type": 'application/json',
1833
+ "accept": 'application/json',
1834
+ }
1835
+
1836
+ @client.call(
1837
+ method: 'POST',
1838
+ path: api_path,
1839
+ headers: api_headers,
1840
+ params: api_params,
1841
+ response_type: Models::PasskeyChallenge
1842
+ )
1843
+ end
1844
+
1845
+ # Complete a passkey sign-in started with [Create passkey
1846
+ # token](/docs/references/cloud/client-web/account#createPasskeyToken). Pass
1847
+ # the challenge ID and the JSON form of the credential returned by
1848
+ # `navigator.credentials.get()`, for example `credential.toJSON()`. The
1849
+ # returned token includes its secret and expires after 1 minute: exchange it
1850
+ # for a session with [Create
1851
+ # session](/docs/references/cloud/client-web/account#createSession). Passkeys
1852
+ # require user verification, so the session also satisfies MFA. Each
1853
+ # challenge can only be used once.
1854
+ #
1855
+ # @param [String] challenge_id Challenge ID returned by createPasskeyToken.
1856
+ # @param [Hash] credential Authentication credential returned by the authenticator, in the JSON form produced by `PublicKeyCredential.toJSON()`.
1857
+ #
1858
+ # @return [TokenSecret]
1859
+ def update_passkey_token(
1860
+ challenge_id:,
1861
+ credential:
1862
+ )
1863
+ if challenge_id.nil?
1864
+ raise Appwrite::Exception.new('Missing required parameter: "challengeId"')
1865
+ end
1866
+
1867
+ if credential.nil?
1868
+ raise Appwrite::Exception.new('Missing required parameter: "credential"')
1869
+ end
1870
+
1871
+ api_path = '/account/tokens/passkey'
1872
+
1873
+ api_params = {
1874
+ challengeId: challenge_id,
1875
+ credential: credential,
1876
+ }
1877
+
1878
+ api_headers = {
1879
+ "X-Appwrite-Project": @client.get_config('project'),
1880
+ "content-type": 'application/json',
1881
+ "accept": 'application/json',
1882
+ }
1883
+
1884
+ @client.call(
1885
+ method: 'PUT',
1886
+ path: api_path,
1887
+ headers: api_headers,
1888
+ params: api_params,
1889
+ response_type: Models::TokenSecret
1890
+ )
1891
+ end
1892
+
1595
1893
  # Sends the user an SMS with a secret key for creating a session. If the
1596
1894
  # provided user ID has not be registered, a new user will be created. Use the
1597
1895
  # returned user ID and secret and submit a request to the [POST
@@ -51,7 +51,7 @@ module Appwrite
51
51
  # @param [Runtime] runtime Execution runtime.
52
52
  # @param [Array] execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
53
53
  # @param [Array] events Events list. Maximum of 100 events are allowed.
54
- # @param [String] schedule Schedule CRON syntax.
54
+ # @param [String] schedule Schedule CRON syntax. Cannot be combined with interval.
55
55
  # @param [Integer] timeout Function maximum execution time in seconds.
56
56
  # @param [] enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
57
57
  # @param [] logging When disabled, executions will exclude logs and errors, and will be slightly faster.
@@ -68,6 +68,7 @@ module Appwrite
68
68
  # @param [String] build_specification Build specification for the function deployments.
69
69
  # @param [String] runtime_specification Runtime specification for the function executions.
70
70
  # @param [Integer] deployment_retention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
71
+ # @param [Integer] interval Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule.
71
72
  #
72
73
  # @return [Function]
73
74
  def create(
@@ -92,7 +93,8 @@ module Appwrite
92
93
  provider_paths: nil,
93
94
  build_specification: nil,
94
95
  runtime_specification: nil,
95
- deployment_retention: nil
96
+ deployment_retention: nil,
97
+ interval: nil
96
98
  )
97
99
  api_path = '/functions'
98
100
 
@@ -131,6 +133,7 @@ module Appwrite
131
133
  buildSpecification: build_specification,
132
134
  runtimeSpecification: runtime_specification,
133
135
  deploymentRetention: deployment_retention,
136
+ interval: interval,
134
137
  }
135
138
 
136
139
  api_headers = {
@@ -237,7 +240,7 @@ module Appwrite
237
240
  # @param [Runtime] runtime Execution runtime.
238
241
  # @param [Array] execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
239
242
  # @param [Array] events Events list. Maximum of 100 events are allowed.
240
- # @param [String] schedule Schedule CRON syntax.
243
+ # @param [String] schedule Schedule CRON syntax. Cannot be combined with interval.
241
244
  # @param [Integer] timeout Maximum execution time in seconds.
242
245
  # @param [] enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
243
246
  # @param [] logging When disabled, executions will exclude logs and errors, and will be slightly faster.
@@ -254,6 +257,7 @@ module Appwrite
254
257
  # @param [String] build_specification Build specification for the function deployments.
255
258
  # @param [String] runtime_specification Runtime specification for the function executions.
256
259
  # @param [Integer] deployment_retention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
260
+ # @param [Integer] interval Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set.
257
261
  #
258
262
  # @return [Function]
259
263
  def update(
@@ -278,7 +282,8 @@ module Appwrite
278
282
  provider_paths: nil,
279
283
  build_specification: nil,
280
284
  runtime_specification: nil,
281
- deployment_retention: nil
285
+ deployment_retention: nil,
286
+ interval: nil
282
287
  )
283
288
  api_path = '/functions/{functionId}'
284
289
  .gsub('{functionId}', function_id)
@@ -313,6 +318,7 @@ module Appwrite
313
318
  buildSpecification: build_specification,
314
319
  runtimeSpecification: runtime_specification,
315
320
  deploymentRetention: deployment_retention,
321
+ interval: interval,
316
322
  }
317
323
 
318
324
  api_headers = {
@@ -3386,6 +3386,44 @@ module Appwrite
3386
3386
  )
3387
3387
  end
3388
3388
 
3389
+ # Set the relying party ID passkeys are bound to: the domain of your
3390
+ # application. Passkeys work on the project's web platforms on that domain or
3391
+ # its subdomains, and on the domain itself for Apple apps. A localhost web
3392
+ # platform enables passkeys for local development without a relying party ID.
3393
+ # The relying party ID cannot change while users have passkeys, and any
3394
+ # change invalidates ceremonies in progress.
3395
+ #
3396
+ # @param [String] rp_id Relying party ID: the domain of your application, such as `example.com`. Use `localhost` for local development, or an empty string to unset it.
3397
+ #
3398
+ # @return [Project]
3399
+ def update_passkey_policy(
3400
+ rp_id:
3401
+ )
3402
+ if rp_id.nil?
3403
+ raise Appwrite::Exception.new('Missing required parameter: "rpId"')
3404
+ end
3405
+
3406
+ api_path = '/project/policies/passkey'
3407
+
3408
+ api_params = {
3409
+ rpId: rp_id,
3410
+ }
3411
+
3412
+ api_headers = {
3413
+ "X-Appwrite-Project": @client.get_config('project'),
3414
+ "content-type": 'application/json',
3415
+ "accept": 'application/json',
3416
+ }
3417
+
3418
+ @client.call(
3419
+ method: 'PATCH',
3420
+ path: api_path,
3421
+ headers: api_headers,
3422
+ params: api_params,
3423
+ response_type: Models::Project
3424
+ )
3425
+ end
3426
+
3389
3427
  # Updating this policy allows you to control if new passwords are checked
3390
3428
  # against most common passwords dictionary. When enabled, and user changes
3391
3429
  # their password, password must not be contained in the dictionary.
@@ -1188,6 +1188,168 @@ module Appwrite
1188
1188
  )
1189
1189
  end
1190
1190
 
1191
+ # Get the list of verified passkeys registered by a user.
1192
+ #
1193
+ # @param [String] user_id User ID.
1194
+ # @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 and order on the following attributes: $id, $createdAt, $updatedAt, name, accessedAt
1195
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
1196
+ #
1197
+ # @return [PasskeyList]
1198
+ def list_passkeys(
1199
+ user_id:,
1200
+ queries: nil,
1201
+ total: nil
1202
+ )
1203
+ if user_id.nil? || user_id == ''
1204
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
1205
+ end
1206
+
1207
+ api_path = '/users/{userId}/passkeys'
1208
+ .gsub('{userId}', user_id)
1209
+
1210
+ api_params = {
1211
+ queries: queries,
1212
+ total: total,
1213
+ }
1214
+
1215
+ api_headers = {
1216
+ "X-Appwrite-Project": @client.get_config('project'),
1217
+ "accept": 'application/json',
1218
+ }
1219
+
1220
+ @client.call(
1221
+ method: 'GET',
1222
+ path: api_path,
1223
+ headers: api_headers,
1224
+ params: api_params,
1225
+ response_type: Models::PasskeyList
1226
+ )
1227
+ end
1228
+
1229
+ # Get a verified passkey of a user by its unique ID.
1230
+ #
1231
+ # @param [String] user_id User ID.
1232
+ # @param [String] passkey_id Passkey ID.
1233
+ #
1234
+ # @return [Passkey]
1235
+ def get_passkey(
1236
+ user_id:,
1237
+ passkey_id:
1238
+ )
1239
+ if user_id.nil? || user_id == ''
1240
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
1241
+ end
1242
+
1243
+ if passkey_id.nil? || passkey_id == ''
1244
+ raise Appwrite::Exception.new('Missing required parameter: "passkeyId"')
1245
+ end
1246
+
1247
+ api_path = '/users/{userId}/passkeys/{passkeyId}'
1248
+ .gsub('{userId}', user_id)
1249
+ .gsub('{passkeyId}', passkey_id)
1250
+
1251
+ api_params = {}
1252
+
1253
+ api_headers = {
1254
+ "X-Appwrite-Project": @client.get_config('project'),
1255
+ "accept": 'application/json',
1256
+ }
1257
+
1258
+ @client.call(
1259
+ method: 'GET',
1260
+ path: api_path,
1261
+ headers: api_headers,
1262
+ params: api_params,
1263
+ response_type: Models::Passkey
1264
+ )
1265
+ end
1266
+
1267
+ # Rename a passkey of a user.
1268
+ #
1269
+ # @param [String] user_id User ID.
1270
+ # @param [String] passkey_id Passkey ID.
1271
+ # @param [String] name Passkey name. Max length: 128 chars.
1272
+ #
1273
+ # @return [Passkey]
1274
+ def update_passkey(
1275
+ user_id:,
1276
+ passkey_id:,
1277
+ name:
1278
+ )
1279
+ if user_id.nil? || user_id == ''
1280
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
1281
+ end
1282
+
1283
+ if passkey_id.nil? || passkey_id == ''
1284
+ raise Appwrite::Exception.new('Missing required parameter: "passkeyId"')
1285
+ end
1286
+
1287
+ if name.nil?
1288
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1289
+ end
1290
+
1291
+ api_path = '/users/{userId}/passkeys/{passkeyId}'
1292
+ .gsub('{userId}', user_id)
1293
+ .gsub('{passkeyId}', passkey_id)
1294
+
1295
+ api_params = {
1296
+ name: name,
1297
+ }
1298
+
1299
+ api_headers = {
1300
+ "X-Appwrite-Project": @client.get_config('project'),
1301
+ "content-type": 'application/json',
1302
+ "accept": 'application/json',
1303
+ }
1304
+
1305
+ @client.call(
1306
+ method: 'PATCH',
1307
+ path: api_path,
1308
+ headers: api_headers,
1309
+ params: api_params,
1310
+ response_type: Models::Passkey
1311
+ )
1312
+ end
1313
+
1314
+ # Delete a passkey from a user, for example when a device is lost. The
1315
+ # passkey can no longer be used to sign in.
1316
+ #
1317
+ # @param [String] user_id User ID.
1318
+ # @param [String] passkey_id Passkey ID.
1319
+ #
1320
+ # @return []
1321
+ def delete_passkey(
1322
+ user_id:,
1323
+ passkey_id:
1324
+ )
1325
+ if user_id.nil? || user_id == ''
1326
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
1327
+ end
1328
+
1329
+ if passkey_id.nil? || passkey_id == ''
1330
+ raise Appwrite::Exception.new('Missing required parameter: "passkeyId"')
1331
+ end
1332
+
1333
+ api_path = '/users/{userId}/passkeys/{passkeyId}'
1334
+ .gsub('{userId}', user_id)
1335
+ .gsub('{passkeyId}', passkey_id)
1336
+
1337
+ api_params = {}
1338
+
1339
+ api_headers = {
1340
+ "X-Appwrite-Project": @client.get_config('project'),
1341
+ "content-type": 'application/json',
1342
+ "accept": 'application/json',
1343
+ }
1344
+
1345
+ @client.call(
1346
+ method: 'DELETE',
1347
+ path: api_path,
1348
+ headers: api_headers,
1349
+ params: api_params,
1350
+ )
1351
+ end
1352
+
1191
1353
  # Update the user password by its unique ID.
1192
1354
  #
1193
1355
  # @param [String] user_id User ID.
data/lib/appwrite.rb CHANGED
@@ -222,6 +222,10 @@ require_relative 'appwrite/models/proxy_rule'
222
222
  require_relative 'appwrite/models/email_template'
223
223
  require_relative 'appwrite/models/mfa_challenge'
224
224
  require_relative 'appwrite/models/mfa_challenge_secret'
225
+ require_relative 'appwrite/models/token_secret'
226
+ require_relative 'appwrite/models/passkey'
227
+ require_relative 'appwrite/models/passkey_challenge'
228
+ require_relative 'appwrite/models/passkey_list'
225
229
  require_relative 'appwrite/models/mfa_recovery_codes'
226
230
  require_relative 'appwrite/models/mfa_type'
227
231
  require_relative 'appwrite/models/mfa_factors'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 28.1.0
4
+ version: 28.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appwrite Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-06 00:00:00.000000000 Z
11
+ date: 2026-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -325,6 +325,9 @@ files:
325
325
  - lib/appwrite/models/oauth2_reject.rb
326
326
  - lib/appwrite/models/oauth2_token.rb
327
327
  - lib/appwrite/models/organization.rb
328
+ - lib/appwrite/models/passkey.rb
329
+ - lib/appwrite/models/passkey_challenge.rb
330
+ - lib/appwrite/models/passkey_list.rb
328
331
  - lib/appwrite/models/phone.rb
329
332
  - lib/appwrite/models/phone_list.rb
330
333
  - lib/appwrite/models/platform_android.rb
@@ -387,6 +390,7 @@ files:
387
390
  - lib/appwrite/models/team.rb
388
391
  - lib/appwrite/models/team_list.rb
389
392
  - lib/appwrite/models/token.rb
393
+ - lib/appwrite/models/token_secret.rb
390
394
  - lib/appwrite/models/topic.rb
391
395
  - lib/appwrite/models/topic_list.rb
392
396
  - lib/appwrite/models/transaction.rb