appwrite 30.0.1 → 30.1.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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +44 -24
  3. data/lib/appwrite/enums/appwrite_migration_resource.rb +46 -0
  4. data/lib/appwrite/enums/build_runtime.rb +4 -0
  5. data/lib/appwrite/enums/environment_resource.rb +40 -0
  6. data/lib/appwrite/enums/firebase_migration_resource.rb +16 -0
  7. data/lib/appwrite/enums/n_host_migration_resource.rb +17 -0
  8. data/lib/appwrite/enums/on_duplicate.rb +9 -0
  9. data/lib/appwrite/enums/project_policy_id.rb +1 -0
  10. data/lib/appwrite/enums/runtime.rb +4 -0
  11. data/lib/appwrite/enums/supabase_migration_resource.rb +17 -0
  12. data/lib/appwrite/models/billing_plan.rb +15 -0
  13. data/lib/appwrite/models/migration.rb +128 -0
  14. data/lib/appwrite/models/migration_list.rb +33 -0
  15. data/lib/appwrite/models/policy_deny_realtime_guests.rb +33 -0
  16. data/lib/appwrite/services/account.rb +19 -19
  17. data/lib/appwrite/services/activities.rb +1 -1
  18. data/lib/appwrite/services/advisor.rb +5 -5
  19. data/lib/appwrite/services/apps.rb +25 -25
  20. data/lib/appwrite/services/avatars.rb +3 -3
  21. data/lib/appwrite/services/backups.rb +6 -6
  22. data/lib/appwrite/services/databases.rb +157 -157
  23. data/lib/appwrite/services/documents_db.rb +63 -63
  24. data/lib/appwrite/services/domains.rb +77 -77
  25. data/lib/appwrite/services/functions.rb +33 -33
  26. data/lib/appwrite/services/messaging.rb +30 -30
  27. data/lib/appwrite/services/migrations.rb +653 -0
  28. data/lib/appwrite/services/mongo.rb +37 -37
  29. data/lib/appwrite/services/mysql.rb +40 -40
  30. data/lib/appwrite/services/oauth2.rb +14 -14
  31. data/lib/appwrite/services/organization.rb +17 -17
  32. data/lib/appwrite/services/postgresql.rb +44 -44
  33. data/lib/appwrite/services/presences.rb +4 -4
  34. data/lib/appwrite/services/project.rb +105 -28
  35. data/lib/appwrite/services/proxy.rb +3 -3
  36. data/lib/appwrite/services/sites.rb +32 -32
  37. data/lib/appwrite/services/storage.rb +17 -17
  38. data/lib/appwrite/services/tables_db.rb +169 -169
  39. data/lib/appwrite/services/teams.rb +23 -23
  40. data/lib/appwrite/services/tokens.rb +7 -7
  41. data/lib/appwrite/services/users.rb +50 -50
  42. data/lib/appwrite/services/vectors_db.rb +55 -55
  43. data/lib/appwrite/services/waf.rb +57 -35
  44. data/lib/appwrite/services/webhooks.rb +4 -4
  45. data/lib/appwrite.rb +12 -0
  46. metadata +12 -2
@@ -192,7 +192,7 @@ module Appwrite
192
192
  end
193
193
 
194
194
  api_path = '/vectorsdb/transactions/{transactionId}'
195
- .gsub('{transactionId}', transaction_id)
195
+ .gsub('{transactionId}', @client.encode_path(transaction_id))
196
196
 
197
197
  api_params = {}
198
198
 
@@ -227,7 +227,7 @@ module Appwrite
227
227
  end
228
228
 
229
229
  api_path = '/vectorsdb/transactions/{transactionId}'
230
- .gsub('{transactionId}', transaction_id)
230
+ .gsub('{transactionId}', @client.encode_path(transaction_id))
231
231
 
232
232
  api_params = {
233
233
  commit: commit,
@@ -262,7 +262,7 @@ module Appwrite
262
262
  end
263
263
 
264
264
  api_path = '/vectorsdb/transactions/{transactionId}'
265
- .gsub('{transactionId}', transaction_id)
265
+ .gsub('{transactionId}', @client.encode_path(transaction_id))
266
266
 
267
267
  api_params = {}
268
268
 
@@ -295,7 +295,7 @@ module Appwrite
295
295
  end
296
296
 
297
297
  api_path = '/vectorsdb/transactions/{transactionId}/operations'
298
- .gsub('{transactionId}', transaction_id)
298
+ .gsub('{transactionId}', @client.encode_path(transaction_id))
299
299
 
300
300
  api_params = {
301
301
  operations: operations,
@@ -330,7 +330,7 @@ module Appwrite
330
330
  end
331
331
 
332
332
  api_path = '/vectorsdb/{databaseId}'
333
- .gsub('{databaseId}', database_id)
333
+ .gsub('{databaseId}', @client.encode_path(database_id))
334
334
 
335
335
  api_params = {}
336
336
 
@@ -377,7 +377,7 @@ module Appwrite
377
377
  end
378
378
 
379
379
  api_path = '/vectorsdb/{databaseId}'
380
- .gsub('{databaseId}', database_id)
380
+ .gsub('{databaseId}', @client.encode_path(database_id))
381
381
 
382
382
  api_params = {
383
383
  name: name,
@@ -417,7 +417,7 @@ module Appwrite
417
417
  end
418
418
 
419
419
  api_path = '/vectorsdb/{databaseId}'
420
- .gsub('{databaseId}', database_id)
420
+ .gsub('{databaseId}', @client.encode_path(database_id))
421
421
 
422
422
  api_params = {}
423
423
 
@@ -455,7 +455,7 @@ module Appwrite
455
455
  end
456
456
 
457
457
  api_path = '/vectorsdb/{databaseId}/collections'
458
- .gsub('{databaseId}', database_id)
458
+ .gsub('{databaseId}', @client.encode_path(database_id))
459
459
 
460
460
  api_params = {
461
461
  queries: queries,
@@ -519,7 +519,7 @@ module Appwrite
519
519
  end
520
520
 
521
521
  api_path = '/vectorsdb/{databaseId}/collections'
522
- .gsub('{databaseId}', database_id)
522
+ .gsub('{databaseId}', @client.encode_path(database_id))
523
523
 
524
524
  api_params = {
525
525
  collectionId: collection_id,
@@ -566,8 +566,8 @@ module Appwrite
566
566
  end
567
567
 
568
568
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
569
- .gsub('{databaseId}', database_id)
570
- .gsub('{collectionId}', collection_id)
569
+ .gsub('{databaseId}', @client.encode_path(database_id))
570
+ .gsub('{collectionId}', @client.encode_path(collection_id))
571
571
 
572
572
  api_params = {}
573
573
 
@@ -620,8 +620,8 @@ module Appwrite
620
620
  end
621
621
 
622
622
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
623
- .gsub('{databaseId}', database_id)
624
- .gsub('{collectionId}', collection_id)
623
+ .gsub('{databaseId}', @client.encode_path(database_id))
624
+ .gsub('{collectionId}', @client.encode_path(collection_id))
625
625
 
626
626
  api_params = {
627
627
  name: name,
@@ -667,8 +667,8 @@ module Appwrite
667
667
  end
668
668
 
669
669
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
670
- .gsub('{databaseId}', database_id)
671
- .gsub('{collectionId}', collection_id)
670
+ .gsub('{databaseId}', @client.encode_path(database_id))
671
+ .gsub('{collectionId}', @client.encode_path(collection_id))
672
672
 
673
673
  api_params = {}
674
674
 
@@ -714,8 +714,8 @@ module Appwrite
714
714
  end
715
715
 
716
716
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
717
- .gsub('{databaseId}', database_id)
718
- .gsub('{collectionId}', collection_id)
717
+ .gsub('{databaseId}', @client.encode_path(database_id))
718
+ .gsub('{collectionId}', @client.encode_path(collection_id))
719
719
 
720
720
  api_params = {
721
721
  queries: queries,
@@ -776,8 +776,8 @@ module Appwrite
776
776
  end
777
777
 
778
778
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
779
- .gsub('{databaseId}', database_id)
780
- .gsub('{collectionId}', collection_id)
779
+ .gsub('{databaseId}', @client.encode_path(database_id))
780
+ .gsub('{collectionId}', @client.encode_path(collection_id))
781
781
 
782
782
  api_params = {
783
783
  documentId: document_id,
@@ -831,8 +831,8 @@ module Appwrite
831
831
  end
832
832
 
833
833
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
834
- .gsub('{databaseId}', database_id)
835
- .gsub('{collectionId}', collection_id)
834
+ .gsub('{databaseId}', @client.encode_path(database_id))
835
+ .gsub('{collectionId}', @client.encode_path(collection_id))
836
836
 
837
837
  api_params = {
838
838
  documents: documents,
@@ -885,8 +885,8 @@ module Appwrite
885
885
  end
886
886
 
887
887
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
888
- .gsub('{databaseId}', database_id)
889
- .gsub('{collectionId}', collection_id)
888
+ .gsub('{databaseId}', @client.encode_path(database_id))
889
+ .gsub('{collectionId}', @client.encode_path(collection_id))
890
890
 
891
891
  api_params = {
892
892
  documents: documents,
@@ -935,8 +935,8 @@ module Appwrite
935
935
  end
936
936
 
937
937
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
938
- .gsub('{databaseId}', database_id)
939
- .gsub('{collectionId}', collection_id)
938
+ .gsub('{databaseId}', @client.encode_path(database_id))
939
+ .gsub('{collectionId}', @client.encode_path(collection_id))
940
940
 
941
941
  api_params = {
942
942
  data: data,
@@ -983,8 +983,8 @@ module Appwrite
983
983
  end
984
984
 
985
985
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
986
- .gsub('{databaseId}', database_id)
987
- .gsub('{collectionId}', collection_id)
986
+ .gsub('{databaseId}', @client.encode_path(database_id))
987
+ .gsub('{collectionId}', @client.encode_path(collection_id))
988
988
 
989
989
  api_params = {
990
990
  queries: queries,
@@ -1037,8 +1037,8 @@ module Appwrite
1037
1037
  end
1038
1038
 
1039
1039
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/query'
1040
- .gsub('{databaseId}', database_id)
1041
- .gsub('{collectionId}', collection_id)
1040
+ .gsub('{databaseId}', @client.encode_path(database_id))
1041
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1042
1042
 
1043
1043
  api_params = {
1044
1044
  queries: queries,
@@ -1092,9 +1092,9 @@ module Appwrite
1092
1092
  end
1093
1093
 
1094
1094
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1095
- .gsub('{databaseId}', database_id)
1096
- .gsub('{collectionId}', collection_id)
1097
- .gsub('{documentId}', document_id)
1095
+ .gsub('{databaseId}', @client.encode_path(database_id))
1096
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1097
+ .gsub('{documentId}', @client.encode_path(document_id))
1098
1098
 
1099
1099
  api_params = {
1100
1100
  queries: queries,
@@ -1149,9 +1149,9 @@ module Appwrite
1149
1149
  end
1150
1150
 
1151
1151
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1152
- .gsub('{databaseId}', database_id)
1153
- .gsub('{collectionId}', collection_id)
1154
- .gsub('{documentId}', document_id)
1152
+ .gsub('{databaseId}', @client.encode_path(database_id))
1153
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1154
+ .gsub('{documentId}', @client.encode_path(document_id))
1155
1155
 
1156
1156
  api_params = {
1157
1157
  data: data,
@@ -1206,9 +1206,9 @@ module Appwrite
1206
1206
  end
1207
1207
 
1208
1208
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1209
- .gsub('{databaseId}', database_id)
1210
- .gsub('{collectionId}', collection_id)
1211
- .gsub('{documentId}', document_id)
1209
+ .gsub('{databaseId}', @client.encode_path(database_id))
1210
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1211
+ .gsub('{documentId}', @client.encode_path(document_id))
1212
1212
 
1213
1213
  api_params = {
1214
1214
  data: data,
@@ -1258,9 +1258,9 @@ module Appwrite
1258
1258
  end
1259
1259
 
1260
1260
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1261
- .gsub('{databaseId}', database_id)
1262
- .gsub('{collectionId}', collection_id)
1263
- .gsub('{documentId}', document_id)
1261
+ .gsub('{databaseId}', @client.encode_path(database_id))
1262
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1263
+ .gsub('{documentId}', @client.encode_path(document_id))
1264
1264
 
1265
1265
  api_params = {
1266
1266
  transactionId: transaction_id,
@@ -1303,8 +1303,8 @@ module Appwrite
1303
1303
  end
1304
1304
 
1305
1305
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'
1306
- .gsub('{databaseId}', database_id)
1307
- .gsub('{collectionId}', collection_id)
1306
+ .gsub('{databaseId}', @client.encode_path(database_id))
1307
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1308
1308
 
1309
1309
  api_params = {
1310
1310
  queries: queries,
@@ -1370,8 +1370,8 @@ module Appwrite
1370
1370
  end
1371
1371
 
1372
1372
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'
1373
- .gsub('{databaseId}', database_id)
1374
- .gsub('{collectionId}', collection_id)
1373
+ .gsub('{databaseId}', @client.encode_path(database_id))
1374
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1375
1375
 
1376
1376
  api_params = {
1377
1377
  key: key,
@@ -1422,9 +1422,9 @@ module Appwrite
1422
1422
  end
1423
1423
 
1424
1424
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'
1425
- .gsub('{databaseId}', database_id)
1426
- .gsub('{collectionId}', collection_id)
1427
- .gsub('{key}', key)
1425
+ .gsub('{databaseId}', @client.encode_path(database_id))
1426
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1427
+ .gsub('{key}', @client.encode_path(key))
1428
1428
 
1429
1429
  api_params = {}
1430
1430
 
@@ -1467,9 +1467,9 @@ module Appwrite
1467
1467
  end
1468
1468
 
1469
1469
  api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'
1470
- .gsub('{databaseId}', database_id)
1471
- .gsub('{collectionId}', collection_id)
1472
- .gsub('{key}', key)
1470
+ .gsub('{databaseId}', @client.encode_path(database_id))
1471
+ .gsub('{collectionId}', @client.encode_path(collection_id))
1472
+ .gsub('{key}', @client.encode_path(key))
1473
1473
 
1474
1474
  api_params = {}
1475
1475
 
@@ -1510,7 +1510,7 @@ module Appwrite
1510
1510
  end
1511
1511
 
1512
1512
  api_path = '/vectorsdb/{databaseId}/failovers'
1513
- .gsub('{databaseId}', database_id)
1513
+ .gsub('{databaseId}', @client.encode_path(database_id))
1514
1514
 
1515
1515
  api_params = {
1516
1516
  targetReplicaId: target_replica_id,
@@ -1553,7 +1553,7 @@ module Appwrite
1553
1553
  end
1554
1554
 
1555
1555
  api_path = '/vectorsdb/{databaseId}/operations'
1556
- .gsub('{databaseId}', database_id)
1556
+ .gsub('{databaseId}', @client.encode_path(database_id))
1557
1557
 
1558
1558
  api_params = {
1559
1559
  status: status,
@@ -1589,7 +1589,7 @@ module Appwrite
1589
1589
  end
1590
1590
 
1591
1591
  api_path = '/vectorsdb/{databaseId}/replicas'
1592
- .gsub('{databaseId}', database_id)
1592
+ .gsub('{databaseId}', @client.encode_path(database_id))
1593
1593
 
1594
1594
  api_params = {}
1595
1595
 
@@ -1622,7 +1622,7 @@ module Appwrite
1622
1622
  end
1623
1623
 
1624
1624
  api_path = '/vectorsdb/{databaseId}/status'
1625
- .gsub('{databaseId}', database_id)
1625
+ .gsub('{databaseId}', @client.encode_path(database_id))
1626
1626
 
1627
1627
  api_params = {}
1628
1628
 
@@ -44,9 +44,9 @@ module Appwrite
44
44
  # Create a bypass WAF rule. Conditions can match request attributes including
45
45
  # `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`,
46
46
  # `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
47
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
48
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
49
- # DB addon.
47
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
48
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
49
+ # `state` require the premium Geo DB addon.
50
50
  #
51
51
  #
52
52
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -112,9 +112,9 @@ module Appwrite
112
112
  # Update a bypass WAF rule. Conditions can match request attributes including
113
113
  # `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`,
114
114
  # `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
115
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
116
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
117
- # DB addon.
115
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
116
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
117
+ # `state` require the premium Geo DB addon.
118
118
  #
119
119
  #
120
120
  # @param [String] rule_id Rule ID.
@@ -142,7 +142,7 @@ module Appwrite
142
142
  end
143
143
 
144
144
  api_path = '/waf/rules/bypass/{ruleId}'
145
- .gsub('{ruleId}', rule_id)
145
+ .gsub('{ruleId}', @client.encode_path(rule_id))
146
146
 
147
147
  api_params = {
148
148
  resourceType: resource_type,
@@ -175,8 +175,9 @@ module Appwrite
175
175
  # challenged again. Conditions can match request attributes including `ip`
176
176
  # (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`,
177
177
  # `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`,
178
- # `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions
179
- # on `city` and `state` require the premium Geo DB addon.
178
+ # `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`, `osVersion`,
179
+ # `browser`, and `browserVersion`. Conditions on `city` and `state` require
180
+ # the premium Geo DB addon.
180
181
  #
181
182
  #
182
183
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -254,8 +255,9 @@ module Appwrite
254
255
  # challenged again. Conditions can match request attributes including `ip`
255
256
  # (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`,
256
257
  # `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`,
257
- # `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions
258
- # on `city` and `state` require the premium Geo DB addon.
258
+ # `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`, `osVersion`,
259
+ # `browser`, and `browserVersion`. Conditions on `city` and `state` require
260
+ # the premium Geo DB addon.
259
261
  #
260
262
  #
261
263
  # @param [String] rule_id Rule ID.
@@ -289,7 +291,7 @@ module Appwrite
289
291
  end
290
292
 
291
293
  api_path = '/waf/rules/challenge/{ruleId}'
292
- .gsub('{ruleId}', rule_id)
294
+ .gsub('{ruleId}', @client.encode_path(rule_id))
293
295
 
294
296
  api_params = {
295
297
  resourceType: resource_type,
@@ -322,9 +324,19 @@ module Appwrite
322
324
  # Create a deny WAF rule. Conditions can match request attributes including
323
325
  # `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`,
324
326
  # `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
325
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
326
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
327
- # DB addon.
327
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
328
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
329
+ # `state` require the premium Geo DB addon. `sessionAge` and `mfaAge` hold
330
+ # the seconds since the request's session was created and since its last MFA
331
+ # challenge. Both are null for requests without a session, such as guests and
332
+ # API keys, while a request authenticated with the `x-appwrite-jwt` header
333
+ # carries the age of the session its token is bound to; on `functions` rules
334
+ # the session comes from the `x-appwrite-user-jwt` header, and `mfaAge` is
335
+ # null when the session never completed MFA. A deny matching on `mfaAge`
336
+ # returns `user_challenge_required` and one matching on `sessionAge` returns
337
+ # `user_reauthentication_required`, both with status 401, so the user can
338
+ # sign in again and retry. To also deny requests without a session, combine
339
+ # `isNull` and `greaterThan` in an `or` condition.
328
340
  #
329
341
  #
330
342
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -390,9 +402,19 @@ module Appwrite
390
402
  # Update a deny WAF rule. Conditions can match request attributes including
391
403
  # `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`,
392
404
  # `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
393
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
394
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
395
- # DB addon.
405
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
406
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
407
+ # `state` require the premium Geo DB addon. `sessionAge` and `mfaAge` hold
408
+ # the seconds since the request's session was created and since its last MFA
409
+ # challenge. Both are null for requests without a session, such as guests and
410
+ # API keys, while a request authenticated with the `x-appwrite-jwt` header
411
+ # carries the age of the session its token is bound to; on `functions` rules
412
+ # the session comes from the `x-appwrite-user-jwt` header, and `mfaAge` is
413
+ # null when the session never completed MFA. A deny matching on `mfaAge`
414
+ # returns `user_challenge_required` and one matching on `sessionAge` returns
415
+ # `user_reauthentication_required`, both with status 401, so the user can
416
+ # sign in again and retry. To also deny requests without a session, combine
417
+ # `isNull` and `greaterThan` in an `or` condition.
396
418
  #
397
419
  #
398
420
  # @param [String] rule_id Rule ID.
@@ -420,7 +442,7 @@ module Appwrite
420
442
  end
421
443
 
422
444
  api_path = '/waf/rules/deny/{ruleId}'
423
- .gsub('{ruleId}', rule_id)
445
+ .gsub('{ruleId}', @client.encode_path(rule_id))
424
446
 
425
447
  api_params = {
426
448
  resourceType: resource_type,
@@ -452,9 +474,9 @@ module Appwrite
452
474
  # without an authenticated user skip `userId` rules). Conditions can match
453
475
  # request attributes including `ip` (plain IPs or CIDR blocks like
454
476
  # `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`,
455
- # `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`,
456
- # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
457
- # `state` require the premium Geo DB addon.
477
+ # `headers.<name>`, `query.<key>`, `queryKeys`, `accept`, `acceptLanguage`,
478
+ # `cookie`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`.
479
+ # Conditions on `city` and `state` require the premium Geo DB addon.
458
480
  #
459
481
  #
460
482
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -545,9 +567,9 @@ module Appwrite
545
567
  # without an authenticated user skip `userId` rules). Conditions can match
546
568
  # request attributes including `ip` (plain IPs or CIDR blocks like
547
569
  # `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`,
548
- # `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`,
549
- # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
550
- # `state` require the premium Geo DB addon.
570
+ # `headers.<name>`, `query.<key>`, `queryKeys`, `accept`, `acceptLanguage`,
571
+ # `cookie`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`.
572
+ # Conditions on `city` and `state` require the premium Geo DB addon.
551
573
  #
552
574
  #
553
575
  # @param [String] rule_id Rule ID.
@@ -583,7 +605,7 @@ module Appwrite
583
605
  end
584
606
 
585
607
  api_path = '/waf/rules/rate-limit/{ruleId}'
586
- .gsub('{ruleId}', rule_id)
608
+ .gsub('{ruleId}', @client.encode_path(rule_id))
587
609
 
588
610
  api_params = {
589
611
  resourceType: resource_type,
@@ -617,9 +639,9 @@ module Appwrite
617
639
  # Create a redirect WAF rule. Conditions can match request attributes
618
640
  # including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`,
619
641
  # `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
620
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
621
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
622
- # DB addon.
642
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
643
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
644
+ # `state` require the premium Geo DB addon.
623
645
  #
624
646
  #
625
647
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -699,9 +721,9 @@ module Appwrite
699
721
  # Update a redirect WAF rule. Conditions can match request attributes
700
722
  # including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`,
701
723
  # `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
702
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
703
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
704
- # DB addon.
724
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
725
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
726
+ # `state` require the premium Geo DB addon.
705
727
  #
706
728
  #
707
729
  # @param [String] rule_id Rule ID.
@@ -733,7 +755,7 @@ module Appwrite
733
755
  end
734
756
 
735
757
  api_path = '/waf/rules/redirect/{ruleId}'
736
- .gsub('{ruleId}', rule_id)
758
+ .gsub('{ruleId}', @client.encode_path(rule_id))
737
759
 
738
760
  api_params = {
739
761
  resourceType: resource_type,
@@ -776,7 +798,7 @@ module Appwrite
776
798
  end
777
799
 
778
800
  api_path = '/waf/rules/{ruleId}'
779
- .gsub('{ruleId}', rule_id)
801
+ .gsub('{ruleId}', @client.encode_path(rule_id))
780
802
 
781
803
  api_params = {}
782
804
 
@@ -838,7 +860,7 @@ module Appwrite
838
860
  end
839
861
 
840
862
  api_path = '/waf/rules/{ruleId}'
841
- .gsub('{ruleId}', rule_id)
863
+ .gsub('{ruleId}', @client.encode_path(rule_id))
842
864
 
843
865
  api_params = {}
844
866
 
@@ -125,7 +125,7 @@ module Appwrite
125
125
  end
126
126
 
127
127
  api_path = '/webhooks/{webhookId}'
128
- .gsub('{webhookId}', webhook_id)
128
+ .gsub('{webhookId}', @client.encode_path(webhook_id))
129
129
 
130
130
  api_params = {}
131
131
 
@@ -185,7 +185,7 @@ module Appwrite
185
185
  end
186
186
 
187
187
  api_path = '/webhooks/{webhookId}'
188
- .gsub('{webhookId}', webhook_id)
188
+ .gsub('{webhookId}', @client.encode_path(webhook_id))
189
189
 
190
190
  api_params = {
191
191
  name: name,
@@ -227,7 +227,7 @@ module Appwrite
227
227
  end
228
228
 
229
229
  api_path = '/webhooks/{webhookId}'
230
- .gsub('{webhookId}', webhook_id)
230
+ .gsub('{webhookId}', @client.encode_path(webhook_id))
231
231
 
232
232
  api_params = {}
233
233
 
@@ -262,7 +262,7 @@ module Appwrite
262
262
  end
263
263
 
264
264
  api_path = '/webhooks/{webhookId}/secret'
265
- .gsub('{webhookId}', webhook_id)
265
+ .gsub('{webhookId}', @client.encode_path(webhook_id))
266
266
 
267
267
  api_params = {
268
268
  secret: secret,
data/lib/appwrite.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'net/http'
2
+ require 'openssl'
3
+ require 'securerandom'
2
4
  require 'uri'
3
5
  require 'json'
4
6
  require 'mime/types'
@@ -56,6 +58,7 @@ require_relative 'appwrite/models/topic_list'
56
58
  require_relative 'appwrite/models/subscriber_list'
57
59
  require_relative 'appwrite/models/target_list'
58
60
  require_relative 'appwrite/models/transaction_list'
61
+ require_relative 'appwrite/models/migration_list'
59
62
  require_relative 'appwrite/models/specification_list'
60
63
  require_relative 'appwrite/models/vectorsdb_collection_list'
61
64
  require_relative 'appwrite/models/embedding_list'
@@ -213,6 +216,7 @@ require_relative 'appwrite/models/policy_deny_aliased_email'
213
216
  require_relative 'appwrite/models/policy_deny_disposable_email'
214
217
  require_relative 'appwrite/models/policy_deny_free_email'
215
218
  require_relative 'appwrite/models/policy_deny_corporate_email'
219
+ require_relative 'appwrite/models/policy_deny_realtime_guests'
216
220
  require_relative 'appwrite/models/platform_web'
217
221
  require_relative 'appwrite/models/platform_apple'
218
222
  require_relative 'appwrite/models/platform_android'
@@ -244,6 +248,7 @@ require_relative 'appwrite/models/topic'
244
248
  require_relative 'appwrite/models/transaction'
245
249
  require_relative 'appwrite/models/subscriber'
246
250
  require_relative 'appwrite/models/target'
251
+ require_relative 'appwrite/models/migration'
247
252
  require_relative 'appwrite/models/insight'
248
253
  require_relative 'appwrite/models/insight_cta'
249
254
  require_relative 'appwrite/models/report'
@@ -363,8 +368,14 @@ require_relative 'appwrite/enums/deployment_download_type'
363
368
  require_relative 'appwrite/enums/execution_method'
364
369
  require_relative 'appwrite/enums/message_priority'
365
370
  require_relative 'appwrite/enums/smtp_encryption'
371
+ require_relative 'appwrite/enums/appwrite_migration_resource'
372
+ require_relative 'appwrite/enums/on_duplicate'
373
+ require_relative 'appwrite/enums/firebase_migration_resource'
374
+ require_relative 'appwrite/enums/n_host_migration_resource'
375
+ require_relative 'appwrite/enums/supabase_migration_resource'
366
376
  require_relative 'appwrite/enums/region'
367
377
  require_relative 'appwrite/enums/project_auth_method_id'
378
+ require_relative 'appwrite/enums/environment_resource'
368
379
  require_relative 'appwrite/enums/project_o_auth2_auth0_prompt'
369
380
  require_relative 'appwrite/enums/project_o_auth2_discord_prompt'
370
381
  require_relative 'appwrite/enums/project_o_auth2_git_hub_prompt'
@@ -435,6 +446,7 @@ require_relative 'appwrite/services/functions'
435
446
  require_relative 'appwrite/services/graphql'
436
447
  require_relative 'appwrite/services/locale'
437
448
  require_relative 'appwrite/services/messaging'
449
+ require_relative 'appwrite/services/migrations'
438
450
  require_relative 'appwrite/services/mongo'
439
451
  require_relative 'appwrite/services/mysql'
440
452
  require_relative 'appwrite/services/oauth2'