appwrite 1.0.9 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +16 -0
  3. data/CHANGELOG.md +1 -0
  4. data/Gemfile +1 -0
  5. data/LICENSE +1 -1
  6. data/README.md +80 -7
  7. data/appwrite.gemspec +2 -2
  8. data/docs/examples/account/create-recovery.md +15 -0
  9. data/docs/examples/account/create-verification.md +15 -0
  10. data/docs/examples/account/delete-session.md +15 -0
  11. data/docs/examples/account/delete-sessions.md +15 -0
  12. data/docs/examples/account/delete.md +15 -0
  13. data/docs/examples/account/get-logs.md +15 -0
  14. data/docs/examples/account/get-prefs.md +15 -0
  15. data/docs/examples/account/get-sessions.md +15 -0
  16. data/docs/examples/account/get.md +15 -0
  17. data/docs/examples/account/update-email.md +15 -0
  18. data/docs/examples/account/update-name.md +15 -0
  19. data/docs/examples/account/update-password.md +15 -0
  20. data/docs/examples/account/update-prefs.md +15 -0
  21. data/docs/examples/account/update-recovery.md +15 -0
  22. data/docs/examples/account/update-verification.md +15 -0
  23. data/docs/examples/avatars/get-browser.md +15 -0
  24. data/docs/examples/avatars/get-credit-card.md +15 -0
  25. data/docs/examples/avatars/get-favicon.md +15 -0
  26. data/docs/examples/avatars/get-flag.md +15 -0
  27. data/docs/examples/avatars/get-image.md +15 -0
  28. data/docs/examples/avatars/get-initials.md +15 -0
  29. data/docs/examples/avatars/get-q-r.md +15 -0
  30. data/docs/examples/database/create-collection.md +15 -0
  31. data/docs/examples/database/create-document.md +15 -0
  32. data/docs/examples/database/delete-collection.md +15 -0
  33. data/docs/examples/database/delete-document.md +15 -0
  34. data/docs/examples/database/get-collection.md +15 -0
  35. data/docs/examples/database/get-document.md +15 -0
  36. data/docs/examples/database/list-collections.md +15 -0
  37. data/docs/examples/database/list-documents.md +15 -0
  38. data/docs/examples/database/update-collection.md +15 -0
  39. data/docs/examples/database/update-document.md +15 -0
  40. data/docs/examples/functions/create-execution.md +15 -0
  41. data/docs/examples/functions/create-tag.md +15 -0
  42. data/docs/examples/functions/create.md +15 -0
  43. data/docs/examples/functions/delete-tag.md +15 -0
  44. data/docs/examples/functions/delete.md +15 -0
  45. data/docs/examples/functions/get-execution.md +15 -0
  46. data/docs/examples/functions/get-tag.md +15 -0
  47. data/docs/examples/functions/get.md +15 -0
  48. data/docs/examples/functions/list-executions.md +15 -0
  49. data/docs/examples/functions/list-tags.md +15 -0
  50. data/docs/examples/functions/list.md +15 -0
  51. data/docs/examples/functions/update-tag.md +15 -0
  52. data/docs/examples/functions/update.md +15 -0
  53. data/docs/examples/health/get-anti-virus.md +15 -0
  54. data/docs/examples/health/get-cache.md +15 -0
  55. data/docs/examples/health/get-d-b.md +15 -0
  56. data/docs/examples/health/get-queue-certificates.md +15 -0
  57. data/docs/examples/health/get-queue-functions.md +15 -0
  58. data/docs/examples/health/get-queue-logs.md +15 -0
  59. data/docs/examples/health/get-queue-tasks.md +15 -0
  60. data/docs/examples/health/get-queue-usage.md +15 -0
  61. data/docs/examples/health/get-queue-webhooks.md +15 -0
  62. data/docs/examples/health/get-storage-local.md +15 -0
  63. data/docs/examples/health/get-time.md +15 -0
  64. data/docs/examples/health/get.md +15 -0
  65. data/docs/examples/locale/get-continents.md +15 -0
  66. data/docs/examples/locale/get-countries-e-u.md +15 -0
  67. data/docs/examples/locale/get-countries-phones.md +15 -0
  68. data/docs/examples/locale/get-countries.md +15 -0
  69. data/docs/examples/locale/get-currencies.md +15 -0
  70. data/docs/examples/locale/get-languages.md +15 -0
  71. data/docs/examples/locale/get.md +15 -0
  72. data/docs/examples/storage/create-file.md +15 -0
  73. data/docs/examples/storage/delete-file.md +15 -0
  74. data/docs/examples/storage/get-file-download.md +15 -0
  75. data/docs/examples/storage/get-file-preview.md +15 -0
  76. data/docs/examples/storage/get-file-view.md +15 -0
  77. data/docs/examples/storage/get-file.md +15 -0
  78. data/docs/examples/storage/list-files.md +15 -0
  79. data/docs/examples/storage/update-file.md +15 -0
  80. data/docs/examples/teams/create-membership.md +15 -0
  81. data/docs/examples/teams/create.md +15 -0
  82. data/docs/examples/teams/delete-membership.md +15 -0
  83. data/docs/examples/teams/delete.md +15 -0
  84. data/docs/examples/teams/get-memberships.md +15 -0
  85. data/docs/examples/teams/get.md +15 -0
  86. data/docs/examples/teams/list.md +15 -0
  87. data/docs/examples/teams/update-membership-roles.md +15 -0
  88. data/docs/examples/teams/update-membership-status.md +15 -0
  89. data/docs/examples/teams/update.md +15 -0
  90. data/docs/examples/users/create.md +15 -0
  91. data/docs/examples/users/delete-session.md +15 -0
  92. data/docs/examples/users/delete-sessions.md +15 -0
  93. data/docs/examples/users/delete.md +15 -0
  94. data/docs/examples/users/get-logs.md +15 -0
  95. data/docs/examples/users/get-prefs.md +15 -0
  96. data/docs/examples/users/get-sessions.md +15 -0
  97. data/docs/examples/users/get.md +15 -0
  98. data/docs/examples/users/list.md +15 -0
  99. data/docs/examples/users/update-prefs.md +15 -0
  100. data/docs/examples/users/update-status.md +15 -0
  101. data/lib/appwrite.rb +6 -0
  102. data/lib/appwrite/client.rb +43 -8
  103. data/lib/appwrite/exception.rb +14 -0
  104. data/lib/appwrite/file.rb +23 -0
  105. data/lib/appwrite/services/account.rb +190 -0
  106. data/lib/appwrite/services/avatars.rb +17 -1
  107. data/lib/appwrite/services/database.rb +20 -22
  108. data/lib/appwrite/services/functions.rb +195 -0
  109. data/lib/appwrite/services/health.rb +141 -0
  110. data/lib/appwrite/services/locale.rb +11 -0
  111. data/lib/appwrite/services/storage.rb +14 -10
  112. data/lib/appwrite/services/teams.rb +43 -10
  113. data/lib/appwrite/services/users.rb +22 -10
  114. metadata +105 -7
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ avatars = Appwrite::Avatars.new(client);
12
+
13
+ response = avatars.get_favicon(url: 'https://example.com');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ avatars = Appwrite::Avatars.new(client);
12
+
13
+ response = avatars.get_flag(code: 'af');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ avatars = Appwrite::Avatars.new(client);
12
+
13
+ response = avatars.get_image(url: 'https://example.com');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ avatars = Appwrite::Avatars.new(client);
12
+
13
+ response = avatars.get_initials();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ avatars = Appwrite::Avatars.new(client);
12
+
13
+ response = avatars.get_q_r(text: '[TEXT]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.create_collection(name: '[NAME]', read: [], write: [], rules: []);
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.create_document(collection_id: '[COLLECTION_ID]', data: {});
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.delete_collection(collection_id: '[COLLECTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.delete_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.get_collection(collection_id: '[COLLECTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.get_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.list_collections();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.list_documents(collection_id: '[COLLECTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.update_collection(collection_id: '[COLLECTION_ID]', name: '[NAME]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ database = Appwrite::Database.new(client);
12
+
13
+ response = database.update_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]', data: {});
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.create_execution(function_id: '[FUNCTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.create_tag(function_id: '[FUNCTION_ID]', command: '[COMMAND]', code: Appwrite::File.new());
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.create(name: '[NAME]', execute: [], env: 'dotnet-3.1');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.delete_tag(function_id: '[FUNCTION_ID]', tag_id: '[TAG_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.delete(function_id: '[FUNCTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.get_execution(function_id: '[FUNCTION_ID]', execution_id: '[EXECUTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.get_tag(function_id: '[FUNCTION_ID]', tag_id: '[TAG_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.get(function_id: '[FUNCTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.list_executions(function_id: '[FUNCTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.list_tags(function_id: '[FUNCTION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.list();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ functions = Appwrite::Functions.new(client);
12
+
13
+ response = functions.update_tag(function_id: '[FUNCTION_ID]', tag: '[TAG]');
14
+
15
+ puts response