diff --git a/README.md b/README.md index 0b09bdd..1c5d4cd 100644 --- a/README.md +++ b/README.md @@ -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.6.2-blue.svg?style=flat-square&v=1) +![Version](https://img.shields.io/badge/api%20version-1.7.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.6.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.7.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) diff --git a/docs/avatars.md b/docs/avatars.md index 9cde42d..97bbfc3 100644 --- a/docs/avatars.md +++ b/docs/avatars.md @@ -16,7 +16,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre | code | string | **Required** Browser Code. | | | width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | | height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. | -1 | ```http request @@ -35,7 +35,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre | code | string | **Required** Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay. | | | width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | | height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. | -1 | ```http request @@ -69,7 +69,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre | code | string | **Required** Country Code. ISO Alpha-2 country code format. | | | width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | | height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. | -1 | ```http request diff --git a/docs/databases.md b/docs/databases.md index cf972e0..5ca5264 100644 --- a/docs/databases.md +++ b/docs/databases.md @@ -606,8 +606,7 @@ GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionI POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents ``` -** Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - ** +** Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. ** ### Parameters @@ -620,6 +619,68 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collection | permissions | array | An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). | | +```http request +POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents +``` + +** Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| 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. | | +| documents | array | Array of documents data as JSON objects. | [] | + + +```http request +PUT https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents +``` + +** Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| collectionId | string | **Required** Collection ID. | | +| documents | array | Array of document data as JSON objects. May contain partial documents. | [] | + + +```http request +PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents +``` + +** Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| collectionId | string | **Required** Collection ID. | | +| data | object | Document data as JSON object. Include only attribute and value pairs to be updated. | {} | +| 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. | [] | + + +```http request +DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents +``` + +** Bulk delete documents using queries, if no queries are passed then all documents are deleted. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| databaseId | string | **Required** Database ID. | | +| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | | +| 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. | [] | + + ```http request GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} ``` @@ -700,6 +761,7 @@ Attributes can be `key`, `fulltext`, and `unique`. ** | type | string | Index type. | | | attributes | array | Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. | | | orders | array | Array of index orders. Maximum of 100 orders are allowed. | [] | +| lengths | array | Length of index. Maximum of 100 | [] | ```http request diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 4cf9538..b3e811e 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index b0e4d75..827b129 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index afa9bc9..b2c5532 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 2658a66..3dc4865 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 1ac0087..639b199 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 7833852..da3b463 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -5,7 +5,7 @@ use Appwrite\Services\Account; use Appwrite\Enums\AuthenticatorType; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index a58d674..faa679f 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -5,7 +5,7 @@ use Appwrite\Services\Account; use Appwrite\Enums\AuthenticationFactor; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index d82a97a..223c95b 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 21b9ef1..1f91db7 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -5,7 +5,7 @@ use Appwrite\Services\Account; use Appwrite\Enums\OAuthProvider; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 72462ff..93c1854 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index cb81da5..a152667 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index a924379..c15e41d 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index aa089ae..2ff630a 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 99929f1..4628175 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 2b25cde..f92155b 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 31e5f42..fd66d3a 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 5367409..42806f8 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -5,7 +5,7 @@ use Appwrite\Services\Account; use Appwrite\Enums\AuthenticatorType; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index d44aca8..9233ae1 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index bf9e5c1..557fd6d 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 43c3f06..bafd6d8 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 808699a..c7077af 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index dfd1c23..be26713 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 427632d..30cb7b2 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index d928921..a7d0a85 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 72199a2..cc7a173 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index d670b97..6756573 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index bbc1b78..7f9749f 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index c5fd462..c7c0d48 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 9489b96..a1978e6 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index e80adf9..fc42cbe 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index d3c36a3..6a09d95 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -5,7 +5,7 @@ use Appwrite\Services\Account; use Appwrite\Enums\AuthenticatorType; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index dcc5dcd..03ace31 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index cf6204a..c7ec6cb 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index a55a076..2603b6e 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 9ef2757..c510138 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 973d29d..12d71c2 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject(''); // Your project ID $account = new Account($client); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index a116447..df59922 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index be489f7..853cb62 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 0d47ee8..698da0f 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 523a617..63518b0 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 3eebb12..11cb4c7 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index d343c95..7c8075e 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index a03e87f..60ec0b3 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Account; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index d7e7e76..2449c26 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -5,7 +5,7 @@ use Appwrite\Services\Avatars; use Appwrite\Enums\Browser; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with @@ -15,5 +15,5 @@ $result = $avatars->getBrowser( code: Browser::AVANTBROWSER(), width: 0, // optional height: 0, // optional - quality: 0 // optional + quality: -1 // optional ); \ No newline at end of file diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 55e2516..123b345 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -5,7 +5,7 @@ use Appwrite\Services\Avatars; use Appwrite\Enums\CreditCard; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with @@ -15,5 +15,5 @@ $result = $avatars->getCreditCard( code: CreditCard::AMERICANEXPRESS(), width: 0, // optional height: 0, // optional - quality: 0 // optional + quality: -1 // optional ); \ No newline at end of file diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 5f5c5d7..1e67186 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Avatars; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 2e5e4b6..5b7d8ba 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -5,7 +5,7 @@ use Appwrite\Services\Avatars; use Appwrite\Enums\Flag; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with @@ -15,5 +15,5 @@ $result = $avatars->getFlag( code: Flag::AFGHANISTAN(), width: 0, // optional height: 0, // optional - quality: 0 // optional + quality: -1 // optional ); \ No newline at end of file diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 0ab77fe..e155545 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Avatars; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 2bd0bbe..d84e23a 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Avatars; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 05f8128..0d5936a 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Avatars; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 823dd03..805d022 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index ae886b9..700d971 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index fb3ce70..dd2fcec 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index f68ea81..8726b37 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -4,9 +4,10 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setSession(''); // The user session to authenticate with + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setSession('') // The user session to authenticate with + ->setKey('') // Your secret API key + ->setJWT(''); // Your secret JSON Web Token $databases = new Databases($client); diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md new file mode 100644 index 0000000..96008e2 --- /dev/null +++ b/docs/examples/databases/create-documents.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setKey(''); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createDocuments( + databaseId: '', + collectionId: '', + documents: [] +); \ No newline at end of file diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index b2f7770..1274a4b 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index de2553c..9abf2df 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index ad534aa..e6eecb5 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 7f95d3f..9e8a221 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -5,7 +5,7 @@ use Appwrite\Services\Databases; use Appwrite\Enums\IndexType; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key @@ -17,5 +17,6 @@ $result = $databases->createIndex( key: '', type: IndexType::KEY(), attributes: [], - orders: [] // optional + orders: [], // optional + lengths: [] // optional ); \ No newline at end of file diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index fb48118..1dbeefa 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index d40e237..f42717c 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 4b353f1..caccd36 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -5,7 +5,7 @@ use Appwrite\Services\Databases; use Appwrite\Enums\RelationshipType; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index a04dfba..5a4f72b 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index bfa8af0..6b9bc80 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 3b9881a..73c6188 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 2db4c76..71b7162 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 4af5130..4e98dfd 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 05a3abb..def7f24 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md new file mode 100644 index 0000000..3552d85 --- /dev/null +++ b/docs/examples/databases/delete-documents.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteDocuments( + databaseId: '', + collectionId: '', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 67cda12..79e476b 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 2480a7c..c796b7c 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index a9dad4b..ba82db4 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index deeddec..ecddab0 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 851e2d5..a3204c5 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index a6e60f5..e9c6307 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 7234b23..9aa6395 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index fb53eae..3105fc4 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 941e4a6..533b26a 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 6ccddf6..07183ac 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index b3935fc..65b45da 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index d5d078f..6bba74d 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 133fbb8..2e4bee7 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 790bb2b..dd030c0 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 4773e54..b1a03ec 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index a1b7018..f1c8a34 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md new file mode 100644 index 0000000..51b4e18 --- /dev/null +++ b/docs/examples/databases/update-documents.md @@ -0,0 +1,18 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateDocuments( + databaseId: '', + collectionId: '', + data: [], // optional + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 9c1bdb4..dc9865f 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 88229bc..f7cd0b7 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 39ad3b1..51f6ec9 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index af4957a..bdbd96c 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index e88e75c..130cd0c 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 0afaea2..01783cf 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 721ba32..e0c8f99 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 1825e55..c200463 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index d9bf5e9..9b0b078 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Databases; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md new file mode 100644 index 0000000..7b9459e --- /dev/null +++ b/docs/examples/databases/upsert-documents.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->upsertDocuments( + databaseId: '', + collectionId: '', + documents: [] // optional +); \ No newline at end of file diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 90f4c7e..7e48b89 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -5,7 +5,7 @@ use Appwrite\InputFile; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-duplicate-deployment.md similarity index 72% rename from docs/examples/functions/create-build.md rename to docs/examples/functions/create-duplicate-deployment.md index 429653c..a898762 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -4,13 +4,13 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key $functions = new Functions($client); -$result = $functions->createBuild( +$result = $functions->createDuplicateDeployment( functionId: '', deploymentId: '', buildId: '' // optional diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 4c62b9a..9aeb976 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md new file mode 100644 index 0000000..9d22bdc --- /dev/null +++ b/docs/examples/functions/create-template-deployment.md @@ -0,0 +1,20 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createTemplateDeployment( + functionId: '', + repository: '', + owner: '', + rootDirectory: '', + version: '', + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index fc1ee4a..ec470d5 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key @@ -13,5 +13,6 @@ $functions = new Functions($client); $result = $functions->createVariable( functionId: '', key: '', - value: '' + value: '', + secret: false // optional ); \ No newline at end of file diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000..bb4622e --- /dev/null +++ b/docs/examples/functions/create-vcs-deployment.md @@ -0,0 +1,19 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createVcsDeployment( + functionId: '', + type: VCSDeploymentType::BRANCH(), + reference: '', + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 6b16c59..3d37b80 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -5,7 +5,7 @@ use Appwrite\Services\Functions; use Appwrite\Enums\; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key @@ -29,9 +29,5 @@ $result = $functions->create( providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional - templateRepository: '', // optional - templateOwner: '', // optional - templateRootDirectory: '', // optional - templateVersion: '', // optional specification: '' // optional ); \ No newline at end of file diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 23439f2..20285d7 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 4fbef18..e55a8b1 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 344506b..e1fb391 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 6596754..9f87f5c 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 4103ec8..7b3e187 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key @@ -12,5 +12,6 @@ $functions = new Functions($client); $result = $functions->getDeploymentDownload( functionId: '', - deploymentId: '' + deploymentId: '', + type: DeploymentDownloadType::SOURCE() // optional ); \ No newline at end of file diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 73d7081..945933b 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 9bb8d6a..7dfeeed 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index cdb5ce9..4c8d3d6 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index d249ce7..ca2160f 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 9046c18..7bbaa0e 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 05e60a0..77a8ba7 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with @@ -12,6 +12,5 @@ $functions = new Functions($client); $result = $functions->listExecutions( functionId: '', - queries: [], // optional - search: '' // optional + queries: [] // optional ); \ No newline at end of file diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 1d22978..6c77c42 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index e68a4b0..eec5c33 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index b9687a4..f85e854 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 22aa3cf..de914af 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-status.md similarity index 71% rename from docs/examples/functions/update-deployment-build.md rename to docs/examples/functions/update-deployment-status.md index 98f2a3a..de36d4e 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-status.md @@ -4,13 +4,13 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key $functions = new Functions($client); -$result = $functions->updateDeploymentBuild( +$result = $functions->updateDeploymentStatus( functionId: '', deploymentId: '' ); \ No newline at end of file diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-function-deployment.md similarity index 70% rename from docs/examples/functions/update-deployment.md rename to docs/examples/functions/update-function-deployment.md index 9c6ad6d..38ba026 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -4,13 +4,13 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key $functions = new Functions($client); -$result = $functions->updateDeployment( +$result = $functions->updateFunctionDeployment( functionId: '', deploymentId: '' ); \ No newline at end of file diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index b1b5008..b15597a 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key @@ -14,5 +14,6 @@ $result = $functions->updateVariable( functionId: '', variableId: '', key: '', - value: '' // optional + value: '', // optional + secret: false // optional ); \ No newline at end of file diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 8f84ca8..ea8d863 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Functions; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 1a0da4a..c349bc2 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Graphql; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index eea9e8f..e6e277c 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Graphql; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 1f0dd2f..4721064 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 4755d69..2e81dae 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 1f0cda4..408581b 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index fec1daa..cfec70e 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 8e331bc..02959db 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -5,7 +5,7 @@ use Appwrite\Services\Health; use Appwrite\Enums\; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index fb266b1..1c346ca 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 7886dfb..8c1f774 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index b00611e..92fb79a 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 81e8442..745b469 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index fe51b07..d395268 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index e6ee688..1a5bea2 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 4c9b0cd..cf5e3b9 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 02d4ed2..132dfa6 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index ec69788..fd5fdb1 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index f52f78a..6811018 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index fd9d421..d0bd6c0 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 018e8ac..627a85c 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 7e7af12..d6ccd7c 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 0c26902..041d249 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index abfc5bb..377416e 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 4577be3..aa26993 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index 514d083..fec3e3f 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Health; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 82247d4..ef4c043 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Locale; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index a88c2b6..273fad0 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Locale; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index e861ece..e8c7ca4 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Locale; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 2b8bf7e..c5dd1d2 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Locale; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index fba9ff8..7585c10 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Locale; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 60801b4..63a2e0b 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Locale; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 5fb1667..d385018 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Locale; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index aec67ca..f0ca4d4 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Locale; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index bdc5d7f..da13d17 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index fe51bf1..9de2487 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 7252fde..baf72a1 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 72f3360..6c62ee8 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index bb7a79a..1eb954a 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 9aaf6ad..46aeeb3 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 53381f6..892d856 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 8c0cb79..1e2d9ac 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index fd771fa..4dcfb3a 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index c0324ab..3516fa3 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setJWT(''); // Your secret JSON Web Token diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 89e17a1..9006918 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 0e0c868..5215d52 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 79e3d26..e94141c 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index f370df2..c356828 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 4663b05..adeacbc 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index a3d8d47..f37d18b 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index a5f7eb7..f7a8425 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setJWT(''); // Your secret JSON Web Token diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 7333a8d..2ec899b 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index b9b3380..5781838 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index c6ff233..cf92221 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 1d29307..d19f5c6 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 503e701..e2a0d7e 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 3277168..fc06cbb 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 283b2a7..0323137 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index a4190e6..965fe08 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index bf80f20..761bb96 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 1dc0e3c..614e9c5 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index c0c88d6..c710575 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 7597ad8..d2625cd 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 1825a08..1112d28 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 1ab8c36..3bbb35a 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index cfcba97..debb363 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index d717755..724453b 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index d3b6569..dd0f645 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 9a80b44..36672f4 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 7891cb5..c99ebc7 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 98f4f13..f6f557c 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 7546fc8..e1df0b9 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 2820e2e..b8473c1 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index a342b7a..730da41 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 66dde3e..a16a630 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 3c1b760..29a54bf 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 3328ac7..e6a1ed1 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 5669e5f..b1f9a32 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 07b7a2e..def821a 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index ba7f530..0841e28 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Messaging; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md new file mode 100644 index 0000000..30770b7 --- /dev/null +++ b/docs/examples/sites/create-deployment.md @@ -0,0 +1,21 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createDeployment( + siteId: '', + code: InputFile::withPath('file.png'), + activate: false, + installCommand: '', // optional + buildCommand: '', // optional + outputDirectory: '' // optional +); \ No newline at end of file diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000..84f65cd --- /dev/null +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createDuplicateDeployment( + siteId: '', + deploymentId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md new file mode 100644 index 0000000..f2d1f3c --- /dev/null +++ b/docs/examples/sites/create-template-deployment.md @@ -0,0 +1,20 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createTemplateDeployment( + siteId: '', + repository: '', + owner: '', + rootDirectory: '', + version: '', + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md new file mode 100644 index 0000000..3097e19 --- /dev/null +++ b/docs/examples/sites/create-variable.md @@ -0,0 +1,18 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createVariable( + siteId: '', + key: '', + value: '', + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000..7f63dff --- /dev/null +++ b/docs/examples/sites/create-vcs-deployment.md @@ -0,0 +1,19 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createVcsDeployment( + siteId: '', + type: VCSDeploymentType::BRANCH(), + reference: '', + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md new file mode 100644 index 0000000..4a1c3a4 --- /dev/null +++ b/docs/examples/sites/create.md @@ -0,0 +1,34 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->create( + siteId: '', + name: '', + framework: ::ANALOG(), + buildRuntime: ::NODE145(), + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '', // optional + buildCommand: '', // optional + outputDirectory: '', // optional + adapter: ::STATIC(), // optional + installationId: '', // optional + fallbackFile: '', // optional + providerRepositoryId: '', // optional + providerBranch: '', // optional + providerSilentMode: false, // optional + providerRootDirectory: '', // optional + specification: '' // optional +); \ No newline at end of file diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md new file mode 100644 index 0000000..4e24748 --- /dev/null +++ b/docs/examples/sites/delete-deployment.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteDeployment( + siteId: '', + deploymentId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md new file mode 100644 index 0000000..b6e3064 --- /dev/null +++ b/docs/examples/sites/delete-log.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteLog( + siteId: '', + logId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md new file mode 100644 index 0000000..6632543 --- /dev/null +++ b/docs/examples/sites/delete-variable.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteVariable( + siteId: '', + variableId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md new file mode 100644 index 0000000..8e6363a --- /dev/null +++ b/docs/examples/sites/delete.md @@ -0,0 +1,15 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->delete( + siteId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md new file mode 100644 index 0000000..91c6b6e --- /dev/null +++ b/docs/examples/sites/get-deployment-download.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getDeploymentDownload( + siteId: '', + deploymentId: '', + type: DeploymentDownloadType::SOURCE() // optional +); \ No newline at end of file diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md new file mode 100644 index 0000000..19525d9 --- /dev/null +++ b/docs/examples/sites/get-deployment.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getDeployment( + siteId: '', + deploymentId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md new file mode 100644 index 0000000..5ceb2b9 --- /dev/null +++ b/docs/examples/sites/get-log.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getLog( + siteId: '', + logId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md new file mode 100644 index 0000000..0cab412 --- /dev/null +++ b/docs/examples/sites/get-variable.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getVariable( + siteId: '', + variableId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md new file mode 100644 index 0000000..e5ec061 --- /dev/null +++ b/docs/examples/sites/get.md @@ -0,0 +1,15 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->get( + siteId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md new file mode 100644 index 0000000..4d687ec --- /dev/null +++ b/docs/examples/sites/list-deployments.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listDeployments( + siteId: '', + queries: [], // optional + search: '' // optional +); \ No newline at end of file diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md new file mode 100644 index 0000000..87df92d --- /dev/null +++ b/docs/examples/sites/list-frameworks.md @@ -0,0 +1,13 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listFrameworks(); diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md new file mode 100644 index 0000000..5674e98 --- /dev/null +++ b/docs/examples/sites/list-logs.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listLogs( + siteId: '', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md new file mode 100644 index 0000000..42dae1b --- /dev/null +++ b/docs/examples/sites/list-specifications.md @@ -0,0 +1,13 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listSpecifications(); diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md new file mode 100644 index 0000000..36aad64 --- /dev/null +++ b/docs/examples/sites/list-variables.md @@ -0,0 +1,15 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listVariables( + siteId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md new file mode 100644 index 0000000..4e16c69 --- /dev/null +++ b/docs/examples/sites/list.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->list( + queries: [], // optional + search: '' // optional +); \ No newline at end of file diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md new file mode 100644 index 0000000..2714b35 --- /dev/null +++ b/docs/examples/sites/update-deployment-status.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateDeploymentStatus( + siteId: '', + deploymentId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md new file mode 100644 index 0000000..6e2614c --- /dev/null +++ b/docs/examples/sites/update-site-deployment.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateSiteDeployment( + siteId: '', + deploymentId: '' +); \ No newline at end of file diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md new file mode 100644 index 0000000..84bafe2 --- /dev/null +++ b/docs/examples/sites/update-variable.md @@ -0,0 +1,19 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateVariable( + siteId: '', + variableId: '', + key: '', + value: '', // optional + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md new file mode 100644 index 0000000..f2ca54a --- /dev/null +++ b/docs/examples/sites/update.md @@ -0,0 +1,33 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->update( + siteId: '', + name: '', + framework: ::ANALOG(), + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '', // optional + buildCommand: '', // optional + outputDirectory: '', // optional + buildRuntime: ::NODE145(), // optional + adapter: ::STATIC(), // optional + fallbackFile: '', // optional + installationId: '', // optional + providerRepositoryId: '', // optional + providerBranch: '', // optional + providerSilentMode: false, // optional + providerRootDirectory: '', // optional + specification: '' // optional +); \ No newline at end of file diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 0c8ef0f..cd17ffe 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index a948546..2d13305 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -5,7 +5,7 @@ use Appwrite\InputFile; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 7843318..50adf35 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 4274c25..d4c45eb 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 85a5b75..e62c43d 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 72be0f6..defefa5 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with @@ -12,5 +12,6 @@ $storage = new Storage($client); $result = $storage->getFileDownload( bucketId: '', - fileId: '' + fileId: '', + token: '' // optional ); \ No newline at end of file diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index aef4f4a..0b65fc3 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with @@ -16,12 +16,13 @@ $result = $storage->getFilePreview( width: 0, // optional height: 0, // optional gravity: ImageGravity::CENTER(), // optional - quality: 0, // optional + quality: -1, // optional borderWidth: 0, // optional borderColor: '', // optional borderRadius: 0, // optional opacity: 0, // optional rotation: -360, // optional background: '', // optional - output: ImageFormat::JPG() // optional + output: ImageFormat::JPG(), // optional + token: '' // optional ); \ No newline at end of file diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 782e49b..dfc84ca 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with @@ -12,5 +12,6 @@ $storage = new Storage($client); $result = $storage->getFileView( bucketId: '', - fileId: '' + fileId: '', + token: '' // optional ); \ No newline at end of file diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 80196a5..6964144 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index a53eb91..a4538c6 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 767fe86..ede0e7c 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index e4a0f5d..1517e36 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 506593f..7b467ac 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Storage; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 51b1795..285368f 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 3cc6b19..643fa0e 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 04f4056..579b790 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 7344645..9db4e7e 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 5f4bd63..bd6cbe8 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 27f6e06..fbade4f 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index f1ce134..0dafa8a 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 9d0c988..817ea7f 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 7ab8f81..99d9895 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 6179020..5dbfd4c 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 3b6cafa..10f135b 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 62768a9..bc13d92 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index ec52ac0..bd8d9de 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Teams; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setSession(''); // The user session to authenticate with diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md new file mode 100644 index 0000000..e4f2302 --- /dev/null +++ b/docs/examples/tokens/create-file-token.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->createFileToken( + bucketId: '', + fileId: '', + expire: '' // optional +); \ No newline at end of file diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md new file mode 100644 index 0000000..278be90 --- /dev/null +++ b/docs/examples/tokens/delete.md @@ -0,0 +1,15 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->delete( + tokenId: '' +); \ No newline at end of file diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md new file mode 100644 index 0000000..e7b4e10 --- /dev/null +++ b/docs/examples/tokens/get.md @@ -0,0 +1,15 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->get( + tokenId: '' +); \ No newline at end of file diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md new file mode 100644 index 0000000..b89420b --- /dev/null +++ b/docs/examples/tokens/list.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->list( + bucketId: '', + fileId: '', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md new file mode 100644 index 0000000..ea95322 --- /dev/null +++ b/docs/examples/tokens/update.md @@ -0,0 +1,16 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->update( + tokenId: '', + expire: '' // optional +); \ No newline at end of file diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index a482b5d..a9166ef 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index af71dcd..c9fd81e 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index 994cdc3..1c1c6d4 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 13bb884..696cbbe 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index faec234..372fb1b 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index da0889d..d56c465 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index ecb9af7..0b9a27e 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index d1c9906..f579efb 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 3c833b0..b406b94 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 498e161..1589315 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 999cae1..57946a4 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -5,7 +5,7 @@ use Appwrite\Services\Users; use Appwrite\Enums\MessagingProviderType; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 9d8e163..1b92f51 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 16549ae..595f24f 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 9ca1556..26b71ee 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 94a9e04..8ef1279 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -5,7 +5,7 @@ use Appwrite\Services\Users; use Appwrite\Enums\AuthenticatorType; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index e711a92..493cf53 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 3b46021..cd6d11e 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 6b9975d..0d85d3e 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index f1dbbf3..883156e 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index b0e3a75..db090fb 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 59589f7..5e99e14 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index ba146a3..31baf3c 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 4ff399b..0ce39ae 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 53ba78d..fd15b7b 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 434dbaf..7aea2dc 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index addc6b7..53c4b1b 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -4,12 +4,14 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key $users = new Users($client); $result = $users->listMemberships( - userId: '' + userId: '', + queries: [], // optional + search: '' // optional ); \ No newline at end of file diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 0d137aa..6a0088c 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 5dcac1f..bdbd0e5 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index a91ac5e..005d51a 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 9b8d1d5..0421736 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index e74e887..636f1d2 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index fc40fac..21ec88b 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 45fe23b..7d4ae5d 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 369c248..75214de 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 5df7aa2..3eda496 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 7050d19..09bb07c 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 8dcb57b..6d58605 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 12e44da..019fb3f 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 95c3115..13bd41b 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 2ffd938..9491239 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 28a0532..f29dc95 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index a1b654d..00ad27b 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -4,7 +4,7 @@ use Appwrite\Client; use Appwrite\Services\Users; $client = (new Client()) - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key diff --git a/docs/functions.md b/docs/functions.md index 0ec5677..4e55bba 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -11,7 +11,7 @@ GET https://cloud.appwrite.io/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/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, entrypoint, commands, installationId | [] | +| 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, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId | [] | | search | string | Search term to filter your list results. Max length: 256 chars. | | @@ -33,7 +33,7 @@ POST https://cloud.appwrite.io/v1/functions | schedule | string | Schedule CRON syntax. | | | timeout | integer | Function maximum execution time in seconds. | 15 | | enabled | boolean | Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. | 1 | -| logging | boolean | Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. | 1 | +| logging | boolean | When disabled, executions will exclude logs and errors, and will be slightly faster. | 1 | | entrypoint | string | Entrypoint File. This path is relative to the "providerRootDirectory". | | | commands | string | Build Commands. | | | scopes | array | List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. | [] | @@ -42,10 +42,6 @@ POST https://cloud.appwrite.io/v1/functions | providerBranch | string | Production branch for the repo linked to the function. | | | providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. | | | providerRootDirectory | string | Path to function code in the linked repo. | | -| templateRepository | string | Repository name of the template. | | -| templateOwner | string | The name of the owner of the template. | | -| templateRootDirectory | string | Path to function code in the template repo. | | -| templateVersion | string | Version (tag) for the repo linked to the function template. | | | specification | string | Runtime specification for the function and builds. | s-1vcpu-512mb | @@ -60,8 +56,7 @@ GET https://cloud.appwrite.io/v1/functions/runtimes GET https://cloud.appwrite.io/v1/functions/specifications ``` -** List allowed function specifications for this instance. - ** +** List allowed function specifications for this instance. ** ```http request @@ -95,7 +90,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId} | schedule | string | Schedule CRON syntax. | | | timeout | integer | Maximum execution time in seconds. | 15 | | enabled | boolean | Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. | 1 | -| logging | boolean | Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. | 1 | +| logging | boolean | When disabled, executions will exclude logs and errors, and will be slightly faster. | 1 | | entrypoint | string | Entrypoint File. This path is relative to the "providerRootDirectory". | | | commands | string | Build Commands. | | | scopes | array | List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. | [] | @@ -120,18 +115,32 @@ DELETE https://cloud.appwrite.io/v1/functions/{functionId} | functionId | string | **Required** Function ID. | | +```http request +PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployment +``` + +** Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function ID. | | +| deploymentId | string | Deployment ID. | | + + ```http request GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments ``` -** Get a list of all the project's code deployments. You can use the query params to filter your results. ** +** Get a list of all the function's code deployments. You can use the query params to filter your results. ** ### Parameters | 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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: size, buildId, activate, entrypoint, commands, type, size | [] | +| 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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type | [] | | search | string | Search term to filter your list results. Max length: 256 chars. | | @@ -157,52 +166,63 @@ Use the "command" param to set the entrypoint used to execute your cod ```http request -GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId} +POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments/duplicate ``` -** Get a code deployment by its unique ID. ** +** Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** ### Parameters | Field Name | Type | Description | Default | | --- | --- | --- | --- | | functionId | string | **Required** Function ID. | | -| deploymentId | string | **Required** Deployment ID. | | +| deploymentId | string | Deployment ID. | | +| buildId | string | Build unique ID. | | ```http request -PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId} +POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments/template ``` -** Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint. ** +** Create a deployment based on a template. + +Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. ** ### Parameters | Field Name | Type | Description | Default | | --- | --- | --- | --- | | functionId | string | **Required** Function ID. | | -| deploymentId | string | **Required** Deployment ID. | | +| repository | string | Repository name of the template. | | +| owner | string | The name of the owner of the template. | | +| rootDirectory | string | Path to function code in the template repo. | | +| version | string | Version (tag) for the repo linked to the function template. | | +| activate | boolean | Automatically activate the deployment when it is finished building. | | ```http request -DELETE https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId} +POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments/vcs ``` -** Delete a code deployment by its unique ID. ** +** Create a deployment when a function is connected to VCS. + +This endpoint lets you create deployment from a branch, commit, or a tag. ** ### Parameters | Field Name | Type | Description | Default | | --- | --- | --- | --- | | functionId | string | **Required** Function ID. | | -| deploymentId | string | **Required** Deployment ID. | | +| type | string | Type of reference passed. Allowed values are: branch, commit | | +| reference | string | VCS reference to create deployment from. Depending on type this can be: branch name, commit hash | | +| activate | boolean | Automatically activate the deployment when it is finished building. | | ```http request -POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId}/build +GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId} ``` -** Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** +** Get a function deployment by its unique ID. ** ### Parameters @@ -210,14 +230,13 @@ POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deployment | --- | --- | --- | --- | | functionId | string | **Required** Function ID. | | | deploymentId | string | **Required** Deployment ID. | | -| buildId | string | Build unique ID. | | ```http request -PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId}/build +DELETE https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId} ``` -** Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** +** Delete a code deployment by its unique ID. ** ### Parameters @@ -231,7 +250,22 @@ PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymen GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId}/download ``` -** Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. ** +** Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function ID. | | +| deploymentId | string | **Required** Deployment ID. | | +| type | string | Deployment file to download. Can be: "source", "output". | source | + + +```http request +PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId}/status +``` + +** Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** ### Parameters @@ -253,7 +287,6 @@ GET https://cloud.appwrite.io/v1/functions/{functionId}/executions | --- | --- | --- | --- | | 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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId | [] | -| search | string | Search term to filter your list results. Max length: 256 chars. | | ```http request @@ -293,8 +326,7 @@ GET https://cloud.appwrite.io/v1/functions/{functionId}/executions/{executionId} DELETE https://cloud.appwrite.io/v1/functions/{functionId}/executions/{executionId} ``` -** Delete a function execution by its unique ID. - ** +** Delete a function execution by its unique ID. ** ### Parameters @@ -330,6 +362,7 @@ POST https://cloud.appwrite.io/v1/functions/{functionId}/variables | functionId | string | **Required** Function unique ID. | | | key | string | Variable key. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | +| secret | boolean | Secret variables can be updated or deleted, but only functions can read them during build and runtime. | 1 | ```http request @@ -360,6 +393,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId}/variables/{variableId} | variableId | string | **Required** Variable unique ID. | | | key | string | Variable key. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | +| secret | boolean | Secret variables can be updated or deleted, but only functions can read them during build and runtime. | | ```http request diff --git a/docs/sites.md b/docs/sites.md new file mode 100644 index 0000000..71ef1a0 --- /dev/null +++ b/docs/sites.md @@ -0,0 +1,388 @@ +# Sites Service + + +```http request +GET https://cloud.appwrite.io/v1/sites +``` + +** Get a list of all the project's sites. You can use the query params to filter your results. ** + +### Parameters + +| 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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId | [] | +| search | string | Search term to filter your list results. Max length: 256 chars. | | + + +```http request +POST https://cloud.appwrite.io/v1/sites +``` + +** Create a new site. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | Site 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 | Site name. Max length: 128 chars. | | +| framework | string | Sites framework. | | +| enabled | boolean | Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. | 1 | +| logging | boolean | When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. | 1 | +| timeout | integer | Maximum request time in seconds. | 30 | +| installCommand | string | Install Command. | | +| buildCommand | string | Build Command. | | +| outputDirectory | string | Output Directory for site. | | +| buildRuntime | string | Runtime to use during build step. | | +| adapter | string | Framework adapter defining rendering strategy. Allowed values are: static, ssr | | +| installationId | string | Appwrite Installation ID for VCS (Version Control System) deployment. | | +| fallbackFile | string | Fallback file for single page application sites. | | +| providerRepositoryId | string | Repository ID of the repo linked to the site. | | +| providerBranch | string | Production branch for the repo linked to the site. | | +| providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. | | +| providerRootDirectory | string | Path to site code in the linked repo. | | +| specification | string | Framework specification for the site and builds. | s-1vcpu-512mb | + + +```http request +GET https://cloud.appwrite.io/v1/sites/frameworks +``` + +** Get a list of all frameworks that are currently available on the server instance. ** + + +```http request +GET https://cloud.appwrite.io/v1/sites/specifications +``` + +** List allowed site specifications for this instance. ** + + +```http request +GET https://cloud.appwrite.io/v1/sites/{siteId} +``` + +** Get a site by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | + + +```http request +PUT https://cloud.appwrite.io/v1/sites/{siteId} +``` + +** Update site by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| name | string | Site name. Max length: 128 chars. | | +| framework | string | Sites framework. | | +| enabled | boolean | Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. | 1 | +| logging | boolean | When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. | 1 | +| timeout | integer | Maximum request time in seconds. | 30 | +| installCommand | string | Install Command. | | +| buildCommand | string | Build Command. | | +| outputDirectory | string | Output Directory for site. | | +| buildRuntime | string | Runtime to use during build step. | | +| adapter | string | Framework adapter defining rendering strategy. Allowed values are: static, ssr | | +| fallbackFile | string | Fallback file for single page application sites. | | +| installationId | string | Appwrite Installation ID for VCS (Version Control System) deployment. | | +| providerRepositoryId | string | Repository ID of the repo linked to the site. | | +| providerBranch | string | Production branch for the repo linked to the site. | | +| providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. | | +| providerRootDirectory | string | Path to site code in the linked repo. | | +| specification | string | Framework specification for the site and builds. | s-1vcpu-512mb | + + +```http request +DELETE https://cloud.appwrite.io/v1/sites/{siteId} +``` + +** Delete a site by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | + + +```http request +PATCH https://cloud.appwrite.io/v1/sites/{siteId}/deployment +``` + +** Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| deploymentId | string | Deployment ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments +``` + +** Get a list of all the site's code deployments. You can use the query params to filter your results. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| 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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type | [] | +| search | string | Search term to filter your list results. Max length: 256 chars. | | + + +```http request +POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments +``` + +** Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| installCommand | string | Install Commands. | | +| buildCommand | string | Build Commands. | | +| outputDirectory | string | Output Directory. | | +| code | file | Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. | | +| activate | boolean | Automatically activate the deployment when it is finished building. | | + + +```http request +POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments/duplicate +``` + +** Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| deploymentId | string | Deployment ID. | | + + +```http request +POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments/template +``` + +** Create a deployment based on a template. + +Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| repository | string | Repository name of the template. | | +| owner | string | The name of the owner of the template. | | +| rootDirectory | string | Path to site code in the template repo. | | +| version | string | Version (tag) for the repo linked to the site template. | | +| activate | boolean | Automatically activate the deployment when it is finished building. | | + + +```http request +POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments/vcs +``` + +** Create a deployment when a site is connected to VCS. + +This endpoint lets you create deployment from a branch, commit, or a tag. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| type | string | Type of reference passed. Allowed values are: branch, commit | | +| reference | string | VCS reference to create deployment from. Depending on type this can be: branch name, commit hash | | +| activate | boolean | Automatically activate the deployment when it is finished building. | | + + +```http request +GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId} +``` + +** Get a site deployment by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| deploymentId | string | **Required** Deployment ID. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId} +``` + +** Delete a site deployment by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| deploymentId | string | **Required** Deployment ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/download +``` + +** Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| deploymentId | string | **Required** Deployment ID. | | +| type | string | Deployment file to download. Can be: "source", "output". | source | + + +```http request +PATCH https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/status +``` + +** Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| deploymentId | string | **Required** Deployment ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/sites/{siteId}/logs +``` + +** Get a list of all site logs. You can use the query params to filter your results. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| 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, responseStatusCode, duration, requestMethod, requestPath, deploymentId | [] | + + +```http request +GET https://cloud.appwrite.io/v1/sites/{siteId}/logs/{logId} +``` + +** Get a site request log by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| logId | string | **Required** Log ID. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/sites/{siteId}/logs/{logId} +``` + +** Delete a site log by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site ID. | | +| logId | string | **Required** Log ID. | | + + +```http request +GET https://cloud.appwrite.io/v1/sites/{siteId}/variables +``` + +** Get a list of all variables of a specific site. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site unique ID. | | + + +```http request +POST https://cloud.appwrite.io/v1/sites/{siteId}/variables +``` + +** Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site unique ID. | | +| key | string | Variable key. Max length: 255 chars. | | +| value | string | Variable value. Max length: 8192 chars. | | +| secret | boolean | Secret variables can be updated or deleted, but only sites can read them during build and runtime. | 1 | + + +```http request +GET https://cloud.appwrite.io/v1/sites/{siteId}/variables/{variableId} +``` + +** Get a variable by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site unique ID. | | +| variableId | string | **Required** Variable unique ID. | | + + +```http request +PUT https://cloud.appwrite.io/v1/sites/{siteId}/variables/{variableId} +``` + +** Update variable by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site unique ID. | | +| variableId | string | **Required** Variable unique ID. | | +| key | string | Variable key. Max length: 255 chars. | | +| value | string | Variable value. Max length: 8192 chars. | | +| secret | boolean | Secret variables can be updated or deleted, but only sites can read them during build and runtime. | | + + +```http request +DELETE https://cloud.appwrite.io/v1/sites/{siteId}/variables/{variableId} +``` + +** Delete a variable by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| siteId | string | **Required** Site unique ID. | | +| variableId | string | **Required** Variable unique ID. | | + diff --git a/docs/storage.md b/docs/storage.md index 10935d8..790718c 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -179,6 +179,7 @@ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/downl | --- | --- | --- | --- | | bucketId | string | **Required** Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | | | fileId | string | **Required** File ID. | | +| token | string | File token for accessing this file. | | ```http request @@ -196,7 +197,7 @@ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/previ | width | integer | Resize preview image width, Pass an integer between 0 to 4000. | 0 | | height | integer | Resize preview image height, Pass an integer between 0 to 4000. | 0 | | gravity | string | Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right | center | -| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | +| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. | -1 | | borderWidth | integer | Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. | 0 | | borderColor | string | Preview image border color. Use a valid HEX color, no # is needed for prefix. | | | borderRadius | integer | Preview image border radius in pixels. Pass an integer between 0 to 4000. | 0 | @@ -204,6 +205,7 @@ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/previ | rotation | integer | Preview image rotation in degrees. Pass an integer between -360 and 360. | 0 | | background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | | | output | string | Output format type (jpeg, jpg, png, gif and webp). | | +| token | string | File token for accessing this file. | | ```http request @@ -218,4 +220,5 @@ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/view | --- | --- | --- | --- | | bucketId | string | **Required** Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | | | fileId | string | **Required** File ID. | | +| token | string | File token for accessing this file. | | diff --git a/docs/teams.md b/docs/teams.md index 856f6c0..5661af4 100644 --- a/docs/teams.md +++ b/docs/teams.md @@ -81,7 +81,7 @@ GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships | Field Name | Type | Description | Default | | --- | --- | --- | --- | | teamId | string | **Required** Team ID. | | -| 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: userId, teamId, invited, joined, confirm | [] | +| 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: userId, teamId, invited, joined, confirm, roles | [] | | search | string | Search term to filter your list results. Max length: 256 chars. | | diff --git a/docs/tokens.md b/docs/tokens.md new file mode 100644 index 0000000..ba4c5df --- /dev/null +++ b/docs/tokens.md @@ -0,0 +1,72 @@ +# Tokens Service + + +```http request +GET https://cloud.appwrite.io/v1/tokens/buckets/{bucketId}/files/{fileId} +``` + +** List all the tokens created for a specific file or bucket. You can use the query params to filter your results. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| bucketId | string | **Required** Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | | +| fileId | string | **Required** File unique ID. | | +| 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: expire | [] | + + +```http request +POST https://cloud.appwrite.io/v1/tokens/buckets/{bucketId}/files/{fileId} +``` + +** Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| bucketId | string | **Required** Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | | +| fileId | string | **Required** File unique ID. | | +| expire | string | Token expiry date | | + + +```http request +GET https://cloud.appwrite.io/v1/tokens/{tokenId} +``` + +** Get a token by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| tokenId | string | **Required** Token ID. | | + + +```http request +PATCH https://cloud.appwrite.io/v1/tokens/{tokenId} +``` + +** Update a token by its unique ID. Use this endpoint to update a token's expiry date. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| tokenId | string | **Required** Token unique ID. | | +| expire | string | File token expiry date | | + + +```http request +DELETE https://cloud.appwrite.io/v1/tokens/{tokenId} +``` + +** Delete a token by its unique ID. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| tokenId | string | **Required** Token ID. | | + diff --git a/docs/users.md b/docs/users.md index 6d3ec8e..89c3cba 100644 --- a/docs/users.md +++ b/docs/users.md @@ -276,6 +276,8 @@ GET https://cloud.appwrite.io/v1/users/{userId}/memberships | Field Name | Type | Description | Default | | --- | --- | --- | --- | | userId | string | **Required** User ID. | | +| 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: userId, teamId, invited, joined, confirm, roles | [] | +| search | string | Search term to filter your list results. Max length: 256 chars. | | ```http request diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 20ae1fa..27f8cca 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -37,11 +37,11 @@ class Client */ protected array $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/14.0.0 ()', + 'user-agent' => 'AppwritePHPSDK/15.0.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '14.0.0', + 'x-sdk-version'=> '15.0.0', ]; /** @@ -49,7 +49,7 @@ class Client */ public function __construct() { - $this->headers['X-Appwrite-Response-Format'] = '1.6.0'; + $this->headers['X-Appwrite-Response-Format'] = '1.7.0'; } diff --git a/src/Appwrite/Enums/Adapter.php b/src/Appwrite/Enums/Adapter.php new file mode 100644 index 0000000..0abdeed --- /dev/null +++ b/src/Appwrite/Enums/Adapter.php @@ -0,0 +1,43 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function STATIC(): Adapter + { + if (!isset(self::$STATIC)) { + self::$STATIC = new Adapter('static'); + } + return self::$STATIC; + } + public static function SSR(): Adapter + { + if (!isset(self::$SSR)) { + self::$SSR = new Adapter('ssr'); + } + return self::$SSR; + } +} \ No newline at end of file diff --git a/src/Appwrite/Enums/BuildRuntime.php b/src/Appwrite/Enums/BuildRuntime.php new file mode 100644 index 0000000..0c0936a --- /dev/null +++ b/src/Appwrite/Enums/BuildRuntime.php @@ -0,0 +1,531 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NODE145(): BuildRuntime + { + if (!isset(self::$NODE145)) { + self::$NODE145 = new BuildRuntime('node-14.5'); + } + return self::$NODE145; + } + public static function NODE160(): BuildRuntime + { + if (!isset(self::$NODE160)) { + self::$NODE160 = new BuildRuntime('node-16.0'); + } + return self::$NODE160; + } + public static function NODE180(): BuildRuntime + { + if (!isset(self::$NODE180)) { + self::$NODE180 = new BuildRuntime('node-18.0'); + } + return self::$NODE180; + } + public static function NODE190(): BuildRuntime + { + if (!isset(self::$NODE190)) { + self::$NODE190 = new BuildRuntime('node-19.0'); + } + return self::$NODE190; + } + public static function NODE200(): BuildRuntime + { + if (!isset(self::$NODE200)) { + self::$NODE200 = new BuildRuntime('node-20.0'); + } + return self::$NODE200; + } + public static function NODE210(): BuildRuntime + { + if (!isset(self::$NODE210)) { + self::$NODE210 = new BuildRuntime('node-21.0'); + } + return self::$NODE210; + } + public static function NODE22(): BuildRuntime + { + if (!isset(self::$NODE22)) { + self::$NODE22 = new BuildRuntime('node-22'); + } + return self::$NODE22; + } + public static function PHP80(): BuildRuntime + { + if (!isset(self::$PHP80)) { + self::$PHP80 = new BuildRuntime('php-8.0'); + } + return self::$PHP80; + } + public static function PHP81(): BuildRuntime + { + if (!isset(self::$PHP81)) { + self::$PHP81 = new BuildRuntime('php-8.1'); + } + return self::$PHP81; + } + public static function PHP82(): BuildRuntime + { + if (!isset(self::$PHP82)) { + self::$PHP82 = new BuildRuntime('php-8.2'); + } + return self::$PHP82; + } + public static function PHP83(): BuildRuntime + { + if (!isset(self::$PHP83)) { + self::$PHP83 = new BuildRuntime('php-8.3'); + } + return self::$PHP83; + } + public static function RUBY30(): BuildRuntime + { + if (!isset(self::$RUBY30)) { + self::$RUBY30 = new BuildRuntime('ruby-3.0'); + } + return self::$RUBY30; + } + public static function RUBY31(): BuildRuntime + { + if (!isset(self::$RUBY31)) { + self::$RUBY31 = new BuildRuntime('ruby-3.1'); + } + return self::$RUBY31; + } + public static function RUBY32(): BuildRuntime + { + if (!isset(self::$RUBY32)) { + self::$RUBY32 = new BuildRuntime('ruby-3.2'); + } + return self::$RUBY32; + } + public static function RUBY33(): BuildRuntime + { + if (!isset(self::$RUBY33)) { + self::$RUBY33 = new BuildRuntime('ruby-3.3'); + } + return self::$RUBY33; + } + public static function PYTHON38(): BuildRuntime + { + if (!isset(self::$PYTHON38)) { + self::$PYTHON38 = new BuildRuntime('python-3.8'); + } + return self::$PYTHON38; + } + public static function PYTHON39(): BuildRuntime + { + if (!isset(self::$PYTHON39)) { + self::$PYTHON39 = new BuildRuntime('python-3.9'); + } + return self::$PYTHON39; + } + public static function PYTHON310(): BuildRuntime + { + if (!isset(self::$PYTHON310)) { + self::$PYTHON310 = new BuildRuntime('python-3.10'); + } + return self::$PYTHON310; + } + public static function PYTHON311(): BuildRuntime + { + if (!isset(self::$PYTHON311)) { + self::$PYTHON311 = new BuildRuntime('python-3.11'); + } + return self::$PYTHON311; + } + public static function PYTHON312(): BuildRuntime + { + if (!isset(self::$PYTHON312)) { + self::$PYTHON312 = new BuildRuntime('python-3.12'); + } + return self::$PYTHON312; + } + public static function PYTHONML311(): BuildRuntime + { + if (!isset(self::$PYTHONML311)) { + self::$PYTHONML311 = new BuildRuntime('python-ml-3.11'); + } + return self::$PYTHONML311; + } + public static function PYTHONML312(): BuildRuntime + { + if (!isset(self::$PYTHONML312)) { + self::$PYTHONML312 = new BuildRuntime('python-ml-3.12'); + } + return self::$PYTHONML312; + } + 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)) { + self::$DENO140 = new BuildRuntime('deno-1.40'); + } + return self::$DENO140; + } + public static function DENO146(): BuildRuntime + { + if (!isset(self::$DENO146)) { + self::$DENO146 = new BuildRuntime('deno-1.46'); + } + return self::$DENO146; + } + public static function DENO20(): BuildRuntime + { + if (!isset(self::$DENO20)) { + self::$DENO20 = new BuildRuntime('deno-2.0'); + } + return self::$DENO20; + } + public static function DART215(): BuildRuntime + { + if (!isset(self::$DART215)) { + self::$DART215 = new BuildRuntime('dart-2.15'); + } + return self::$DART215; + } + public static function DART216(): BuildRuntime + { + if (!isset(self::$DART216)) { + self::$DART216 = new BuildRuntime('dart-2.16'); + } + return self::$DART216; + } + public static function DART217(): BuildRuntime + { + if (!isset(self::$DART217)) { + self::$DART217 = new BuildRuntime('dart-2.17'); + } + return self::$DART217; + } + public static function DART218(): BuildRuntime + { + if (!isset(self::$DART218)) { + self::$DART218 = new BuildRuntime('dart-2.18'); + } + return self::$DART218; + } + public static function DART219(): BuildRuntime + { + if (!isset(self::$DART219)) { + self::$DART219 = new BuildRuntime('dart-2.19'); + } + return self::$DART219; + } + public static function DART30(): BuildRuntime + { + if (!isset(self::$DART30)) { + self::$DART30 = new BuildRuntime('dart-3.0'); + } + return self::$DART30; + } + public static function DART31(): BuildRuntime + { + if (!isset(self::$DART31)) { + self::$DART31 = new BuildRuntime('dart-3.1'); + } + return self::$DART31; + } + public static function DART33(): BuildRuntime + { + if (!isset(self::$DART33)) { + self::$DART33 = new BuildRuntime('dart-3.3'); + } + return self::$DART33; + } + public static function DART35(): BuildRuntime + { + if (!isset(self::$DART35)) { + self::$DART35 = new BuildRuntime('dart-3.5'); + } + return self::$DART35; + } + public static function DOTNET60(): BuildRuntime + { + if (!isset(self::$DOTNET60)) { + self::$DOTNET60 = new BuildRuntime('dotnet-6.0'); + } + return self::$DOTNET60; + } + public static function DOTNET70(): BuildRuntime + { + if (!isset(self::$DOTNET70)) { + self::$DOTNET70 = new BuildRuntime('dotnet-7.0'); + } + return self::$DOTNET70; + } + public static function DOTNET80(): BuildRuntime + { + if (!isset(self::$DOTNET80)) { + self::$DOTNET80 = new BuildRuntime('dotnet-8.0'); + } + return self::$DOTNET80; + } + public static function JAVA80(): BuildRuntime + { + if (!isset(self::$JAVA80)) { + self::$JAVA80 = new BuildRuntime('java-8.0'); + } + return self::$JAVA80; + } + public static function JAVA110(): BuildRuntime + { + if (!isset(self::$JAVA110)) { + self::$JAVA110 = new BuildRuntime('java-11.0'); + } + return self::$JAVA110; + } + public static function JAVA170(): BuildRuntime + { + if (!isset(self::$JAVA170)) { + self::$JAVA170 = new BuildRuntime('java-17.0'); + } + return self::$JAVA170; + } + public static function JAVA180(): BuildRuntime + { + if (!isset(self::$JAVA180)) { + self::$JAVA180 = new BuildRuntime('java-18.0'); + } + return self::$JAVA180; + } + public static function JAVA210(): BuildRuntime + { + if (!isset(self::$JAVA210)) { + self::$JAVA210 = new BuildRuntime('java-21.0'); + } + return self::$JAVA210; + } + public static function JAVA22(): BuildRuntime + { + if (!isset(self::$JAVA22)) { + self::$JAVA22 = new BuildRuntime('java-22'); + } + return self::$JAVA22; + } + public static function SWIFT55(): BuildRuntime + { + if (!isset(self::$SWIFT55)) { + self::$SWIFT55 = new BuildRuntime('swift-5.5'); + } + return self::$SWIFT55; + } + public static function SWIFT58(): BuildRuntime + { + if (!isset(self::$SWIFT58)) { + self::$SWIFT58 = new BuildRuntime('swift-5.8'); + } + return self::$SWIFT58; + } + public static function SWIFT59(): BuildRuntime + { + if (!isset(self::$SWIFT59)) { + self::$SWIFT59 = new BuildRuntime('swift-5.9'); + } + return self::$SWIFT59; + } + public static function SWIFT510(): BuildRuntime + { + if (!isset(self::$SWIFT510)) { + self::$SWIFT510 = new BuildRuntime('swift-5.10'); + } + return self::$SWIFT510; + } + public static function KOTLIN16(): BuildRuntime + { + if (!isset(self::$KOTLIN16)) { + self::$KOTLIN16 = new BuildRuntime('kotlin-1.6'); + } + return self::$KOTLIN16; + } + public static function KOTLIN18(): BuildRuntime + { + if (!isset(self::$KOTLIN18)) { + self::$KOTLIN18 = new BuildRuntime('kotlin-1.8'); + } + return self::$KOTLIN18; + } + public static function KOTLIN19(): BuildRuntime + { + if (!isset(self::$KOTLIN19)) { + self::$KOTLIN19 = new BuildRuntime('kotlin-1.9'); + } + return self::$KOTLIN19; + } + public static function KOTLIN20(): BuildRuntime + { + if (!isset(self::$KOTLIN20)) { + self::$KOTLIN20 = new BuildRuntime('kotlin-2.0'); + } + return self::$KOTLIN20; + } + public static function CPP17(): BuildRuntime + { + if (!isset(self::$CPP17)) { + self::$CPP17 = new BuildRuntime('cpp-17'); + } + return self::$CPP17; + } + public static function CPP20(): BuildRuntime + { + if (!isset(self::$CPP20)) { + self::$CPP20 = new BuildRuntime('cpp-20'); + } + return self::$CPP20; + } + public static function BUN10(): BuildRuntime + { + if (!isset(self::$BUN10)) { + self::$BUN10 = new BuildRuntime('bun-1.0'); + } + return self::$BUN10; + } + public static function BUN11(): BuildRuntime + { + if (!isset(self::$BUN11)) { + self::$BUN11 = new BuildRuntime('bun-1.1'); + } + return self::$BUN11; + } + public static function GO123(): BuildRuntime + { + if (!isset(self::$GO123)) { + self::$GO123 = new BuildRuntime('go-1.23'); + } + return self::$GO123; + } + public static function STATIC1(): BuildRuntime + { + if (!isset(self::$STATIC1)) { + self::$STATIC1 = new BuildRuntime('static-1'); + } + return self::$STATIC1; + } + public static function FLUTTER324(): BuildRuntime + { + if (!isset(self::$FLUTTER324)) { + self::$FLUTTER324 = new BuildRuntime('flutter-3.24'); + } + return self::$FLUTTER324; + } + public static function FLUTTER327(): BuildRuntime + { + if (!isset(self::$FLUTTER327)) { + self::$FLUTTER327 = new BuildRuntime('flutter-3.27'); + } + return self::$FLUTTER327; + } + public static function FLUTTER329(): BuildRuntime + { + if (!isset(self::$FLUTTER329)) { + self::$FLUTTER329 = new BuildRuntime('flutter-3.29'); + } + return self::$FLUTTER329; + } +} \ No newline at end of file diff --git a/src/Appwrite/Enums/DeploymentDownloadType.php b/src/Appwrite/Enums/DeploymentDownloadType.php new file mode 100644 index 0000000..5acdb73 --- /dev/null +++ b/src/Appwrite/Enums/DeploymentDownloadType.php @@ -0,0 +1,43 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function SOURCE(): DeploymentDownloadType + { + if (!isset(self::$SOURCE)) { + self::$SOURCE = new DeploymentDownloadType('source'); + } + return self::$SOURCE; + } + public static function OUTPUT(): DeploymentDownloadType + { + if (!isset(self::$OUTPUT)) { + self::$OUTPUT = new DeploymentDownloadType('output'); + } + return self::$OUTPUT; + } +} \ No newline at end of file diff --git a/src/Appwrite/Enums/Framework.php b/src/Appwrite/Enums/Framework.php new file mode 100644 index 0000000..642506e --- /dev/null +++ b/src/Appwrite/Enums/Framework.php @@ -0,0 +1,139 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function ANALOG(): Framework + { + if (!isset(self::$ANALOG)) { + self::$ANALOG = new Framework('analog'); + } + return self::$ANALOG; + } + public static function ANGULAR(): Framework + { + if (!isset(self::$ANGULAR)) { + self::$ANGULAR = new Framework('angular'); + } + return self::$ANGULAR; + } + public static function NEXTJS(): Framework + { + if (!isset(self::$NEXTJS)) { + self::$NEXTJS = new Framework('nextjs'); + } + return self::$NEXTJS; + } + public static function REACT(): Framework + { + if (!isset(self::$REACT)) { + self::$REACT = new Framework('react'); + } + return self::$REACT; + } + public static function NUXT(): Framework + { + if (!isset(self::$NUXT)) { + self::$NUXT = new Framework('nuxt'); + } + return self::$NUXT; + } + public static function VUE(): Framework + { + if (!isset(self::$VUE)) { + self::$VUE = new Framework('vue'); + } + return self::$VUE; + } + public static function SVELTEKIT(): Framework + { + if (!isset(self::$SVELTEKIT)) { + self::$SVELTEKIT = new Framework('sveltekit'); + } + return self::$SVELTEKIT; + } + public static function ASTRO(): Framework + { + if (!isset(self::$ASTRO)) { + self::$ASTRO = new Framework('astro'); + } + return self::$ASTRO; + } + public static function REMIX(): Framework + { + if (!isset(self::$REMIX)) { + self::$REMIX = new Framework('remix'); + } + return self::$REMIX; + } + public static function LYNX(): Framework + { + if (!isset(self::$LYNX)) { + self::$LYNX = new Framework('lynx'); + } + return self::$LYNX; + } + public static function FLUTTER(): Framework + { + if (!isset(self::$FLUTTER)) { + self::$FLUTTER = new Framework('flutter'); + } + return self::$FLUTTER; + } + public static function REACTNATIVE(): Framework + { + if (!isset(self::$REACTNATIVE)) { + self::$REACTNATIVE = new Framework('react-native'); + } + return self::$REACTNATIVE; + } + public static function VITE(): Framework + { + if (!isset(self::$VITE)) { + self::$VITE = new Framework('vite'); + } + return self::$VITE; + } + public static function OTHER(): Framework + { + if (!isset(self::$OTHER)) { + self::$OTHER = new Framework('other'); + } + return self::$OTHER; + } +} \ No newline at end of file diff --git a/src/Appwrite/Enums/ImageFormat.php b/src/Appwrite/Enums/ImageFormat.php index 9495e34..0ea7a98 100644 --- a/src/Appwrite/Enums/ImageFormat.php +++ b/src/Appwrite/Enums/ImageFormat.php @@ -8,7 +8,6 @@ class ImageFormat implements JsonSerializable { private static ImageFormat $JPG; private static ImageFormat $JPEG; - private static ImageFormat $GIF; private static ImageFormat $PNG; private static ImageFormat $WEBP; private static ImageFormat $HEIC; @@ -45,13 +44,6 @@ public static function JPEG(): ImageFormat } return self::$JPEG; } - public static function GIF(): ImageFormat - { - if (!isset(self::$GIF)) { - self::$GIF = new ImageFormat('gif'); - } - return self::$GIF; - } public static function PNG(): ImageFormat { if (!isset(self::$PNG)) { diff --git a/src/Appwrite/Enums/Runtime.php b/src/Appwrite/Enums/Runtime.php index d5da338..f29a4d2 100644 --- a/src/Appwrite/Enums/Runtime.php +++ b/src/Appwrite/Enums/Runtime.php @@ -27,6 +27,7 @@ class Runtime implements JsonSerializable private static Runtime $PYTHON311; private static Runtime $PYTHON312; private static Runtime $PYTHONML311; + private static Runtime $PYTHONML312; private static Runtime $DENO121; private static Runtime $DENO124; private static Runtime $DENO135; @@ -37,6 +38,7 @@ class Runtime implements JsonSerializable private static Runtime $DART216; private static Runtime $DART217; private static Runtime $DART218; + private static Runtime $DART219; private static Runtime $DART30; private static Runtime $DART31; private static Runtime $DART33; @@ -65,6 +67,8 @@ class Runtime implements JsonSerializable private static Runtime $GO123; private static Runtime $STATIC1; private static Runtime $FLUTTER324; + private static Runtime $FLUTTER327; + private static Runtime $FLUTTER329; private string $value; @@ -230,6 +234,13 @@ public static function PYTHONML311(): Runtime } return self::$PYTHONML311; } + public static function PYTHONML312(): Runtime + { + if (!isset(self::$PYTHONML312)) { + self::$PYTHONML312 = new Runtime('python-ml-3.12'); + } + return self::$PYTHONML312; + } public static function DENO121(): Runtime { if (!isset(self::$DENO121)) { @@ -300,6 +311,13 @@ public static function DART218(): Runtime } return self::$DART218; } + public static function DART219(): Runtime + { + if (!isset(self::$DART219)) { + self::$DART219 = new Runtime('dart-2.19'); + } + return self::$DART219; + } public static function DART30(): Runtime { if (!isset(self::$DART30)) { @@ -496,4 +514,18 @@ public static function FLUTTER324(): Runtime } return self::$FLUTTER324; } + public static function FLUTTER327(): Runtime + { + if (!isset(self::$FLUTTER327)) { + self::$FLUTTER327 = new Runtime('flutter-3.27'); + } + return self::$FLUTTER327; + } + public static function FLUTTER329(): Runtime + { + if (!isset(self::$FLUTTER329)) { + self::$FLUTTER329 = new Runtime('flutter-3.29'); + } + return self::$FLUTTER329; + } } \ No newline at end of file diff --git a/src/Appwrite/Enums/VCSDeploymentType.php b/src/Appwrite/Enums/VCSDeploymentType.php new file mode 100644 index 0000000..f5ec544 --- /dev/null +++ b/src/Appwrite/Enums/VCSDeploymentType.php @@ -0,0 +1,51 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function BRANCH(): VCSDeploymentType + { + if (!isset(self::$BRANCH)) { + self::$BRANCH = new VCSDeploymentType('branch'); + } + return self::$BRANCH; + } + public static function COMMIT(): VCSDeploymentType + { + if (!isset(self::$COMMIT)) { + self::$COMMIT = new VCSDeploymentType('commit'); + } + return self::$COMMIT; + } + public static function TAG(): VCSDeploymentType + { + if (!isset(self::$TAG)) { + self::$TAG = new VCSDeploymentType('tag'); + } + return self::$TAG; + } +} \ No newline at end of file diff --git a/src/Appwrite/Services/Databases.php b/src/Appwrite/Services/Databases.php index fb636cc..66b293c 100644 --- a/src/Appwrite/Services/Databases.php +++ b/src/Appwrite/Services/Databases.php @@ -1496,7 +1496,6 @@ public function listDocuments(string $databaseId, string $collectionId, ?array $ * collection resource using either a [server * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. - * * * @param string $databaseId * @param string $collectionId @@ -1535,6 +1534,162 @@ public function createDocument(string $databaseId, string $collectionId, string ); } + /** + * Create new Documents. Before using this route, you should create a new + * collection resource using either a [server + * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + * API or directly from your database console. + * + * @param string $databaseId + * @param string $collectionId + * @param array $documents + * @throws AppwriteException + * @return array + */ + public function createDocuments(string $databaseId, string $collectionId, array $documents): array + { + $apiPath = str_replace( + ['{databaseId}', '{collectionId}'], + [$databaseId, $collectionId], + '/databases/{databaseId}/collections/{collectionId}/documents' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['collectionId'] = $collectionId; + $apiParams['documents'] = $documents; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Create or update Documents. Before using this route, you should create a + * new collection resource using either a [server + * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + * API or directly from your database console. + * + * + * @param string $databaseId + * @param string $collectionId + * @param ?array $documents + * @throws AppwriteException + * @return array + */ + public function upsertDocuments(string $databaseId, string $collectionId, ?array $documents = null): array + { + $apiPath = str_replace( + ['{databaseId}', '{collectionId}'], + [$databaseId, $collectionId], + '/databases/{databaseId}/collections/{collectionId}/documents' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['collectionId'] = $collectionId; + + if (!is_null($documents)) { + $apiParams['documents'] = $documents; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_PUT, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Update all documents that match your queries, if no queries are submitted + * then all documents are updated. You can pass only specific fields to be + * updated. + * + * @param string $databaseId + * @param string $collectionId + * @param ?array $data + * @param ?array $queries + * @throws AppwriteException + * @return array + */ + public function updateDocuments(string $databaseId, string $collectionId, ?array $data = null, ?array $queries = null): array + { + $apiPath = str_replace( + ['{databaseId}', '{collectionId}'], + [$databaseId, $collectionId], + '/databases/{databaseId}/collections/{collectionId}/documents' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['collectionId'] = $collectionId; + + if (!is_null($data)) { + $apiParams['data'] = $data; + } + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Bulk delete documents using queries, if no queries are passed then all + * documents are deleted. + * + * @param string $databaseId + * @param string $collectionId + * @param ?array $queries + * @throws AppwriteException + * @return array + */ + public function deleteDocuments(string $databaseId, string $collectionId, ?array $queries = null): array + { + $apiPath = str_replace( + ['{databaseId}', '{collectionId}'], + [$databaseId, $collectionId], + '/databases/{databaseId}/collections/{collectionId}/documents' + ); + + $apiParams = []; + $apiParams['databaseId'] = $databaseId; + $apiParams['collectionId'] = $collectionId; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + } + /** * Get a document by its unique ID. This endpoint response returns a JSON * object with the document data. @@ -1696,10 +1851,11 @@ public function listIndexes(string $databaseId, string $collectionId, ?array $qu * @param IndexType $type * @param array $attributes * @param ?array $orders + * @param ?array $lengths * @throws AppwriteException * @return array */ - public function createIndex(string $databaseId, string $collectionId, string $key, IndexType $type, array $attributes, ?array $orders = null): array + public function createIndex(string $databaseId, string $collectionId, string $key, IndexType $type, array $attributes, ?array $orders = null, ?array $lengths = null): array { $apiPath = str_replace( ['{databaseId}', '{collectionId}'], @@ -1718,6 +1874,10 @@ public function createIndex(string $databaseId, string $collectionId, string $ke $apiParams['orders'] = $orders; } + if (!is_null($lengths)) { + $apiParams['lengths'] = $lengths; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; diff --git a/src/Appwrite/Services/Functions.php b/src/Appwrite/Services/Functions.php index b495155..1f335c1 100644 --- a/src/Appwrite/Services/Functions.php +++ b/src/Appwrite/Services/Functions.php @@ -7,6 +7,8 @@ use Appwrite\Service; use Appwrite\InputFile; use Appwrite\Enums\Runtime; +use Appwrite\Enums\VCSDeploymentType; +use Appwrite\Enums\DeploymentDownloadType; use Appwrite\Enums\ExecutionMethod; class Functions extends Service @@ -76,15 +78,11 @@ public function list(?array $queries = null, ?string $search = null): array * @param ?string $providerBranch * @param ?bool $providerSilentMode * @param ?string $providerRootDirectory - * @param ?string $templateRepository - * @param ?string $templateOwner - * @param ?string $templateRootDirectory - * @param ?string $templateVersion * @param ?string $specification * @throws AppwriteException * @return array */ - public function create(string $functionId, string $name, Runtime $runtime, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?string $templateRepository = null, ?string $templateOwner = null, ?string $templateRootDirectory = null, ?string $templateVersion = null, ?string $specification = null): array + public function create(string $functionId, string $name, Runtime $runtime, ?array $execute = null, ?array $events = null, ?string $schedule = null, ?int $timeout = null, ?bool $enabled = null, ?bool $logging = null, ?string $entrypoint = null, ?string $commands = null, ?array $scopes = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?string $specification = null): array { $apiPath = str_replace( [], @@ -153,22 +151,6 @@ public function create(string $functionId, string $name, Runtime $runtime, ?arra $apiParams['providerRootDirectory'] = $providerRootDirectory; } - if (!is_null($templateRepository)) { - $apiParams['templateRepository'] = $templateRepository; - } - - if (!is_null($templateOwner)) { - $apiParams['templateOwner'] = $templateOwner; - } - - if (!is_null($templateRootDirectory)) { - $apiParams['templateRootDirectory'] = $templateRootDirectory; - } - - if (!is_null($templateVersion)) { - $apiParams['templateVersion'] = $templateVersion; - } - if (!is_null($specification)) { $apiParams['specification'] = $specification; } @@ -212,7 +194,6 @@ public function listRuntimes(): array /** * List allowed function specifications for this instance. - * * * @throws AppwriteException * @return array @@ -403,7 +384,39 @@ public function delete(string $functionId): string } /** - * Get a list of all the project's code deployments. You can use the query + * Update the function active deployment. Use this endpoint to switch the code + * deployment that should be used when visitor opens your function. + * + * @param string $functionId + * @param string $deploymentId + * @throws AppwriteException + * @return array + */ + public function updateFunctionDeployment(string $functionId, string $deploymentId): array + { + $apiPath = str_replace( + ['{functionId}'], + [$functionId], + '/functions/{functionId}/deployment' + ); + + $apiParams = []; + $apiParams['functionId'] = $functionId; + $apiParams['deploymentId'] = $deploymentId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a list of all the function's code deployments. You can use the query * params to filter your results. * * @param string $functionId @@ -559,29 +572,39 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti } /** - * Get a code deployment by its unique ID. + * Create a new build for an existing function deployment. This endpoint + * allows you to rebuild a deployment with the updated function configuration, + * including its entrypoint and build commands if they have been modified. The + * build process will be queued and executed asynchronously. The original + * deployment's code will be preserved and used for the new build. * * @param string $functionId * @param string $deploymentId + * @param ?string $buildId * @throws AppwriteException * @return array */ - public function getDeployment(string $functionId, string $deploymentId): array + public function createDuplicateDeployment(string $functionId, string $deploymentId, ?string $buildId = null): array { $apiPath = str_replace( - ['{functionId}', '{deploymentId}'], - [$functionId, $deploymentId], - '/functions/{functionId}/deployments/{deploymentId}' + ['{functionId}'], + [$functionId], + '/functions/{functionId}/deployments/duplicate' ); $apiParams = []; $apiParams['functionId'] = $functionId; $apiParams['deploymentId'] = $deploymentId; + if (!is_null($buildId)) { + $apiParams['buildId'] = $buildId; + } + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; return $this->client->call( - Client::METHOD_GET, + Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams @@ -589,32 +612,45 @@ public function getDeployment(string $functionId, string $deploymentId): array } /** - * Update the function code deployment ID using the unique function ID. Use - * this endpoint to switch the code deployment that should be executed by the - * execution endpoint. + * Create a deployment based on a template. + * + * Use this endpoint with combination of + * [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to + * find the template details. * * @param string $functionId - * @param string $deploymentId + * @param string $repository + * @param string $owner + * @param string $rootDirectory + * @param string $version + * @param ?bool $activate * @throws AppwriteException * @return array */ - public function updateDeployment(string $functionId, string $deploymentId): array + public function createTemplateDeployment(string $functionId, string $repository, string $owner, string $rootDirectory, string $version, ?bool $activate = null): array { $apiPath = str_replace( - ['{functionId}', '{deploymentId}'], - [$functionId, $deploymentId], - '/functions/{functionId}/deployments/{deploymentId}' + ['{functionId}'], + [$functionId], + '/functions/{functionId}/deployments/template' ); $apiParams = []; $apiParams['functionId'] = $functionId; - $apiParams['deploymentId'] = $deploymentId; + $apiParams['repository'] = $repository; + $apiParams['owner'] = $owner; + $apiParams['rootDirectory'] = $rootDirectory; + $apiParams['version'] = $version; + + if (!is_null($activate)) { + $apiParams['activate'] = $activate; + } $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; return $this->client->call( - Client::METHOD_PATCH, + Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams @@ -622,14 +658,54 @@ public function updateDeployment(string $functionId, string $deploymentId): arra } /** - * Delete a code deployment by its unique ID. + * Create a deployment when a function is connected to VCS. + * + * This endpoint lets you create deployment from a branch, commit, or a tag. + * + * @param string $functionId + * @param VCSDeploymentType $type + * @param string $reference + * @param ?bool $activate + * @throws AppwriteException + * @return array + */ + public function createVcsDeployment(string $functionId, VCSDeploymentType $type, string $reference, ?bool $activate = null): array + { + $apiPath = str_replace( + ['{functionId}'], + [$functionId], + '/functions/{functionId}/deployments/vcs' + ); + + $apiParams = []; + $apiParams['functionId'] = $functionId; + $apiParams['type'] = $type; + $apiParams['reference'] = $reference; + + if (!is_null($activate)) { + $apiParams['activate'] = $activate; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a function deployment by its unique ID. * * @param string $functionId * @param string $deploymentId * @throws AppwriteException - * @return string + * @return array */ - public function deleteDeployment(string $functionId, string $deploymentId): string + public function getDeployment(string $functionId, string $deploymentId): array { $apiPath = str_replace( ['{functionId}', '{deploymentId}'], @@ -642,10 +718,9 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri $apiParams['deploymentId'] = $deploymentId; $apiHeaders = []; - $apiHeaders['content-type'] = 'application/json'; return $this->client->call( - Client::METHOD_DELETE, + Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams @@ -653,39 +728,30 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri } /** - * Create a new build for an existing function deployment. This endpoint - * allows you to rebuild a deployment with the updated function configuration, - * including its entrypoint and build commands if they have been modified The - * build process will be queued and executed asynchronously. The original - * deployment's code will be preserved and used for the new build. + * Delete a code deployment by its unique ID. * * @param string $functionId * @param string $deploymentId - * @param ?string $buildId * @throws AppwriteException * @return string */ - public function createBuild(string $functionId, string $deploymentId, ?string $buildId = null): string + public function deleteDeployment(string $functionId, string $deploymentId): string { $apiPath = str_replace( ['{functionId}', '{deploymentId}'], [$functionId, $deploymentId], - '/functions/{functionId}/deployments/{deploymentId}/build' + '/functions/{functionId}/deployments/{deploymentId}' ); $apiParams = []; $apiParams['functionId'] = $functionId; $apiParams['deploymentId'] = $deploymentId; - if (!is_null($buildId)) { - $apiParams['buildId'] = $buildId; - } - $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; return $this->client->call( - Client::METHOD_POST, + Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams @@ -693,34 +759,36 @@ public function createBuild(string $functionId, string $deploymentId, ?string $b } /** - * Cancel an ongoing function deployment build. If the build is already in - * progress, it will be stopped and marked as canceled. If the build hasn't - * started yet, it will be marked as canceled without executing. You cannot - * cancel builds that have already completed (status 'ready') or failed. The - * response includes the final build status and details. + * Get a function deployment content by its unique ID. The endpoint response + * return with a 'Content-Disposition: attachment' header that tells the + * browser to start downloading the file to user downloads directory. * * @param string $functionId * @param string $deploymentId + * @param ?DeploymentDownloadType $type * @throws AppwriteException - * @return array + * @return string */ - public function updateDeploymentBuild(string $functionId, string $deploymentId): array + public function getDeploymentDownload(string $functionId, string $deploymentId, ?DeploymentDownloadType $type = null): string { $apiPath = str_replace( ['{functionId}', '{deploymentId}'], [$functionId, $deploymentId], - '/functions/{functionId}/deployments/{deploymentId}/build' + '/functions/{functionId}/deployments/{deploymentId}/download' ); $apiParams = []; $apiParams['functionId'] = $functionId; $apiParams['deploymentId'] = $deploymentId; + if (!is_null($type)) { + $apiParams['type'] = $type; + } + $apiHeaders = []; - $apiHeaders['content-type'] = 'application/json'; return $this->client->call( - Client::METHOD_PATCH, + Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams @@ -728,20 +796,23 @@ public function updateDeploymentBuild(string $functionId, string $deploymentId): } /** - * Get a Deployment's contents by its unique ID. This endpoint supports range - * requests for partial or streaming file download. + * Cancel an ongoing function deployment build. If the build is already in + * progress, it will be stopped and marked as canceled. If the build hasn't + * started yet, it will be marked as canceled without executing. You cannot + * cancel builds that have already completed (status 'ready') or failed. The + * response includes the final build status and details. * * @param string $functionId * @param string $deploymentId * @throws AppwriteException - * @return string + * @return array */ - public function getDeploymentDownload(string $functionId, string $deploymentId): string + public function updateDeploymentStatus(string $functionId, string $deploymentId): array { $apiPath = str_replace( ['{functionId}', '{deploymentId}'], [$functionId, $deploymentId], - '/functions/{functionId}/deployments/{deploymentId}/download' + '/functions/{functionId}/deployments/{deploymentId}/status' ); $apiParams = []; @@ -749,9 +820,10 @@ public function getDeploymentDownload(string $functionId, string $deploymentId): $apiParams['deploymentId'] = $deploymentId; $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; return $this->client->call( - Client::METHOD_GET, + Client::METHOD_PATCH, $apiPath, $apiHeaders, $apiParams @@ -764,11 +836,10 @@ public function getDeploymentDownload(string $functionId, string $deploymentId): * * @param string $functionId * @param ?array $queries - * @param ?string $search * @throws AppwriteException * @return array */ - public function listExecutions(string $functionId, ?array $queries = null, ?string $search = null): array + public function listExecutions(string $functionId, ?array $queries = null): array { $apiPath = str_replace( ['{functionId}'], @@ -783,10 +854,6 @@ public function listExecutions(string $functionId, ?array $queries = null, ?stri $apiParams['queries'] = $queries; } - if (!is_null($search)) { - $apiParams['search'] = $search; - } - $apiHeaders = []; return $this->client->call( @@ -891,7 +958,6 @@ public function getExecution(string $functionId, string $executionId): array /** * Delete a function execution by its unique ID. - * * * @param string $functionId * @param string $executionId @@ -956,10 +1022,11 @@ public function listVariables(string $functionId): array * @param string $functionId * @param string $key * @param string $value + * @param ?bool $secret * @throws AppwriteException * @return array */ - public function createVariable(string $functionId, string $key, string $value): array + public function createVariable(string $functionId, string $key, string $value, ?bool $secret = null): array { $apiPath = str_replace( ['{functionId}'], @@ -972,6 +1039,10 @@ public function createVariable(string $functionId, string $key, string $value): $apiParams['key'] = $key; $apiParams['value'] = $value; + if (!is_null($secret)) { + $apiParams['secret'] = $secret; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; @@ -1020,10 +1091,11 @@ public function getVariable(string $functionId, string $variableId): array * @param string $variableId * @param string $key * @param ?string $value + * @param ?bool $secret * @throws AppwriteException * @return array */ - public function updateVariable(string $functionId, string $variableId, string $key, ?string $value = null): array + public function updateVariable(string $functionId, string $variableId, string $key, ?string $value = null, ?bool $secret = null): array { $apiPath = str_replace( ['{functionId}', '{variableId}'], @@ -1040,6 +1112,10 @@ public function updateVariable(string $functionId, string $variableId, string $k $apiParams['value'] = $value; } + if (!is_null($secret)) { + $apiParams['secret'] = $secret; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; diff --git a/src/Appwrite/Services/Sites.php b/src/Appwrite/Services/Sites.php new file mode 100644 index 0000000..698e684 --- /dev/null +++ b/src/Appwrite/Services/Sites.php @@ -0,0 +1,1087 @@ +client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Create a new site. + * + * @param string $siteId + * @param string $name + * @param Framework $framework + * @param BuildRuntime $buildRuntime + * @param ?bool $enabled + * @param ?bool $logging + * @param ?int $timeout + * @param ?string $installCommand + * @param ?string $buildCommand + * @param ?string $outputDirectory + * @param ?Adapter $adapter + * @param ?string $installationId + * @param ?string $fallbackFile + * @param ?string $providerRepositoryId + * @param ?string $providerBranch + * @param ?bool $providerSilentMode + * @param ?string $providerRootDirectory + * @param ?string $specification + * @throws AppwriteException + * @return array + */ + public function create(string $siteId, string $name, Framework $framework, BuildRuntime $buildRuntime, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $outputDirectory = null, ?Adapter $adapter = null, ?string $installationId = null, ?string $fallbackFile = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?string $specification = null): array + { + $apiPath = str_replace( + [], + [], + '/sites' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['name'] = $name; + $apiParams['framework'] = $framework; + $apiParams['buildRuntime'] = $buildRuntime; + + if (!is_null($enabled)) { + $apiParams['enabled'] = $enabled; + } + + if (!is_null($logging)) { + $apiParams['logging'] = $logging; + } + + if (!is_null($timeout)) { + $apiParams['timeout'] = $timeout; + } + + if (!is_null($installCommand)) { + $apiParams['installCommand'] = $installCommand; + } + + if (!is_null($buildCommand)) { + $apiParams['buildCommand'] = $buildCommand; + } + + if (!is_null($outputDirectory)) { + $apiParams['outputDirectory'] = $outputDirectory; + } + + if (!is_null($adapter)) { + $apiParams['adapter'] = $adapter; + } + + if (!is_null($installationId)) { + $apiParams['installationId'] = $installationId; + } + + if (!is_null($fallbackFile)) { + $apiParams['fallbackFile'] = $fallbackFile; + } + + if (!is_null($providerRepositoryId)) { + $apiParams['providerRepositoryId'] = $providerRepositoryId; + } + + if (!is_null($providerBranch)) { + $apiParams['providerBranch'] = $providerBranch; + } + + if (!is_null($providerSilentMode)) { + $apiParams['providerSilentMode'] = $providerSilentMode; + } + + if (!is_null($providerRootDirectory)) { + $apiParams['providerRootDirectory'] = $providerRootDirectory; + } + + if (!is_null($specification)) { + $apiParams['specification'] = $specification; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a list of all frameworks that are currently available on the server + * instance. + * + * @throws AppwriteException + * @return array + */ + public function listFrameworks(): array + { + $apiPath = str_replace( + [], + [], + '/sites/frameworks' + ); + + $apiParams = []; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * List allowed site specifications for this instance. + * + * @throws AppwriteException + * @return array + */ + public function listSpecifications(): array + { + $apiPath = str_replace( + [], + [], + '/sites/specifications' + ); + + $apiParams = []; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a site by its unique ID. + * + * @param string $siteId + * @throws AppwriteException + * @return array + */ + public function get(string $siteId): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Update site by its unique ID. + * + * @param string $siteId + * @param string $name + * @param Framework $framework + * @param ?bool $enabled + * @param ?bool $logging + * @param ?int $timeout + * @param ?string $installCommand + * @param ?string $buildCommand + * @param ?string $outputDirectory + * @param ?BuildRuntime $buildRuntime + * @param ?Adapter $adapter + * @param ?string $fallbackFile + * @param ?string $installationId + * @param ?string $providerRepositoryId + * @param ?string $providerBranch + * @param ?bool $providerSilentMode + * @param ?string $providerRootDirectory + * @param ?string $specification + * @throws AppwriteException + * @return array + */ + public function update(string $siteId, string $name, Framework $framework, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $outputDirectory = null, ?BuildRuntime $buildRuntime = null, ?Adapter $adapter = null, ?string $fallbackFile = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?string $specification = null): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['name'] = $name; + $apiParams['framework'] = $framework; + + if (!is_null($enabled)) { + $apiParams['enabled'] = $enabled; + } + + if (!is_null($logging)) { + $apiParams['logging'] = $logging; + } + + if (!is_null($timeout)) { + $apiParams['timeout'] = $timeout; + } + + if (!is_null($installCommand)) { + $apiParams['installCommand'] = $installCommand; + } + + if (!is_null($buildCommand)) { + $apiParams['buildCommand'] = $buildCommand; + } + + if (!is_null($outputDirectory)) { + $apiParams['outputDirectory'] = $outputDirectory; + } + + if (!is_null($buildRuntime)) { + $apiParams['buildRuntime'] = $buildRuntime; + } + + if (!is_null($adapter)) { + $apiParams['adapter'] = $adapter; + } + + if (!is_null($fallbackFile)) { + $apiParams['fallbackFile'] = $fallbackFile; + } + + if (!is_null($installationId)) { + $apiParams['installationId'] = $installationId; + } + + if (!is_null($providerRepositoryId)) { + $apiParams['providerRepositoryId'] = $providerRepositoryId; + } + + if (!is_null($providerBranch)) { + $apiParams['providerBranch'] = $providerBranch; + } + + if (!is_null($providerSilentMode)) { + $apiParams['providerSilentMode'] = $providerSilentMode; + } + + if (!is_null($providerRootDirectory)) { + $apiParams['providerRootDirectory'] = $providerRootDirectory; + } + + if (!is_null($specification)) { + $apiParams['specification'] = $specification; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_PUT, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Delete a site by its unique ID. + * + * @param string $siteId + * @throws AppwriteException + * @return string + */ + public function delete(string $siteId): string + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Update the site active deployment. Use this endpoint to switch the code + * deployment that should be used when visitor opens your site. + * + * @param string $siteId + * @param string $deploymentId + * @throws AppwriteException + * @return array + */ + public function updateSiteDeployment(string $siteId, string $deploymentId): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/deployment' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['deploymentId'] = $deploymentId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a list of all the site's code deployments. You can use the query params + * to filter your results. + * + * @param string $siteId + * @param ?array $queries + * @param ?string $search + * @throws AppwriteException + * @return array + */ + public function listDeployments(string $siteId, ?array $queries = null, ?string $search = null): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/deployments' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($search)) { + $apiParams['search'] = $search; + } + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Create a new site code deployment. Use this endpoint to upload a new + * version of your site code. To activate your newly uploaded code, you'll + * need to update the function's deployment to use your new deployment ID. + * + * @param string $siteId + * @param InputFile $code + * @param bool $activate + * @param ?string $installCommand + * @param ?string $buildCommand + * @param ?string $outputDirectory + * @throws AppwriteException + * @return array + */ + public function createDeployment(string $siteId, InputFile $code, bool $activate, ?string $installCommand = null, ?string $buildCommand = null, ?string $outputDirectory = null, callable $onProgress = null): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/deployments' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['code'] = $code; + $apiParams['activate'] = $activate; + + if (!is_null($installCommand)) { + $apiParams['installCommand'] = $installCommand; + } + + if (!is_null($buildCommand)) { + $apiParams['buildCommand'] = $buildCommand; + } + + if (!is_null($outputDirectory)) { + $apiParams['outputDirectory'] = $outputDirectory; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'multipart/form-data'; + $size = 0; + $mimeType = null; + $postedName = null; + if(empty($code->getPath() ?? null)) { + $size = strlen($code->getData()); + $mimeType = $code->getMimeType(); + $postedName = $code->getFilename(); + if ($size <= Client::CHUNK_SIZE) { + $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($code->getData()), $mimeType, $postedName); + return $this->client->call(Client::METHOD_POST, $apiPath, [ + 'content-type' => 'multipart/form-data', + ], $apiParams); + } + } else { + $size = filesize($code->getPath()); + $mimeType = $code->getMimeType() ?? mime_content_type($code->getPath()); + $postedName = $code->getFilename() ?? basename($code->getPath()); + //send single file if size is less than or equal to 5MB + if ($size <= Client::CHUNK_SIZE) { + $apiParams['code'] = new \CURLFile($code->getPath(), $mimeType, $postedName); + return $this->client->call(Client::METHOD_POST, $apiPath, [ + 'content-type' => 'multipart/form-data', + ], $apiParams); + } + } + + $id = ''; + $counter = 0; + + + $apiHeaders = ['content-type' => 'multipart/form-data']; + $handle = null; + + if(!empty($code->getPath())) { + $handle = @fopen($code->getPath(), "rb"); + } + + $start = $counter * Client::CHUNK_SIZE; + while ($start < $size) { + $chunk = ''; + if(!empty($handle)) { + fseek($handle, $start); + $chunk = @fread($handle, Client::CHUNK_SIZE); + } else { + $chunk = substr($file->getData(), $start, Client::CHUNK_SIZE); + } + $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); + $apiHeaders['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size - 1) . '/' . $size; + if(!empty($id)) { + $apiHeaders['x-appwrite-id'] = $id; + } + $response = $this->client->call(Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams); + $counter++; + $start += Client::CHUNK_SIZE; + if(empty($id)) { + $id = $response['$id']; + } + if($onProgress !== null) { + $onProgress([ + '$id' => $response['$id'], + 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE)), $size) / $size * 100, + 'sizeUploaded' => min($counter * Client::CHUNK_SIZE), + 'chunksTotal' => $response['chunksTotal'], + 'chunksUploaded' => $response['chunksUploaded'], + ]); + } + } + if(!empty($handle)) { + @fclose($handle); + } + return $response; + + } + + /** + * Create a new build for an existing site deployment. This endpoint allows + * you to rebuild a deployment with the updated site configuration, including + * its commands and output directory if they have been modified. The build + * process will be queued and executed asynchronously. The original + * deployment's code will be preserved and used for the new build. + * + * @param string $siteId + * @param string $deploymentId + * @throws AppwriteException + * @return array + */ + public function createDuplicateDeployment(string $siteId, string $deploymentId): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/deployments/duplicate' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['deploymentId'] = $deploymentId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Create a deployment based on a template. + * + * Use this endpoint with combination of + * [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to + * find the template details. + * + * @param string $siteId + * @param string $repository + * @param string $owner + * @param string $rootDirectory + * @param string $version + * @param ?bool $activate + * @throws AppwriteException + * @return array + */ + public function createTemplateDeployment(string $siteId, string $repository, string $owner, string $rootDirectory, string $version, ?bool $activate = null): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/deployments/template' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['repository'] = $repository; + $apiParams['owner'] = $owner; + $apiParams['rootDirectory'] = $rootDirectory; + $apiParams['version'] = $version; + + if (!is_null($activate)) { + $apiParams['activate'] = $activate; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Create a deployment when a site is connected to VCS. + * + * This endpoint lets you create deployment from a branch, commit, or a tag. + * + * @param string $siteId + * @param VCSDeploymentType $type + * @param string $reference + * @param ?bool $activate + * @throws AppwriteException + * @return array + */ + public function createVcsDeployment(string $siteId, VCSDeploymentType $type, string $reference, ?bool $activate = null): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/deployments/vcs' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['type'] = $type; + $apiParams['reference'] = $reference; + + if (!is_null($activate)) { + $apiParams['activate'] = $activate; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a site deployment by its unique ID. + * + * @param string $siteId + * @param string $deploymentId + * @throws AppwriteException + * @return array + */ + public function getDeployment(string $siteId, string $deploymentId): array + { + $apiPath = str_replace( + ['{siteId}', '{deploymentId}'], + [$siteId, $deploymentId], + '/sites/{siteId}/deployments/{deploymentId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['deploymentId'] = $deploymentId; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Delete a site deployment by its unique ID. + * + * @param string $siteId + * @param string $deploymentId + * @throws AppwriteException + * @return string + */ + public function deleteDeployment(string $siteId, string $deploymentId): string + { + $apiPath = str_replace( + ['{siteId}', '{deploymentId}'], + [$siteId, $deploymentId], + '/sites/{siteId}/deployments/{deploymentId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['deploymentId'] = $deploymentId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a site deployment content by its unique ID. The endpoint response + * return with a 'Content-Disposition: attachment' header that tells the + * browser to start downloading the file to user downloads directory. + * + * @param string $siteId + * @param string $deploymentId + * @param ?DeploymentDownloadType $type + * @throws AppwriteException + * @return string + */ + public function getDeploymentDownload(string $siteId, string $deploymentId, ?DeploymentDownloadType $type = null): string + { + $apiPath = str_replace( + ['{siteId}', '{deploymentId}'], + [$siteId, $deploymentId], + '/sites/{siteId}/deployments/{deploymentId}/download' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['deploymentId'] = $deploymentId; + + if (!is_null($type)) { + $apiParams['type'] = $type; + } + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Cancel an ongoing site deployment build. If the build is already in + * progress, it will be stopped and marked as canceled. If the build hasn't + * started yet, it will be marked as canceled without executing. You cannot + * cancel builds that have already completed (status 'ready') or failed. The + * response includes the final build status and details. + * + * @param string $siteId + * @param string $deploymentId + * @throws AppwriteException + * @return array + */ + public function updateDeploymentStatus(string $siteId, string $deploymentId): array + { + $apiPath = str_replace( + ['{siteId}', '{deploymentId}'], + [$siteId, $deploymentId], + '/sites/{siteId}/deployments/{deploymentId}/status' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['deploymentId'] = $deploymentId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a list of all site logs. You can use the query params to filter your + * results. + * + * @param string $siteId + * @param ?array $queries + * @throws AppwriteException + * @return array + */ + public function listLogs(string $siteId, ?array $queries = null): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/logs' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a site request log by its unique ID. + * + * @param string $siteId + * @param string $logId + * @throws AppwriteException + * @return array + */ + public function getLog(string $siteId, string $logId): array + { + $apiPath = str_replace( + ['{siteId}', '{logId}'], + [$siteId, $logId], + '/sites/{siteId}/logs/{logId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['logId'] = $logId; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Delete a site log by its unique ID. + * + * @param string $siteId + * @param string $logId + * @throws AppwriteException + * @return string + */ + public function deleteLog(string $siteId, string $logId): string + { + $apiPath = str_replace( + ['{siteId}', '{logId}'], + [$siteId, $logId], + '/sites/{siteId}/logs/{logId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['logId'] = $logId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a list of all variables of a specific site. + * + * @param string $siteId + * @throws AppwriteException + * @return array + */ + public function listVariables(string $siteId): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/variables' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Create a new site variable. These variables can be accessed during build + * and runtime (server-side rendering) as environment variables. + * + * @param string $siteId + * @param string $key + * @param string $value + * @param ?bool $secret + * @throws AppwriteException + * @return array + */ + public function createVariable(string $siteId, string $key, string $value, ?bool $secret = null): array + { + $apiPath = str_replace( + ['{siteId}'], + [$siteId], + '/sites/{siteId}/variables' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['key'] = $key; + $apiParams['value'] = $value; + + if (!is_null($secret)) { + $apiParams['secret'] = $secret; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a variable by its unique ID. + * + * @param string $siteId + * @param string $variableId + * @throws AppwriteException + * @return array + */ + public function getVariable(string $siteId, string $variableId): array + { + $apiPath = str_replace( + ['{siteId}', '{variableId}'], + [$siteId, $variableId], + '/sites/{siteId}/variables/{variableId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['variableId'] = $variableId; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Update variable by its unique ID. + * + * @param string $siteId + * @param string $variableId + * @param string $key + * @param ?string $value + * @param ?bool $secret + * @throws AppwriteException + * @return array + */ + public function updateVariable(string $siteId, string $variableId, string $key, ?string $value = null, ?bool $secret = null): array + { + $apiPath = str_replace( + ['{siteId}', '{variableId}'], + [$siteId, $variableId], + '/sites/{siteId}/variables/{variableId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['variableId'] = $variableId; + $apiParams['key'] = $key; + + if (!is_null($value)) { + $apiParams['value'] = $value; + } + + if (!is_null($secret)) { + $apiParams['secret'] = $secret; + } + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_PUT, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Delete a variable by its unique ID. + * + * @param string $siteId + * @param string $variableId + * @throws AppwriteException + * @return string + */ + public function deleteVariable(string $siteId, string $variableId): string + { + $apiPath = str_replace( + ['{siteId}', '{variableId}'], + [$siteId, $variableId], + '/sites/{siteId}/variables/{variableId}' + ); + + $apiParams = []; + $apiParams['siteId'] = $siteId; + $apiParams['variableId'] = $variableId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + } +} \ No newline at end of file diff --git a/src/Appwrite/Services/Storage.php b/src/Appwrite/Services/Storage.php index cf392dc..8f24c1d 100644 --- a/src/Appwrite/Services/Storage.php +++ b/src/Appwrite/Services/Storage.php @@ -530,10 +530,11 @@ public function deleteFile(string $bucketId, string $fileId): string * * @param string $bucketId * @param string $fileId + * @param ?string $token * @throws AppwriteException * @return string */ - public function getFileDownload(string $bucketId, string $fileId): string + public function getFileDownload(string $bucketId, string $fileId, ?string $token = null): string { $apiPath = str_replace( ['{bucketId}', '{fileId}'], @@ -545,6 +546,10 @@ public function getFileDownload(string $bucketId, string $fileId): string $apiParams['bucketId'] = $bucketId; $apiParams['fileId'] = $fileId; + if (!is_null($token)) { + $apiParams['token'] = $token; + } + $apiHeaders = []; return $this->client->call( @@ -575,10 +580,11 @@ public function getFileDownload(string $bucketId, string $fileId): string * @param ?int $rotation * @param ?string $background * @param ?ImageFormat $output + * @param ?string $token * @throws AppwriteException * @return string */ - public function getFilePreview(string $bucketId, string $fileId, ?int $width = null, ?int $height = null, ?ImageGravity $gravity = null, ?int $quality = null, ?int $borderWidth = null, ?string $borderColor = null, ?int $borderRadius = null, ?float $opacity = null, ?int $rotation = null, ?string $background = null, ?ImageFormat $output = null): string + public function getFilePreview(string $bucketId, string $fileId, ?int $width = null, ?int $height = null, ?ImageGravity $gravity = null, ?int $quality = null, ?int $borderWidth = null, ?string $borderColor = null, ?int $borderRadius = null, ?float $opacity = null, ?int $rotation = null, ?string $background = null, ?ImageFormat $output = null, ?string $token = null): string { $apiPath = str_replace( ['{bucketId}', '{fileId}'], @@ -634,6 +640,10 @@ public function getFilePreview(string $bucketId, string $fileId, ?int $width = n $apiParams['output'] = $output; } + if (!is_null($token)) { + $apiParams['token'] = $token; + } + $apiHeaders = []; return $this->client->call( @@ -651,10 +661,11 @@ public function getFilePreview(string $bucketId, string $fileId, ?int $width = n * * @param string $bucketId * @param string $fileId + * @param ?string $token * @throws AppwriteException * @return string */ - public function getFileView(string $bucketId, string $fileId): string + public function getFileView(string $bucketId, string $fileId, ?string $token = null): string { $apiPath = str_replace( ['{bucketId}', '{fileId}'], @@ -666,6 +677,10 @@ public function getFileView(string $bucketId, string $fileId): string $apiParams['bucketId'] = $bucketId; $apiParams['fileId'] = $fileId; + if (!is_null($token)) { + $apiParams['token'] = $token; + } + $apiHeaders = []; return $this->client->call( diff --git a/src/Appwrite/Services/Tokens.php b/src/Appwrite/Services/Tokens.php new file mode 100644 index 0000000..4811f4a --- /dev/null +++ b/src/Appwrite/Services/Tokens.php @@ -0,0 +1,175 @@ +client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Create a new token. A token is linked to a file. Token can be passed as a + * header or request get parameter. + * + * @param string $bucketId + * @param string $fileId + * @param ?string $expire + * @throws AppwriteException + * @return array + */ + public function createFileToken(string $bucketId, string $fileId, ?string $expire = null): array + { + $apiPath = str_replace( + ['{bucketId}', '{fileId}'], + [$bucketId, $fileId], + '/tokens/buckets/{bucketId}/files/{fileId}' + ); + + $apiParams = []; + $apiParams['bucketId'] = $bucketId; + $apiParams['fileId'] = $fileId; + $apiParams['expire'] = $expire; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_POST, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get a token by its unique ID. + * + * @param string $tokenId + * @throws AppwriteException + * @return array + */ + public function get(string $tokenId): array + { + $apiPath = str_replace( + ['{tokenId}'], + [$tokenId], + '/tokens/{tokenId}' + ); + + $apiParams = []; + $apiParams['tokenId'] = $tokenId; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Update a token by its unique ID. Use this endpoint to update a token's + * expiry date. + * + * @param string $tokenId + * @param ?string $expire + * @throws AppwriteException + * @return array + */ + public function update(string $tokenId, ?string $expire = null): array + { + $apiPath = str_replace( + ['{tokenId}'], + [$tokenId], + '/tokens/{tokenId}' + ); + + $apiParams = []; + $apiParams['tokenId'] = $tokenId; + $apiParams['expire'] = $expire; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Delete a token by its unique ID. + * + * @param string $tokenId + * @throws AppwriteException + * @return string + */ + public function delete(string $tokenId): string + { + $apiPath = str_replace( + ['{tokenId}'], + [$tokenId], + '/tokens/{tokenId}' + ); + + $apiParams = []; + $apiParams['tokenId'] = $tokenId; + + $apiHeaders = []; + $apiHeaders['content-type'] = 'application/json'; + + return $this->client->call( + Client::METHOD_DELETE, + $apiPath, + $apiHeaders, + $apiParams + ); + } +} \ No newline at end of file diff --git a/src/Appwrite/Services/Users.php b/src/Appwrite/Services/Users.php index 53fedd2..e5c2841 100644 --- a/src/Appwrite/Services/Users.php +++ b/src/Appwrite/Services/Users.php @@ -684,10 +684,12 @@ public function listLogs(string $userId, ?array $queries = null): array * Get the user membership list by its unique ID. * * @param string $userId + * @param ?array $queries + * @param ?string $search * @throws AppwriteException * @return array */ - public function listMemberships(string $userId): array + public function listMemberships(string $userId, ?array $queries = null, ?string $search = null): array { $apiPath = str_replace( ['{userId}'], @@ -698,6 +700,14 @@ public function listMemberships(string $userId): array $apiParams = []; $apiParams['userId'] = $userId; + if (!is_null($queries)) { + $apiParams['queries'] = $queries; + } + + if (!is_null($search)) { + $apiParams['search'] = $search; + } + $apiHeaders = []; return $this->client->call( diff --git a/tests/Appwrite/Services/DatabasesTest.php b/tests/Appwrite/Services/DatabasesTest.php index a4c11e3..d8ecfd5 100644 --- a/tests/Appwrite/Services/DatabasesTest.php +++ b/tests/Appwrite/Services/DatabasesTest.php @@ -888,6 +888,83 @@ public function testMethodCreateDocument(): void { $this->assertSame($data, $response); } + public function testMethodCreateDocuments(): void { + + $data = array( + "total" => 5, + "documents" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->databases->createDocuments( + "", + "", + array() + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpsertDocuments(): void { + + $data = array( + "total" => 5, + "documents" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->databases->upsertDocuments( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpdateDocuments(): void { + + $data = array( + "total" => 5, + "documents" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->databases->updateDocuments( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodDeleteDocuments(): void { + + $data = array( + "total" => 5, + "documents" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->databases->deleteDocuments( + "", + "" + ); + + $this->assertSame($data, $response); + } + public function testMethodGetDocument(): void { $data = array( @@ -981,6 +1058,7 @@ public function testMethodCreateIndex(): void { "status" => "available", "error" => "string", "attributes" => array(), + "lengths" => array(), "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); @@ -1008,6 +1086,7 @@ public function testMethodGetIndex(): void { "status" => "available", "error" => "string", "attributes" => array(), + "lengths" => array(), "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); diff --git a/tests/Appwrite/Services/FunctionsTest.php b/tests/Appwrite/Services/FunctionsTest.php index 66266dd..c92a32c 100644 --- a/tests/Appwrite/Services/FunctionsTest.php +++ b/tests/Appwrite/Services/FunctionsTest.php @@ -45,7 +45,11 @@ public function testMethodCreate(): void { "live" => true, "logging" => true, "runtime" => "python-3.8", - "deployment" => "5e5ea5c16897e", + "deploymentId" => "5e5ea5c16897e", + "deploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId" => "5e5ea5c16897e", + "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus" => "ready", "scopes" => array(), "vars" => array(), "events" => array(), @@ -121,7 +125,11 @@ public function testMethodGet(): void { "live" => true, "logging" => true, "runtime" => "python-3.8", - "deployment" => "5e5ea5c16897e", + "deploymentId" => "5e5ea5c16897e", + "deploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId" => "5e5ea5c16897e", + "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus" => "ready", "scopes" => array(), "vars" => array(), "events" => array(), @@ -161,7 +169,11 @@ public function testMethodUpdate(): void { "live" => true, "logging" => true, "runtime" => "python-3.8", - "deployment" => "5e5ea5c16897e", + "deploymentId" => "5e5ea5c16897e", + "deploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId" => "5e5ea5c16897e", + "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus" => "ready", "scopes" => array(), "vars" => array(), "events" => array(), @@ -206,6 +218,51 @@ public function testMethodDelete(): void { $this->assertSame($data, $response); } + public function testMethodUpdateFunctionDeployment(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "execute" => array(), + "name" => "My Function", + "enabled" => true, + "live" => true, + "logging" => true, + "runtime" => "python-3.8", + "deploymentId" => "5e5ea5c16897e", + "deploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId" => "5e5ea5c16897e", + "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus" => "ready", + "scopes" => array(), + "vars" => array(), + "events" => array(), + "schedule" => "5 4 * * *", + "timeout" => 300, + "entrypoint" => "index.js", + "commands" => "npm install", + "version" => "v2", + "installationId" => "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId" => "appwrite", + "providerBranch" => "main", + "providerRootDirectory" => "functions/helloWorld", + "providerSilentMode" => true, + "specification" => "s-1vcpu-512mb",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->functions->updateFunctionDeployment( + "", + "" + ); + + $this->assertSame($data, $response); + } + public function testMethodListDeployments(): void { $data = array( @@ -234,13 +291,16 @@ public function testMethodCreateDeployment(): void { "resourceId" => "5e5ea6g16897e", "resourceType" => "functions", "entrypoint" => "index.js", - "size" => 128, + "sourceSize" => 128, "buildSize" => 128, + "totalSize" => 128, "buildId" => "5e5ea5c16897e", "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", "status" => "ready", "buildLogs" => "Compiling source files...", - "buildTime" => 128, + "buildDuration" => 128, "providerRepositoryName" => "database", "providerRepositoryOwner" => "utopia", "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", @@ -266,7 +326,7 @@ public function testMethodCreateDeployment(): void { $this->assertSame($data, $response); } - public function testMethodGetDeployment(): void { + public function testMethodCreateDuplicateDeployment(): void { $data = array( "\$id" => "5e5ea5c16897e", @@ -276,13 +336,16 @@ public function testMethodGetDeployment(): void { "resourceId" => "5e5ea6g16897e", "resourceType" => "functions", "entrypoint" => "index.js", - "size" => 128, + "sourceSize" => 128, "buildSize" => 128, + "totalSize" => 128, "buildId" => "5e5ea5c16897e", "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", "status" => "ready", "buildLogs" => "Compiling source files...", - "buildTime" => 128, + "buildDuration" => 128, "providerRepositoryName" => "database", "providerRepositoryOwner" => "utopia", "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", @@ -299,7 +362,7 @@ public function testMethodGetDeployment(): void { ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) ->andReturn($data); - $response = $this->functions->getDeployment( + $response = $this->functions->createDuplicateDeployment( "", "" ); @@ -307,74 +370,135 @@ public function testMethodGetDeployment(): void { $this->assertSame($data, $response); } - public function testMethodUpdateDeployment(): void { + public function testMethodCreateTemplateDeployment(): void { $data = array( "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), - "name" => "My Function", - "enabled" => true, - "live" => true, - "logging" => true, - "runtime" => "python-3.8", - "deployment" => "5e5ea5c16897e", - "scopes" => array(), - "vars" => array(), - "events" => array(), - "schedule" => "5 4 * * *", - "timeout" => 300, + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "entrypoint" => "index.js", - "commands" => "npm install", - "version" => "v2", - "installationId" => "6m40at4ejk5h2u9s1hboo", - "providerRepositoryId" => "appwrite", - "providerBranch" => "main", - "providerRootDirectory" => "functions/helloWorld", - "providerSilentMode" => true, - "specification" => "s-1vcpu-512mb",); + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) ->andReturn($data); - $response = $this->functions->updateDeployment( + $response = $this->functions->createTemplateDeployment( "", - "" + "", + "", + "", + "" ); $this->assertSame($data, $response); } - public function testMethodDeleteDeployment(): void { + public function testMethodCreateVcsDeployment(): void { - $data = ''; + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) ->andReturn($data); - $response = $this->functions->deleteDeployment( + $response = $this->functions->createVcsDeployment( "", - "" + "branch", + "" ); $this->assertSame($data, $response); } - public function testMethodCreateBuild(): void { + public function testMethodGetDeployment(): void { - $data = ''; + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) ->andReturn($data); - $response = $this->functions->createBuild( + $response = $this->functions->getDeployment( "", "" ); @@ -382,25 +506,16 @@ public function testMethodCreateBuild(): void { $this->assertSame($data, $response); } - public function testMethodUpdateDeploymentBuild(): void { + public function testMethodDeleteDeployment(): void { - $data = array( - "\$id" => "5e5ea5c16897e", - "deploymentId" => "5e5ea5c16897e", - "status" => "ready", - "stdout" => "", - "stderr" => "", - "startTime" => "2020-10-15T06:38:00.000+00:00", - "endTime" => "2020-10-15T06:38:00.000+00:00", - "duration" => 0, - "size" => 128,); + $data = ''; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) ->andReturn($data); - $response = $this->functions->updateDeploymentBuild( + $response = $this->functions->deleteDeployment( "", "" ); @@ -425,6 +540,50 @@ public function testMethodGetDeploymentDownload(): void { $this->assertSame($data, $response); } + public function testMethodUpdateDeploymentStatus(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->functions->updateDeploymentStatus( + "", + "" + ); + + $this->assertSame($data, $response); + } + public function testMethodListExecutions(): void { $data = array( @@ -551,6 +710,7 @@ public function testMethodCreateVariable(): void { "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "key" => "API_KEY", "value" => "myPa\$\$word1", + "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction",); @@ -576,6 +736,7 @@ public function testMethodGetVariable(): void { "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "key" => "API_KEY", "value" => "myPa\$\$word1", + "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction",); @@ -600,6 +761,7 @@ public function testMethodUpdateVariable(): void { "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "key" => "API_KEY", "value" => "myPa\$\$word1", + "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction",); diff --git a/tests/Appwrite/Services/SitesTest.php b/tests/Appwrite/Services/SitesTest.php new file mode 100644 index 0000000..2d287de --- /dev/null +++ b/tests/Appwrite/Services/SitesTest.php @@ -0,0 +1,773 @@ +client = Mockery::mock(Client::class); + $this->sites = new Sites($this->client); + } + + public function testMethodList(): void { + + $data = array( + "total" => 5, + "sites" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->list( + ); + + $this->assertSame($data, $response); + } + + public function testMethodCreate(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Site", + "enabled" => true, + "live" => true, + "logging" => true, + "framework" => "react", + "deploymentId" => "5e5ea5c16897e", + "deploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight" => "5e5ea5c16897e", + "deploymentScreenshotDark" => "5e5ea5c16897e", + "latestDeploymentId" => "5e5ea5c16897e", + "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus" => "ready", + "vars" => array(), + "timeout" => 300, + "installCommand" => "npm install", + "buildCommand" => "npm run build", + "outputDirectory" => "build", + "installationId" => "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId" => "appwrite", + "providerBranch" => "main", + "providerRootDirectory" => "sites/helloWorld", + "providerSilentMode" => true, + "specification" => "s-1vcpu-512mb", + "buildRuntime" => "node-22", + "adapter" => "static", + "fallbackFile" => "index.html",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->create( + "", + "", + "analog", + "node-14.5" + ); + + $this->assertSame($data, $response); + } + + public function testMethodListFrameworks(): void { + + $data = array( + "total" => 5, + "frameworks" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->listFrameworks( + ); + + $this->assertSame($data, $response); + } + + public function testMethodListSpecifications(): void { + + $data = array( + "total" => 5, + "specifications" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->listSpecifications( + ); + + $this->assertSame($data, $response); + } + + public function testMethodGet(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Site", + "enabled" => true, + "live" => true, + "logging" => true, + "framework" => "react", + "deploymentId" => "5e5ea5c16897e", + "deploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight" => "5e5ea5c16897e", + "deploymentScreenshotDark" => "5e5ea5c16897e", + "latestDeploymentId" => "5e5ea5c16897e", + "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus" => "ready", + "vars" => array(), + "timeout" => 300, + "installCommand" => "npm install", + "buildCommand" => "npm run build", + "outputDirectory" => "build", + "installationId" => "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId" => "appwrite", + "providerBranch" => "main", + "providerRootDirectory" => "sites/helloWorld", + "providerSilentMode" => true, + "specification" => "s-1vcpu-512mb", + "buildRuntime" => "node-22", + "adapter" => "static", + "fallbackFile" => "index.html",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->get( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpdate(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Site", + "enabled" => true, + "live" => true, + "logging" => true, + "framework" => "react", + "deploymentId" => "5e5ea5c16897e", + "deploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight" => "5e5ea5c16897e", + "deploymentScreenshotDark" => "5e5ea5c16897e", + "latestDeploymentId" => "5e5ea5c16897e", + "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus" => "ready", + "vars" => array(), + "timeout" => 300, + "installCommand" => "npm install", + "buildCommand" => "npm run build", + "outputDirectory" => "build", + "installationId" => "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId" => "appwrite", + "providerBranch" => "main", + "providerRootDirectory" => "sites/helloWorld", + "providerSilentMode" => true, + "specification" => "s-1vcpu-512mb", + "buildRuntime" => "node-22", + "adapter" => "static", + "fallbackFile" => "index.html",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->update( + "", + "", + "analog" + ); + + $this->assertSame($data, $response); + } + + public function testMethodDelete(): void { + + $data = ''; + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->delete( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpdateSiteDeployment(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "name" => "My Site", + "enabled" => true, + "live" => true, + "logging" => true, + "framework" => "react", + "deploymentId" => "5e5ea5c16897e", + "deploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight" => "5e5ea5c16897e", + "deploymentScreenshotDark" => "5e5ea5c16897e", + "latestDeploymentId" => "5e5ea5c16897e", + "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus" => "ready", + "vars" => array(), + "timeout" => 300, + "installCommand" => "npm install", + "buildCommand" => "npm run build", + "outputDirectory" => "build", + "installationId" => "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId" => "appwrite", + "providerBranch" => "main", + "providerRootDirectory" => "sites/helloWorld", + "providerSilentMode" => true, + "specification" => "s-1vcpu-512mb", + "buildRuntime" => "node-22", + "adapter" => "static", + "fallbackFile" => "index.html",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->updateSiteDeployment( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodListDeployments(): void { + + $data = array( + "total" => 5, + "deployments" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->listDeployments( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodCreateDeployment(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->createDeployment( + "", + InputFile::withData('', "image/png"), + true + ); + + $this->assertSame($data, $response); + } + + public function testMethodCreateDuplicateDeployment(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->createDuplicateDeployment( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodCreateTemplateDeployment(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->createTemplateDeployment( + "", + "", + "", + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodCreateVcsDeployment(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->createVcsDeployment( + "", + "branch", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodGetDeployment(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->getDeployment( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodDeleteDeployment(): void { + + $data = ''; + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->deleteDeployment( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodGetDeploymentDownload(): void { + + $data = ''; + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->getDeploymentDownload( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpdateDeploymentStatus(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "type" => "vcs", + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", + "entrypoint" => "index.js", + "sourceSize" => 128, + "buildSize" => 128, + "totalSize" => 128, + "buildId" => "5e5ea5c16897e", + "activate" => true, + "screenshotLight" => "5e5ea5c16897e", + "screenshotDark" => "5e5ea5c16897e", + "status" => "ready", + "buildLogs" => "Compiling source files...", + "buildDuration" => 128, + "providerRepositoryName" => "database", + "providerRepositoryOwner" => "utopia", + "providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function", + "providerBranch" => "0.7.x", + "providerCommitHash" => "7c3f25d", + "providerCommitAuthorUrl" => "https://github.com/vermakhushboo", + "providerCommitAuthor" => "Khushboo Verma", + "providerCommitMessage" => "Update index.js", + "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->updateDeploymentStatus( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodListLogs(): void { + + $data = array( + "total" => 5, + "executions" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->listLogs( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodGetLog(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "\$permissions" => array(), + "functionId" => "5e5ea6g16897e", + "trigger" => "http", + "status" => "processing", + "requestMethod" => "GET", + "requestPath" => "/articles?id=5", + "requestHeaders" => array(), + "responseStatusCode" => 200, + "responseBody" => "", + "responseHeaders" => array(), + "logs" => "", + "errors" => "", + "duration" => 0.4,); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->getLog( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodDeleteLog(): void { + + $data = ''; + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->deleteLog( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodListVariables(): void { + + $data = array( + "total" => 5, + "variables" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->listVariables( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodCreateVariable(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "key" => "API_KEY", + "value" => "myPa\$\$word1", + "secret" => true, + "resourceType" => "function", + "resourceId" => "myAwesomeFunction",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->createVariable( + "", + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodGetVariable(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "key" => "API_KEY", + "value" => "myPa\$\$word1", + "secret" => true, + "resourceType" => "function", + "resourceId" => "myAwesomeFunction",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->getVariable( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpdateVariable(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", + "key" => "API_KEY", + "value" => "myPa\$\$word1", + "secret" => true, + "resourceType" => "function", + "resourceId" => "myAwesomeFunction",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->updateVariable( + "", + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodDeleteVariable(): void { + + $data = ''; + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->sites->deleteVariable( + "", + "" + ); + + $this->assertSame($data, $response); + } + +} diff --git a/tests/Appwrite/Services/TokensTest.php b/tests/Appwrite/Services/TokensTest.php new file mode 100644 index 0000000..550b608 --- /dev/null +++ b/tests/Appwrite/Services/TokensTest.php @@ -0,0 +1,124 @@ +client = Mockery::mock(Client::class); + $this->tokens = new Tokens($this->client); + } + + public function testMethodList(): void { + + $data = array( + "total" => 5, + "tokens" => array(),); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->tokens->list( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodCreateFileToken(): void { + + $data = array( + "\$id" => "bb8ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType" => "files", + "expire" => "2020-10-15T06:38:00.000+00:00", + "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt" => "2020-10-15T06:38:00.000+00:00",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->tokens->createFileToken( + "", + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodGet(): void { + + $data = array( + "\$id" => "bb8ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType" => "files", + "expire" => "2020-10-15T06:38:00.000+00:00", + "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt" => "2020-10-15T06:38:00.000+00:00",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->tokens->get( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodUpdate(): void { + + $data = array( + "\$id" => "bb8ea5c16897e", + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType" => "files", + "expire" => "2020-10-15T06:38:00.000+00:00", + "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt" => "2020-10-15T06:38:00.000+00:00",); + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->tokens->update( + "" + ); + + $this->assertSame($data, $response); + } + + public function testMethodDelete(): void { + + $data = ''; + + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->tokens->delete( + "" + ); + + $this->assertSame($data, $response); + } + +} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy