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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# RuboCop layout for the generated Ruby SDK.
# IndentationWidth 4 matches the published sdk-for-ruby house style.
# Only Layout cops are enabled: this is a formatter check, not a full linter.
AllCops:
NewCops: enable
TargetRubyVersion: 2.7
SuggestExtensions: false
DisabledByDefault: true
Exclude:
- '.github/**/*'
- 'vendor/**/*'
- '.bundle/**/*'

Layout:
Enabled: true

Layout/IndentationWidth:
Width: 4

Layout/LineLength:
Max: 200
AllowedPatterns:
- '^\s*#'

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Change Log

## 28.0.0.rc1

* Breaking: `Execution.functionId` is replaced by `resourceId` and `resourceType`, now that executions cover both functions and sites
* Breaking: removed `dedicatedDatabases.execute` from `ProjectKeyScopes`
* Breaking: `EmbeddingModel` no longer offers `embedding-gemma` or `bge-small`
* Added: `documentsDB`, `vectorsDB`, `mysql`, `postgresql`, and `mongo` services, no longer hidden from server SDKs
* Added: `DocumentsDBIndexType` and `VectorsDBIndexType` enums
* Added: dedicated database models for branches, backups, restorations, poolers, PITR windows, extensions, and executions
* Added: `PostgresExtension`, `VectorsdbCollection`, `AttributeObject`, and `AttributeVector` models
* Added: `ExecutionResourceType` enum and `resourceType` on the `Execution` model
* Added: `OAuth2HuggingFace` model and the `huggingface` OAuth provider
* Added: `userId`, `emailHash`, and `name` parameters to `avatars.getPhoto`
* Added: `error`, `containerStatus`, and `lifecycleState` on the `Database` model
* Added: `changelogWatermark` on the `DatabaseMigration` model
* Added: `total` on the `DedicatedDatabaseBranchList` model
* Updated: `DedicatedDatabaseOperation.status` documents the new `queued` state

## 27.0.0

* Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gemspec
gemspec
21 changes: 10 additions & 11 deletions appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Gem::Specification.new do |spec|
spec.name = 'appwrite'
spec.version = '28.0.0.rc1'
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'
spec.homepage = 'https://appwrite.io/support'
spec.email = 'team@appwrite.io'
spec.files = Dir['lib/**/*.rb']

spec.name = 'appwrite'
spec.version = '27.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'
spec.homepage = 'https://appwrite.io/support'
spec.email = 'team@appwrite.io'
spec.files = Dir['lib/**/*.rb']

spec.add_dependency 'mime-types', '~> 3.4.1'
end
spec.add_dependency 'mime-types', '~> 3.4.1'
end
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-initials.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ result = avatars.get_initials(
name: '<NAME>', # optional
width: 0, # optional
height: 0, # optional
background: '' # optional
background: 'FFFFFF' # optional
)
```
23 changes: 23 additions & 0 deletions docs/examples/avatars/get-photo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```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

avatars = Avatars.new(client)

result = avatars.get_photo(
width: 0, # optional
height: 0, # optional
quality: 0, # optional
output: 'png', # optional
rating: 'g', # optional
user_id: 'current()', # optional
email_hash: '<EMAIL_HASH>', # optional
name: '<NAME>' # optional
)
```
8 changes: 4 additions & 4 deletions docs/examples/databases/create-big-int-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ databases = Databases.new(client)
result = databases.create_big_int_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
min: null, # optional
max: null, # optional
default: null, # optional
min: 0, # optional
max: 1000000, # optional
default: 0, # optional
array: false # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/databases/create-boolean-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases = Databases.new(client)
result = databases.create_boolean_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: false, # optional
array: false # optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-datetime-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases = Databases.new(client)
result = databases.create_datetime_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: '2020-10-15T06:38:00.000+00:00', # optional
array: false # optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-email-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases = Databases.new(client)
result = databases.create_email_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: 'email@example.com', # optional
array: false # optional
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/databases/create-enum-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ databases = Databases.new(client)
result = databases.create_enum_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
elements: [],
key: '<KEY>',
elements: ["active", "inactive"],
required: false,
default: '<DEFAULT>', # optional
default: 'active', # optional
array: false # optional
)
```
8 changes: 4 additions & 4 deletions docs/examples/databases/create-float-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ databases = Databases.new(client)
result = databases.create_float_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
min: null, # optional
max: null, # optional
default: null, # optional
min: 0, # optional
max: 100, # optional
default: 10.5, # optional
array: false # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/databases/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ databases = Databases.new(client)
result = databases.create_index(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
type: DatabasesIndexType::KEY,
attributes: [],
orders: [OrderBy::ASC], # optional
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/databases/create-integer-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ databases = Databases.new(client)
result = databases.create_integer_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
min: null, # optional
max: null, # optional
default: null, # optional
min: 0, # optional
max: 100, # optional
default: 10, # optional
array: false # optional
)
```
4 changes: 2 additions & 2 deletions docs/examples/databases/create-ip-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ databases = Databases.new(client)
result = databases.create_ip_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: '', # optional
default: '192.0.2.0', # optional
array: false # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/databases/create-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases = Databases.new(client)
result = databases.create_line_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: [[1, 2], [3, 4], [5, 6]] # optional
)
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-longtext-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ databases = Databases.new(client)
result = databases.create_longtext_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: '<DEFAULT>', # optional
default: 'Hello World', # optional
array: false, # optional
encrypt: false # optional
)
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-mediumtext-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ databases = Databases.new(client)
result = databases.create_mediumtext_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: '<DEFAULT>', # optional
default: 'Hello World', # optional
array: false, # optional
encrypt: false # optional
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases = Databases.new(client)
result = databases.create_point_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: [1, 2] # optional
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases = Databases.new(client)
result = databases.create_polygon_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional
)
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-relationship-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ result = databases.create_relationship_attribute(
related_collection_id: '<RELATED_COLLECTION_ID>',
type: RelationshipType::ONETOONE,
two_way: false, # optional
key: '', # optional
two_way_key: '', # optional
key: '<KEY>', # optional
two_way_key: '<TWO_WAY_KEY>', # optional
on_delete: RelationMutate::CASCADE # optional
)
```
4 changes: 2 additions & 2 deletions docs/examples/databases/create-string-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ databases = Databases.new(client)
result = databases.create_string_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
size: 1,
required: false,
default: '<DEFAULT>', # optional
default: 'Hello World', # optional
array: false, # optional
encrypt: false # optional
)
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-text-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ databases = Databases.new(client)
result = databases.create_text_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: '<DEFAULT>', # optional
default: 'Hello World', # optional
array: false, # optional
encrypt: false # optional
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-url-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases = Databases.new(client)
result = databases.create_url_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
required: false,
default: 'https://example.com', # optional
array: false # optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-varchar-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ databases = Databases.new(client)
result = databases.create_varchar_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
key: '<KEY>',
size: 1,
required: false,
default: '<DEFAULT>', # optional
default: 'Hello World', # optional
array: false, # optional
encrypt: false # optional
)
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/databases/decrement-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ result = databases.decrement_document_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>',
attribute: '',
value: null, # optional
min: null, # optional
attribute: '<ATTRIBUTE>',
value: 1, # optional
min: 0, # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/databases/delete-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ databases = Databases.new(client)
result = databases.delete_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: ''
key: '<KEY>'
)
```
2 changes: 1 addition & 1 deletion docs/examples/databases/delete-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ databases = Databases.new(client)
result = databases.delete_index(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: ''
key: '<KEY>'
)
```
2 changes: 1 addition & 1 deletion docs/examples/databases/get-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ databases = Databases.new(client)
result = databases.get_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: ''
key: '<KEY>'
)
```
2 changes: 1 addition & 1 deletion docs/examples/databases/get-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ databases = Databases.new(client)
result = databases.get_index(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: ''
key: '<KEY>'
)
```
6 changes: 3 additions & 3 deletions docs/examples/databases/increment-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ result = databases.increment_document_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>',
attribute: '',
value: null, # optional
max: null, # optional
attribute: '<ATTRIBUTE>',
value: 1, # optional
max: 100, # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
```
Loading