Skip to content

Commit 8940689

Browse files
authored
Merge pull request #18 from appwrite/dev
Appwrite 1.2.0 support
2 parents bfed397 + 9cd3a95 commit 8940689

31 files changed

+168
-234
lines changed

β€ŽLICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Redistribution and use in source and binary forms, with or without modification,
77

88
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
99

10-
3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1111

1212
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

β€ŽREADME.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Appwrite PHP SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?style=flat-square&v=1)
4-
![Version](https://img.shields.io/badge/api%20version-1.0.0-blue.svg?style=flat-square&v=1)
4+
![Version](https://img.shields.io/badge/api%20version-1.2.0-blue.svg?style=flat-square&v=1)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 1.0.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
9+
**This SDK is compatible with Appwrite server version 1.2.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

β€Ždocs/account.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GET https://HOSTNAME/v1/account
88

99
** Get currently logged in user data as JSON object. **
1010

11-
## Update Account Email
11+
## Update Email
1212

1313
```http request
1414
PATCH https://HOSTNAME/v1/account/email
@@ -25,7 +25,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
2525
| email | string | User email. | |
2626
| password | string | User password. Must be at least 8 chars. | |
2727

28-
## List Account Logs
28+
## List Logs
2929

3030
```http request
3131
GET https://HOSTNAME/v1/account/logs
@@ -39,7 +39,7 @@ GET https://HOSTNAME/v1/account/logs
3939
| --- | --- | --- | --- |
4040
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset | [] |
4141

42-
## Update Account Name
42+
## Update Name
4343

4444
```http request
4545
PATCH https://HOSTNAME/v1/account/name
@@ -53,7 +53,7 @@ PATCH https://HOSTNAME/v1/account/name
5353
| --- | --- | --- | --- |
5454
| name | string | User name. Max length: 128 chars. | |
5555

56-
## Update Account Password
56+
## Update Password
5757

5858
```http request
5959
PATCH https://HOSTNAME/v1/account/password
@@ -68,7 +68,7 @@ PATCH https://HOSTNAME/v1/account/password
6868
| password | string | New user password. Must be at least 8 chars. | |
6969
| oldPassword | string | Current user password. Must be at least 8 chars. | |
7070

71-
## Update Account Phone
71+
## Update Phone
7272

7373
```http request
7474
PATCH https://HOSTNAME/v1/account/phone
@@ -91,7 +91,7 @@ GET https://HOSTNAME/v1/account/prefs
9191

9292
** Get currently logged in user preferences as a key-value object. **
9393

94-
## Update Account Preferences
94+
## Update Preferences
9595

9696
```http request
9797
PATCH https://HOSTNAME/v1/account/prefs
@@ -139,23 +139,23 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
139139
| password | string | New user password. Must be at least 8 chars. | |
140140
| passwordAgain | string | Repeat new user password. Must be at least 8 chars. | |
141141

142-
## List Account Sessions
142+
## List Sessions
143143

144144
```http request
145145
GET https://HOSTNAME/v1/account/sessions
146146
```
147147

148148
** Get currently logged in user list of active sessions across different devices. **
149149

150-
## Delete All Account Sessions
150+
## Delete Sessions
151151

152152
```http request
153153
DELETE https://HOSTNAME/v1/account/sessions
154154
```
155155

156156
** Delete all sessions from the user account and remove any sessions cookies from the end client. **
157157

158-
## Get Session By ID
158+
## Get Session
159159

160160
```http request
161161
GET https://HOSTNAME/v1/account/sessions/{sessionId}
@@ -169,7 +169,7 @@ GET https://HOSTNAME/v1/account/sessions/{sessionId}
169169
| --- | --- | --- | --- |
170170
| sessionId | string | **Required** Session ID. Use the string 'current' to get the current device session. | |
171171

172-
## Update Session (Refresh Tokens)
172+
## Update OAuth Session (Refresh Tokens)
173173

174174
```http request
175175
PATCH https://HOSTNAME/v1/account/sessions/{sessionId}
@@ -183,7 +183,7 @@ PATCH https://HOSTNAME/v1/account/sessions/{sessionId}
183183
| --- | --- | --- | --- |
184184
| sessionId | string | **Required** Session ID. Use the string 'current' to update the current device session. | |
185185

186-
## Delete Account Session
186+
## Delete Session
187187

188188
```http request
189189
DELETE https://HOSTNAME/v1/account/sessions/{sessionId}
@@ -198,7 +198,7 @@ DELETE https://HOSTNAME/v1/account/sessions/{sessionId}
198198
| --- | --- | --- | --- |
199199
| sessionId | string | **Required** Session ID. Use the string 'current' to delete the current device session. | |
200200

201-
## Update Account Status
201+
## Update Status
202202

203203
```http request
204204
PATCH https://HOSTNAME/v1/account/status

β€Ždocs/databases.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ POST https://HOSTNAME/v1/databases
2828

2929
| Field Name | Type | Description | Default |
3030
| --- | --- | --- | --- |
31-
| databaseId | string | Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. 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. | |
31+
| databaseId | string | Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. 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. | |
3232
| name | string | Collection name. Max length: 128 chars. | |
3333

3434
## Get Database
@@ -58,7 +58,7 @@ PUT https://HOSTNAME/v1/databases/{databaseId}
5858
| Field Name | Type | Description | Default |
5959
| --- | --- | --- | --- |
6060
| databaseId | string | **Required** Database ID. | |
61-
| name | string | Collection name. Max length: 128 chars. | |
61+
| name | string | Database name. Max length: 128 chars. | |
6262

6363
## Delete Database
6464

@@ -103,7 +103,7 @@ POST https://HOSTNAME/v1/databases/{databaseId}/collections
103103
| Field Name | Type | Description | Default |
104104
| --- | --- | --- | --- |
105105
| databaseId | string | **Required** Database ID. | |
106-
| collectionId | string | Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. 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. | |
106+
| collectionId | string | Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. 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. | |
107107
| name | string | Collection name. Max length: 128 chars. | |
108108
| permissions | array | An array of permissions strings. By default no user is granted with any permissions. [Learn more about permissions](/docs/permissions). | |
109109
| documentSecurity | boolean | Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions). | |
@@ -384,7 +384,7 @@ DELETE https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/att
384384
GET https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/documents
385385
```
386386

387-
** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of documents belonging to the provided collectionId. [Learn more about different API modes](/docs/admin). **
387+
** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. **
388388

389389
### Parameters
390390

@@ -408,7 +408,7 @@ POST https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/docum
408408
| --- | --- | --- | --- |
409409
| databaseId | string | **Required** Database ID. | |
410410
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. | |
411-
| documentId | string | Document ID. Choose your own unique ID or pass the string "unique()" to auto generate it. 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. | |
411+
| documentId | string | Document ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. 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. | |
412412
| data | object | Document data as JSON object. | {} |
413413
| permissions | array | An array of permissions strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions). | |
414414

β€Ždocs/examples/account/get-logs.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

β€Ždocs/examples/account/get-sessions.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

β€Ždocs/examples/account/update-phone.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ $client
1313

1414
$account = new Account($client);
1515

16-
$result = $account->updatePhone('', 'password');
16+
$result = $account->updatePhone('+12065550100', 'password');

β€Ždocs/examples/functions/retry-build.md renamed to β€Ždocs/examples/functions/create-build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ $client
1313

1414
$functions = new Functions($client);
1515

16-
$result = $functions->retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]');
16+
$result = $functions->createBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]');
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
33
use Appwrite\Client;
4-
use Appwrite\Services\Locale;
4+
use Appwrite\Services\Graphql;
55
66
$client = new Client();
77
@@ -11,6 +11,6 @@ $client
1111
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1212
;
1313

14-
$locale = new Locale($client);
14+
$graphql = new Graphql($client);
1515

16-
$result = $locale->getCurrencies();
16+
$result = $graphql->mutation([]);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
33
use Appwrite\Client;
4-
use Appwrite\Services\Locale;
4+
use Appwrite\Services\Graphql;
55
66
$client = new Client();
77
@@ -11,6 +11,6 @@ $client
1111
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1212
;
1313

14-
$locale = new Locale($client);
14+
$graphql = new Graphql($client);
1515

16-
$result = $locale->getLanguages();
16+
$result = $graphql->query([]);

β€Ždocs/examples/locale/get-continents.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

β€Ždocs/examples/locale/get-countries-e-u.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

β€Ždocs/examples/locale/get-countries-phones.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

β€Ždocs/examples/locale/get-countries.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

β€Ždocs/examples/teams/get-memberships.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

β€Ždocs/examples/users/get-logs.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

β€Ždocs/examples/users/get-memberships.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
Β (0)