Skip to content

Commit 2ce7220

Browse files
authored
Merge pull request #62 from appwrite/dev
feat: PHP SDK update for version 20.2.0
2 parents e946bb6 + a771bbf commit 2ce7220

17 files changed

Lines changed: 217 additions & 105 deletions

File tree

CHANGELOG.md

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

3+
## 21.0.0
4+
5+
* Breaking: Updated createDeployment signature and relationship attribute endpoint path
6+
* Added TTL parameter support to listDocuments and listRows
7+
* Added getConsolePausing health endpoint to Health service
8+
39
## 20.2.0
410

511
* Added optional encrypt parameter for database attributes (Text, Longtext, Mediumtext, Varchar) and corresponding column creation methods to enable encryption at rest. Encrypted attributes/columns cannot be queried.

docs/databases.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collection
264264
| Field Name | Type | Description | Default |
265265
| --- | --- | --- | --- |
266266
| databaseId | string | **Required** Database ID. | |
267-
| collectionId | string | **Required** Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
267+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
268268
| key | string | Attribute Key. | |
269269
| required | boolean | Is attribute required? | |
270270
| default | boolean | Default value for attribute when not provided. Cannot be set when attribute is required. | |
@@ -729,6 +729,24 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collection
729729
| onDelete | string | Constraints option | restrict |
730730

731731

732+
```http request
733+
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}
734+
```
735+
736+
** Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
737+
**
738+
739+
### Parameters
740+
741+
| Field Name | Type | Description | Default |
742+
| --- | --- | --- | --- |
743+
| databaseId | string | **Required** Database ID. | |
744+
| collectionId | string | **Required** Collection ID. | |
745+
| key | string | **Required** Attribute Key. | |
746+
| onDelete | string | Constraints option | |
747+
| newKey | string | New Attribute Key. | |
748+
749+
732750
```http request
733751
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/string
734752
```
@@ -918,24 +936,6 @@ DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collecti
918936
| key | string | **Required** Attribute Key. | |
919937

920938

921-
```http request
922-
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship
923-
```
924-
925-
** Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
926-
**
927-
928-
### Parameters
929-
930-
| Field Name | Type | Description | Default |
931-
| --- | --- | --- | --- |
932-
| databaseId | string | **Required** Database ID. | |
933-
| collectionId | string | **Required** Collection ID. | |
934-
| key | string | **Required** Attribute Key. | |
935-
| onDelete | string | Constraints option | |
936-
| newKey | string | New Attribute Key. | |
937-
938-
939939
```http request
940940
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents
941941
```
@@ -951,6 +951,7 @@ GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionI
951951
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |
952952
| transactionId | string | Transaction ID to read uncommitted changes within the transaction. | |
953953
| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 |
954+
| ttl | integer | TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). | 0 |
954955

955956

956957
```http request

docs/examples/databases/list-documents.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ $result = $databases->listDocuments(
1616
collectionId: '<COLLECTION_ID>',
1717
queries: [], // optional
1818
transactionId: '<TRANSACTION_ID>', // optional
19-
total: false // optional
19+
total: false, // optional
20+
ttl: 0 // optional
2021
);```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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->getConsolePausing(
15+
threshold: null, // optional
16+
inactivityDays: null // optional
17+
);```

docs/examples/sites/create-deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ $sites = new Sites($client);
1515
$result = $sites->createDeployment(
1616
siteId: '<SITE_ID>',
1717
code: InputFile::withPath('file.png'),
18-
activate: false,
1918
installCommand: '<INSTALL_COMMAND>', // optional
2019
buildCommand: '<BUILD_COMMAND>', // optional
21-
outputDirectory: '<OUTPUT_DIRECTORY>' // optional
20+
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
21+
activate: false // optional
2222
);```

docs/examples/tablesdb/list-rows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ $result = $tablesDB->listRows(
1616
tableId: '<TABLE_ID>',
1717
queries: [], // optional
1818
transactionId: '<TRANSACTION_ID>', // optional
19-
total: false // optional
19+
total: false, // optional
20+
ttl: 0 // optional
2021
);```

docs/health.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ GET https://cloud.appwrite.io/v1/health/certificate
3535
| domain | string | string | |
3636

3737

38+
```http request
39+
GET https://cloud.appwrite.io/v1/health/console-pausing
40+
```
41+
42+
** Get console pausing health status. Monitors projects approaching the pause threshold to detect potential issues with console access tracking.
43+
**
44+
45+
### Parameters
46+
47+
| Field Name | Type | Description | Default |
48+
| --- | --- | --- | --- |
49+
| threshold | integer | Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10. | 10 |
50+
| inactivityDays | integer | Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7. | 7 |
51+
52+
3853
```http request
3954
GET https://cloud.appwrite.io/v1/health/db
4055
```

docs/messaging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ GET https://cloud.appwrite.io/v1/messaging/topics/{topicId}/subscribers
986986
| Field Name | Type | Description | Default |
987987
| --- | --- | --- | --- |
988988
| topicId | string | **Required** Topic ID. The topic ID subscribed to. | |
989-
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled | [] |
989+
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: targetId, topicId, userId, providerType | [] |
990990
| search | string | Search term to filter your list results. Max length: 256 chars. | |
991991
| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 |
992992

docs/tablesdb.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/rows
10161016
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |
10171017
| transactionId | string | Transaction ID to read uncommitted changes within the transaction. | |
10181018
| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 |
1019+
| ttl | integer | TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). | 0 |
10191020

10201021

10211022
```http request

docs/teams.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
108108
| email | string | Email of the new team member. | |
109109
| userId | string | ID of the user to be added to a team. | |
110110
| phone | string | Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. | |
111-
| roles | array | Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. | |
111+
| roles | array | Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. | |
112112
| url | string | URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project 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. | |
113113
| name | string | Name of the new team member. Max length: 128 chars. | |
114114

@@ -140,7 +140,7 @@ PATCH https://cloud.appwrite.io/v1/teams/{teamId}/memberships/{membershipId}
140140
| --- | --- | --- | --- |
141141
| teamId | string | **Required** Team ID. | |
142142
| membershipId | string | **Required** Membership ID. | |
143-
| roles | array | An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. | |
143+
| roles | array | An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. | |
144144

145145

146146
```http request

0 commit comments

Comments
 (0)