Skip to content

Commit ec02d82

Browse files
authored
Merge pull request #78 from appwrite/dev
feat: PHP SDK update for version 25.1.0
2 parents a3091da + 32d6201 commit ec02d82

63 files changed

Lines changed: 3465 additions & 151 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
## 25.1.0
4+
5+
* Added: `createSesProvider` and `updateSesProvider` to `messaging`
6+
* Added: `updateOAuth2Server` to `project` for OAuth2 server settings
7+
* Added: `updatePasswordStrengthPolicy` and `PolicyPasswordStrength` to `project`
8+
* Added: `getAuditsDB` health check to `health`
9+
* Added: `password-strength` to `ProjectPolicyId`
10+
* Added: `apps.read` and `apps.write` to `ProjectKeyScopes`
11+
12+
313
## 25.0.0
414

515
* Breaking: Removed `githubImagine` and `googleImagine` from `ProjectOAuthProviderId`
@@ -8,7 +18,7 @@
818
* Added: `Organization` service for managing projects and API keys
919
* Added: `PolicyDenyAliasedEmail`, `PolicyDenyDisposableEmail`, and `PolicyDenyFreeEmail` policy models
1020
* Added: `deny-aliased-email`, `deny-disposable-email`, and `deny-free-email` to `ProjectPolicyId`
11-
* Added: `BrowserTheme`, `HealthQueueName`, `OrganizationKeyScopes`, and `Region` enums
21+
* Replaced: `BrowserTheme`, `HealthQueueName`, `OrganizationKeyScopes`, and `Region` enums
1222
* Added: `dart-3.12` and `flutter-3.44` runtimes
1323
* Added: `ProjectList` model and new attributes on `Function`, `Site`, and `UsageGauge`
1424
* Updated: `functions`, `sites`, `usage`, `health`, and `avatars` services

docs/account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ PATCH https://cloud.appwrite.io/v1/account/password
321321
| Field Name | Type | Description | Default |
322322
| --- | --- | --- | --- |
323323
| password | string | New user password. Must be at least 8 chars. | |
324-
| oldPassword | string | Current user password. Must be at least 8 chars. | |
324+
| oldPassword | string | Current user password. Max length: 256 chars. | |
325325

326326

327327
```http request

docs/examples/account/update-password.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ $account = new Account($client);
1313

1414
$result = $account->updatePassword(
1515
password: '',
16-
oldPassword: 'password' // optional
16+
oldPassword: '<OLD_PASSWORD>' // optional
1717
);```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Health;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$health = new Health($client);
13+
14+
$result = $health->getAuditsDB();
15+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Messaging;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$messaging = new Messaging($client);
13+
14+
$result = $messaging->createSesProvider(
15+
providerId: '<PROVIDER_ID>',
16+
name: '<NAME>',
17+
accessKey: '<ACCESS_KEY>', // optional
18+
secretKey: '<SECRET_KEY>', // optional
19+
region: '<REGION>', // optional
20+
fromName: '<FROM_NAME>', // optional
21+
fromEmail: 'email@example.com', // optional
22+
replyToName: '<REPLY_TO_NAME>', // optional
23+
replyToEmail: 'email@example.com', // optional
24+
enabled: false // optional
25+
);```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Messaging;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$messaging = new Messaging($client);
13+
14+
$result = $messaging->updateSesProvider(
15+
providerId: '<PROVIDER_ID>',
16+
name: '<NAME>', // optional
17+
enabled: false, // optional
18+
accessKey: '<ACCESS_KEY>', // optional
19+
secretKey: '<SECRET_KEY>', // optional
20+
region: '<REGION>', // optional
21+
fromName: '<FROM_NAME>', // optional
22+
fromEmail: 'email@example.com', // optional
23+
replyToName: '<REPLY_TO_NAME>', // optional
24+
replyToEmail: '<REPLY_TO_EMAIL>' // optional
25+
);```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Project;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$project = new Project($client);
13+
14+
$result = $project->updateOAuth2Server(
15+
enabled: false,
16+
authorizationUrl: 'https://example.com',
17+
scopes: [], // optional
18+
accessTokenDuration: 60, // optional
19+
refreshTokenDuration: 60, // optional
20+
publicAccessTokenDuration: 60, // optional
21+
publicRefreshTokenDuration: 60, // optional
22+
confidentialPkce: false // optional
23+
);```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Project;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$project = new Project($client);
13+
14+
$result = $project->updatePasswordStrengthPolicy(
15+
min: 8, // optional
16+
uppercase: false, // optional
17+
lowercase: false, // optional
18+
number: false, // optional
19+
symbols: false // optional
20+
);```

docs/health.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ GET https://cloud.appwrite.io/v1/health/anti-virus
1515
** Check the Appwrite Antivirus server is up and connection is successful. **
1616

1717

18+
```http request
19+
GET https://cloud.appwrite.io/v1/health/audits-db
20+
```
21+
22+
** Check the database that backs the audit and activity store. When the connection is reachable the endpoint returns a passing status with its response time.
23+
**
24+
25+
1826
```http request
1927
GET https://cloud.appwrite.io/v1/health/cache
2028
```

docs/messaging.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,50 @@ PATCH https://cloud.appwrite.io/v1/messaging/providers/sendgrid/{providerId}
582582
| replyToEmail | string | Email set in the Reply To field for the mail. Default value is Sender Email. | |
583583

584584

585+
```http request
586+
POST https://cloud.appwrite.io/v1/messaging/providers/ses
587+
```
588+
589+
** Create a new Amazon SES provider. **
590+
591+
### Parameters
592+
593+
| Field Name | Type | Description | Default |
594+
| --- | --- | --- | --- |
595+
| providerId | string | Provider 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. | |
596+
| name | string | Provider name. | |
597+
| accessKey | string | AWS access key ID. | |
598+
| secretKey | string | AWS secret access key. | |
599+
| region | string | AWS region, for example us-east-1. | |
600+
| fromName | string | Sender Name. | |
601+
| fromEmail | string | Sender email address. | |
602+
| replyToName | string | Name set in the reply to field for the mail. Default value is sender name. | |
603+
| replyToEmail | string | Email set in the reply to field for the mail. Default value is sender email. | |
604+
| enabled | boolean | Set as enabled. | |
605+
606+
607+
```http request
608+
PATCH https://cloud.appwrite.io/v1/messaging/providers/ses/{providerId}
609+
```
610+
611+
** Update an Amazon SES provider by its unique ID. **
612+
613+
### Parameters
614+
615+
| Field Name | Type | Description | Default |
616+
| --- | --- | --- | --- |
617+
| providerId | string | **Required** Provider ID. | |
618+
| name | string | Provider name. | |
619+
| enabled | boolean | Set as enabled. | |
620+
| accessKey | string | AWS access key ID. | |
621+
| secretKey | string | AWS secret access key. | |
622+
| region | string | AWS region, for example us-east-1. | |
623+
| fromName | string | Sender Name. | |
624+
| fromEmail | string | Sender email address. | |
625+
| replyToName | string | Name set in the Reply To field for the mail. Default value is Sender Name. | |
626+
| replyToEmail | string | Email set in the Reply To field for the mail. Default value is Sender Email. | |
627+
628+
585629
```http request
586630
POST https://cloud.appwrite.io/v1/messaging/providers/smtp
587631
```

0 commit comments

Comments
 (0)