From 9667d04f79ea32e3ceea62a3b2ec4ccaa9bd25b6 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 11 Dec 2024 01:04:42 +1300 Subject: [PATCH] Add new push message parameters --- README.md | 2 +- docs/account.md | 22 ++-- .../databases/update-string-attribute.md | 2 +- docs/examples/messaging/create-push.md | 11 +- docs/examples/messaging/update-push.md | 5 +- docs/functions.md | 4 +- docs/locale.md | 2 +- docs/messaging.md | 12 +- docs/storage.md | 2 +- docs/teams.md | 4 +- docs/users.md | 20 +-- src/Appwrite/Client.php | 4 +- src/Appwrite/Enums/ImageFormat.php | 8 ++ src/Appwrite/Enums/MessagePriority.php | 43 +++++++ src/Appwrite/Enums/Runtime.php | 114 +++++++++++++++++- src/Appwrite/Services/Account.php | 24 ++-- src/Appwrite/Services/Locale.php | 2 +- src/Appwrite/Services/Messaging.php | 51 ++++++-- src/Appwrite/Services/Storage.php | 2 +- src/Appwrite/Services/Teams.php | 6 +- src/Appwrite/Services/Users.php | 20 +-- tests/Appwrite/Services/DatabasesTest.php | 60 +++++++-- tests/Appwrite/Services/FunctionsTest.php | 12 +- tests/Appwrite/Services/MessagingTest.php | 4 +- tests/Appwrite/Services/UsersTest.php | 15 ++- 25 files changed, 350 insertions(+), 101 deletions(-) create mode 100644 src/Appwrite/Enums/MessagePriority.php diff --git a/README.md b/README.md index 57ef550..52309eb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # 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.0-blue.svg?style=flat-square&v=1) +![Version](https://img.shields.io/badge/api%20version-1.6.1-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) diff --git a/docs/account.md b/docs/account.md index d23e642..94cc0ec 100644 --- a/docs/account.md +++ b/docs/account.md @@ -42,7 +42,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, | email | string | User email. | | | password | string | User password. Must be at least 8 chars. | | -## List Identities +## List identities ```http request GET https://cloud.appwrite.io/v1/account/identities @@ -106,7 +106,7 @@ PATCH https://cloud.appwrite.io/v1/account/mfa | --- | --- | --- | --- | | mfa | boolean | Enable or disable MFA. | | -## Create Authenticator +## Create authenticator ```http request POST https://cloud.appwrite.io/v1/account/mfa/authenticators/{type} @@ -120,7 +120,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/authenticators/{type} | --- | --- | --- | --- | | type | string | **Required** Type of authenticator. Must be `totp` | | -## Verify Authenticator +## Verify authenticator ```http request PUT https://cloud.appwrite.io/v1/account/mfa/authenticators/{type} @@ -135,7 +135,7 @@ PUT https://cloud.appwrite.io/v1/account/mfa/authenticators/{type} | type | string | **Required** Type of authenticator. | | | otp | string | Valid verification token. | | -## Delete Authenticator +## Delete authenticator ```http request DELETE https://cloud.appwrite.io/v1/account/mfa/authenticators/{type} @@ -149,7 +149,7 @@ DELETE https://cloud.appwrite.io/v1/account/mfa/authenticators/{type} | --- | --- | --- | --- | | type | string | **Required** Type of authenticator. | | -## Create MFA Challenge +## Create MFA challenge ```http request POST https://cloud.appwrite.io/v1/account/mfa/challenge @@ -163,7 +163,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/challenge | --- | --- | --- | --- | | factor | string | Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. | | -## Create MFA Challenge (confirmation) +## Create MFA challenge (confirmation) ```http request PUT https://cloud.appwrite.io/v1/account/mfa/challenge @@ -178,7 +178,7 @@ PUT https://cloud.appwrite.io/v1/account/mfa/challenge | challengeId | string | ID of the challenge. | | | otp | string | Valid verification token. | | -## List Factors +## List factors ```http request GET https://cloud.appwrite.io/v1/account/mfa/factors @@ -186,7 +186,7 @@ GET https://cloud.appwrite.io/v1/account/mfa/factors ** List the factors available on the account to be used as a MFA challange. ** -## Get MFA Recovery Codes +## Get MFA recovery codes ```http request GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes @@ -194,7 +194,7 @@ GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes ** Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. ** -## Create MFA Recovery Codes +## Create MFA recovery codes ```http request POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes @@ -202,7 +202,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes ** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** -## Regenerate MFA Recovery Codes +## Regenerate MFA recovery codes ```http request PATCH https://cloud.appwrite.io/v1/account/mfa/recovery-codes @@ -469,7 +469,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about POST https://cloud.appwrite.io/v1/account/tokens/magic-url ``` -** Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default. +** Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). ** diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 9e821e4..721ba32 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -16,6 +16,6 @@ $result = $databases->updateStringAttribute( key: '', required: false, default: '', - size: null, // optional + size: 1, // optional newKey: '' // optional ); \ No newline at end of file diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 7838576..9aaf6ad 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -12,8 +12,8 @@ $messaging = new Messaging($client); $result = $messaging->createPush( messageId: '', - title: '', - body: '<BODY>', + title: '<TITLE>', // optional + body: '<BODY>', // optional topics: [], // optional users: [], // optional targets: [], // optional @@ -24,7 +24,10 @@ $result = $messaging->createPush( sound: '<SOUND>', // optional color: '<COLOR>', // optional tag: '<TAG>', // optional - badge: '<BADGE>', // optional + badge: null, // optional draft: false, // optional - scheduledAt: '' // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority::NORMAL() // optional ); \ No newline at end of file diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 09a4d96..7546fc8 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -26,5 +26,8 @@ $result = $messaging->updatePush( tag: '<TAG>', // optional badge: null, // optional draft: false, // optional - scheduledAt: '' // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority::NORMAL() // optional ); \ No newline at end of file diff --git a/docs/functions.md b/docs/functions.md index 625d258..00b15ea 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -48,7 +48,7 @@ POST https://cloud.appwrite.io/v1/functions | 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-0.5vcpu-512mb | +| specification | string | Runtime specification for the function and builds. | s-1vcpu-512mb | ## List runtimes @@ -110,7 +110,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId} | 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. | | -| specification | string | Runtime specification for the function and builds. | s-0.5vcpu-512mb | +| specification | string | Runtime specification for the function and builds. | s-1vcpu-512mb | ## Delete function diff --git a/docs/locale.md b/docs/locale.md index 6678bf2..31b0be2 100644 --- a/docs/locale.md +++ b/docs/locale.md @@ -10,7 +10,7 @@ GET https://cloud.appwrite.io/v1/locale ([IP Geolocation by DB-IP](https://db-ip.com)) ** -## List Locale Codes +## List locale codes ```http request GET https://cloud.appwrite.io/v1/locale/codes diff --git a/docs/messaging.md b/docs/messaging.md index f4fc48f..984c26b 100644 --- a/docs/messaging.md +++ b/docs/messaging.md @@ -84,16 +84,19 @@ POST https://cloud.appwrite.io/v1/messaging/messages/push | topics | array | List of Topic IDs. | [] | | users | array | List of User IDs. | [] | | targets | array | List of Targets IDs. | [] | -| data | object | Additional Data for push notification. | {} | +| data | object | Additional key-value pair data for push notification. | {} | | action | string | Action for push notification. | | | image | string | Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. | | | icon | string | Icon for push notification. Available only for Android and Web Platform. | | -| sound | string | Sound for push notification. Available only for Android and IOS Platform. | | +| sound | string | Sound for push notification. Available only for Android and iOS Platform. | | | color | string | Color for push notification. Available only for Android Platform. | | | tag | string | Tag for push notification. Available only for Android Platform. | | -| badge | string | Badge for push notification. Available only for IOS Platform. | | +| badge | integer | Badge for push notification. Available only for iOS Platform. | -1 | | draft | boolean | Is message a draft | | | scheduledAt | string | Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. | | +| contentAvailable | boolean | If set to true, the notification will be delivered in the background. Available only for iOS Platform. | | +| critical | boolean | If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. | | +| priority | string | Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification. | high | ## Update push notification @@ -124,6 +127,9 @@ PATCH https://cloud.appwrite.io/v1/messaging/messages/push/{messageId} | badge | integer | Badge for push notification. Available only for iOS platforms. | | | draft | boolean | Is message a draft | | | scheduledAt | string | Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. | | +| contentAvailable | boolean | If set to true, the notification will be delivered in the background. Available only for iOS Platform. | | +| critical | boolean | If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. | | +| priority | string | Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. | | ## Create SMS diff --git a/docs/storage.md b/docs/storage.md index 2f07dbd..0acb0b1 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -161,7 +161,7 @@ PUT https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId} | name | string | Name of the file | | | permissions | array | An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). | | -## Delete File +## Delete file ```http request DELETE https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId} diff --git a/docs/teams.md b/docs/teams.md index 0804aee..74301f1 100644 --- a/docs/teams.md +++ b/docs/teams.md @@ -80,7 +80,7 @@ DELETE https://cloud.appwrite.io/v1/teams/{teamId} GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships ``` -** Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. ** +** Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. ** ### Parameters @@ -123,7 +123,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships/{membershipId} ``` -** Get a team member by the membership unique id. All team members have read access for this resource. ** +** Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. ** ### Parameters diff --git a/docs/users.md b/docs/users.md index 4101f27..0e820fa 100644 --- a/docs/users.md +++ b/docs/users.md @@ -67,7 +67,7 @@ POST https://cloud.appwrite.io/v1/users/bcrypt | password | string | User password hashed using Bcrypt. | | | name | string | User name. Max length: 128 chars. | | -## List Identities +## List identities ```http request GET https://cloud.appwrite.io/v1/users/identities @@ -310,7 +310,7 @@ PATCH https://cloud.appwrite.io/v1/users/{userId}/mfa | userId | string | **Required** User ID. | | | mfa | boolean | Enable or disable MFA. | | -## Delete Authenticator +## Delete authenticator ```http request DELETE https://cloud.appwrite.io/v1/users/{userId}/mfa/authenticators/{type} @@ -325,7 +325,7 @@ DELETE https://cloud.appwrite.io/v1/users/{userId}/mfa/authenticators/{type} | userId | string | **Required** User ID. | | | type | string | **Required** Type of authenticator. | | -## List Factors +## List factors ```http request GET https://cloud.appwrite.io/v1/users/{userId}/mfa/factors @@ -339,7 +339,7 @@ GET https://cloud.appwrite.io/v1/users/{userId}/mfa/factors | --- | --- | --- | --- | | userId | string | **Required** User ID. | | -## Get MFA Recovery Codes +## Get MFA recovery codes ```http request GET https://cloud.appwrite.io/v1/users/{userId}/mfa/recovery-codes @@ -353,7 +353,7 @@ GET https://cloud.appwrite.io/v1/users/{userId}/mfa/recovery-codes | --- | --- | --- | --- | | userId | string | **Required** User ID. | | -## Regenerate MFA Recovery Codes +## Regenerate MFA recovery codes ```http request PUT https://cloud.appwrite.io/v1/users/{userId}/mfa/recovery-codes @@ -367,7 +367,7 @@ PUT https://cloud.appwrite.io/v1/users/{userId}/mfa/recovery-codes | --- | --- | --- | --- | | userId | string | **Required** User ID. | | -## Create MFA Recovery Codes +## Create MFA recovery codes ```http request PATCH https://cloud.appwrite.io/v1/users/{userId}/mfa/recovery-codes @@ -529,7 +529,7 @@ PATCH https://cloud.appwrite.io/v1/users/{userId}/status | userId | string | **Required** User ID. | | | status | boolean | User Status. To activate the user pass `true` and to block the user pass `false`. | | -## List User Targets +## List user targets ```http request GET https://cloud.appwrite.io/v1/users/{userId}/targets @@ -544,7 +544,7 @@ GET https://cloud.appwrite.io/v1/users/{userId}/targets | 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: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels | [] | -## Create User Target +## Create user target ```http request POST https://cloud.appwrite.io/v1/users/{userId}/targets @@ -563,7 +563,7 @@ POST https://cloud.appwrite.io/v1/users/{userId}/targets | providerId | string | Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. | | | name | string | Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23. | | -## Get User Target +## Get user target ```http request GET https://cloud.appwrite.io/v1/users/{userId}/targets/{targetId} @@ -578,7 +578,7 @@ GET https://cloud.appwrite.io/v1/users/{userId}/targets/{targetId} | userId | string | **Required** User ID. | | | targetId | string | **Required** Target ID. | | -## Update User target +## Update user target ```http request PATCH https://cloud.appwrite.io/v1/users/{userId}/targets/{targetId} diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index b102f8d..02421c7 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/12.0.0 ()', + 'user-agent' => 'AppwritePHPSDK/12.2.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '12.0.0', + 'x-sdk-version'=> '12.2.0', ]; /** diff --git a/src/Appwrite/Enums/ImageFormat.php b/src/Appwrite/Enums/ImageFormat.php index 9ec15d2..092d94d 100644 --- a/src/Appwrite/Enums/ImageFormat.php +++ b/src/Appwrite/Enums/ImageFormat.php @@ -11,6 +11,7 @@ class ImageFormat implements JsonSerializable private static ImageFormat $GIF; private static ImageFormat $PNG; private static ImageFormat $WEBP; + private static ImageFormat $AVIF; private string $value; @@ -64,4 +65,11 @@ public static function WEBP(): ImageFormat } return self::$WEBP; } + public static function AVIF(): ImageFormat + { + if (!isset(self::$AVIF)) { + self::$AVIF = new ImageFormat('avif'); + } + return self::$AVIF; + } } \ No newline at end of file diff --git a/src/Appwrite/Enums/MessagePriority.php b/src/Appwrite/Enums/MessagePriority.php new file mode 100644 index 0000000..e23d253 --- /dev/null +++ b/src/Appwrite/Enums/MessagePriority.php @@ -0,0 +1,43 @@ +<?php + +namespace Appwrite\Enums; + +use JsonSerializable; + +class MessagePriority implements JsonSerializable +{ + private static MessagePriority $NORMAL; + private static MessagePriority $HIGH; + + private string $value; + + private function __construct(string $value) + { + $this->value = $value; + } + + public function __toString(): string + { + return $this->value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function NORMAL(): MessagePriority + { + if (!isset(self::$NORMAL)) { + self::$NORMAL = new MessagePriority('normal'); + } + return self::$NORMAL; + } + public static function HIGH(): MessagePriority + { + if (!isset(self::$HIGH)) { + self::$HIGH = new MessagePriority('high'); + } + return self::$HIGH; + } +} \ No newline at end of file diff --git a/src/Appwrite/Enums/Runtime.php b/src/Appwrite/Enums/Runtime.php index bb0fd1a..d5da338 100644 --- a/src/Appwrite/Enums/Runtime.php +++ b/src/Appwrite/Enums/Runtime.php @@ -12,6 +12,7 @@ class Runtime implements JsonSerializable private static Runtime $NODE190; private static Runtime $NODE200; private static Runtime $NODE210; + private static Runtime $NODE22; private static Runtime $PHP80; private static Runtime $PHP81; private static Runtime $PHP82; @@ -26,7 +27,12 @@ class Runtime implements JsonSerializable private static Runtime $PYTHON311; private static Runtime $PYTHON312; private static Runtime $PYTHONML311; + private static Runtime $DENO121; + private static Runtime $DENO124; + private static Runtime $DENO135; private static Runtime $DENO140; + private static Runtime $DENO146; + private static Runtime $DENO20; private static Runtime $DART215; private static Runtime $DART216; private static Runtime $DART217; @@ -34,24 +40,31 @@ class Runtime implements JsonSerializable private static Runtime $DART30; private static Runtime $DART31; private static Runtime $DART33; - private static Runtime $DOTNET31; + private static Runtime $DART35; private static Runtime $DOTNET60; private static Runtime $DOTNET70; + private static Runtime $DOTNET80; 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 $SWIFT55; private static Runtime $SWIFT58; private static Runtime $SWIFT59; + private static Runtime $SWIFT510; private static Runtime $KOTLIN16; private static Runtime $KOTLIN18; private static Runtime $KOTLIN19; + private static Runtime $KOTLIN20; private static Runtime $CPP17; private static Runtime $CPP20; private static Runtime $BUN10; + private static Runtime $BUN11; private static Runtime $GO123; + private static Runtime $STATIC1; + private static Runtime $FLUTTER324; private string $value; @@ -112,6 +125,13 @@ public static function NODE210(): Runtime } return self::$NODE210; } + public static function NODE22(): Runtime + { + if (!isset(self::$NODE22)) { + self::$NODE22 = new Runtime('node-22'); + } + return self::$NODE22; + } public static function PHP80(): Runtime { if (!isset(self::$PHP80)) { @@ -210,6 +230,27 @@ public static function PYTHONML311(): Runtime } return self::$PYTHONML311; } + public static function DENO121(): Runtime + { + if (!isset(self::$DENO121)) { + self::$DENO121 = new Runtime('deno-1.21'); + } + return self::$DENO121; + } + public static function DENO124(): Runtime + { + if (!isset(self::$DENO124)) { + self::$DENO124 = new Runtime('deno-1.24'); + } + return self::$DENO124; + } + public static function DENO135(): Runtime + { + if (!isset(self::$DENO135)) { + self::$DENO135 = new Runtime('deno-1.35'); + } + return self::$DENO135; + } public static function DENO140(): Runtime { if (!isset(self::$DENO140)) { @@ -217,6 +258,20 @@ public static function DENO140(): Runtime } return self::$DENO140; } + public static function DENO146(): Runtime + { + if (!isset(self::$DENO146)) { + self::$DENO146 = new Runtime('deno-1.46'); + } + return self::$DENO146; + } + public static function DENO20(): Runtime + { + if (!isset(self::$DENO20)) { + self::$DENO20 = new Runtime('deno-2.0'); + } + return self::$DENO20; + } public static function DART215(): Runtime { if (!isset(self::$DART215)) { @@ -266,12 +321,12 @@ public static function DART33(): Runtime } return self::$DART33; } - public static function DOTNET31(): Runtime + public static function DART35(): Runtime { - if (!isset(self::$DOTNET31)) { - self::$DOTNET31 = new Runtime('dotnet-3.1'); + if (!isset(self::$DART35)) { + self::$DART35 = new Runtime('dart-3.5'); } - return self::$DOTNET31; + return self::$DART35; } public static function DOTNET60(): Runtime { @@ -287,6 +342,13 @@ public static function DOTNET70(): Runtime } return self::$DOTNET70; } + public static function DOTNET80(): Runtime + { + if (!isset(self::$DOTNET80)) { + self::$DOTNET80 = new Runtime('dotnet-8.0'); + } + return self::$DOTNET80; + } public static function JAVA80(): Runtime { if (!isset(self::$JAVA80)) { @@ -322,6 +384,13 @@ public static function JAVA210(): Runtime } return self::$JAVA210; } + public static function JAVA22(): Runtime + { + if (!isset(self::$JAVA22)) { + self::$JAVA22 = new Runtime('java-22'); + } + return self::$JAVA22; + } public static function SWIFT55(): Runtime { if (!isset(self::$SWIFT55)) { @@ -343,6 +412,13 @@ public static function SWIFT59(): Runtime } return self::$SWIFT59; } + public static function SWIFT510(): Runtime + { + if (!isset(self::$SWIFT510)) { + self::$SWIFT510 = new Runtime('swift-5.10'); + } + return self::$SWIFT510; + } public static function KOTLIN16(): Runtime { if (!isset(self::$KOTLIN16)) { @@ -364,6 +440,13 @@ public static function KOTLIN19(): Runtime } return self::$KOTLIN19; } + public static function KOTLIN20(): Runtime + { + if (!isset(self::$KOTLIN20)) { + self::$KOTLIN20 = new Runtime('kotlin-2.0'); + } + return self::$KOTLIN20; + } public static function CPP17(): Runtime { if (!isset(self::$CPP17)) { @@ -385,6 +468,13 @@ public static function BUN10(): Runtime } return self::$BUN10; } + public static function BUN11(): Runtime + { + if (!isset(self::$BUN11)) { + self::$BUN11 = new Runtime('bun-1.1'); + } + return self::$BUN11; + } public static function GO123(): Runtime { if (!isset(self::$GO123)) { @@ -392,4 +482,18 @@ public static function GO123(): Runtime } return self::$GO123; } + public static function STATIC1(): Runtime + { + if (!isset(self::$STATIC1)) { + self::$STATIC1 = new Runtime('static-1'); + } + return self::$STATIC1; + } + public static function FLUTTER324(): Runtime + { + if (!isset(self::$FLUTTER324)) { + self::$FLUTTER324 = new Runtime('flutter-3.24'); + } + return self::$FLUTTER324; + } } \ No newline at end of file diff --git a/src/Appwrite/Services/Account.php b/src/Appwrite/Services/Account.php index bbaec76..5b350da 100644 --- a/src/Appwrite/Services/Account.php +++ b/src/Appwrite/Services/Account.php @@ -133,7 +133,7 @@ public function updateEmail(string $email, string $password): array } /** - * List Identities + * List identities * * Get the list of identities for the currently logged in user. * @@ -297,7 +297,7 @@ public function updateMFA(bool $mfa): array } /** - * Create Authenticator + * Create authenticator * * Add an authenticator app to be used as an MFA factor. Verify the * authenticator using the [verify @@ -331,7 +331,7 @@ public function createMfaAuthenticator(AuthenticatorType $type): array } /** - * Verify Authenticator + * Verify authenticator * * Verify an authenticator app after adding it using the [add * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) @@ -366,7 +366,7 @@ public function updateMfaAuthenticator(AuthenticatorType $type, string $otp): ar } /** - * Delete Authenticator + * Delete authenticator * * Delete an authenticator for a user by ID. * @@ -397,7 +397,7 @@ public function deleteMfaAuthenticator(AuthenticatorType $type): string } /** - * Create MFA Challenge + * Create MFA challenge * * Begin the process of MFA verification after sign-in. Finish the flow with * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) @@ -430,7 +430,7 @@ public function createMfaChallenge(AuthenticationFactor $factor): array } /** - * Create MFA Challenge (confirmation) + * Create MFA challenge (confirmation) * * Complete the MFA challenge by providing the one-time password. Finish the * process of MFA verification by providing the one-time password. To begin @@ -467,7 +467,7 @@ public function updateMfaChallenge(string $challengeId, string $otp): string } /** - * List Factors + * List factors * * List the factors available on the account to be used as a MFA challange. * @@ -496,7 +496,7 @@ public function listMfaFactors(): array } /** - * Get MFA Recovery Codes + * Get MFA recovery codes * * Get recovery codes that can be used as backup for MFA flow. Before getting * codes, they must be generated using @@ -528,7 +528,7 @@ public function getMfaRecoveryCodes(): array } /** - * Create MFA Recovery Codes + * Create MFA recovery codes * * Generate recovery codes as backup for MFA flow. It's recommended to * generate and show then immediately after user successfully adds their @@ -561,7 +561,7 @@ public function createMfaRecoveryCodes(): array } /** - * Regenerate MFA Recovery Codes + * Regenerate MFA recovery codes * * Regenerate recovery codes that can be used as backup for MFA flow. Before * regenerating codes, they must be first generated using @@ -1271,9 +1271,7 @@ public function createEmailToken(string $userId, string $email, ?bool $phrase = * [POST * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint to complete the login process. The link sent to the user's email - * address is valid for 1 hour. If you are on a mobile device you can leave - * the URL parameter empty, so that the login completion will be handled by - * your Appwrite instance by default. + * address is valid for 1 hour. * * A user is limited to 10 active sessions at a time by default. [Learn more * about session diff --git a/src/Appwrite/Services/Locale.php b/src/Appwrite/Services/Locale.php index 6ea96d1..8f20ebc 100644 --- a/src/Appwrite/Services/Locale.php +++ b/src/Appwrite/Services/Locale.php @@ -49,7 +49,7 @@ public function get(): array } /** - * List Locale Codes + * List locale codes * * List of all locale codes in [ISO * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). diff --git a/src/Appwrite/Services/Messaging.php b/src/Appwrite/Services/Messaging.php index dc3b41b..cf90e70 100644 --- a/src/Appwrite/Services/Messaging.php +++ b/src/Appwrite/Services/Messaging.php @@ -6,6 +6,7 @@ use Appwrite\Client; use Appwrite\Service; use Appwrite\InputFile; +use Appwrite\Enums\MessagePriority; use Appwrite\Enums\SmtpEncryption; class Messaging extends Service @@ -227,8 +228,8 @@ public function updateEmail(string $messageId, ?array $topics = null, ?array $us * Create a new push notification. * * @param string $messageId - * @param string $title - * @param string $body + * @param ?string $title + * @param ?string $body * @param ?array $topics * @param ?array $users * @param ?array $targets @@ -239,13 +240,16 @@ public function updateEmail(string $messageId, ?array $topics = null, ?array $us * @param ?string $sound * @param ?string $color * @param ?string $tag - * @param ?string $badge + * @param ?int $badge * @param ?bool $draft * @param ?string $scheduledAt + * @param ?bool $contentAvailable + * @param ?bool $critical + * @param ?MessagePriority $priority * @throws AppwriteException * @return array */ - public function createPush(string $messageId, string $title, string $body, ?array $topics = null, ?array $users = null, ?array $targets = null, ?array $data = null, ?string $action = null, ?string $image = null, ?string $icon = null, ?string $sound = null, ?string $color = null, ?string $tag = null, ?string $badge = null, ?bool $draft = null, ?string $scheduledAt = null): array + public function createPush(string $messageId, ?string $title = null, ?string $body = null, ?array $topics = null, ?array $users = null, ?array $targets = null, ?array $data = null, ?string $action = null, ?string $image = null, ?string $icon = null, ?string $sound = null, ?string $color = null, ?string $tag = null, ?int $badge = null, ?bool $draft = null, ?string $scheduledAt = null, ?bool $contentAvailable = null, ?bool $critical = null, ?MessagePriority $priority = null): array { $apiPath = str_replace( [], @@ -255,8 +259,14 @@ public function createPush(string $messageId, string $title, string $body, ?arra $apiParams = []; $apiParams['messageId'] = $messageId; - $apiParams['title'] = $title; - $apiParams['body'] = $body; + + if (!is_null($title)) { + $apiParams['title'] = $title; + } + + if (!is_null($body)) { + $apiParams['body'] = $body; + } if (!is_null($topics)) { $apiParams['topics'] = $topics; @@ -310,6 +320,18 @@ public function createPush(string $messageId, string $title, string $body, ?arra $apiParams['scheduledAt'] = $scheduledAt; } + if (!is_null($contentAvailable)) { + $apiParams['contentAvailable'] = $contentAvailable; + } + + if (!is_null($critical)) { + $apiParams['critical'] = $critical; + } + + if (!is_null($priority)) { + $apiParams['priority'] = $priority; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; @@ -343,10 +365,13 @@ public function createPush(string $messageId, string $title, string $body, ?arra * @param ?int $badge * @param ?bool $draft * @param ?string $scheduledAt + * @param ?bool $contentAvailable + * @param ?bool $critical + * @param ?MessagePriority $priority * @throws AppwriteException * @return array */ - public function updatePush(string $messageId, ?array $topics = null, ?array $users = null, ?array $targets = null, ?string $title = null, ?string $body = null, ?array $data = null, ?string $action = null, ?string $image = null, ?string $icon = null, ?string $sound = null, ?string $color = null, ?string $tag = null, ?int $badge = null, ?bool $draft = null, ?string $scheduledAt = null): array + public function updatePush(string $messageId, ?array $topics = null, ?array $users = null, ?array $targets = null, ?string $title = null, ?string $body = null, ?array $data = null, ?string $action = null, ?string $image = null, ?string $icon = null, ?string $sound = null, ?string $color = null, ?string $tag = null, ?int $badge = null, ?bool $draft = null, ?string $scheduledAt = null, ?bool $contentAvailable = null, ?bool $critical = null, ?MessagePriority $priority = null): array { $apiPath = str_replace( ['{messageId}'], @@ -417,6 +442,18 @@ public function updatePush(string $messageId, ?array $topics = null, ?array $use $apiParams['scheduledAt'] = $scheduledAt; } + if (!is_null($contentAvailable)) { + $apiParams['contentAvailable'] = $contentAvailable; + } + + if (!is_null($critical)) { + $apiParams['critical'] = $critical; + } + + if (!is_null($priority)) { + $apiParams['priority'] = $priority; + } + $apiHeaders = []; $apiHeaders['content-type'] = 'application/json'; diff --git a/src/Appwrite/Services/Storage.php b/src/Appwrite/Services/Storage.php index fd2ebf9..27d5a64 100644 --- a/src/Appwrite/Services/Storage.php +++ b/src/Appwrite/Services/Storage.php @@ -516,7 +516,7 @@ public function updateFile(string $bucketId, string $fileId, ?string $name = nul } /** - * Delete File + * Delete file * * Delete a file by its unique ID. Only users with write permissions have * access to delete this resource. diff --git a/src/Appwrite/Services/Teams.php b/src/Appwrite/Services/Teams.php index 53c35b1..d4712bc 100644 --- a/src/Appwrite/Services/Teams.php +++ b/src/Appwrite/Services/Teams.php @@ -194,7 +194,8 @@ public function delete(string $teamId): string * List team memberships * * Use this endpoint to list a team's members using the team's ID. All team - * members have read access to this endpoint. + * members have read access to this endpoint. Hide sensitive attributes from + * the response by toggling membership privacy in the Console. * * @param string $teamId * @param ?array $queries @@ -314,7 +315,8 @@ public function createMembership(string $teamId, array $roles, ?string $email = * Get team membership * * Get a team member by the membership unique id. All team members have read - * access for this resource. + * access for this resource. Hide sensitive attributes from the response by + * toggling membership privacy in the Console. * * @param string $teamId * @param string $membershipId diff --git a/src/Appwrite/Services/Users.php b/src/Appwrite/Services/Users.php index 3da6d52..d25e5c9 100644 --- a/src/Appwrite/Services/Users.php +++ b/src/Appwrite/Services/Users.php @@ -195,7 +195,7 @@ public function createBcryptUser(string $userId, string $email, string $password } /** - * List Identities + * List identities * * Get identities for all users. * @@ -783,7 +783,7 @@ public function updateMfa(string $userId, bool $mfa): array } /** - * Delete Authenticator + * Delete authenticator * * Delete an authenticator app. * @@ -816,7 +816,7 @@ public function deleteMfaAuthenticator(string $userId, AuthenticatorType $type): } /** - * List Factors + * List factors * * List the factors available on the account to be used as a MFA challange. * @@ -847,7 +847,7 @@ public function listMfaFactors(string $userId): array } /** - * Get MFA Recovery Codes + * Get MFA recovery codes * * Get recovery codes that can be used as backup for MFA flow by User ID. * Before getting codes, they must be generated using @@ -881,7 +881,7 @@ public function getMfaRecoveryCodes(string $userId): array } /** - * Regenerate MFA Recovery Codes + * Regenerate MFA recovery codes * * Regenerate recovery codes that can be used as backup for MFA flow by User * ID. Before regenerating codes, they must be first generated using @@ -915,7 +915,7 @@ public function updateMfaRecoveryCodes(string $userId): array } /** - * Create MFA Recovery Codes + * Create MFA recovery codes * * Generate recovery codes used as backup for MFA flow for User ID. Recovery * codes can be used as a MFA verification type in @@ -1279,7 +1279,7 @@ public function updateStatus(string $userId, bool $status): array } /** - * List User Targets + * List user targets * * List the messaging targets that are associated with a user. * @@ -1315,7 +1315,7 @@ public function listTargets(string $userId, ?array $queries = null): array } /** - * Create User Target + * Create user target * * Create a messaging target. * @@ -1362,7 +1362,7 @@ public function createTarget(string $userId, string $targetId, MessagingProvider } /** - * Get User Target + * Get user target * * Get a user's push notification target by ID. * @@ -1395,7 +1395,7 @@ public function getTarget(string $userId, string $targetId): array } /** - * Update User target + * Update user target * * Update a messaging target. * diff --git a/tests/Appwrite/Services/DatabasesTest.php b/tests/Appwrite/Services/DatabasesTest.php index cf4f452..a1bf00e 100644 --- a/tests/Appwrite/Services/DatabasesTest.php +++ b/tests/Appwrite/Services/DatabasesTest.php @@ -258,7 +258,9 @@ public function testMethodCreateBooleanAttribute(): void { "type" => "boolean", "status" => "available", "error" => "string", - "required" => true,); + "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); $this->client @@ -282,7 +284,9 @@ public function testMethodUpdateBooleanAttribute(): void { "type" => "boolean", "status" => "available", "error" => "string", - "required" => true,); + "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); $this->client @@ -308,6 +312,8 @@ public function testMethodCreateDatetimeAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime",); @@ -333,6 +339,8 @@ public function testMethodUpdateDatetimeAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime",); @@ -359,6 +367,8 @@ public function testMethodCreateEmailAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email",); @@ -384,6 +394,8 @@ public function testMethodUpdateEmailAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email",); @@ -410,6 +422,8 @@ public function testMethodCreateEnumAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "elements" => array(), "format" => "enum",); @@ -437,6 +451,8 @@ public function testMethodUpdateEnumAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "elements" => array(), "format" => "enum",); @@ -464,7 +480,9 @@ public function testMethodCreateFloatAttribute(): void { "type" => "double", "status" => "available", "error" => "string", - "required" => true,); + "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); $this->client @@ -488,7 +506,9 @@ public function testMethodUpdateFloatAttribute(): void { "type" => "double", "status" => "available", "error" => "string", - "required" => true,); + "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); $this->client @@ -515,7 +535,9 @@ public function testMethodCreateIntegerAttribute(): void { "type" => "integer", "status" => "available", "error" => "string", - "required" => true,); + "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); $this->client @@ -539,7 +561,9 @@ public function testMethodUpdateIntegerAttribute(): void { "type" => "integer", "status" => "available", "error" => "string", - "required" => true,); + "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); $this->client @@ -567,6 +591,8 @@ public function testMethodCreateIpAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip",); @@ -592,6 +618,8 @@ public function testMethodUpdateIpAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip",); @@ -618,6 +646,8 @@ public function testMethodCreateRelationshipAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "relatedCollection" => "collection", "relationType" => "oneToOne|oneToMany|manyToOne|manyToMany", "twoWay" => true, @@ -648,6 +678,8 @@ public function testMethodCreateStringAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128,); @@ -674,6 +706,8 @@ public function testMethodUpdateStringAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128,); @@ -700,6 +734,8 @@ public function testMethodCreateUrlAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url",); @@ -725,6 +761,8 @@ public function testMethodUpdateUrlAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url",); @@ -787,6 +825,8 @@ public function testMethodUpdateRelationshipAttribute(): void { "status" => "available", "error" => "string", "required" => true, + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "relatedCollection" => "collection", "relationType" => "oneToOne|oneToMany|manyToOne|manyToMany", "twoWay" => true, @@ -944,7 +984,9 @@ public function testMethodCreateIndex(): void { "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(),); + "attributes" => array(), + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); $this->client @@ -969,7 +1011,9 @@ public function testMethodGetIndex(): void { "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(),); + "attributes" => array(), + "\$createdAt" => "2020-10-15T06:38:00.000+00:00", + "\$updatedAt" => "2020-10-15T06:38:00.000+00:00",); $this->client diff --git a/tests/Appwrite/Services/FunctionsTest.php b/tests/Appwrite/Services/FunctionsTest.php index 854f83b..66266dd 100644 --- a/tests/Appwrite/Services/FunctionsTest.php +++ b/tests/Appwrite/Services/FunctionsTest.php @@ -59,7 +59,7 @@ public function testMethodCreate(): void { "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "specification" => "s-0.5vcpu-512mb",); + "specification" => "s-1vcpu-512mb",); $this->client @@ -135,7 +135,7 @@ public function testMethodGet(): void { "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "specification" => "s-0.5vcpu-512mb",); + "specification" => "s-1vcpu-512mb",); $this->client @@ -175,7 +175,7 @@ public function testMethodUpdate(): void { "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "specification" => "s-0.5vcpu-512mb",); + "specification" => "s-1vcpu-512mb",); $this->client @@ -333,7 +333,7 @@ public function testMethodUpdateDeployment(): void { "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "specification" => "s-0.5vcpu-512mb",); + "specification" => "s-1vcpu-512mb",); $this->client @@ -457,7 +457,7 @@ public function testMethodCreateExecution(): void { "requestPath" => "/articles?id=5", "requestHeaders" => array(), "responseStatusCode" => 200, - "responseBody" => "Developers are awesome.", + "responseBody" => "", "responseHeaders" => array(), "logs" => "", "errors" => "", @@ -489,7 +489,7 @@ public function testMethodGetExecution(): void { "requestPath" => "/articles?id=5", "requestHeaders" => array(), "responseStatusCode" => 200, - "responseBody" => "Developers are awesome.", + "responseBody" => "", "responseHeaders" => array(), "logs" => "", "errors" => "", diff --git a/tests/Appwrite/Services/MessagingTest.php b/tests/Appwrite/Services/MessagingTest.php index 49cdac9..f447883 100644 --- a/tests/Appwrite/Services/MessagingTest.php +++ b/tests/Appwrite/Services/MessagingTest.php @@ -107,9 +107,7 @@ public function testMethodCreatePush(): void { ->andReturn($data); $response = $this->messaging->createPush( - "<MESSAGE_ID>", - "<TITLE>", - "<BODY>" + "<MESSAGE_ID>" ); $this->assertSame($data, $response); diff --git a/tests/Appwrite/Services/UsersTest.php b/tests/Appwrite/Services/UsersTest.php index 4cb0911..e686783 100644 --- a/tests/Appwrite/Services/UsersTest.php +++ b/tests/Appwrite/Services/UsersTest.php @@ -933,10 +933,11 @@ public function testMethodCreateTarget(): void { "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "name" => "Aegon apple token", + "name" => "Apple iPhone 12", "userId" => "259125845563242502", "providerType" => "email", - "identifier" => "token",); + "identifier" => "token", + "expired" => true,); $this->client @@ -959,10 +960,11 @@ public function testMethodGetTarget(): void { "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "name" => "Aegon apple token", + "name" => "Apple iPhone 12", "userId" => "259125845563242502", "providerType" => "email", - "identifier" => "token",); + "identifier" => "token", + "expired" => true,); $this->client @@ -983,10 +985,11 @@ public function testMethodUpdateTarget(): void { "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "name" => "Aegon apple token", + "name" => "Apple iPhone 12", "userId" => "259125845563242502", "providerType" => "email", - "identifier" => "token",); + "identifier" => "token", + "expired" => true,); $this->client