Skip to content

Commit

Permalink
Merge pull request #20 from appwrite/dev
Browse files Browse the repository at this point in the history
update to appwrite 1.3.0
  • Loading branch information
christyjacob4 committed Apr 12, 2023
2 parents 8940689 + c02ca05 commit 2b9e966
Show file tree
Hide file tree
Showing 32 changed files with 1,236 additions and 82 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite PHP SDK

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

**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).**
**This SDK is compatible with Appwrite server version 1.3.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**

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)

Expand Down
2 changes: 1 addition & 1 deletion docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GET https://HOSTNAME/v1/account/logs

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| 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 | [] |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset | [] |

## Update Name

Expand Down
231 changes: 221 additions & 10 deletions docs/databases.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/examples/account/update-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $client

$account = new Account($client);

$result = $account->updatePassword('password');
$result = $account->updatePassword('');
16 changes: 16 additions & 0 deletions docs/examples/databases/create-relationship-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->createRelationshipAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', 'oneToOne');
16 changes: 16 additions & 0 deletions docs/examples/databases/update-boolean-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateBooleanAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', false, false);
16 changes: 16 additions & 0 deletions docs/examples/databases/update-datetime-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateDatetimeAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', false, '');
16 changes: 16 additions & 0 deletions docs/examples/databases/update-email-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateEmailAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', false, 'email@example.com');
16 changes: 16 additions & 0 deletions docs/examples/databases/update-enum-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateEnumAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', [], false, '[DEFAULT]');
16 changes: 16 additions & 0 deletions docs/examples/databases/update-float-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateFloatAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', false, null, null, null);
16 changes: 16 additions & 0 deletions docs/examples/databases/update-integer-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateIntegerAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', false, null, null, null);
16 changes: 16 additions & 0 deletions docs/examples/databases/update-ip-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateIpAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', false, '');
16 changes: 16 additions & 0 deletions docs/examples/databases/update-relationship-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateRelationshipAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '');
16 changes: 16 additions & 0 deletions docs/examples/databases/update-string-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateStringAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', false, '[DEFAULT]');
16 changes: 16 additions & 0 deletions docs/examples/databases/update-url-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->updateUrlAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', false, 'https://example.com');
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $client

$functions = new Functions($client);

$result = $functions->create('[FUNCTION_ID]', '[NAME]', ["any"], 'node-14.5');
$result = $functions->create('[FUNCTION_ID]', '[NAME]', 'node-14.5');
2 changes: 1 addition & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $client

$functions = new Functions($client);

$result = $functions->update('[FUNCTION_ID]', '[NAME]', ["any"]);
$result = $functions->update('[FUNCTION_ID]', '[NAME]');
2 changes: 1 addition & 1 deletion docs/examples/teams/create-membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $client

$teams = new Teams($client);

$result = $teams->createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com');
$result = $teams->createMembership('[TEAM_ID]', [], 'https://example.com');
16 changes: 16 additions & 0 deletions docs/examples/teams/get-prefs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Teams;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;

$teams = new Teams($client);

$result = $teams->getPrefs('[TEAM_ID]');
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $client

$teams = new Teams($client);

$result = $teams->update('[TEAM_ID]', '[NAME]');
$result = $teams->updateName('[TEAM_ID]', '[NAME]');
16 changes: 16 additions & 0 deletions docs/examples/teams/update-prefs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Teams;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;

$teams = new Teams($client);

$result = $teams->updatePrefs('[TEAM_ID]', []);
2 changes: 1 addition & 1 deletion docs/examples/users/update-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $client

$users = new Users($client);

$result = $users->updatePassword('[USER_ID]', 'password');
$result = $users->updatePassword('[USER_ID]', '');
12 changes: 6 additions & 6 deletions docs/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GET https://HOSTNAME/v1/functions

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| 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). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout | [] |
| 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, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout | [] |
| search | string | Search term to filter your list results. Max length: 256 chars. | |

## Create Function
Expand All @@ -27,9 +27,9 @@ POST https://HOSTNAME/v1/functions

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| functionId | string | Function 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. | |
| functionId | string | Function 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. | |
| name | string | Function name. Max length: 128 chars. | |
| execute | array | An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 64 characters long. | |
| execute | array | An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 64 characters long. | [] |
| runtime | string | Execution runtime. | |
| events | array | Events list. Maximum of 100 events are allowed. | [] |
| schedule | string | Schedule CRON syntax. | |
Expand Down Expand Up @@ -72,7 +72,7 @@ PUT https://HOSTNAME/v1/functions/{functionId}
| --- | --- | --- | --- |
| functionId | string | **Required** Function ID. | |
| name | string | Function name. Max length: 128 chars. | |
| execute | array | An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 64 characters long. | |
| execute | array | An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 64 characters long. | [] |
| events | array | Events list. Maximum of 100 events are allowed. | [] |
| schedule | string | Schedule CRON syntax. | |
| timeout | integer | Maximum execution time in seconds. | 15 |
Expand Down Expand Up @@ -105,7 +105,7 @@ GET https://HOSTNAME/v1/functions/{functionId}/deployments
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| functionId | string | **Required** Function ID. | |
| 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). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: entrypoint, size, buildId, activate | [] |
| 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: entrypoint, size, buildId, activate | [] |
| search | string | Search term to filter your list results. Max length: 256 chars. | |

## Create Deployment
Expand Down Expand Up @@ -201,7 +201,7 @@ GET https://HOSTNAME/v1/functions/{functionId}/executions
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| functionId | string | **Required** Function ID. | |
| 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). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, statusCode, duration | [] |
| 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: trigger, status, statusCode, duration | [] |
| search | string | Search term to filter your list results. Max length: 256 chars. | |

## Create Execution
Expand Down
Loading

0 comments on commit 2b9e966

Please sign in to comment.