Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
with:
ruby-version: 2.7
bundler-cache: true
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## 24.0.0

* Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId`
* Breaking: Renamed `EmailTemplateType` to `ProjectEmailTemplateId` and `EmailTemplateLocale` to `ProjectEmailTemplateLocale`
* Breaking: Renamed `ServiceId` to `ProjectServiceId`, `ProtocolId` to `ProjectProtocolId`, `Secure` to `ProjectSMTPSecure`, `ProjectPolicy` to `ProjectPolicyId`
* Breaking: Replaced `Scopes` enum with `ProjectKeyScopes` for project key endpoints
* Breaking: Removed `Project#update_deny_canonical_email_policy`; replaced with `update_deny_aliased_email_policy`, `update_deny_disposable_email_policy`, and `update_deny_free_email_policy`
* Breaking: Removed `AuthProvider` model; use new `ProjectOAuthProviderId` enum instead
* Added: `Project#get` method to fetch current project details
* Added: `Advisor`, `Presences`, and `Usage` services
* Added: `Insight`, `Presence`, `Report`, `UsageEvent`, and `UsageGauge` models with list variants
* Added: `ProjectAuthMethod`, `ProjectProtocol`, and `ProjectService` models
* Added: `ProjectOAuthProviderId` and `ProjectOAuth2GooglePrompt` enums
* Updated: `Project`, `Database`, and `OAuth2Google` model schemas
* Updated: `X-Appwrite-Response-Format` header to `1.9.5`

## 23.1.0

* Added: Introduced `bigint` create/update APIs for legacy Databases attributes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Appwrite Ruby SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.4-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.5-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
Expand Down
2 changes: 1 addition & 1 deletion appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |spec|

spec.name = 'appwrite'
spec.version = '23.1.0'
spec.version = '24.0.0'
spec.license = 'BSD-3-Clause'
spec.summary = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API'
spec.author = 'Appwrite Team'
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/advisor/delete-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

advisor = Advisor.new(client)

result = advisor.delete_report(
report_id: '<REPORT_ID>'
)
```
17 changes: 17 additions & 0 deletions docs/examples/advisor/get-insight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_session('') # The user session to authenticate with

advisor = Advisor.new(client)

result = advisor.get_insight(
report_id: '<REPORT_ID>',
insight_id: '<INSIGHT_ID>'
)
```
16 changes: 16 additions & 0 deletions docs/examples/advisor/get-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_session('') # The user session to authenticate with

advisor = Advisor.new(client)

result = advisor.get_report(
report_id: '<REPORT_ID>'
)
```
18 changes: 18 additions & 0 deletions docs/examples/advisor/list-insights.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_session('') # The user session to authenticate with

advisor = Advisor.new(client)

result = advisor.list_insights(
report_id: '<REPORT_ID>',
queries: [], # optional
total: false # optional
)
```
17 changes: 17 additions & 0 deletions docs/examples/advisor/list-reports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_session('') # The user session to authenticate with

advisor = Advisor.new(client)

result = advisor.list_reports(
queries: [], # optional
total: false # optional
)
```
16 changes: 16 additions & 0 deletions docs/examples/presences/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

presences = Presences.new(client)

result = presences.delete(
presence_id: '<PRESENCE_ID>'
)
```
16 changes: 16 additions & 0 deletions docs/examples/presences/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

presences = Presences.new(client)

result = presences.get(
presence_id: '<PRESENCE_ID>'
)
```
18 changes: 18 additions & 0 deletions docs/examples/presences/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

presences = Presences.new(client)

result = presences.list(
queries: [], # optional
total: false, # optional
ttl: 0 # optional
)
```
24 changes: 24 additions & 0 deletions docs/examples/presences/update-presence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```ruby
require 'appwrite'

include Appwrite
include Appwrite::Permission
include Appwrite::Role

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

presences = Presences.new(client)

result = presences.update_presence(
presence_id: '<PRESENCE_ID>',
user_id: '<USER_ID>',
status: '<STATUS>', # optional
expires_at: '2020-10-15T06:38:00.000+00:00', # optional
metadata: {}, # optional
permissions: [Permission.read(Role.any())], # optional
purge: false # optional
)
```
23 changes: 23 additions & 0 deletions docs/examples/presences/upsert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```ruby
require 'appwrite'

include Appwrite
include Appwrite::Permission
include Appwrite::Role

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

presences = Presences.new(client)

result = presences.upsert(
presence_id: '<PRESENCE_ID>',
user_id: '<USER_ID>',
status: '<STATUS>',
permissions: [Permission.read(Role.any())], # optional
expires_at: '2020-10-15T06:38:00.000+00:00', # optional
metadata: {} # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/project/create-ephemeral-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ client = Client.new
project = Project.new(client)

result = project.create_ephemeral_key(
scopes: [Scopes::PROJECT_READ],
scopes: [ProjectKeyScopes::PROJECT_READ],
duration: 600
)
```
2 changes: 1 addition & 1 deletion docs/examples/project/create-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ project = Project.new(client)
result = project.create_key(
key_id: '<KEY_ID>',
name: '<NAME>',
scopes: [Scopes::PROJECT_READ],
scopes: [ProjectKeyScopes::PROJECT_READ],
expire: '2020-10-15T06:38:00.000+00:00' # optional
)
```
4 changes: 2 additions & 2 deletions docs/examples/project/get-email-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ client = Client.new
project = Project.new(client)

result = project.get_email_template(
template_id: EmailTemplateType::VERIFICATION,
locale: EmailTemplateLocale::AF # optional
template_id: ProjectEmailTemplateId::VERIFICATION,
locale: ProjectEmailTemplateLocale::AF # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/project/get-o-auth-2-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ client = Client.new
project = Project.new(client)

result = project.get_o_auth2_provider(
provider_id: OAuthProvider::AMAZON
provider_id: ProjectOAuthProviderId::AMAZON
)
```
2 changes: 1 addition & 1 deletion docs/examples/project/get-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ client = Client.new
project = Project.new(client)

result = project.get_policy(
policy_id: ProjectPolicy::PASSWORD_DICTIONARY
policy_id: ProjectPolicyId::PASSWORD_DICTIONARY
)
```
14 changes: 14 additions & 0 deletions docs/examples/project/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.get()
```
2 changes: 1 addition & 1 deletion docs/examples/project/update-auth-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ client = Client.new
project = Project.new(client)

result = project.update_auth_method(
method_id: AuthMethod::EMAIL_PASSWORD,
method_id: ProjectAuthMethodId::EMAIL_PASSWORD,
enabled: false
)
```
16 changes: 16 additions & 0 deletions docs/examples/project/update-deny-aliased-email-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.update_deny_aliased_email_policy(
enabled: false
)
```
16 changes: 16 additions & 0 deletions docs/examples/project/update-deny-disposable-email-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.update_deny_disposable_email_policy(
enabled: false
)
```
16 changes: 16 additions & 0 deletions docs/examples/project/update-deny-free-email-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.update_deny_free_email_policy(
enabled: false
)
```
4 changes: 2 additions & 2 deletions docs/examples/project/update-email-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ client = Client.new
project = Project.new(client)

result = project.update_email_template(
template_id: EmailTemplateType::VERIFICATION,
locale: EmailTemplateLocale::AF, # optional
template_id: ProjectEmailTemplateId::VERIFICATION,
locale: ProjectEmailTemplateLocale::AF, # optional
subject: '<SUBJECT>', # optional
message: '<MESSAGE>', # optional
sender_name: '<SENDER_NAME>', # optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/project/update-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ project = Project.new(client)
result = project.update_key(
key_id: '<KEY_ID>',
name: '<NAME>',
scopes: [Scopes::PROJECT_READ],
scopes: [ProjectKeyScopes::PROJECT_READ],
expire: '2020-10-15T06:38:00.000+00:00' # optional
)
```
2 changes: 2 additions & 0 deletions docs/examples/project/update-o-auth-2-google.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand All @@ -13,6 +14,7 @@ project = Project.new(client)
result = project.update_o_auth2_google(
client_id: '<CLIENT_ID>', # optional
client_secret: '<CLIENT_SECRET>', # optional
prompt: [ProjectOAuth2GooglePrompt::NONE], # optional
enabled: false # optional
)
```
Loading
Loading