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
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Change Log

## 29.0.0

* Breaking: requires PHP 8.5 or later, up from PHP 8.2
* Breaking: HTTP transport rewritten on `utopia-php/client` (PSR-18), now a required dependency
* Breaking: `Execution.functionId` replaced by `resourceId` and `resourceType`
* Breaking: removed `dedicatedDatabases.execute` from `ProjectKeyScopes`
* Breaking: `Project.wafEnabled` is now nullable
* Added: `avatars.getPhoto`, with `userId`, `emailHash`, and `name` to resolve an avatar for someone other than the caller
* Added: `project.updateOAuth2HuggingFace`, the `OAuth2HuggingFace` model, and the `huggingface` OAuth provider
* Added: `scopes` parameter to `sites.create` and `sites.update`, and `Site.scopes`
* Added: `ExecutionResourceType` enum and the `bun-1.4` runtime
* Added: `Database` fields `containerStatus`, `error`, and `lifecycleState`
* Added: `BillingPlan` fields `supportsDedicatedDatabases` and `databaseComputeCredit`
* Added: `DatabaseMigration.changelogWatermark`, and `replicating` on `DatabaseStatusReplica` and `DedicatedDatabaseMember`
* Updated: enums now implement `Stringable`
* Updated: sources declare `strict_types` and ship `pint`, `phpstan`, and `rector` configs


## 28.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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To install via [Composer](http://getcomposer.org/):
composer require appwrite/appwrite
```

Requires PHP 8.2 or later.
Requires PHP 8.5 or later.


## Getting Started
Expand Down
15 changes: 12 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,31 @@
"email": "team@appwrite.io"
},
"scripts": {
"test": "vendor/bin/phpunit"
"test": "vendor/bin/phpunit",
"format": "vendor/bin/pint",
"lint": "vendor/bin/pint --test",
"analyse": "vendor/bin/phpstan analyse --memory-limit=1G",
"refactor": "vendor/bin/rector process --dry-run"
},
"autoload": {
"psr-4": {
"Appwrite\\": "src/Appwrite"
}
},
"require": {
"php": ">=8.2.0",
"php": ">=8.5",
"ext-curl": "*",
"ext-json": "*",
"utopia-php/client": "^0.4.1",
"adhocore/jwt": "^1.1"
},
"require-dev": {
"laravel/pint": "^1.25",
"mockery/mockery": "1.6.15",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-mockery": "^2.0",
"phpunit/phpunit": "^12",
"mockery/mockery": "1.6.12"
"rector/rector": "^2.2"
},
"prefer-stable": true,
"minimum-stability": "dev"
Expand Down
32 changes: 16 additions & 16 deletions docs/account.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/advisor.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
GET https://cloud.appwrite.io/v1/reports
```

** Get a list of all the project's analyzer reports. You can use the query params to filter your results.
** Get a list of all the project's analyzer reports. You can use the query params to filter your results.
**

### Parameters
Expand All @@ -20,7 +20,7 @@ GET https://cloud.appwrite.io/v1/reports
GET https://cloud.appwrite.io/v1/reports/{reportId}
```

** Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced.
** Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced.
**

### Parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ GET https://cloud.appwrite.io/v1/apps/{appId}/keys
POST https://cloud.appwrite.io/v1/apps/{appId}/keys
```

** Create a new app key for an application. App keys carry no scopes; send one in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header to list the application's installations and create installation access tokens. **
** Create a new app key for an application. App keys carry no scopes; send one in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header to list the application's installations and create installation access tokens. **

### Parameters

Expand Down
26 changes: 24 additions & 2 deletions docs/avatars.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ This endpoint does not follow HTTP redirects. **
GET https://cloud.appwrite.io/v1/avatars/initials
```

** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.

You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
**
Expand All @@ -112,6 +112,28 @@ When one dimension is specified and the other is 0, the image is scaled with pre
| background | string | Changes background color. By default a random color will be picked and stay will persistent to the given name. | |


```http request
GET https://cloud.appwrite.io/v1/avatars/photo
```

** Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.

The photo resolves for the currently authenticated user unless `userId` points at another user. Passing `emailHash` and/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the user's own identity photos, email, and name leave the chain so they never shadow the avatar being asked for. Emails are only ever accepted pre-hashed, so no address ends up in a URL. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| width | integer | Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256. | 256 |
| height | integer | Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256. | 256 |
| quality | integer | Output image quality between 0 and 100. Defaults to 100. | 100 |
| output | string | Output image format. Defaults to 'png'. | png |
| rating | string | Maximum image rating to fetch from Gravatar/Libravatar. Defaults to 'g'. | g |
| userId | string | User ID to resolve the photo for. Defaults to 'current()' for the currently authenticated user. | current() |
| emailHash | string | SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own photo sources. Pass the hash, never the address itself. | |
| name | string | Name to render initials from instead of the user's own photo sources. Max length: 128 chars. | |


```http request
GET https://cloud.appwrite.io/v1/avatars/qr
```
Expand Down
10 changes: 5 additions & 5 deletions docs/backups.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ POST https://cloud.appwrite.io/v1/backups/archives
GET https://cloud.appwrite.io/v1/backups/archives/{archiveId}
```

** Get a backup archive using it's ID. **
** Get a backup archive using it's ID. **

### Parameters

Expand Down Expand Up @@ -90,7 +90,7 @@ POST https://cloud.appwrite.io/v1/backups/policies
GET https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Get a backup policy using it's ID. **
** Get a backup policy using it's ID. **

### Parameters

Expand All @@ -103,7 +103,7 @@ GET https://cloud.appwrite.io/v1/backups/policies/{policyId}
PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Update an existing policy using it's ID. **
** Update an existing policy using it's ID. **

### Parameters

Expand All @@ -120,7 +120,7 @@ PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId}
DELETE https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Delete a policy using it's ID. **
** Delete a policy using it's ID. **

### Parameters

Expand All @@ -141,7 +141,7 @@ The restoration migration records the archived database in `resourceId` and `res

To list every migration related to one database, use its canonical type in a nested `OR(AND(...), AND(...), AND(...))` across the root, parent, and destination relation pairs: `(resourceType, resourceId)`, `(parentResourceType, parentResourceId)`, and `(destinationResourceType, destinationResourceId)`. Legacy and TablesDB databases use `database`; the operational `resourceType` of a table migration is not rewritten to `tablesdb`.

When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead.
When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead.
**

### Parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collecti
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents
```

** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. **
** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. **

### Parameters

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->createEmailPasswordSession(
email: 'email@example.com',
password: 'password'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ $result = $account->createEmailToken(
userId: '<USER_ID>',
email: 'email@example.com',
phrase: false // optional
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ $account = new Account($client);

$result = $account->createEmailVerification(
url: 'https://example.com'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ $result = $account->createMagicURLToken(
email: 'email@example.com',
url: 'https://example.com', // optional
phrase: false // optional
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);

$result = $account->createMFAAuthenticator(
type: AuthenticatorType::TOTP()
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);

$result = $account->createMFAChallenge(
factor: AuthenticationFactor::EMAIL()
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ $result = $account->createOAuth2Token(
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [] // optional
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->createPhoneToken(
userId: '<USER_ID>',
phone: '+12065550100'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->createRecovery(
email: 'email@example.com',
url: 'https://example.com'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->createSession(
userId: '<USER_ID>',
secret: '<SECRET>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ $account = new Account($client);

$result = $account->createVerification(
url: 'https://example.com'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ $result = $account->create(
email: 'email@example.com',
password: 'password',
name: '<NAME>' // optional
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/delete-consent-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->deleteConsentToken(
consentId: '<CONSENT_ID>',
tokenId: '<TOKEN_ID>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/delete-consent.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ $account = new Account($client);

$result = $account->deleteConsent(
consentId: '<CONSENT_ID>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/delete-identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ $account = new Account($client);

$result = $account->deleteIdentity(
identityId: '<IDENTITY_ID>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);

$result = $account->deleteMFAAuthenticator(
type: AuthenticatorType::TOTP()
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/delete-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ $account = new Account($client);

$result = $account->deleteSession(
sessionId: '<SESSION_ID>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/get-consent-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->getConsentToken(
consentId: '<CONSENT_ID>',
tokenId: '<TOKEN_ID>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/get-consent.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ $account = new Account($client);

$result = $account->getConsent(
consentId: '<CONSENT_ID>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/get-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ $account = new Account($client);

$result = $account->getSession(
sessionId: '<SESSION_ID>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/list-consent-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ $result = $account->listConsentTokens(
consentId: '<CONSENT_ID>',
queries: [], // optional
total: false // optional
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/list-consents.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->listConsents(
queries: [], // optional
total: false // optional
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/list-identities.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->listIdentities(
queries: [], // optional
total: false // optional
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/list-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->listLogs(
queries: [], // optional
total: false // optional
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/update-email-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->updateEmailVerification(
userId: '<USER_ID>',
secret: '<SECRET>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/update-email.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->updateEmail(
email: 'email@example.com',
password: 'password'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/update-magic-url-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->updateMagicURLSession(
userId: '<USER_ID>',
secret: '<SECRET>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/update-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ $account = new Account($client);
$result = $account->updateMFAAuthenticator(
type: AuthenticatorType::TOTP(),
otp: '<OTP>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/update-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ $account = new Account($client);
$result = $account->updateMFAChallenge(
challengeId: '<CHALLENGE_ID>',
otp: '<OTP>'
);```
);
```
3 changes: 2 additions & 1 deletion docs/examples/account/update-mfa.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ $account = new Account($client);

$result = $account->updateMFA(
mfa: false
);```
);
```
Loading