diff --git a/CHANGELOG.md b/CHANGELOG.md index 345fee4..b8d0be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ # Change Log -## 20.1.0 +## 20.2.0 -* Fix doc examples with proper formatting +* Added optional encrypt parameter for database attributes (Text, Longtext, Mediumtext, Varchar) and corresponding column creation methods to enable encryption at rest. Encrypted attributes/columns cannot be queried. +* Updated API docs and code examples to include the new encrypt option (defaulting to false) across databases and TablesDB sections. +* Updated README compatibility note to reflect Appwrite server version 1.8.x. * Add support for the new `Backups` service +## 20.0.1 + +* Fix doc examples with proper formatting + ## 20.0.0 * Add array-based enum parameters (e.g., `permissions: array`). diff --git a/README.md b/README.md index 6f4db85..9713e5d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![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 latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).** +**This SDK is compatible with Appwrite server version 1.8.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 abstracts and simplifies 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/activities.md b/docs/activities.md new file mode 100644 index 0000000..06b40cb --- /dev/null +++ b/docs/activities.md @@ -0,0 +1,29 @@ +# Activities Service + + +```http request +GET https://cloud.appwrite.io/v1/activities/events +``` + +** List all events for selected filters. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| queries | string | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. | [] | + + +```http request +GET https://cloud.appwrite.io/v1/activities/events/{eventId} +``` + +** Get event by ID. + ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| eventId | string | **Required** Event ID. | | + diff --git a/docs/databases.md b/docs/databases.md index b719a18..f677835 100644 --- a/docs/databases.md +++ b/docs/databases.md @@ -577,6 +577,7 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collection | required | boolean | Is attribute required? | | | default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | | | array | boolean | Is attribute an array? | | +| encrypt | boolean | Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. | | ```http request @@ -615,6 +616,7 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collection | required | boolean | Is attribute required? | | | default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | | | array | boolean | Is attribute an array? | | +| encrypt | boolean | Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. | | ```http request @@ -785,6 +787,7 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collection | required | boolean | Is attribute required? | | | default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | | | array | boolean | Is attribute an array? | | +| encrypt | boolean | Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. | | ```http request @@ -862,6 +865,7 @@ POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collection | required | boolean | Is attribute required? | | | default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | | | array | boolean | Is attribute an array? | | +| encrypt | boolean | Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. | | ```http request diff --git a/docs/examples/health/get-queue-threats.md b/docs/examples/activities/get-event.md similarity index 66% rename from docs/examples/health/get-queue-threats.md rename to docs/examples/activities/get-event.md index 8ccfb0d..6b8f542 100644 --- a/docs/examples/health/get-queue-threats.md +++ b/docs/examples/activities/get-event.md @@ -2,15 +2,15 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$activities = new Activities($client); -$result = $health->getQueueThreats( - threshold: null // optional +$result = $activities->getEvent( + eventId: '' );``` diff --git a/docs/examples/health/get-queue-priority-builds.md b/docs/examples/activities/list-events.md similarity index 65% rename from docs/examples/health/get-queue-priority-builds.md rename to docs/examples/activities/list-events.md index b7a97a5..ef9a9d7 100644 --- a/docs/examples/health/get-queue-priority-builds.md +++ b/docs/examples/activities/list-events.md @@ -2,15 +2,15 @@ setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID ->setKey(''); // Your secret API key -$health = new Health($client); +$activities = new Activities($client); -$result = $health->getQueuePriorityBuilds( - threshold: null // optional +$result = $activities->listEvents( + queries: '' // optional );``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index 9c3b4a6..cc597b5 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -17,5 +17,6 @@ $result = $databases->createLongtextAttribute( key: '', required: false, default: '', // optional - array: false // optional + array: false, // optional + encrypt: false // optional );``` diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index 9c3a78f..16fbe80 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -17,5 +17,6 @@ $result = $databases->createMediumtextAttribute( key: '', required: false, default: '', // optional - array: false // optional + array: false, // optional + encrypt: false // optional );``` diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index b123b1b..30067dc 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -17,5 +17,6 @@ $result = $databases->createTextAttribute( key: '', required: false, default: '', // optional - array: false // optional + array: false, // optional + encrypt: false // optional );``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 31a1028..1ebbff5 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -18,5 +18,6 @@ $result = $databases->createVarcharAttribute( size: 1, required: false, default: '', // optional - array: false // optional + array: false, // optional + encrypt: false // optional );``` diff --git a/docs/examples/health/get-queue-billing-project-aggregation.md b/docs/examples/health/get-queue-billing-project-aggregation.md deleted file mode 100644 index e04fc2e..0000000 --- a/docs/examples/health/get-queue-billing-project-aggregation.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueBillingProjectAggregation( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-billing-team-aggregation.md b/docs/examples/health/get-queue-billing-team-aggregation.md deleted file mode 100644 index 37fa4d2..0000000 --- a/docs/examples/health/get-queue-billing-team-aggregation.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueBillingTeamAggregation( - threshold: null // optional -);``` diff --git a/docs/examples/health/get-queue-region-manager.md b/docs/examples/health/get-queue-region-manager.md deleted file mode 100644 index 11b63f7..0000000 --- a/docs/examples/health/get-queue-region-manager.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$health = new Health($client); - -$result = $health->getQueueRegionManager( - threshold: null // optional -);``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index cb2bd85..2b53666 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -17,5 +17,6 @@ $result = $tablesDB->createLongtextColumn( key: '', required: false, default: '', // optional - array: false // optional + array: false, // optional + encrypt: false // optional );``` diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index b17328c..0fbd9ca 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -17,5 +17,6 @@ $result = $tablesDB->createMediumtextColumn( key: '', required: false, default: '', // optional - array: false // optional + array: false, // optional + encrypt: false // optional );``` diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index 833aa90..8d28392 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -17,5 +17,6 @@ $result = $tablesDB->createTextColumn( key: '', required: false, default: '', // optional - array: false // optional + array: false, // optional + encrypt: false // optional );``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 25aa354..2f93192 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -18,5 +18,6 @@ $result = $tablesDB->createVarcharColumn( size: 1, required: false, default: '', // optional - array: false // optional + array: false, // optional + encrypt: false // optional );``` diff --git a/docs/tablesdb.md b/docs/tablesdb.md index 863408d..f2eb6b0 100644 --- a/docs/tablesdb.md +++ b/docs/tablesdb.md @@ -576,6 +576,7 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/columns | required | boolean | Is column required? | | | default | string | Default value for column when not provided. Cannot be set when column is required. | | | array | boolean | Is column an array? | | +| encrypt | boolean | Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. | | ```http request @@ -614,6 +615,7 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/columns | required | boolean | Is column required? | | | default | string | Default value for column when not provided. Cannot be set when column is required. | | | array | boolean | Is column an array? | | +| encrypt | boolean | Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. | | ```http request @@ -784,6 +786,7 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/columns | required | boolean | Is column required? | | | default | string | Default value for column when not provided. Cannot be set when column is required. | | | array | boolean | Is column an array? | | +| encrypt | boolean | Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. | | ```http request @@ -861,6 +864,7 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/columns | required | boolean | Is column required? | | | default | string | Default value for column when not provided. Cannot be set when column is required. | | | array | boolean | Is column an array? | | +| encrypt | boolean | Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. | | ```http request diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 8823ff0..0a744c8 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/20.1.0 ()', + 'user-agent' => 'AppwritePHPSDK/20.2.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '20.1.0', + 'x-sdk-version'=> '20.2.0', ]; /** diff --git a/src/Appwrite/Enums/BuildRuntime.php b/src/Appwrite/Enums/BuildRuntime.php index a7fe12a..f0d01a0 100644 --- a/src/Appwrite/Enums/BuildRuntime.php +++ b/src/Appwrite/Enums/BuildRuntime.php @@ -13,24 +13,35 @@ class BuildRuntime implements JsonSerializable private static BuildRuntime $NODE200; private static BuildRuntime $NODE210; private static BuildRuntime $NODE22; + private static BuildRuntime $NODE23; + private static BuildRuntime $NODE24; + private static BuildRuntime $NODE25; private static BuildRuntime $PHP80; private static BuildRuntime $PHP81; private static BuildRuntime $PHP82; private static BuildRuntime $PHP83; + private static BuildRuntime $PHP84; private static BuildRuntime $RUBY30; private static BuildRuntime $RUBY31; private static BuildRuntime $RUBY32; private static BuildRuntime $RUBY33; + private static BuildRuntime $RUBY34; + private static BuildRuntime $RUBY40; private static BuildRuntime $PYTHON38; private static BuildRuntime $PYTHON39; private static BuildRuntime $PYTHON310; private static BuildRuntime $PYTHON311; private static BuildRuntime $PYTHON312; + private static BuildRuntime $PYTHON313; + private static BuildRuntime $PYTHON314; private static BuildRuntime $PYTHONML311; private static BuildRuntime $PYTHONML312; + private static BuildRuntime $PYTHONML313; private static BuildRuntime $DENO140; private static BuildRuntime $DENO146; private static BuildRuntime $DENO20; + private static BuildRuntime $DENO25; + private static BuildRuntime $DENO26; private static BuildRuntime $DART215; private static BuildRuntime $DART216; private static BuildRuntime $DART217; @@ -46,25 +57,34 @@ class BuildRuntime implements JsonSerializable private static BuildRuntime $DOTNET60; private static BuildRuntime $DOTNET70; private static BuildRuntime $DOTNET80; + private static BuildRuntime $DOTNET10; private static BuildRuntime $JAVA80; private static BuildRuntime $JAVA110; private static BuildRuntime $JAVA170; private static BuildRuntime $JAVA180; private static BuildRuntime $JAVA210; private static BuildRuntime $JAVA22; + private static BuildRuntime $JAVA25; private static BuildRuntime $SWIFT55; private static BuildRuntime $SWIFT58; private static BuildRuntime $SWIFT59; private static BuildRuntime $SWIFT510; + private static BuildRuntime $SWIFT62; private static BuildRuntime $KOTLIN16; private static BuildRuntime $KOTLIN18; private static BuildRuntime $KOTLIN19; private static BuildRuntime $KOTLIN20; + private static BuildRuntime $KOTLIN23; private static BuildRuntime $CPP17; private static BuildRuntime $CPP20; private static BuildRuntime $BUN10; private static BuildRuntime $BUN11; + private static BuildRuntime $BUN12; + private static BuildRuntime $BUN13; private static BuildRuntime $GO123; + private static BuildRuntime $GO124; + private static BuildRuntime $GO125; + private static BuildRuntime $GO126; private static BuildRuntime $STATIC1; private static BuildRuntime $FLUTTER324; private static BuildRuntime $FLUTTER327; @@ -139,6 +159,27 @@ public static function NODE22(): BuildRuntime } return self::$NODE22; } + public static function NODE23(): BuildRuntime + { + if (!isset(self::$NODE23)) { + self::$NODE23 = new BuildRuntime('node-23'); + } + return self::$NODE23; + } + public static function NODE24(): BuildRuntime + { + if (!isset(self::$NODE24)) { + self::$NODE24 = new BuildRuntime('node-24'); + } + return self::$NODE24; + } + public static function NODE25(): BuildRuntime + { + if (!isset(self::$NODE25)) { + self::$NODE25 = new BuildRuntime('node-25'); + } + return self::$NODE25; + } public static function PHP80(): BuildRuntime { if (!isset(self::$PHP80)) { @@ -167,6 +208,13 @@ public static function PHP83(): BuildRuntime } return self::$PHP83; } + public static function PHP84(): BuildRuntime + { + if (!isset(self::$PHP84)) { + self::$PHP84 = new BuildRuntime('php-8.4'); + } + return self::$PHP84; + } public static function RUBY30(): BuildRuntime { if (!isset(self::$RUBY30)) { @@ -195,6 +243,20 @@ public static function RUBY33(): BuildRuntime } return self::$RUBY33; } + public static function RUBY34(): BuildRuntime + { + if (!isset(self::$RUBY34)) { + self::$RUBY34 = new BuildRuntime('ruby-3.4'); + } + return self::$RUBY34; + } + public static function RUBY40(): BuildRuntime + { + if (!isset(self::$RUBY40)) { + self::$RUBY40 = new BuildRuntime('ruby-4.0'); + } + return self::$RUBY40; + } public static function PYTHON38(): BuildRuntime { if (!isset(self::$PYTHON38)) { @@ -230,6 +292,20 @@ public static function PYTHON312(): BuildRuntime } return self::$PYTHON312; } + public static function PYTHON313(): BuildRuntime + { + if (!isset(self::$PYTHON313)) { + self::$PYTHON313 = new BuildRuntime('python-3.13'); + } + return self::$PYTHON313; + } + public static function PYTHON314(): BuildRuntime + { + if (!isset(self::$PYTHON314)) { + self::$PYTHON314 = new BuildRuntime('python-3.14'); + } + return self::$PYTHON314; + } public static function PYTHONML311(): BuildRuntime { if (!isset(self::$PYTHONML311)) { @@ -244,6 +320,13 @@ public static function PYTHONML312(): BuildRuntime } return self::$PYTHONML312; } + public static function PYTHONML313(): BuildRuntime + { + if (!isset(self::$PYTHONML313)) { + self::$PYTHONML313 = new BuildRuntime('python-ml-3.13'); + } + return self::$PYTHONML313; + } public static function DENO140(): BuildRuntime { if (!isset(self::$DENO140)) { @@ -265,6 +348,20 @@ public static function DENO20(): BuildRuntime } return self::$DENO20; } + public static function DENO25(): BuildRuntime + { + if (!isset(self::$DENO25)) { + self::$DENO25 = new BuildRuntime('deno-2.5'); + } + return self::$DENO25; + } + public static function DENO26(): BuildRuntime + { + if (!isset(self::$DENO26)) { + self::$DENO26 = new BuildRuntime('deno-2.6'); + } + return self::$DENO26; + } public static function DART215(): BuildRuntime { if (!isset(self::$DART215)) { @@ -370,6 +467,13 @@ public static function DOTNET80(): BuildRuntime } return self::$DOTNET80; } + public static function DOTNET10(): BuildRuntime + { + if (!isset(self::$DOTNET10)) { + self::$DOTNET10 = new BuildRuntime('dotnet-10'); + } + return self::$DOTNET10; + } public static function JAVA80(): BuildRuntime { if (!isset(self::$JAVA80)) { @@ -412,6 +516,13 @@ public static function JAVA22(): BuildRuntime } return self::$JAVA22; } + public static function JAVA25(): BuildRuntime + { + if (!isset(self::$JAVA25)) { + self::$JAVA25 = new BuildRuntime('java-25'); + } + return self::$JAVA25; + } public static function SWIFT55(): BuildRuntime { if (!isset(self::$SWIFT55)) { @@ -440,6 +551,13 @@ public static function SWIFT510(): BuildRuntime } return self::$SWIFT510; } + public static function SWIFT62(): BuildRuntime + { + if (!isset(self::$SWIFT62)) { + self::$SWIFT62 = new BuildRuntime('swift-6.2'); + } + return self::$SWIFT62; + } public static function KOTLIN16(): BuildRuntime { if (!isset(self::$KOTLIN16)) { @@ -468,6 +586,13 @@ public static function KOTLIN20(): BuildRuntime } return self::$KOTLIN20; } + public static function KOTLIN23(): BuildRuntime + { + if (!isset(self::$KOTLIN23)) { + self::$KOTLIN23 = new BuildRuntime('kotlin-2.3'); + } + return self::$KOTLIN23; + } public static function CPP17(): BuildRuntime { if (!isset(self::$CPP17)) { @@ -496,6 +621,20 @@ public static function BUN11(): BuildRuntime } return self::$BUN11; } + public static function BUN12(): BuildRuntime + { + if (!isset(self::$BUN12)) { + self::$BUN12 = new BuildRuntime('bun-1.2'); + } + return self::$BUN12; + } + public static function BUN13(): BuildRuntime + { + if (!isset(self::$BUN13)) { + self::$BUN13 = new BuildRuntime('bun-1.3'); + } + return self::$BUN13; + } public static function GO123(): BuildRuntime { if (!isset(self::$GO123)) { @@ -503,6 +642,27 @@ public static function GO123(): BuildRuntime } return self::$GO123; } + public static function GO124(): BuildRuntime + { + if (!isset(self::$GO124)) { + self::$GO124 = new BuildRuntime('go-1.24'); + } + return self::$GO124; + } + public static function GO125(): BuildRuntime + { + if (!isset(self::$GO125)) { + self::$GO125 = new BuildRuntime('go-1.25'); + } + return self::$GO125; + } + public static function GO126(): BuildRuntime + { + if (!isset(self::$GO126)) { + self::$GO126 = new BuildRuntime('go-1.26'); + } + return self::$GO126; + } public static function STATIC1(): BuildRuntime { if (!isset(self::$STATIC1)) { diff --git a/src/Appwrite/Enums/Runtime.php b/src/Appwrite/Enums/Runtime.php index 0c5eeab..2388a96 100644 --- a/src/Appwrite/Enums/Runtime.php +++ b/src/Appwrite/Enums/Runtime.php @@ -13,24 +13,35 @@ class Runtime implements JsonSerializable private static Runtime $NODE200; private static Runtime $NODE210; private static Runtime $NODE22; + private static Runtime $NODE23; + private static Runtime $NODE24; + private static Runtime $NODE25; private static Runtime $PHP80; private static Runtime $PHP81; private static Runtime $PHP82; private static Runtime $PHP83; + private static Runtime $PHP84; private static Runtime $RUBY30; private static Runtime $RUBY31; private static Runtime $RUBY32; private static Runtime $RUBY33; + private static Runtime $RUBY34; + private static Runtime $RUBY40; private static Runtime $PYTHON38; private static Runtime $PYTHON39; private static Runtime $PYTHON310; private static Runtime $PYTHON311; private static Runtime $PYTHON312; + private static Runtime $PYTHON313; + private static Runtime $PYTHON314; private static Runtime $PYTHONML311; private static Runtime $PYTHONML312; + private static Runtime $PYTHONML313; private static Runtime $DENO140; private static Runtime $DENO146; private static Runtime $DENO20; + private static Runtime $DENO25; + private static Runtime $DENO26; private static Runtime $DART215; private static Runtime $DART216; private static Runtime $DART217; @@ -46,25 +57,34 @@ class Runtime implements JsonSerializable private static Runtime $DOTNET60; private static Runtime $DOTNET70; private static Runtime $DOTNET80; + private static Runtime $DOTNET10; private static Runtime $JAVA80; private static Runtime $JAVA110; private static Runtime $JAVA170; private static Runtime $JAVA180; private static Runtime $JAVA210; private static Runtime $JAVA22; + private static Runtime $JAVA25; private static Runtime $SWIFT55; private static Runtime $SWIFT58; private static Runtime $SWIFT59; private static Runtime $SWIFT510; + private static Runtime $SWIFT62; private static Runtime $KOTLIN16; private static Runtime $KOTLIN18; private static Runtime $KOTLIN19; private static Runtime $KOTLIN20; + private static Runtime $KOTLIN23; private static Runtime $CPP17; private static Runtime $CPP20; private static Runtime $BUN10; private static Runtime $BUN11; + private static Runtime $BUN12; + private static Runtime $BUN13; private static Runtime $GO123; + private static Runtime $GO124; + private static Runtime $GO125; + private static Runtime $GO126; private static Runtime $STATIC1; private static Runtime $FLUTTER324; private static Runtime $FLUTTER327; @@ -139,6 +159,27 @@ public static function NODE22(): Runtime } return self::$NODE22; } + public static function NODE23(): Runtime + { + if (!isset(self::$NODE23)) { + self::$NODE23 = new Runtime('node-23'); + } + return self::$NODE23; + } + public static function NODE24(): Runtime + { + if (!isset(self::$NODE24)) { + self::$NODE24 = new Runtime('node-24'); + } + return self::$NODE24; + } + public static function NODE25(): Runtime + { + if (!isset(self::$NODE25)) { + self::$NODE25 = new Runtime('node-25'); + } + return self::$NODE25; + } public static function PHP80(): Runtime { if (!isset(self::$PHP80)) { @@ -167,6 +208,13 @@ public static function PHP83(): Runtime } return self::$PHP83; } + public static function PHP84(): Runtime + { + if (!isset(self::$PHP84)) { + self::$PHP84 = new Runtime('php-8.4'); + } + return self::$PHP84; + } public static function RUBY30(): Runtime { if (!isset(self::$RUBY30)) { @@ -195,6 +243,20 @@ public static function RUBY33(): Runtime } return self::$RUBY33; } + public static function RUBY34(): Runtime + { + if (!isset(self::$RUBY34)) { + self::$RUBY34 = new Runtime('ruby-3.4'); + } + return self::$RUBY34; + } + public static function RUBY40(): Runtime + { + if (!isset(self::$RUBY40)) { + self::$RUBY40 = new Runtime('ruby-4.0'); + } + return self::$RUBY40; + } public static function PYTHON38(): Runtime { if (!isset(self::$PYTHON38)) { @@ -230,6 +292,20 @@ public static function PYTHON312(): Runtime } return self::$PYTHON312; } + public static function PYTHON313(): Runtime + { + if (!isset(self::$PYTHON313)) { + self::$PYTHON313 = new Runtime('python-3.13'); + } + return self::$PYTHON313; + } + public static function PYTHON314(): Runtime + { + if (!isset(self::$PYTHON314)) { + self::$PYTHON314 = new Runtime('python-3.14'); + } + return self::$PYTHON314; + } public static function PYTHONML311(): Runtime { if (!isset(self::$PYTHONML311)) { @@ -244,6 +320,13 @@ public static function PYTHONML312(): Runtime } return self::$PYTHONML312; } + public static function PYTHONML313(): Runtime + { + if (!isset(self::$PYTHONML313)) { + self::$PYTHONML313 = new Runtime('python-ml-3.13'); + } + return self::$PYTHONML313; + } public static function DENO140(): Runtime { if (!isset(self::$DENO140)) { @@ -265,6 +348,20 @@ public static function DENO20(): Runtime } return self::$DENO20; } + public static function DENO25(): Runtime + { + if (!isset(self::$DENO25)) { + self::$DENO25 = new Runtime('deno-2.5'); + } + return self::$DENO25; + } + public static function DENO26(): Runtime + { + if (!isset(self::$DENO26)) { + self::$DENO26 = new Runtime('deno-2.6'); + } + return self::$DENO26; + } public static function DART215(): Runtime { if (!isset(self::$DART215)) { @@ -370,6 +467,13 @@ public static function DOTNET80(): Runtime } return self::$DOTNET80; } + public static function DOTNET10(): Runtime + { + if (!isset(self::$DOTNET10)) { + self::$DOTNET10 = new Runtime('dotnet-10'); + } + return self::$DOTNET10; + } public static function JAVA80(): Runtime { if (!isset(self::$JAVA80)) { @@ -412,6 +516,13 @@ public static function JAVA22(): Runtime } return self::$JAVA22; } + public static function JAVA25(): Runtime + { + if (!isset(self::$JAVA25)) { + self::$JAVA25 = new Runtime('java-25'); + } + return self::$JAVA25; + } public static function SWIFT55(): Runtime { if (!isset(self::$SWIFT55)) { @@ -440,6 +551,13 @@ public static function SWIFT510(): Runtime } return self::$SWIFT510; } + public static function SWIFT62(): Runtime + { + if (!isset(self::$SWIFT62)) { + self::$SWIFT62 = new Runtime('swift-6.2'); + } + return self::$SWIFT62; + } public static function KOTLIN16(): Runtime { if (!isset(self::$KOTLIN16)) { @@ -468,6 +586,13 @@ public static function KOTLIN20(): Runtime } return self::$KOTLIN20; } + public static function KOTLIN23(): Runtime + { + if (!isset(self::$KOTLIN23)) { + self::$KOTLIN23 = new Runtime('kotlin-2.3'); + } + return self::$KOTLIN23; + } public static function CPP17(): Runtime { if (!isset(self::$CPP17)) { @@ -496,6 +621,20 @@ public static function BUN11(): Runtime } return self::$BUN11; } + public static function BUN12(): Runtime + { + if (!isset(self::$BUN12)) { + self::$BUN12 = new Runtime('bun-1.2'); + } + return self::$BUN12; + } + public static function BUN13(): Runtime + { + if (!isset(self::$BUN13)) { + self::$BUN13 = new Runtime('bun-1.3'); + } + return self::$BUN13; + } public static function GO123(): Runtime { if (!isset(self::$GO123)) { @@ -503,6 +642,27 @@ public static function GO123(): Runtime } return self::$GO123; } + public static function GO124(): Runtime + { + if (!isset(self::$GO124)) { + self::$GO124 = new Runtime('go-1.24'); + } + return self::$GO124; + } + public static function GO125(): Runtime + { + if (!isset(self::$GO125)) { + self::$GO125 = new Runtime('go-1.25'); + } + return self::$GO125; + } + public static function GO126(): Runtime + { + if (!isset(self::$GO126)) { + self::$GO126 = new Runtime('go-1.26'); + } + return self::$GO126; + } public static function STATIC1(): Runtime { if (!isset(self::$STATIC1)) { diff --git a/src/Appwrite/Enums/Scopes.php b/src/Appwrite/Enums/Scopes.php index 9634724..e9478f1 100644 --- a/src/Appwrite/Enums/Scopes.php +++ b/src/Appwrite/Enums/Scopes.php @@ -54,6 +54,8 @@ class Scopes implements JsonSerializable private static Scopes $TARGETSWRITE; private static Scopes $RULESREAD; private static Scopes $RULESWRITE; + private static Scopes $SCHEDULESREAD; + private static Scopes $SCHEDULESWRITE; private static Scopes $MIGRATIONSREAD; private static Scopes $MIGRATIONSWRITE; private static Scopes $VCSREAD; @@ -69,6 +71,7 @@ class Scopes implements JsonSerializable private static Scopes $RESTORATIONSWRITE; private static Scopes $DOMAINSREAD; private static Scopes $DOMAINSWRITE; + private static Scopes $EVENTSREAD; private string $value; @@ -423,6 +426,20 @@ public static function RULESWRITE(): Scopes } return self::$RULESWRITE; } + public static function SCHEDULESREAD(): Scopes + { + if (!isset(self::$SCHEDULESREAD)) { + self::$SCHEDULESREAD = new Scopes('schedules.read'); + } + return self::$SCHEDULESREAD; + } + public static function SCHEDULESWRITE(): Scopes + { + if (!isset(self::$SCHEDULESWRITE)) { + self::$SCHEDULESWRITE = new Scopes('schedules.write'); + } + return self::$SCHEDULESWRITE; + } public static function MIGRATIONSREAD(): Scopes { if (!isset(self::$MIGRATIONSREAD)) { @@ -528,4 +545,11 @@ public static function DOMAINSWRITE(): Scopes } return self::$DOMAINSWRITE; } + public static function EVENTSREAD(): Scopes + { + if (!isset(self::$EVENTSREAD)) { + self::$EVENTSREAD = new Scopes('events.read'); + } + return self::$EVENTSREAD; + } } \ No newline at end of file diff --git a/src/Appwrite/Query.php b/src/Appwrite/Query.php index 75586e6..a423864 100644 --- a/src/Appwrite/Query.php +++ b/src/Appwrite/Query.php @@ -268,6 +268,10 @@ public static function offset(int $offset): string /** * Contains * + * Filter resources where attribute contains the specified value. + * For string attributes, checks if the string contains the substring. + * + * Note: For array attributes, use containsAny() or containsAll() instead. * @param string $attribute * @param mixed $value * @return string @@ -277,6 +281,38 @@ public static function contains(string $attribute, $value): string return (new Query('contains', $attribute, $value))->__toString(); } + /** + * Contains Any + * + * Filter resources where attribute contains ANY of the specified values. + * For array and relationship attributes, matches documents where the attribute + * contains at least one of the given values. + * + * @param string $attribute + * @param array $value + * @return string + */ + public static function containsAny(string $attribute, array $value): string + { + return (new Query('containsAny', $attribute, $value))->__toString(); + } + + /** + * Contains All + * + * Filter resources where attribute contains ALL of the specified values. + * For array and relationship attributes, matches documents where the attribute + * contains every one of the given values. + * + * @param string $attribute + * @param array $value + * @return string + */ + public static function containsAll(string $attribute, array $value): string + { + return (new Query('containsAll', $attribute, $value))->__toString(); + } + /** * Not Contains * diff --git a/src/Appwrite/Services/Activities.php b/src/Appwrite/Services/Activities.php new file mode 100644 index 0000000..b8c0e83 --- /dev/null +++ b/src/Appwrite/Services/Activities.php @@ -0,0 +1,76 @@ +client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } + + /** + * Get event by ID. + * + * + * @param string $eventId + * @throws AppwriteException + * @return array + */ + public function getEvent(string $eventId): array + { + $apiPath = str_replace( + ['{eventId}'], + [$eventId], + '/activities/events/{eventId}' + ); + + $apiParams = []; + $apiParams['eventId'] = $eventId; + + $apiHeaders = []; + + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); + } +} \ No newline at end of file diff --git a/src/Appwrite/Services/Databases.php b/src/Appwrite/Services/Databases.php index b4aa42c..4354e07 100644 --- a/src/Appwrite/Services/Databases.php +++ b/src/Appwrite/Services/Databases.php @@ -1417,10 +1417,11 @@ public function updateLineAttribute(string $databaseId, string $collectionId, st * @param bool $required * @param ?string $xdefault * @param ?bool $xarray + * @param ?bool $encrypt * @throws AppwriteException * @return array */ - public function createLongtextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): array + public function createLongtextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): array { $apiPath = str_replace( ['{databaseId}', '{collectionId}'], @@ -1439,6 +1440,10 @@ public function createLongtextAttribute(string $databaseId, string $collectionId $apiParams['array'] = $xarray; } + if (!is_null($encrypt)) { + $apiParams['encrypt'] = $encrypt; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; @@ -1501,10 +1506,11 @@ public function updateLongtextAttribute(string $databaseId, string $collectionId * @param bool $required * @param ?string $xdefault * @param ?bool $xarray + * @param ?bool $encrypt * @throws AppwriteException * @return array */ - public function createMediumtextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): array + public function createMediumtextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): array { $apiPath = str_replace( ['{databaseId}', '{collectionId}'], @@ -1523,6 +1529,10 @@ public function createMediumtextAttribute(string $databaseId, string $collection $apiParams['array'] = $xarray; } + if (!is_null($encrypt)) { + $apiParams['encrypt'] = $encrypt; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; @@ -1904,10 +1914,11 @@ public function updateStringAttribute(string $databaseId, string $collectionId, * @param bool $required * @param ?string $xdefault * @param ?bool $xarray + * @param ?bool $encrypt * @throws AppwriteException * @return array */ - public function createTextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): array + public function createTextAttribute(string $databaseId, string $collectionId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): array { $apiPath = str_replace( ['{databaseId}', '{collectionId}'], @@ -1926,6 +1937,10 @@ public function createTextAttribute(string $databaseId, string $collectionId, st $apiParams['array'] = $xarray; } + if (!is_null($encrypt)) { + $apiParams['encrypt'] = $encrypt; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; @@ -2079,10 +2094,11 @@ public function updateUrlAttribute(string $databaseId, string $collectionId, str * @param bool $required * @param ?string $xdefault * @param ?bool $xarray + * @param ?bool $encrypt * @throws AppwriteException * @return array */ - public function createVarcharAttribute(string $databaseId, string $collectionId, string $key, int $size, bool $required, ?string $xdefault = null, ?bool $xarray = null): array + public function createVarcharAttribute(string $databaseId, string $collectionId, string $key, int $size, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): array { $apiPath = str_replace( ['{databaseId}', '{collectionId}'], @@ -2102,6 +2118,10 @@ public function createVarcharAttribute(string $databaseId, string $collectionId, $apiParams['array'] = $xarray; } + if (!is_null($encrypt)) { + $apiParams['encrypt'] = $encrypt; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; diff --git a/src/Appwrite/Services/TablesDB.php b/src/Appwrite/Services/TablesDB.php index 685378f..01d1a45 100644 --- a/src/Appwrite/Services/TablesDB.php +++ b/src/Appwrite/Services/TablesDB.php @@ -1335,10 +1335,11 @@ public function updateLineColumn(string $databaseId, string $tableId, string $ke * @param bool $required * @param ?string $xdefault * @param ?bool $xarray + * @param ?bool $encrypt * @throws AppwriteException * @return array */ - public function createLongtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): array + public function createLongtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): array { $apiPath = str_replace( ['{databaseId}', '{tableId}'], @@ -1357,6 +1358,10 @@ public function createLongtextColumn(string $databaseId, string $tableId, string $apiParams['array'] = $xarray; } + if (!is_null($encrypt)) { + $apiParams['encrypt'] = $encrypt; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; @@ -1419,10 +1424,11 @@ public function updateLongtextColumn(string $databaseId, string $tableId, string * @param bool $required * @param ?string $xdefault * @param ?bool $xarray + * @param ?bool $encrypt * @throws AppwriteException * @return array */ - public function createMediumtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): array + public function createMediumtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): array { $apiPath = str_replace( ['{databaseId}', '{tableId}'], @@ -1441,6 +1447,10 @@ public function createMediumtextColumn(string $databaseId, string $tableId, stri $apiParams['array'] = $xarray; } + if (!is_null($encrypt)) { + $apiParams['encrypt'] = $encrypt; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; @@ -1807,10 +1817,11 @@ public function updateStringColumn(string $databaseId, string $tableId, string $ * @param bool $required * @param ?string $xdefault * @param ?bool $xarray + * @param ?bool $encrypt * @throws AppwriteException * @return array */ - public function createTextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): array + public function createTextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): array { $apiPath = str_replace( ['{databaseId}', '{tableId}'], @@ -1829,6 +1840,10 @@ public function createTextColumn(string $databaseId, string $tableId, string $ke $apiParams['array'] = $xarray; } + if (!is_null($encrypt)) { + $apiParams['encrypt'] = $encrypt; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; @@ -1976,10 +1991,11 @@ public function updateUrlColumn(string $databaseId, string $tableId, string $key * @param bool $required * @param ?string $xdefault * @param ?bool $xarray + * @param ?bool $encrypt * @throws AppwriteException * @return array */ - public function createVarcharColumn(string $databaseId, string $tableId, string $key, int $size, bool $required, ?string $xdefault = null, ?bool $xarray = null): array + public function createVarcharColumn(string $databaseId, string $tableId, string $key, int $size, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): array { $apiPath = str_replace( ['{databaseId}', '{tableId}'], @@ -1999,6 +2015,10 @@ public function createVarcharColumn(string $databaseId, string $tableId, string $apiParams['array'] = $xarray; } + if (!is_null($encrypt)) { + $apiParams['encrypt'] = $encrypt; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; diff --git a/tests/Appwrite/Services/ActivitiesTest.php b/tests/Appwrite/Services/ActivitiesTest.php new file mode 100644 index 0000000..caaf39e --- /dev/null +++ b/tests/Appwrite/Services/ActivitiesTest.php @@ -0,0 +1,82 @@ +client = Mockery::mock(Client::class); + $this->activities = new Activities($this->client); + } + + public function testMethodListEvents(): void { + + $data = array( + "total" => 5, + "events" => array()); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->activities->listEvents( + ); + + $this->assertSame($data, $response); + } + + public function testMethodGetEvent(): void { + + $data = array( + "\$id" => "5e5ea5c16897e", + "userType" => "user", + "userId" => "610fc2f985ee0", + "userEmail" => "john@appwrite.io", + "userName" => "John Doe", + "resourceParent" => "database/ID", + "resourceType" => "collection", + "resourceId" => "610fc2f985ee0", + "resource" => "collections/610fc2f985ee0", + "event" => "account.sessions.create", + "userAgent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36", + "ip" => "127.0.0.1", + "mode" => "admin", + "country" => "US", + "time" => "2020-10-15T06:38:00.000+00:00", + "projectId" => "610fc2f985ee0", + "teamId" => "610fc2f985ee0", + "hostname" => "appwrite.io", + "osCode" => "Mac", + "osName" => "Mac", + "osVersion" => "Mac", + "clientType" => "browser", + "clientCode" => "CM", + "clientName" => "Chrome Mobile iOS", + "clientVersion" => "84.0", + "clientEngine" => "WebKit", + "clientEngineVersion" => "605.1.15", + "deviceName" => "smartphone", + "deviceBrand" => "Google", + "deviceModel" => "Nexus 5", + "countryCode" => "US", + "countryName" => "United States"); + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + + $response = $this->activities->getEvent( + "" + ); + + $this->assertSame($data, $response); + } + +}