Skip to content
Closed
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
8 changes: 0 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Change Log

## 24.1.0

* Added `sizeActual` property to `File` model for actual stored size after compression/encryption
* Updated `BillingLimits` properties to be nullable to match the server's sparse "limits crossed" response
* Updated `Project.billingLimits` to be nullable
* Updated advisor example docs to use API key authentication
* Removed orphaned `Prompt` enum (already unused; superseded by `ProjectOAuth2GooglePrompt` in 24.0.0)

## 24.0.0

* Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId`
Expand Down
63 changes: 63 additions & 0 deletions docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,27 @@ PUT https://cloud.appwrite.io/v1/account/sessions/magic-url
| secret | string | Valid verification token. | |


```http request
GET https://cloud.appwrite.io/v1/account/sessions/oauth2/{provider}
```

** Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.

If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.

A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
**

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | |
| success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
| failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
| scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. | [] |


```http request
PUT https://cloud.appwrite.io/v1/account/sessions/phone
```
Expand Down Expand Up @@ -514,6 +535,48 @@ PATCH https://cloud.appwrite.io/v1/account/status
** Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead. **


```http request
POST https://cloud.appwrite.io/v1/account/targets/push
```

** Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| targetId | string | Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
| identifier | string | The target identifier (token, email, phone etc.) | |
| providerId | string | Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. | |


```http request
PUT https://cloud.appwrite.io/v1/account/targets/{targetId}/push
```

** Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| targetId | string | **Required** Target ID. | |
| identifier | string | The target identifier (token, email, phone etc.) | |


```http request
DELETE https://cloud.appwrite.io/v1/account/targets/{targetId}/push
```

** Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| targetId | string | **Required** Target ID. | |


```http request
POST https://cloud.appwrite.io/v1/account/tokens/email
```
Expand Down
20 changes: 20 additions & 0 deletions docs/examples/account/create-o-auth-2-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Account;
use Appwrite\Enums\OAuthProvider;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with

$account = new Account($client);

$result = $account->createOAuth2Session(
provider: OAuthProvider::AMAZON(),
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [] // optional
);```
18 changes: 18 additions & 0 deletions docs/examples/account/create-push-target.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Account;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with

$account = new Account($client);

$result = $account->createPushTarget(
targetId: '<TARGET_ID>',
identifier: '<IDENTIFIER>',
providerId: '<PROVIDER_ID>' // optional
);```
16 changes: 16 additions & 0 deletions docs/examples/account/delete-push-target.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Account;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with

$account = new Account($client);

$result = $account->deletePushTarget(
targetId: '<TARGET_ID>'
);```
17 changes: 17 additions & 0 deletions docs/examples/account/update-push-target.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Account;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with

$account = new Account($client);

$result = $account->updatePushTarget(
targetId: '<TARGET_ID>',
identifier: '<IDENTIFIER>'
);```
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $result = $avatars->getScreenshot(
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
timezone: Timezone::AMERICANEWYORK(), // optional
timezone: Timezone::AFRICAABIDJAN(), // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
Expand Down
20 changes: 10 additions & 10 deletions docs/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/google
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| clientId | string | 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com | |
| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: example-google-client-secret | |
| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj | |
| prompt | array | Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. | |
| enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | |

Expand Down Expand Up @@ -549,7 +549,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/linkedin
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| clientId | string | 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv | |
| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: example-linkedin-client-secret | |
| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== | |
| enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | |


Expand Down Expand Up @@ -1292,12 +1292,12 @@ PATCH https://cloud.appwrite.io/v1/project/smtp
| --- | --- | --- | --- |
| host | string | SMTP server hostname (domain) | |
| port | integer | SMTP server port | |
| username | string | SMTP server username. Leave empty for no authorization. | |
| password | string | SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only). | |
| senderEmail | string | Email address shown in inbox as the sender of the email. | |
| senderName | string | Name shown in inbox as the sender of the email. | |
| replyToEmail | string | Email used when user replies to the email. | |
| replyToName | string | Name used when user replies to the email. | |
| username | string | SMTP server username. Pass an empty string to clear a previously set value. | |
| password | string | SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only). | |
| senderEmail | string | Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. | |
| senderName | string | Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. | |
| replyToEmail | string | Email used when user replies to the email. Pass an empty string to clear a previously set value. | |
| replyToName | string | Name used when user replies to the email. Pass an empty string to clear a previously set value. | |
| secure | string | Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. | |
| enabled | boolean | Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. | |

Expand Down Expand Up @@ -1344,8 +1344,8 @@ PATCH https://cloud.appwrite.io/v1/project/templates/email
| subject | string | Subject of the email template. Can be up to 255 characters. | |
| message | string | Plain or HTML body of the email template message. Can be up to 10MB of content. | |
| senderName | string | Name of the email sender. | |
| senderEmail | string | Email of the sender. | |
| replyToEmail | string | Reply to email. | |
| senderEmail | string | Email of the sender. Pass an empty string to clear a previously set value. | |
| replyToEmail | string | Reply to email. Pass an empty string to clear a previously set value. | |
| replyToName | string | Reply to name. | |


Expand Down
27 changes: 0 additions & 27 deletions src/Appwrite/Enums/BuildRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class BuildRuntime implements JsonSerializable
private static BuildRuntime $PYTHONML311;
private static BuildRuntime $PYTHONML312;
private static BuildRuntime $PYTHONML313;
private static BuildRuntime $DENO121;
private static BuildRuntime $DENO124;
private static BuildRuntime $DENO135;
private static BuildRuntime $DENO140;
private static BuildRuntime $DENO146;
private static BuildRuntime $DENO20;
Expand Down Expand Up @@ -333,27 +330,6 @@ public static function PYTHONML313(): BuildRuntime
}
return self::$PYTHONML313;
}
public static function DENO121(): BuildRuntime
{
if (!isset(self::$DENO121)) {
self::$DENO121 = new BuildRuntime('deno-1.21');
}
return self::$DENO121;
}
public static function DENO124(): BuildRuntime
{
if (!isset(self::$DENO124)) {
self::$DENO124 = new BuildRuntime('deno-1.24');
}
return self::$DENO124;
}
public static function DENO135(): BuildRuntime
{
if (!isset(self::$DENO135)) {
self::$DENO135 = new BuildRuntime('deno-1.35');
}
return self::$DENO135;
}
public static function DENO140(): BuildRuntime
{
if (!isset(self::$DENO140)) {
Expand Down Expand Up @@ -795,9 +771,6 @@ public static function from(string $value): self
'python-ml-3.11' => self::PYTHONML311(),
'python-ml-3.12' => self::PYTHONML312(),
'python-ml-3.13' => self::PYTHONML313(),
'deno-1.21' => self::DENO121(),
'deno-1.24' => self::DENO124(),
'deno-1.35' => self::DENO135(),
'deno-1.40' => self::DENO140(),
'deno-1.46' => self::DENO146(),
'deno-2.0' => self::DENO20(),
Expand Down
27 changes: 0 additions & 27 deletions src/Appwrite/Enums/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class Runtime implements JsonSerializable
private static Runtime $PYTHONML311;
private static Runtime $PYTHONML312;
private static Runtime $PYTHONML313;
private static Runtime $DENO121;
private static Runtime $DENO124;
private static Runtime $DENO135;
private static Runtime $DENO140;
private static Runtime $DENO146;
private static Runtime $DENO20;
Expand Down Expand Up @@ -333,27 +330,6 @@ public static function PYTHONML313(): Runtime
}
return self::$PYTHONML313;
}
public static function DENO121(): Runtime
{
if (!isset(self::$DENO121)) {
self::$DENO121 = new Runtime('deno-1.21');
}
return self::$DENO121;
}
public static function DENO124(): Runtime
{
if (!isset(self::$DENO124)) {
self::$DENO124 = new Runtime('deno-1.24');
}
return self::$DENO124;
}
public static function DENO135(): Runtime
{
if (!isset(self::$DENO135)) {
self::$DENO135 = new Runtime('deno-1.35');
}
return self::$DENO135;
}
public static function DENO140(): Runtime
{
if (!isset(self::$DENO140)) {
Expand Down Expand Up @@ -795,9 +771,6 @@ public static function from(string $value): self
'python-ml-3.11' => self::PYTHONML311(),
'python-ml-3.12' => self::PYTHONML312(),
'python-ml-3.13' => self::PYTHONML313(),
'deno-1.21' => self::DENO121(),
'deno-1.24' => self::DENO124(),
'deno-1.35' => self::DENO135(),
'deno-1.40' => self::DENO140(),
'deno-1.46' => self::DENO146(),
'deno-2.0' => self::DENO20(),
Expand Down
Loading
Loading