From d2fd4afffff8b84d19b3c1aa37fa629cc75ae0a5 Mon Sep 17 00:00:00 2001 From: panxl6 Date: Fri, 17 Jan 2025 11:23:40 +0800 Subject: [PATCH] feat: supporting 2025-01 version. --- LICENSE.txt | 37 +- README.md | 193 +++-- composer.json | 2 +- composer.lock | 712 ++++++++---------- src/API/Base/APIBase.php | 35 +- src/API/Courier.php | 36 +- src/API/Courier/DetectCourierRequest.php | 48 +- .../Courier/TrackingDetectCourierRequest.php | 60 -- src/API/EstimatedDeliveryDate.php | 22 +- .../DestinationAddressPredictRequest.php | 32 + .../DestinationAddressPredictResponse.php | 32 + .../EstimatedPickupPredictRequest.php | 28 + .../EstimatedPickupPredictResponse.php | 32 + ...ssingTimeEstimatedPickupPredictRequest.php | 20 + ...singTimeEstimatedPickupPredictResponse.php | 20 + .../OriginAddressPredictRequest.php | 32 + .../OriginAddressPredictResponse.php | 32 + .../EstimatedDeliveryDate/PredictRequest.php | 44 ++ .../EstimatedDeliveryDate/PredictResponse.php | 64 ++ .../WeightPredictRequest.php | 20 + .../WeightPredictResponse.php | 20 + src/API/LastCheckpoint.php | 68 -- ...GetCheckpointBySlugTrackingNumberQuery.php | 92 --- ...CheckpointBySlugTrackingNumberResponse.php | 40 - .../GetCheckpointByTrackingIdQuery.php | 29 - .../GetCheckpointByTrackingIdResponse.php | 40 - src/API/Notification.php | 161 ---- ...dNotificationBySlugTrackingNumberQuery.php | 74 -- ...otificationBySlugTrackingNumberRequest.php | 16 - ...tificationBySlugTrackingNumberResponse.php | 16 - .../AddNotificationByTrackingIdRequest.php | 16 - .../AddNotificationByTrackingIdResponse.php | 16 - ...eNotificationBySlugTrackingNumberQuery.php | 74 -- ...otificationBySlugTrackingNumberRequest.php | 16 - ...tificationBySlugTrackingNumberResponse.php | 16 - .../DeleteNotificationByTrackingIdRequest.php | 16 - ...DeleteNotificationByTrackingIdResponse.php | 16 - ...tNotificationBySlugTrackingNumberQuery.php | 74 -- ...tificationBySlugTrackingNumberResponse.php | 16 - .../GetNotificationByTrackingIdResponse.php | 16 - src/API/Tracking.php | 211 +----- ...atedDeliveryDateCreateTrackingResponse.php | 28 + ...DeliveryDateDeleteTrackingByIdResponse.php | 28 + ...tedDeliveryDateGetTrackingByIdResponse.php | 28 + ...yDateMarkTrackingCompletedByIdResponse.php | 28 + ...eliveryDateRetrackTrackingByIdResponse.php | 28 + ...DeliveryDateUpdateTrackingByIdResponse.php | 28 + .../CarbonEmissionsCreateTrackingResponse.php | 20 + ...bonEmissionsDeleteTrackingByIdResponse.php | 20 + ...CarbonEmissionsGetTrackingByIdResponse.php | 20 + ...sionsMarkTrackingCompletedByIdResponse.php | 20 + ...onEmissionsRetrackTrackingByIdResponse.php | 20 + ...bonEmissionsUpdateTrackingByIdResponse.php | 20 + ...atedDeliveryDateCreateTrackingResponse.php | 24 + ...DeliveryDateDeleteTrackingByIdResponse.php | 24 + ...tedDeliveryDateGetTrackingByIdResponse.php | 24 + ...yDateMarkTrackingCompletedByIdResponse.php | 24 + ...eliveryDateRetrackTrackingByIdResponse.php | 24 + ...DeliveryDateUpdateTrackingByIdResponse.php | 24 + src/API/Tracking/CreateTrackingRequest.php | 156 +++- src/API/Tracking/CreateTrackingResponse.php | 316 +++++++- ...atedDeliveryDateCreateTrackingResponse.php | 28 + ...DeliveryDateDeleteTrackingByIdResponse.php | 28 + ...tedDeliveryDateGetTrackingByIdResponse.php | 28 + ...yDateMarkTrackingCompletedByIdResponse.php | 28 + ...eliveryDateRetrackTrackingByIdResponse.php | 28 + ...DeliveryDateUpdateTrackingByIdResponse.php | 28 + ...ateTrackingBySlugTrackingNumberRequest.php | 12 - .../CustomersCreateTrackingRequest.php | 32 + .../CustomersCreateTrackingResponse.php | 32 + .../CustomersDeleteTrackingByIdResponse.php | 32 + .../CustomersGetTrackingByIdResponse.php | 32 + ...omersMarkTrackingCompletedByIdResponse.php | 32 + .../CustomersRetrackTrackingByIdResponse.php | 32 + .../CustomersUpdateTrackingByIdRequest.php | 32 + .../CustomersUpdateTrackingByIdResponse.php | 32 + .../Tracking/DeleteTrackingByIdResponse.php | 316 +++++++- ...eleteTrackingBySlugTrackingNumberQuery.php | 74 -- ...teTrackingBySlugTrackingNumberResponse.php | 16 - ...stimatedDeliveryCreateTrackingResponse.php | 32 + ...atedDeliveryDeleteTrackingByIdResponse.php | 32 + ...timatedDeliveryGetTrackingByIdResponse.php | 32 + ...iveryMarkTrackingCompletedByIdResponse.php | 32 + ...tedDeliveryRetrackTrackingByIdResponse.php | 32 + ...atedDeliveryUpdateTrackingByIdResponse.php | 32 + .../FirstMileCreateTrackingResponse.php | 32 + .../FirstMileDeleteTrackingByIdResponse.php | 32 + .../FirstMileGetTrackingByIdResponse.php | 32 + ...tMileMarkTrackingCompletedByIdResponse.php | 32 + .../FirstMileRetrackTrackingByIdResponse.php | 32 + .../FirstMileUpdateTrackingByIdResponse.php | 32 + src/API/Tracking/GetTrackingByIdQuery.php | 2 +- src/API/Tracking/GetTrackingByIdResponse.php | 316 +++++++- .../GetTrackingBySlugTrackingNumberQuery.php | 92 --- ...etTrackingBySlugTrackingNumberResponse.php | 16 - src/API/Tracking/GetTrackingsQuery.php | 24 +- src/API/Tracking/GetTrackingsResponse.php | 19 +- .../LastMileCreateTrackingRequest.php | 20 + .../LastMileCreateTrackingResponse.php | 36 + .../LastMileDeleteTrackingByIdResponse.php | 36 + .../LastMileGetTrackingByIdResponse.php | 36 + ...tMileMarkTrackingCompletedByIdResponse.php | 36 + .../LastMileRetrackTrackingByIdResponse.php | 36 + .../LastMileUpdateTrackingByIdResponse.php | 36 + ...stimatedDeliveryCreateTrackingResponse.php | 32 + ...atedDeliveryDeleteTrackingByIdResponse.php | 32 + ...timatedDeliveryGetTrackingByIdResponse.php | 32 + ...iveryMarkTrackingCompletedByIdResponse.php | 32 + ...tedDeliveryRetrackTrackingByIdResponse.php | 32 + ...atedDeliveryUpdateTrackingByIdResponse.php | 32 + .../MarkTrackingCompletedByIdResponse.php | 316 +++++++- ...kingCompletedBySlugTrackingNumberQuery.php | 74 -- ...ngCompletedBySlugTrackingNumberRequest.php | 16 - ...gCompletedBySlugTrackingNumberResponse.php | 16 - ...tCouriersTrackingCreateTrackingRequest.php | 20 - .../PaginationGetTrackingsResponse.php | 24 + .../Tracking/RetrackTrackingByIdResponse.php | 316 +++++++- ...trackTrackingBySlugTrackingNumberQuery.php | 74 -- ...ckTrackingBySlugTrackingNumberResponse.php | 16 - .../ShipmentWeightCreateTrackingResponse.php | 20 + ...ipmentWeightDeleteTrackingByIdResponse.php | 20 + .../ShipmentWeightGetTrackingByIdResponse.php | 20 + ...eightMarkTrackingCompletedByIdResponse.php | 20 + ...pmentWeightRetrackTrackingByIdResponse.php | 20 + ...ipmentWeightUpdateTrackingByIdResponse.php | 20 + .../TrackingCreateTrackingRequest.php | 176 ----- .../TrackingUpdateTrackingByIdRequest.php | 156 ---- ...ateTrackingBySlugTrackingNumberRequest.php | 112 --- .../Tracking/UpdateTrackingByIdRequest.php | 136 +++- .../Tracking/UpdateTrackingByIdResponse.php | 316 +++++++- ...pdateTrackingBySlugTrackingNumberQuery.php | 74 -- ...ateTrackingBySlugTrackingNumberRequest.php | 16 - ...teTrackingBySlugTrackingNumberResponse.php | 16 - src/Client.php | 20 +- src/Exception/AfterShipError.php | 9 +- src/Exception/ErrorCode.php | 8 +- src/Model/AdditionalFieldsV1.php | 4 +- src/Model/Checkpoint.php | 8 +- src/Model/Courier.php | 4 +- .../CourierEstimatedDeliveryDateTracking.php | 24 + src/Model/CustomersTracking.php | 32 + src/Model/DataNotificationResponseV1.php | 16 - src/Model/DataTrackingDeleteResponseV1.php | 16 - .../DataTrackingResponseGetMultipleV1.php | 52 +- src/Model/DataTrackingResponseV1.php | 16 - ...ionAddressEstimatedDeliveryDateRequest.php | 2 +- ...onAddressEstimatedDeliveryDateResponse.php | 2 +- src/Model/EstimatedDeliveryDateResponse.php | 4 + src/Model/FirstMileTracking.php | 32 + src/Model/LastMileTracking.php | 36 + src/Model/NextCouriersTracking.php | 24 - src/Model/Notification.php | 20 - src/Model/NotificationRequestV1.php | 20 - src/Model/NotificationResponseV1.php | 20 - ...ginAddressEstimatedDeliveryDateRequest.php | 2 +- ...inAddressEstimatedDeliveryDateResponse.php | 2 +- src/Model/PaginationCursor.php | 25 - ...ationDataTrackingResponseGetMultipleV1.php | 24 + src/Model/PaginationPage.php | 27 - src/Model/PartialDeleteTracking.php | 52 -- src/Model/PartialUpdateTracking.php | 56 -- src/Model/ShipmentWeightTracking.php | 20 + src/Model/Tracking.php | 80 +- src/Model/TrackingDeleteResponseV1.php | 20 - src/Model/TrackingResponseV1.php | 2 +- src/Transport/Http.php | 2 +- test.php | 91 +++ 167 files changed, 5266 insertions(+), 3071 deletions(-) delete mode 100644 src/API/Courier/TrackingDetectCourierRequest.php create mode 100644 src/API/EstimatedDeliveryDate/DestinationAddressPredictRequest.php create mode 100644 src/API/EstimatedDeliveryDate/DestinationAddressPredictResponse.php create mode 100644 src/API/EstimatedDeliveryDate/EstimatedPickupPredictRequest.php create mode 100644 src/API/EstimatedDeliveryDate/EstimatedPickupPredictResponse.php create mode 100644 src/API/EstimatedDeliveryDate/OrderProcessingTimeEstimatedPickupPredictRequest.php create mode 100644 src/API/EstimatedDeliveryDate/OrderProcessingTimeEstimatedPickupPredictResponse.php create mode 100644 src/API/EstimatedDeliveryDate/OriginAddressPredictRequest.php create mode 100644 src/API/EstimatedDeliveryDate/OriginAddressPredictResponse.php create mode 100644 src/API/EstimatedDeliveryDate/PredictRequest.php create mode 100644 src/API/EstimatedDeliveryDate/PredictResponse.php create mode 100644 src/API/EstimatedDeliveryDate/WeightPredictRequest.php create mode 100644 src/API/EstimatedDeliveryDate/WeightPredictResponse.php delete mode 100644 src/API/LastCheckpoint.php delete mode 100644 src/API/LastCheckpoint/GetCheckpointBySlugTrackingNumberQuery.php delete mode 100644 src/API/LastCheckpoint/GetCheckpointBySlugTrackingNumberResponse.php delete mode 100644 src/API/LastCheckpoint/GetCheckpointByTrackingIdQuery.php delete mode 100644 src/API/LastCheckpoint/GetCheckpointByTrackingIdResponse.php delete mode 100644 src/API/Notification.php delete mode 100644 src/API/Notification/AddNotificationBySlugTrackingNumberQuery.php delete mode 100644 src/API/Notification/AddNotificationBySlugTrackingNumberRequest.php delete mode 100644 src/API/Notification/AddNotificationBySlugTrackingNumberResponse.php delete mode 100644 src/API/Notification/AddNotificationByTrackingIdRequest.php delete mode 100644 src/API/Notification/AddNotificationByTrackingIdResponse.php delete mode 100644 src/API/Notification/DeleteNotificationBySlugTrackingNumberQuery.php delete mode 100644 src/API/Notification/DeleteNotificationBySlugTrackingNumberRequest.php delete mode 100644 src/API/Notification/DeleteNotificationBySlugTrackingNumberResponse.php delete mode 100644 src/API/Notification/DeleteNotificationByTrackingIdRequest.php delete mode 100644 src/API/Notification/DeleteNotificationByTrackingIdResponse.php delete mode 100644 src/API/Notification/GetNotificationBySlugTrackingNumberQuery.php delete mode 100644 src/API/Notification/GetNotificationBySlugTrackingNumberResponse.php delete mode 100644 src/API/Notification/GetNotificationByTrackingIdResponse.php create mode 100644 src/API/Tracking/AftershipEstimatedDeliveryDateCreateTrackingResponse.php create mode 100644 src/API/Tracking/AftershipEstimatedDeliveryDateDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/AftershipEstimatedDeliveryDateGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/AftershipEstimatedDeliveryDateRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse.php create mode 100644 src/API/Tracking/CarbonEmissionsCreateTrackingResponse.php create mode 100644 src/API/Tracking/CarbonEmissionsDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/CarbonEmissionsGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/CarbonEmissionsMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/CarbonEmissionsRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/CarbonEmissionsUpdateTrackingByIdResponse.php create mode 100644 src/API/Tracking/CourierEstimatedDeliveryDateCreateTrackingResponse.php create mode 100644 src/API/Tracking/CourierEstimatedDeliveryDateDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/CourierEstimatedDeliveryDateGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/CourierEstimatedDeliveryDateMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/CourierEstimatedDeliveryDateRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/CourierEstimatedDeliveryDateUpdateTrackingByIdResponse.php create mode 100644 src/API/Tracking/CustomEstimatedDeliveryDateCreateTrackingResponse.php create mode 100644 src/API/Tracking/CustomEstimatedDeliveryDateDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/CustomEstimatedDeliveryDateGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/CustomEstimatedDeliveryDateRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/CustomEstimatedDeliveryDateUpdateTrackingByIdResponse.php delete mode 100644 src/API/Tracking/CustomFieldsTrackingUpdateTrackingBySlugTrackingNumberRequest.php create mode 100644 src/API/Tracking/CustomersCreateTrackingRequest.php create mode 100644 src/API/Tracking/CustomersCreateTrackingResponse.php create mode 100644 src/API/Tracking/CustomersDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/CustomersGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/CustomersMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/CustomersRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/CustomersUpdateTrackingByIdRequest.php create mode 100644 src/API/Tracking/CustomersUpdateTrackingByIdResponse.php delete mode 100644 src/API/Tracking/DeleteTrackingBySlugTrackingNumberQuery.php delete mode 100644 src/API/Tracking/DeleteTrackingBySlugTrackingNumberResponse.php create mode 100644 src/API/Tracking/FirstEstimatedDeliveryCreateTrackingResponse.php create mode 100644 src/API/Tracking/FirstEstimatedDeliveryDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/FirstEstimatedDeliveryGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/FirstEstimatedDeliveryRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/FirstEstimatedDeliveryUpdateTrackingByIdResponse.php create mode 100644 src/API/Tracking/FirstMileCreateTrackingResponse.php create mode 100644 src/API/Tracking/FirstMileDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/FirstMileGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/FirstMileMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/FirstMileRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/FirstMileUpdateTrackingByIdResponse.php delete mode 100644 src/API/Tracking/GetTrackingBySlugTrackingNumberQuery.php delete mode 100644 src/API/Tracking/GetTrackingBySlugTrackingNumberResponse.php create mode 100644 src/API/Tracking/LastMileCreateTrackingRequest.php create mode 100644 src/API/Tracking/LastMileCreateTrackingResponse.php create mode 100644 src/API/Tracking/LastMileDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/LastMileGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/LastMileMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/LastMileRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/LastMileUpdateTrackingByIdResponse.php create mode 100644 src/API/Tracking/LatestEstimatedDeliveryCreateTrackingResponse.php create mode 100644 src/API/Tracking/LatestEstimatedDeliveryDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/LatestEstimatedDeliveryGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/LatestEstimatedDeliveryRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/LatestEstimatedDeliveryUpdateTrackingByIdResponse.php delete mode 100644 src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberQuery.php delete mode 100644 src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberRequest.php delete mode 100644 src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberResponse.php delete mode 100644 src/API/Tracking/NextCouriersTrackingCreateTrackingRequest.php create mode 100644 src/API/Tracking/PaginationGetTrackingsResponse.php delete mode 100644 src/API/Tracking/RetrackTrackingBySlugTrackingNumberQuery.php delete mode 100644 src/API/Tracking/RetrackTrackingBySlugTrackingNumberResponse.php create mode 100644 src/API/Tracking/ShipmentWeightCreateTrackingResponse.php create mode 100644 src/API/Tracking/ShipmentWeightDeleteTrackingByIdResponse.php create mode 100644 src/API/Tracking/ShipmentWeightGetTrackingByIdResponse.php create mode 100644 src/API/Tracking/ShipmentWeightMarkTrackingCompletedByIdResponse.php create mode 100644 src/API/Tracking/ShipmentWeightRetrackTrackingByIdResponse.php create mode 100644 src/API/Tracking/ShipmentWeightUpdateTrackingByIdResponse.php delete mode 100644 src/API/Tracking/TrackingCreateTrackingRequest.php delete mode 100644 src/API/Tracking/TrackingUpdateTrackingByIdRequest.php delete mode 100644 src/API/Tracking/TrackingUpdateTrackingBySlugTrackingNumberRequest.php delete mode 100644 src/API/Tracking/UpdateTrackingBySlugTrackingNumberQuery.php delete mode 100644 src/API/Tracking/UpdateTrackingBySlugTrackingNumberRequest.php delete mode 100644 src/API/Tracking/UpdateTrackingBySlugTrackingNumberResponse.php create mode 100644 src/Model/CourierEstimatedDeliveryDateTracking.php create mode 100644 src/Model/CustomersTracking.php delete mode 100644 src/Model/DataNotificationResponseV1.php delete mode 100644 src/Model/DataTrackingDeleteResponseV1.php delete mode 100644 src/Model/DataTrackingResponseV1.php create mode 100644 src/Model/FirstMileTracking.php create mode 100644 src/Model/LastMileTracking.php delete mode 100644 src/Model/NextCouriersTracking.php delete mode 100644 src/Model/Notification.php delete mode 100644 src/Model/NotificationRequestV1.php delete mode 100644 src/Model/NotificationResponseV1.php delete mode 100644 src/Model/PaginationCursor.php create mode 100644 src/Model/PaginationDataTrackingResponseGetMultipleV1.php delete mode 100644 src/Model/PaginationPage.php delete mode 100644 src/Model/PartialDeleteTracking.php delete mode 100644 src/Model/PartialUpdateTracking.php create mode 100644 src/Model/ShipmentWeightTracking.php delete mode 100644 src/Model/TrackingDeleteResponseV1.php create mode 100644 test.php diff --git a/LICENSE.txt b/LICENSE.txt index cf9a7b7..39025bd 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,22 +1,21 @@ -Copyright (c) 2024 AfterShip +MIT License -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +Copyright (c) 2025 AfterShip -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 41b3422..b3f3610 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ If you need support using AfterShip products, please contact support@aftership.c - [AfterShip Tracking API library for PHP](#aftership-tracking-api-library-for-php) - [Table of Contents](#table-of-contents) - [Before you begin](#before-you-begin) + - [API and SDK Version](#api-and-sdk-version) - [Quick Start](#quick-start) - [Installation](#installation) - - [Usage](#usage) - [Constructor](#constructor) - [Example](#example) - [Rate Limiter](#rate-limiter) @@ -22,8 +22,6 @@ If you need support using AfterShip products, please contact support@aftership.c - [Endpoints](#endpoints) - [/trackings](#trackings) - [/couriers](#couriers) - - [/last\_checkpoint](#last_checkpoint) - - [/notifications](#notifications) - [/estimated-delivery-date](#estimated-delivery-date) - [Help](#help) - [License](#license) @@ -37,41 +35,33 @@ Before you begin to integrate: - [Create an API key](https://organization.automizely.com/api-keys). - [Install PHP](https://www.php.net/downloads.php) version 8.0 or later. -## Quick Start +### API and SDK Version -### Installation -```bash -composer require aftership/tracking-sdk -``` +Each SDK version is designed to work with a specific API version. Please refer to the table below to identify the supported API versions for each SDK version, ensuring you select the appropriate SDK version for the API version you intend to use. -### Usage -```php - 'YOUR_API_KEY', - 'authenticationType' => \Tracking\Config::AUTHENTICATION_TYPE_API_KEY, -]); +## Quick Start -try { - $trackingInfo = $client->tracking->getTrackingById(''); - var_dump($trackingInfo->checkpoints); -} catch (\Tracking\Exception\AfterShipError $e) { - // Handle the error - var_dump($e->getErrorCode()); - var_dump($e->getStatusCode()); -} +### Installation +```bash +composer require aftership/tracking-sdk ``` - ## Constructor Create AfterShip instance with options | Name | Type | Required | Description | -|------------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------| +| ---------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | api_key | string | ✔ | Your AfterShip API key | | auth_type | enum | | Default value: `AuthType.API_KEY`
AES authentication: `AuthType.AES`
RSA authentication: `AuthType.RSA` | | api_secret | string | | Required if the authentication type is `AuthType.AES` or `AuthType.RSA` | @@ -84,56 +74,69 @@ Create AfterShip instance with options ### Example ```php + 'YOUR_API_KEY', - 'apiSecret' => 'YOUR_API_SECRET', - 'authenticationType' => \Tracking\Config::AUTHENTICATION_TYPE_AES, + 'authenticationType' => \Tracking\Config::AUTHENTICATION_TYPE_API_KEY, ]); + +try { + $trackingInfo = $client->tracking->getTrackingById(''); + var_dump($trackingInfo->checkpoints); +} catch (\Tracking\Exception\AfterShipError $e) { + // Handle the error + var_dump($e->getErrorCode()); + var_dump($e->getStatusCode()); +} ``` ## Rate Limiter -See the [Rate Limit](https://www.aftership.com/docs/aftership/quickstart/rate-limit) to understand the AfterShip rate limit policy. +See the [Rate Limit](https://www.aftership.com/docs/tracking/2025-01/quickstart/rate-limit) to understand the AfterShip rate limit policy. ## Error Handling The SDK will return an error object when there is any error during the request, with the following specification: -| Name | Type | Description | -|---------------|--------|--------------------------------| -| message | string | Detail message of the error | -| code | enum | Error code enum for API Error. | -| meta_code | number | API response meta code. | -| status_code | number | HTTP status code. | -| response_body | string | API response body. | +| Name | Type | Description | +| --------------- | ------ | ------------------------------ | +| message | string | Detail message of the error | +| code | enum | Error code enum for API Error. | +| meta_code | number | API response meta code. | +| status_code | number | HTTP status code. | +| response_body | string | API response body. | +| response_header | object | API response header. | ### Error List -| code | meta_code | status_code | message | -|-----------------------------------|------------------|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| INVALID_REQUEST | 400 | 400 | The request was invalid or cannot be otherwise served. | -| INVALID_JSON | 4001 | 400 | Invalid JSON data. | -| TRACKING_ALREADY_EXIST | 4003 | 400 | Tracking already exists. | -| TRACKING_DOES_NOT_EXIST | 4004 | 404 | Tracking does not exist. | -| TRACKING_NUMBER_INVALID | 4005 | 400 | The value of tracking_number is invalid. | -| TRACKING_REQUIRED | 4006 | 400 | tracking object is required. | -| TRACKING_NUMBER_REQUIRED | 4007 | 400 | tracking_number is required. | -| VALUE_INVALID | 4008 | 400 | The value of [field_name] is invalid. | -| VALUE_REQUIRED | 4009 | 400 | [field_name] is required. | -| SLUG_INVALID | 4010 | 400 | The value of slug is invalid. | -| MISSING_OR_INVALID_REQUIRED_FIELD | 4011 | 400 | Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name] | -| BAD_COURIER | 4012 | 400 | The error message will be one of the following:
1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers
2. Unable to import shipment as we don’t recognize the carrier from this tracking number.
3. Unable to import shipment as the tracking number has an invalid format.
4. Unable to import shipment as this carrier is no longer supported.
5. Unable to import shipment as the tracking number does not belong to a carrier in that group. | -| INACTIVE_RETRACK_NOT_ALLOWED | 4013 | 400 | Retrack is not allowed. You can only retrack an inactive tracking. | -| NOTIFICATION_REUQIRED | 4014 | 400 | notification object is required. | -| ID_INVALID | 4015 | 400 | The value of id is invalid. | -| RETRACK_ONCE_ALLOWED | 4016 | 400 | Retrack is not allowed. You can only retrack each shipment once. | -| TRACKING_NUMBER_FORMAT_INVALID | 4017 | 400 | The format of tracking_number is invalid. | -| API_KEY_INVALID | 401 | 401 | The API key is invalid. | -| REQUEST_NOT_ALLOWED | 403 | 403 | The request is understood, but it has been refused or access is not allowed. | -| NOT_FOUND | 404 | 404 | The URI requested is invalid or the resource requested does not exist. | -| TOO_MANY_REQUEST | 429 | 429 | You have exceeded the API call rate limit. The default limit is 10 requests per second. | -| INTERNAL_ERROR | 500 502 503 504 | 500 502 503 504 | Something went wrong on AfterShip's end. | +| code | meta_code | status_code | message | +| --------------------------------- | --------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| INVALID_REQUEST | 400 | 400 | The request was invalid or cannot be otherwise served. | +| INVALID_JSON | 4001 | 400 | Invalid JSON data. | +| TRACKING_ALREADY_EXIST | 4003 | 400 | Tracking already exists. | +| TRACKING_DOES_NOT_EXIST | 4004 | 404 | Tracking does not exist. | +| TRACKING_NUMBER_INVALID | 4005 | 400 | The value of tracking_number is invalid. | +| TRACKING_REQUIRED | 4006 | 400 | tracking object is required. | +| TRACKING_NUMBER_REQUIRED | 4007 | 400 | tracking_number is required. | +| VALUE_INVALID | 4008 | 400 | The value of [field_name] is invalid. | +| VALUE_REQUIRED | 4009 | 400 | [field_name] is required. | +| SLUG_INVALID | 4010 | 400 | The value of slug is invalid. | +| MISSING_OR_INVALID_REQUIRED_FIELD | 4011 | 400 | Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name] | +| BAD_COURIER | 4012 | 400 | The error message will be one of the following:
1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers
2. Unable to import shipment as we don’t recognize the carrier from this tracking number.
3. Unable to import shipment as the tracking number has an invalid format.
4. Unable to import shipment as this carrier is no longer supported.
5. Unable to import shipment as the tracking number does not belong to a carrier in that group. | +| INACTIVE_RETRACK_NOT_ALLOWED | 4013 | 400 | Retrack is not allowed. You can only retrack an inactive tracking. | +| NOTIFICATION_REUQIRED | 4014 | 400 | notification object is required. | +| ID_INVALID | 4015 | 400 | The value of id is invalid. | +| RETRACK_ONCE_ALLOWED | 4016 | 400 | Retrack is not allowed. You can only retrack each shipment once. | +| TRACKING_NUMBER_FORMAT_INVALID | 4017 | 400 | The format of tracking_number is invalid. | +| API_KEY_INVALID | 401 | 401 | The API key is invalid. | +| REQUEST_NOT_ALLOWED | 403 | 403 | The request is understood, but it has been refused or access is not allowed. | +| NOT_FOUND | 404 | 404 | The URI requested is invalid or the resource requested does not exist. | +| TOO_MANY_REQUEST | 429 | 429 | You have exceeded the API call rate limit. The default limit is 10 requests per second. | +| INTERNAL_ERROR | 500 502 503 504 | 500 502 503 504 | Something went wrong on AfterShip's end. | ## Endpoints @@ -141,16 +144,14 @@ The AfterShip instance has the following properties which are exactly the same a - courier - Get a list of our supported couriers. - tracking - Create trackings, update trackings, and get tracking results. -- last_checkpoint - Get tracking information of the last checkpoint of a tracking. -- notification - Get, add or remove contacts (sms or email) to be notified when the status of a tracking has changed. - +- estimated-delivery-date - Get estimated delivery date for your order. ### /trackings **POST** /trackings ```php -$payload = new \Tracking\API\Tracking\TrackingCreateTrackingRequest(); +$payload = new \Tracking\API\Tracking\CreateTrackingRequest(); $payload->tracking_number = ''; $payload->slug = ''; $trackingInfo = $client->tracking->createTracking($payload); @@ -160,7 +161,7 @@ var_dump($trackingInfo); **DELETE** /trackings/:id ```php -$trackingInfo = $client->tracking->deleteTrackingById(''); +$trackingInfo = $client->tracking->deleteTrackingById(''); var_dump($trackingInfo); ``` @@ -178,23 +179,23 @@ var_dump($trackingInfo); **GET** /trackings/:id ```php -$trackingInfo = $client->tracking->getTrackingById(''); +$trackingInfo = $client->tracking->getTrackingById(''); var_dump($trackingInfo); ``` **PUT** /trackings/:id ```php -$payload = new \Tracking\API\Tracking\TrackingUpdateTrackingByIdRequest(); +$payload = new \Tracking\API\Tracking\UpdateTrackingByIdRequest(); $payload->title = 'test'; -$trackingInfo = $client->tracking->updateTrackingById('', $payload); +$trackingInfo = $client->tracking->updateTrackingById('', $payload); var_dump($trackingInfo); ``` **POST** /trackings/:id/retrack ```php -$trackingInfo = $client->tracking->retrackTrackingById(''); +$trackingInfo = $client->tracking->retrackTrackingById(''); var_dump($trackingInfo); ``` @@ -203,7 +204,7 @@ var_dump($trackingInfo); ```php $payload = new \Tracking\API\Tracking\MarkTrackingCompletedByIdRequest(); $payload->reason = 'DELIVERED'; -$trackingInfo = $client->tracking->markTrackingCompletedById('', $payload); +$trackingInfo = $client->tracking->markTrackingCompletedById('', $payload); var_dump($trackingInfo); ``` @@ -225,49 +226,13 @@ var_dump($couriers); **POST** /couriers/detect ```php -$payload = new \Tracking\API\Courier\TrackingDetectCourierRequest(); -$payload->slug = ''; +$payload = new \Tracking\API\Courier\DetectCourierRequest(); +$payload->slug = ['']; $payload->tracking_number = ''; $couriers = $client->courier->detectCourier($payload); var_dump($couriers); ``` -### /last_checkpoint - -**GET** /last_checkpoint/:id - -```php -$checkpoint = $client->last_checkpoint->getCheckpointByTrackingId(''); -var_dump($checkpoint); -``` - -### /notifications - -**GET** /notifications/:id - -```php -$notification = $client->notification->getNotificationByTrackingId(''); -var_dump($notification); -``` - -**POST** /notifications/:id/add - -```php -$payload = new \Tracking\Model\NotificationRequestV1(); -$payload->emails = ['YOUR_EMAIL']; -$notification = $client->notification->addNotificationByTrackingId('', $payload); -var_dump($notification); -``` - -**POST** /notifications/:id/remove - -```php -$payload = new \Tracking\Model\NotificationRequestV1(); -$payload->emails = ['YOUR_EMAIL']; -$notification = $client->notification->deleteNotificationByTrackingId('', $payload); -var_dump($notification); -``` - ### /estimated-delivery-date **POST** /estimated-delivery-date/predict-batch @@ -276,6 +241,16 @@ var_dump($notification); $payload = new \Tracking\API\EstimatedDeliveryDate\PredictBatchRequest(); $edd = new \Tracking\Model\EstimatedDeliveryDateRequest(); $edd->slug = ''; +$edd->pickup_time = '2024-08-01 06:42:30'; +$orginAddress = new \Tracking\Model\OriginAddressEstimatedDeliveryDateRequest(); +$orginAddress->country_region = ''; +$orginAddress->state = ''; +$edd->origin_address = $orginAddress; + +$destAddress = new \Tracking\Model\DestinationAddressEstimatedDeliveryDateRequest(); +$destAddress->country_region = ''; +$destAddress->state = ''; +$edd->destination_address = $destAddress; $payload->estimated_delivery_dates = [$edd]; $notification = $client->estimated_delivery_date->predictBatch($payload); var_dump($notification); @@ -289,6 +264,6 @@ If you get stuck, we're here to help: - Contact AfterShip official support via support@aftership.com ## License -Copyright (c) 2024 AfterShip +Copyright (c) 2025 AfterShip Licensed under the MIT license. \ No newline at end of file diff --git a/composer.json b/composer.json index 11c4521..4c19714 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ } ], "require": { - "php": ">=8.1.0", + "php": ">=8.0.0", "guzzlehttp/guzzle": "6.5.8", "phpseclib/phpseclib": "3.0.37", "symfony/serializer": "^3.4", diff --git a/composer.lock b/composer.lock index 04ee6b4..aea0ebe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,33 +4,31 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "66a36581a05774a47156b44b3746f298", + "content-hash": "8c13bc6687afa832f21c89e97bc23a1b", "packages": [ { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -38,7 +36,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -49,9 +47,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "guzzlehttp/guzzle", @@ -524,16 +522,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -542,17 +540,17 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.5 || ~1.6.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -582,29 +580,29 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-05-21T05:55:05+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.8.2", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "phpstan/phpdoc-parser": "^1.18|^2.0" }, "require-dev": { "ext-tokenizer": "*", @@ -640,9 +638,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" }, - "time": "2024-02-23T11:10:43+00:00" + "time": "2024-11-09T15:12:26+00:00" }, { "name": "phpseclib/phpseclib", @@ -756,30 +754,30 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.29.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", - "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -797,9 +795,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" }, - "time": "2024-05-31T08:52:43+00:00" + "time": "2024-10-13T11:29:49+00:00" }, { "name": "psr/http-message", @@ -972,20 +970,20 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -996,8 +994,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1031,7 +1029,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -1047,26 +1045,25 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c" + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", - "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" @@ -1074,8 +1071,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1115,7 +1112,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" }, "funding": [ { @@ -1131,24 +1128,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -1156,8 +1153,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1196,7 +1193,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -1212,7 +1209,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php70", @@ -1233,12 +1230,12 @@ }, "type": "metapackage", "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + }, "branch-alias": { "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" } }, "notification-url": "https://packagist.org/downloads/", @@ -1282,101 +1279,28 @@ ], "time": "2020-10-23T14:02:19+00:00" }, - { - "name": "symfony/polyfill-php72", - "version": "v1.30.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "10112722600777e02d2745716b70c5db4ca70442" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/10112722600777e02d2745716b70c5db4ca70442", - "reference": "10112722600777e02d2745716b70c5db4ca70442", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-06-19T12:30:46+00:00" - }, { "name": "symfony/polyfill-php80", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1417,7 +1341,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -1433,7 +1357,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/property-access", @@ -1820,28 +1744,36 @@ }, { "name": "composer/pcre", - "version": "3.1.4", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "04229f163664973f68f38f6f73d917799168ef24" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", - "reference": "04229f163664973f68f38f6f73d917799168ef24", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, "branch-alias": { "dev-main": "3.x-dev" } @@ -1871,7 +1803,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.4" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -1887,28 +1819,28 @@ "type": "tidelift" } ], - "time": "2024-05-27T13:40:54+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -1952,7 +1884,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -1968,7 +1900,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", @@ -2085,16 +2017,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { @@ -2134,7 +2066,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { @@ -2142,20 +2074,20 @@ "type": "github" } ], - "time": "2024-02-07T09:43:46+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.59.3", + "version": "v3.68.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" + "reference": "73f78d8b2b34a0dd65fedb434a602ee4c2c8ad4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/73f78d8b2b34a0dd65fedb434a602ee4c2c8ad4c", + "reference": "73f78d8b2b34a0dd65fedb434a602ee4c2c8ad4c", "shasum": "" }, "require": { @@ -2165,38 +2097,38 @@ "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", - "fidry/cpu-core-counter": "^1.0", + "fidry/cpu-core-counter": "^1.2", "php": "^7.4 || ^8.0", "react/child-process": "^0.6.5", "react/event-loop": "^1.0", "react/promise": "^2.0 || ^3.0", "react/socket": "^1.0", "react/stream": "^1.0", - "sebastian/diff": "^4.0 || ^5.0 || ^6.0", - "symfony/console": "^5.4 || ^6.0 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", - "symfony/finder": "^5.4 || ^6.0 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", - "symfony/polyfill-mbstring": "^1.28", - "symfony/polyfill-php80": "^1.28", - "symfony/polyfill-php81": "^1.28", - "symfony/process": "^5.4 || ^6.0 || ^7.0", - "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" }, "require-dev": { - "facile-it/paraunit": "^1.3 || ^2.3", - "infection/infection": "^0.29.5", - "justinrainbow/json-schema": "^5.2", + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", "keradus/cli-executor": "^2.1", - "mikey179/vfsstream": "^1.6.11", + "mikey179/vfsstream": "^1.6.12", "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", - "phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2", - "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -2237,7 +2169,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.0" }, "funding": [ { @@ -2245,7 +2177,7 @@ "type": "github" } ], - "time": "2024-06-16T14:17:03+00:00" + "time": "2025-01-13T17:01:01+00:00" }, { "name": "psr/container", @@ -2352,16 +2284,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -2396,9 +2328,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "react/cache", @@ -2474,33 +2406,33 @@ }, { "name": "react/child-process", - "version": "v0.6.5", + "version": "v0.6.6", "source": { "type": "git", "url": "https://github.com/reactphp/child-process.git", - "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", - "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", "react/event-loop": "^1.2", - "react/stream": "^1.2" + "react/stream": "^1.4" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/socket": "^1.8", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, "type": "library", "autoload": { "psr-4": { - "React\\ChildProcess\\": "src" + "React\\ChildProcess\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2537,19 +2469,15 @@ ], "support": { "issues": "https://github.com/reactphp/child-process/issues", - "source": "https://github.com/reactphp/child-process/tree/v0.6.5" + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-09-16T13:41:56+00:00" + "time": "2025-01-01T16:37:48+00:00" }, { "name": "react/dns", @@ -2774,31 +2702,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -2842,7 +2770,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -2850,7 +2778,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", @@ -2932,29 +2860,29 @@ }, { "name": "sebastian/diff", - "version": "5.1.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0", - "symfony/process": "^6.4" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2987,7 +2915,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -2995,51 +2923,50 @@ "type": "github" } ], - "time": "2024-03-02T07:15:17+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "symfony/console", - "version": "v6.4.9", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3073,7 +3000,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.9" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -3089,20 +3016,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:49:33+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -3110,12 +3037,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -3140,7 +3067,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -3156,28 +3083,28 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.4.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "8d7507f02b06e06815e56bb39aa0128e3806208b" + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8d7507f02b06e06815e56bb39aa0128e3806208b", - "reference": "8d7507f02b06e06815e56bb39aa0128e3806208b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4", + "symfony/dependency-injection": "<6.4", "symfony/service-contracts": "<2.5" }, "provide": { @@ -3186,13 +3113,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0|^7.0" + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3220,7 +3147,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.8" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" }, "funding": [ { @@ -3236,20 +3163,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { @@ -3258,12 +3185,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -3296,7 +3223,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -3312,29 +3239,29 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", - "version": "v6.4.9", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b51ef8059159330b74a4d52f68e671033c0fe463" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b51ef8059159330b74a4d52f68e671033c0fe463", - "reference": "b51ef8059159330b74a4d52f68e671033c0fe463", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^5.4|^6.4|^7.0" + "symfony/process": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3362,7 +3289,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.9" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -3378,27 +3305,27 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:49:33+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v6.4.8", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3ef977a43883215d560a2cecb82ec8e62131471c", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.0|^7.0" + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3426,7 +3353,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.8" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -3442,24 +3369,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.4.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "22ab9e9101ab18de37839074f8a1197f55590c1b" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/22ab9e9101ab18de37839074f8a1197f55590c1b", - "reference": "22ab9e9101ab18de37839074f8a1197f55590c1b", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", @@ -3493,7 +3420,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.8" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -3509,24 +3436,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -3534,8 +3461,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3571,7 +3498,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -3587,24 +3514,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -3615,8 +3542,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3651,7 +3578,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -3667,30 +3594,30 @@ "type": "tidelift" } ], - "time": "2024-06-19T12:30:46+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", - "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3727,7 +3654,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -3743,24 +3670,24 @@ "type": "tidelift" } ], - "time": "2024-06-19T12:30:46+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v6.4.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8d92dd79149f29e89ee0f480254db595f6a6a2c5" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8d92dd79149f29e89ee0f480254db595f6a6a2c5", - "reference": "8d92dd79149f29e89ee0f480254db595f6a6a2c5", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -3788,7 +3715,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.8" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -3804,20 +3731,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -3830,12 +3757,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -3871,7 +3798,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -3887,24 +3814,24 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.4.8", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "63e069eb616049632cde9674c46957819454b8aa" + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/63e069eb616049632cde9674c46957819454b8aa", - "reference": "63e069eb616049632cde9674c46957819454b8aa", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -3933,7 +3860,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.4.8" + "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" }, "funding": [ { @@ -3949,24 +3876,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-12-18T14:28:33+00:00" }, { "name": "symfony/string", - "version": "v6.4.9", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/76792dbd99690a5ebef8050d9206c60c59e681d7", - "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -3976,11 +3903,12 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4019,7 +3947,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.9" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -4035,19 +3963,19 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:25:38+00:00" + "time": "2024-11-13T13:31:26+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.1.0", + "php": ">=8.0.0", "ext-json": "*", "ext-mbstring": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/src/API/Base/APIBase.php b/src/API/Base/APIBase.php index 14c8e94..6214d35 100644 --- a/src/API/Base/APIBase.php +++ b/src/API/Base/APIBase.php @@ -10,45 +10,16 @@ class APIBase { - protected function parseSingleResource(ResponseInterface $resp, $resourceKey, $modelClass) + protected function parseSingleResource(ResponseInterface $resp, $modelClass) { $body = $resp->getBody()->getContents(); $statusCode = $resp->getStatusCode(); $response = json_decode($body, true); if ($statusCode < 200 || $statusCode > 299) { - throw ErrorCode::genRemoteError($statusCode, $response['meta']['code'] ?? null, $body, $response['meta']['message'] ?? null); + throw ErrorCode::genRemoteError($statusCode, $response['meta']['code'] ?? null, $body, $response['meta']['message'] ?? null, $resp->getHeaders() ?? null); } - return $modelClass::fromArray($resourceKey ? $response['data'][$resourceKey] : $response['data'], $modelClass); - } - - protected function parseMultipleResources(ResponseInterface $resp, $resourceKey, $modelClass, $paginationClass) - { - $body = $resp->getBody()->getContents(); - $statusCode = $resp->getStatusCode(); - - $response = json_decode($body, true); - - if ($statusCode < 200 || $statusCode > 299) { - throw ErrorCode::genRemoteError($statusCode, $response['meta']['code'] ?? null, $body, $response['meta']['message'] ?? null); - } - // 提取资源和分页信息 - $resources = []; - - $rawResources = $resourceKey ? $response['data'][$resourceKey] : $response['data']; - if (isset($response['data'][$resourceKey])) { - $resources = array_map(function ($resourceData) use ($modelClass) { - return $modelClass::fromArray($resourceData, $modelClass); - }, $rawResources); - } - - $pagination = $paginationClass::fromArray($response['data'], $paginationClass); - - // 返回资源和分页信息 - return [ - 'resources' => $resources, - 'pagination' => $pagination, - ]; + return $modelClass::fromArray($response['data'], $modelClass); } } diff --git a/src/API/Courier.php b/src/API/Courier.php index 2901326..0b97acf 100644 --- a/src/API/Courier.php +++ b/src/API/Courier.php @@ -22,43 +22,43 @@ public function __construct(Http $httpClient) /** * @throws AfterShipError */ - public function getUserCouriers( + public function detectCourier( + \Tracking\API\Courier\DetectCourierRequest $body, array $headers = [] - ): \Tracking\API\Courier\GetUserCouriersResponse { + ): \Tracking\API\Courier\DetectCourierResponse { $options = [ 'headers' => $headers, + + 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/couriers"), $options); - $result = $this->parseSingleResource($resp, '', \Tracking\API\Courier\GetUserCouriersResponse::class); - return $result; + $resp = $this->httpClient->request('POST', sprintf("/tracking/2025-01/couriers/detect"), $options); + + return $this->parseSingleResource($resp, \Tracking\API\Courier\DetectCourierResponse::class); } /** * @throws AfterShipError */ - public function getAllCouriers( + public function getUserCouriers( array $headers = [] - ): \Tracking\API\Courier\GetAllCouriersResponse { + ): \Tracking\API\Courier\GetUserCouriersResponse { $options = [ 'headers' => $headers, ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/couriers/all"), $options); - $result = $this->parseSingleResource($resp, '', \Tracking\API\Courier\GetAllCouriersResponse::class); - return $result; + $resp = $this->httpClient->request('GET', sprintf("/tracking/2025-01/couriers"), $options); + + return $this->parseSingleResource($resp, \Tracking\API\Courier\GetUserCouriersResponse::class); } /** * @throws AfterShipError */ - public function detectCourier( - \Tracking\API\Courier\TrackingDetectCourierRequest $body, + public function getAllCouriers( array $headers = [] - ): \Tracking\API\Courier\DetectCourierResponse { + ): \Tracking\API\Courier\GetAllCouriersResponse { $options = [ 'headers' => $headers, - - 'json' => ['tracking' => $body->toRequestArray()], ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/couriers/detect"), $options); - $result = $this->parseSingleResource($resp, '', \Tracking\API\Courier\DetectCourierResponse::class); - return $result; + $resp = $this->httpClient->request('GET', sprintf("/tracking/2025-01/couriers/all"), $options); + + return $this->parseSingleResource($resp, \Tracking\API\Courier\GetAllCouriersResponse::class); } } diff --git a/src/API/Courier/DetectCourierRequest.php b/src/API/Courier/DetectCourierRequest.php index 3bfde10..ce199b7 100644 --- a/src/API/Courier/DetectCourierRequest.php +++ b/src/API/Courier/DetectCourierRequest.php @@ -10,7 +10,51 @@ class DetectCourierRequest extends Base { /** - * @var TrackingDetectCourierRequest Detect courier request + * @var string Tracking number of a shipment. */ - public $tracking; + public $tracking_number; + /** + * @var array[] If not specified, Aftership will automatically detect the courier based on the tracking number format and your . Use array to input a list of couriers for auto detect. Cannot be used with slug_group at the same time. + */ + public $slug; + /** + * @var string The postal code of receiver's address. Required by some couriers. Refer to for more details + */ + public $tracking_postal_code; + /** + * @var string Shipping date in `YYYYMMDD` format. Required by some couriers. Refer to for more details + */ + public $tracking_ship_date; + /** + * @var string Account number of the shipper for a specific courier. Required by some couriers. Refer to for more details + */ + public $tracking_account_number; + /** + * @var string Key of the shipment for a specific courier. Required by some couriers. Refer to for more details + */ + public $tracking_key; + /** + * @var string Origin Country/Region of the shipment for a specific courier. Required by some couriers. + */ + public $tracking_origin_country_region; + /** + * @var string Destination Country/Region of the shipment for a specific courier. Required by some couriers. Refer to for more details + */ + public $tracking_destination_country_region; + /** + * @var string State of the destination shipping address of the shipment. Required by some couriers. + */ + public $tracking_state; + /** + * @var string|null|\Tracking\Model\SlugGroupV1 Slug group is a group of slugs which belong to same courier. For example, when you inpit "fedex-group" as slug_group, AfterShip will detect the tracking with "fedex-uk", "fedex-fims", and other slugs which belong to "fedex". It cannot be used with slug at the same time. ( + */ + public $slug_group; + /** + * @var string Enter . + */ + public $origin_country_region; + /** + * @var string Enter . + */ + public $destination_country_region; } diff --git a/src/API/Courier/TrackingDetectCourierRequest.php b/src/API/Courier/TrackingDetectCourierRequest.php deleted file mode 100644 index 1acb55f..0000000 --- a/src/API/Courier/TrackingDetectCourierRequest.php +++ /dev/null @@ -1,60 +0,0 @@ - $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/estimated-delivery-date/predict-batch"), $options); - $result = $this->parseSingleResource($resp, '', \Tracking\API\EstimatedDeliveryDate\PredictBatchResponse::class); - return $result; + $resp = $this->httpClient->request('POST', sprintf("/tracking/2025-01/estimated-delivery-date/predict-batch"), $options); + + return $this->parseSingleResource($resp, \Tracking\API\EstimatedDeliveryDate\PredictBatchResponse::class); + } + /** + * @throws AfterShipError + */ + public function predict( + \Tracking\API\EstimatedDeliveryDate\PredictRequest $body, + array $headers = [] + ): \Tracking\API\EstimatedDeliveryDate\PredictResponse { + $options = [ + 'headers' => $headers, + + 'json' => $body->toRequestArray(), + ]; + $resp = $this->httpClient->request('POST', sprintf("/tracking/2025-01/estimated-delivery-date/predict"), $options); + + return $this->parseSingleResource($resp, \Tracking\API\EstimatedDeliveryDate\PredictResponse::class); } } diff --git a/src/API/EstimatedDeliveryDate/DestinationAddressPredictRequest.php b/src/API/EstimatedDeliveryDate/DestinationAddressPredictRequest.php new file mode 100644 index 0000000..86d4e85 --- /dev/null +++ b/src/API/EstimatedDeliveryDate/DestinationAddressPredictRequest.php @@ -0,0 +1,32 @@ +httpClient = $httpClient; - } - - /** - * @throws AfterShipError - */ - public function getCheckpointByTrackingId( - string $tracking_id, - GetCheckpointByTrackingIdQuery $query = null, - array $headers = [] - ): \Tracking\API\LastCheckpoint\GetCheckpointByTrackingIdResponse { - if ($tracking_id === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_id' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/last_checkpoint/%s", $tracking_id), $options); - $result = $this->parseSingleResource($resp, '', \Tracking\API\LastCheckpoint\GetCheckpointByTrackingIdResponse::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function getCheckpointBySlugTrackingNumber( - string $slug, - string $tracking_number, - GetCheckpointBySlugTrackingNumberQuery $query = null, - array $headers = [] - ): \Tracking\API\LastCheckpoint\GetCheckpointBySlugTrackingNumberResponse { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/last_checkpoint/%s/%s", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, '', \Tracking\API\LastCheckpoint\GetCheckpointBySlugTrackingNumberResponse::class); - return $result; - } -} diff --git a/src/API/LastCheckpoint/GetCheckpointBySlugTrackingNumberQuery.php b/src/API/LastCheckpoint/GetCheckpointBySlugTrackingNumberQuery.php deleted file mode 100644 index a1c8945..0000000 --- a/src/API/LastCheckpoint/GetCheckpointBySlugTrackingNumberQuery.php +++ /dev/null @@ -1,92 +0,0 @@ -fields = $fields; - return $this; - } - public function setLang(string $lang): GetCheckpointBySlugTrackingNumberQuery - { - $this->lang = $lang; - return $this; - } - public function setTrackingAccountNumber(string $tracking_account_number): GetCheckpointBySlugTrackingNumberQuery - { - $this->tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): GetCheckpointBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): GetCheckpointBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): GetCheckpointBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): GetCheckpointBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): GetCheckpointBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): GetCheckpointBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/LastCheckpoint/GetCheckpointBySlugTrackingNumberResponse.php b/src/API/LastCheckpoint/GetCheckpointBySlugTrackingNumberResponse.php deleted file mode 100644 index d5202fe..0000000 --- a/src/API/LastCheckpoint/GetCheckpointBySlugTrackingNumberResponse.php +++ /dev/null @@ -1,40 +0,0 @@ -fields = $fields; - return $this; - } - public function setLang(string $lang): GetCheckpointByTrackingIdQuery - { - $this->lang = $lang; - return $this; - } -} diff --git a/src/API/LastCheckpoint/GetCheckpointByTrackingIdResponse.php b/src/API/LastCheckpoint/GetCheckpointByTrackingIdResponse.php deleted file mode 100644 index a2ae945..0000000 --- a/src/API/LastCheckpoint/GetCheckpointByTrackingIdResponse.php +++ /dev/null @@ -1,40 +0,0 @@ -httpClient = $httpClient; - } - - /** - * @throws AfterShipError - */ - public function addNotificationByTrackingId( - string $tracking_id, - \Tracking\Model\NotificationRequestV1 $body, - array $headers = [] - ): \Tracking\Model\Notification { - if ($tracking_id === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_id' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - - 'json' => ['notification' => $body->toRequestArray()], - ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/notifications/%s/add", $tracking_id), $options); - $result = $this->parseSingleResource($resp, 'notification', \Tracking\Model\Notification::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function deleteNotificationBySlugTrackingNumber( - string $slug, - string $tracking_number, - \Tracking\Model\NotificationRequestV1 $body, - DeleteNotificationBySlugTrackingNumberQuery $query = null, - array $headers = [] - ): \Tracking\Model\Notification { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - 'json' => ['notification' => $body->toRequestArray()], - ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/notifications/%s/%s/remove", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'notification', \Tracking\Model\Notification::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function getNotificationByTrackingId( - string $tracking_id, - array $headers = [] - ): \Tracking\Model\Notification { - if ($tracking_id === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_id' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/notifications/%s", $tracking_id), $options); - $result = $this->parseSingleResource($resp, 'notification', \Tracking\Model\Notification::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function getNotificationBySlugTrackingNumber( - string $slug, - string $tracking_number, - GetNotificationBySlugTrackingNumberQuery $query = null, - array $headers = [] - ): \Tracking\Model\Notification { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/notifications/%s/%s", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'notification', \Tracking\Model\Notification::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function addNotificationBySlugTrackingNumber( - string $slug, - string $tracking_number, - \Tracking\Model\NotificationRequestV1 $body, - AddNotificationBySlugTrackingNumberQuery $query = null, - array $headers = [] - ): \Tracking\Model\Notification { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - 'json' => ['notification' => $body->toRequestArray()], - ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/notifications/%s/%s/add", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'notification', \Tracking\Model\Notification::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function deleteNotificationByTrackingId( - string $tracking_id, - \Tracking\Model\NotificationRequestV1 $body, - array $headers = [] - ): \Tracking\Model\Notification { - if ($tracking_id === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_id' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - - 'json' => ['notification' => $body->toRequestArray()], - ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/notifications/%s/remove", $tracking_id), $options); - $result = $this->parseSingleResource($resp, 'notification', \Tracking\Model\Notification::class); - return $result; - } -} diff --git a/src/API/Notification/AddNotificationBySlugTrackingNumberQuery.php b/src/API/Notification/AddNotificationBySlugTrackingNumberQuery.php deleted file mode 100644 index 325d0d1..0000000 --- a/src/API/Notification/AddNotificationBySlugTrackingNumberQuery.php +++ /dev/null @@ -1,74 +0,0 @@ -tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): AddNotificationBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): AddNotificationBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): AddNotificationBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): AddNotificationBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): AddNotificationBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): AddNotificationBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/Notification/AddNotificationBySlugTrackingNumberRequest.php b/src/API/Notification/AddNotificationBySlugTrackingNumberRequest.php deleted file mode 100644 index 385f85c..0000000 --- a/src/API/Notification/AddNotificationBySlugTrackingNumberRequest.php +++ /dev/null @@ -1,16 +0,0 @@ -tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): DeleteNotificationBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): DeleteNotificationBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): DeleteNotificationBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): DeleteNotificationBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): DeleteNotificationBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): DeleteNotificationBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/Notification/DeleteNotificationBySlugTrackingNumberRequest.php b/src/API/Notification/DeleteNotificationBySlugTrackingNumberRequest.php deleted file mode 100644 index 9d9923b..0000000 --- a/src/API/Notification/DeleteNotificationBySlugTrackingNumberRequest.php +++ /dev/null @@ -1,16 +0,0 @@ -tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): GetNotificationBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): GetNotificationBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): GetNotificationBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): GetNotificationBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): GetNotificationBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): GetNotificationBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/Notification/GetNotificationBySlugTrackingNumberResponse.php b/src/API/Notification/GetNotificationBySlugTrackingNumberResponse.php deleted file mode 100644 index a146c17..0000000 --- a/src/API/Notification/GetNotificationBySlugTrackingNumberResponse.php +++ /dev/null @@ -1,16 +0,0 @@ -httpClient = $httpClient; } - /** - * @throws AfterShipError - */ - public function getTrackings( - GetTrackingsQuery $query = null, - array $headers = [] - ): \Tracking\API\Tracking\GetTrackingsResponse { - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/trackings"), $options); - $data = $this->parseMultipleResources( - $resp, - 'trackings', - \Tracking\Model\Tracking::class, - \Tracking\Model\PaginationPage::class - ); - $result = new \Tracking\API\Tracking\GetTrackingsResponse($data['resources'], $data['pagination']); - return $result; - } - /** - * @throws AfterShipError - */ - public function retrackTrackingById( - string $id, - array $headers = [] - ): \Tracking\Model\PartialUpdateTracking { - if ($id === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings/%s/retrack", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\PartialUpdateTracking::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function deleteTrackingBySlugTrackingNumber( - string $slug, - string $tracking_number, - DeleteTrackingBySlugTrackingNumberQuery $query = null, - array $headers = [] - ): \Tracking\Model\PartialDeleteTracking { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } - - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - ]; - $resp = $this->httpClient->request('DELETE', sprintf("/tracking/2024-04/trackings/%s/%s", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\PartialDeleteTracking::class); - return $result; - } /** * @throws AfterShipError */ @@ -96,7 +28,7 @@ public function getTrackingById( string $id, GetTrackingByIdQuery $query = null, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\GetTrackingByIdResponse { if ($id === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } @@ -105,18 +37,18 @@ public function getTrackingById( 'headers' => $headers, 'query' => $query ? $query->toArray() : [], ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/trackings/%s", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); - return $result; + $resp = $this->httpClient->request('GET', sprintf("/tracking/2025-01/trackings/%s", $id), $options); + + return $this->parseSingleResource($resp, \Tracking\API\Tracking\GetTrackingByIdResponse::class); } /** * @throws AfterShipError */ public function updateTrackingById( string $id, - \Tracking\API\Tracking\TrackingUpdateTrackingByIdRequest $body, + \Tracking\API\Tracking\UpdateTrackingByIdRequest $body, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\UpdateTrackingByIdResponse { if ($id === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } @@ -124,59 +56,53 @@ public function updateTrackingById( $options = [ 'headers' => $headers, - 'json' => ['tracking' => $body->toRequestArray()], + 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('PUT', sprintf("/tracking/2024-04/trackings/%s", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); - return $result; + $resp = $this->httpClient->request('PUT', sprintf("/tracking/2025-01/trackings/%s", $id), $options); + + return $this->parseSingleResource($resp, \Tracking\API\Tracking\UpdateTrackingByIdResponse::class); } /** * @throws AfterShipError */ - public function retrackTrackingBySlugTrackingNumber( - string $slug, - string $tracking_number, - RetrackTrackingBySlugTrackingNumberQuery $query = null, + public function deleteTrackingById( + string $id, array $headers = [] - ): \Tracking\Model\PartialUpdateTracking { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); + ): \Tracking\API\Tracking\DeleteTrackingByIdResponse { + if ($id === "") { + throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } $options = [ 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings/%s/%s/retrack", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\PartialUpdateTracking::class); - return $result; + $resp = $this->httpClient->request('DELETE', sprintf("/tracking/2025-01/trackings/%s", $id), $options); + + return $this->parseSingleResource($resp, \Tracking\API\Tracking\DeleteTrackingByIdResponse::class); } /** * @throws AfterShipError */ public function createTracking( - \Tracking\API\Tracking\TrackingCreateTrackingRequest $body, + \Tracking\API\Tracking\CreateTrackingRequest $body, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\CreateTrackingResponse { $options = [ 'headers' => $headers, - 'json' => ['tracking' => $body->toRequestArray()], + 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings"), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); - return $result; + $resp = $this->httpClient->request('POST', sprintf("/tracking/2025-01/trackings"), $options); + + return $this->parseSingleResource($resp, \Tracking\API\Tracking\CreateTrackingResponse::class); } /** * @throws AfterShipError */ - public function deleteTrackingById( + public function retrackTrackingById( string $id, array $headers = [] - ): \Tracking\Model\PartialDeleteTracking { + ): \Tracking\API\Tracking\RetrackTrackingByIdResponse { if ($id === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } @@ -184,35 +110,9 @@ public function deleteTrackingById( $options = [ 'headers' => $headers, ]; - $resp = $this->httpClient->request('DELETE', sprintf("/tracking/2024-04/trackings/%s", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\PartialDeleteTracking::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function updateTrackingBySlugTrackingNumber( - string $slug, - string $tracking_number, - \Tracking\API\Tracking\TrackingUpdateTrackingBySlugTrackingNumberRequest $body, - UpdateTrackingBySlugTrackingNumberQuery $query = null, - array $headers = [] - ): \Tracking\Model\Tracking { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } + $resp = $this->httpClient->request('POST', sprintf("/tracking/2025-01/trackings/%s/retrack", $id), $options); - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - 'json' => ['tracking' => $body->toRequestArray()], - ]; - $resp = $this->httpClient->request('PUT', sprintf("/tracking/2024-04/trackings/%s/%s", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); - return $result; + return $this->parseSingleResource($resp, \Tracking\API\Tracking\RetrackTrackingByIdResponse::class); } /** * @throws AfterShipError @@ -221,7 +121,7 @@ public function markTrackingCompletedById( string $id, \Tracking\API\Tracking\MarkTrackingCompletedByIdRequest $body, array $headers = [] - ): \Tracking\Model\Tracking { + ): \Tracking\API\Tracking\MarkTrackingCompletedByIdResponse { if ($id === "") { throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'id' cannot be an empty string"); } @@ -231,58 +131,23 @@ public function markTrackingCompletedById( 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings/%s/mark-as-completed", $id), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); - return $result; - } - /** - * @throws AfterShipError - */ - public function getTrackingBySlugTrackingNumber( - string $slug, - string $tracking_number, - GetTrackingBySlugTrackingNumberQuery $query = null, - array $headers = [] - ): \Tracking\Model\Tracking { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } + $resp = $this->httpClient->request('POST', sprintf("/tracking/2025-01/trackings/%s/mark-as-completed", $id), $options); - $options = [ - 'headers' => $headers, - 'query' => $query ? $query->toArray() : [], - ]; - $resp = $this->httpClient->request('GET', sprintf("/tracking/2024-04/trackings/%s/%s", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); - return $result; + return $this->parseSingleResource($resp, \Tracking\API\Tracking\MarkTrackingCompletedByIdResponse::class); } /** * @throws AfterShipError */ - public function markTrackingCompletedBySlugTrackingNumber( - string $slug, - string $tracking_number, - \Tracking\API\Tracking\MarkTrackingCompletedBySlugTrackingNumberRequest $body, - MarkTrackingCompletedBySlugTrackingNumberQuery $query = null, + public function getTrackings( + GetTrackingsQuery $query = null, array $headers = [] - ): \Tracking\Model\Tracking { - if ($slug === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'slug' cannot be an empty string"); - } - if ($tracking_number === "") { - throw ErrorCode::genLocalError(ErrorCode::INVALID_REQUEST, "Param 'tracking_number' cannot be an empty string"); - } - + ): \Tracking\API\Tracking\GetTrackingsResponse { $options = [ 'headers' => $headers, 'query' => $query ? $query->toArray() : [], - 'json' => $body->toRequestArray(), ]; - $resp = $this->httpClient->request('POST', sprintf("/tracking/2024-04/trackings/%s/%s/mark-as-completed", $slug, $tracking_number), $options); - $result = $this->parseSingleResource($resp, 'tracking', \Tracking\Model\Tracking::class); - return $result; + $resp = $this->httpClient->request('GET', sprintf("/tracking/2025-01/trackings"), $options); + + return $this->parseSingleResource($resp, \Tracking\API\Tracking\GetTrackingsResponse::class); } } diff --git a/src/API/Tracking/AftershipEstimatedDeliveryDateCreateTrackingResponse.php b/src/API/Tracking/AftershipEstimatedDeliveryDateCreateTrackingResponse.php new file mode 100644 index 0000000..128064b --- /dev/null +++ b/src/API/Tracking/AftershipEstimatedDeliveryDateCreateTrackingResponse.php @@ -0,0 +1,28 @@ + + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_region; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_region; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_region; + /** + * @var CourierEstimatedDeliveryDateCreateTrackingResponse The field contains the estimated delivery date provided by the carrier. + */ + public $courier_estimated_delivery_date; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightCreateTrackingResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateCreateTrackingResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateCreateTrackingResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryCreateTrackingResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryCreateTrackingResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var string|null (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsCreateTrackingResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; + /** + * @var string|null The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_url; + /** + * @var string|null The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_order_url; + /** + * @var FirstMileCreateTrackingResponse The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. + */ + public $first_mile; + /** + * @var LastMileCreateTrackingResponse This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + */ + public $last_mile; + /** + * @var CustomersCreateTrackingResponse[] The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. + */ + public $customers; } diff --git a/src/API/Tracking/CustomEstimatedDeliveryDateCreateTrackingResponse.php b/src/API/Tracking/CustomEstimatedDeliveryDateCreateTrackingResponse.php new file mode 100644 index 0000000..6069486 --- /dev/null +++ b/src/API/Tracking/CustomEstimatedDeliveryDateCreateTrackingResponse.php @@ -0,0 +1,28 @@ +In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var string|null (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsDeleteTrackingByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; + /** + * @var string|null The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_url; + /** + * @var string|null The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_order_url; + /** + * @var FirstMileDeleteTrackingByIdResponse The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. + */ + public $first_mile; + /** + * @var LastMileDeleteTrackingByIdResponse This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + */ + public $last_mile; + /** + * @var CustomersDeleteTrackingByIdResponse[] The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. + */ + public $customers; } diff --git a/src/API/Tracking/DeleteTrackingBySlugTrackingNumberQuery.php b/src/API/Tracking/DeleteTrackingBySlugTrackingNumberQuery.php deleted file mode 100644 index 5087af7..0000000 --- a/src/API/Tracking/DeleteTrackingBySlugTrackingNumberQuery.php +++ /dev/null @@ -1,74 +0,0 @@ -tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): DeleteTrackingBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): DeleteTrackingBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): DeleteTrackingBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): DeleteTrackingBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): DeleteTrackingBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): DeleteTrackingBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/Tracking/DeleteTrackingBySlugTrackingNumberResponse.php b/src/API/Tracking/DeleteTrackingBySlugTrackingNumberResponse.php deleted file mode 100644 index 0ee77fc..0000000 --- a/src/API/Tracking/DeleteTrackingBySlugTrackingNumberResponse.php +++ /dev/null @@ -1,16 +0,0 @@ - + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_region; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_region; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_region; + /** + * @var CourierEstimatedDeliveryDateGetTrackingByIdResponse The field contains the estimated delivery date provided by the carrier. + */ + public $courier_estimated_delivery_date; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightGetTrackingByIdResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateGetTrackingByIdResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateGetTrackingByIdResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryGetTrackingByIdResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryGetTrackingByIdResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var string|null (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsGetTrackingByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; + /** + * @var string|null The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_url; + /** + * @var string|null The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_order_url; + /** + * @var FirstMileGetTrackingByIdResponse The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. + */ + public $first_mile; + /** + * @var LastMileGetTrackingByIdResponse This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + */ + public $last_mile; + /** + * @var CustomersGetTrackingByIdResponse[] The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. + */ + public $customers; } diff --git a/src/API/Tracking/GetTrackingBySlugTrackingNumberQuery.php b/src/API/Tracking/GetTrackingBySlugTrackingNumberQuery.php deleted file mode 100644 index 5c96659..0000000 --- a/src/API/Tracking/GetTrackingBySlugTrackingNumberQuery.php +++ /dev/null @@ -1,92 +0,0 @@ -fields = $fields; - return $this; - } - public function setLang(string $lang): GetTrackingBySlugTrackingNumberQuery - { - $this->lang = $lang; - return $this; - } - public function setTrackingAccountNumber(string $tracking_account_number): GetTrackingBySlugTrackingNumberQuery - { - $this->tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): GetTrackingBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): GetTrackingBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): GetTrackingBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): GetTrackingBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): GetTrackingBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): GetTrackingBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/Tracking/GetTrackingBySlugTrackingNumberResponse.php b/src/API/Tracking/GetTrackingBySlugTrackingNumberResponse.php deleted file mode 100644 index c98ec40..0000000 --- a/src/API/Tracking/GetTrackingBySlugTrackingNumberResponse.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ - public $tracking; -} diff --git a/src/API/Tracking/GetTrackingsQuery.php b/src/API/Tracking/GetTrackingsQuery.php index d25c06b..938bcb2 100644 --- a/src/API/Tracking/GetTrackingsQuery.php +++ b/src/API/Tracking/GetTrackingsQuery.php @@ -8,15 +8,15 @@ class GetTrackingsQuery extends \Tracking\API\Base\QueryBase { /** - * @var int|null The page to query. Maximum page number is bounded by total number of queried trackings which cannot exceed 160,000 trackings. (Default: 1) + * @var string|null A string representing the cursor value for the current page of results. */ - public $page; + public $cursor; /** * @var int|null Number of trackings each page contain. (Default: 100, Max: 200) */ public $limit; /** - * @var string|null Search the content of the tracking record fields: `tracking_number`, `title`, `order_id`, `customer_name`, `custom_fields`, `emails`, `smses` + * @var string|null Search the content of the tracking record fields: `tracking_number`, `title`, `order_id`, `customers[x].name`, `custom_fields`, `customers[x].email`, `customers[x].phone_number` */ public $keyword; /** @@ -44,19 +44,19 @@ class GetTrackingsQuery extends \Tracking\API\Base\QueryBase */ public $tag; /** - * @var string|null Start date and time of trackings created. AfterShip only stores data of 120 days.(Defaults: 30 days ago, Example: 2013-03-15T16:41:56+08:00) + * @var string|null Start date and time of trackings created. AfterShip only stores data of 120 days. Please make sure the value of the parameter is properly escaped in */ public $created_at_min; /** - * @var string|null End date and time of trackings created.(Defaults: now, Example: 2013-04-15T16:41:56+08:00) + * @var string|null End date and time of trackings created. Please make sure the value of the parameter is properly escaped in */ public $created_at_max; /** - * @var string|null Start date and time of trackings updated. (Example: 2013-04-15T16:41:56+08:00) + * @var string|null Start date and time of trackings updated. Please make sure the value of the parameter is properly escaped in */ public $updated_at_min; /** - * @var string|null End date and time of trackings updated. (Example: 2013-04-15T16:41:56+08:00) + * @var string|null End date and time of trackings updated. Please make sure the value of the parameter is properly escaped in */ public $updated_at_max; /** @@ -70,7 +70,7 @@ class GetTrackingsQuery extends \Tracking\API\Base\QueryBase /** * @var string|null Destination country/region of trackings returned by courier. Use ISO Alpha-3 (three letters). Use comma for multiple values. (Example: USA,HKG) */ - public $courier_destination_country_iso3; + public $courier_destination_country_region; /** * @var string|null Tags you added to your shipments to help categorize and filter them easily. Use a comma to separate multiple values (Example: a,b) */ @@ -80,9 +80,9 @@ class GetTrackingsQuery extends \Tracking\API\Base\QueryBase */ public $order_id; - public function setPage(string $page): GetTrackingsQuery + public function setCursor(string $cursor): GetTrackingsQuery { - $this->page = $page; + $this->cursor = $cursor; return $this; } public function setLimit(string $limit): GetTrackingsQuery @@ -155,9 +155,9 @@ public function setReturnToSender(string $return_to_sender): GetTrackingsQuery $this->return_to_sender = $return_to_sender; return $this; } - public function setCourierDestinationCountryIso3(string $courier_destination_country_iso3): GetTrackingsQuery + public function setCourierDestinationCountryRegion(string $courier_destination_country_region): GetTrackingsQuery { - $this->courier_destination_country_iso3 = $courier_destination_country_iso3; + $this->courier_destination_country_region = $courier_destination_country_region; return $this; } public function setShipmentTags(string $shipment_tags): GetTrackingsQuery diff --git a/src/API/Tracking/GetTrackingsResponse.php b/src/API/Tracking/GetTrackingsResponse.php index 869ee2e..34fe050 100644 --- a/src/API/Tracking/GetTrackingsResponse.php +++ b/src/API/Tracking/GetTrackingsResponse.php @@ -5,21 +5,16 @@ */ namespace Tracking\API\Tracking; -class GetTrackingsResponse extends \Tracking\Model\Base\Base +use Tracking\Model\Base\Base; + +class GetTrackingsResponse extends Base { /** - * @var \Tracking\Model\Tracking[] + * @var PaginationGetTrackingsResponse The Pagination holds the information for the pagination when the response contains multiple objects. */ - public $trackings; - + public $pagination; /** - * @var \Tracking\Model\PaginationPage + * @var \Tracking\Model\Tracking[] Array of */ - public $pagination; - - public function __construct(array $trackings, \Tracking\Model\PaginationPage $pagination) - { - $this->trackings = $trackings; - $this->pagination = $pagination; - } + public $trackings; } diff --git a/src/API/Tracking/LastMileCreateTrackingRequest.php b/src/API/Tracking/LastMileCreateTrackingRequest.php new file mode 100644 index 0000000..d37548d --- /dev/null +++ b/src/API/Tracking/LastMileCreateTrackingRequest.php @@ -0,0 +1,20 @@ + + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_region; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_region; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_region; + /** + * @var CourierEstimatedDeliveryDateMarkTrackingCompletedByIdResponse The field contains the estimated delivery date provided by the carrier. + */ + public $courier_estimated_delivery_date; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightMarkTrackingCompletedByIdResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var string|null (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsMarkTrackingCompletedByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; + /** + * @var string|null The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_url; + /** + * @var string|null The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_order_url; + /** + * @var FirstMileMarkTrackingCompletedByIdResponse The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. + */ + public $first_mile; + /** + * @var LastMileMarkTrackingCompletedByIdResponse This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + */ + public $last_mile; + /** + * @var CustomersMarkTrackingCompletedByIdResponse[] The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. + */ + public $customers; } diff --git a/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberQuery.php b/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberQuery.php deleted file mode 100644 index 4dcadf3..0000000 --- a/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberQuery.php +++ /dev/null @@ -1,74 +0,0 @@ -tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): MarkTrackingCompletedBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): MarkTrackingCompletedBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): MarkTrackingCompletedBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): MarkTrackingCompletedBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): MarkTrackingCompletedBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): MarkTrackingCompletedBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberRequest.php b/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberRequest.php deleted file mode 100644 index 5e000f6..0000000 --- a/src/API/Tracking/MarkTrackingCompletedBySlugTrackingNumberRequest.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ - public $tracking; -} diff --git a/src/API/Tracking/NextCouriersTrackingCreateTrackingRequest.php b/src/API/Tracking/NextCouriersTrackingCreateTrackingRequest.php deleted file mode 100644 index 6807eb2..0000000 --- a/src/API/Tracking/NextCouriersTrackingCreateTrackingRequest.php +++ /dev/null @@ -1,20 +0,0 @@ -In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var string|null (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsRetrackTrackingByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; + /** + * @var string|null The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_url; + /** + * @var string|null The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_order_url; + /** + * @var FirstMileRetrackTrackingByIdResponse The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. + */ + public $first_mile; + /** + * @var LastMileRetrackTrackingByIdResponse This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + */ + public $last_mile; + /** + * @var CustomersRetrackTrackingByIdResponse[] The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. + */ + public $customers; } diff --git a/src/API/Tracking/RetrackTrackingBySlugTrackingNumberQuery.php b/src/API/Tracking/RetrackTrackingBySlugTrackingNumberQuery.php deleted file mode 100644 index 0c6d45a..0000000 --- a/src/API/Tracking/RetrackTrackingBySlugTrackingNumberQuery.php +++ /dev/null @@ -1,74 +0,0 @@ -tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): RetrackTrackingBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): RetrackTrackingBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): RetrackTrackingBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): RetrackTrackingBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): RetrackTrackingBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): RetrackTrackingBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/Tracking/RetrackTrackingBySlugTrackingNumberResponse.php b/src/API/Tracking/RetrackTrackingBySlugTrackingNumberResponse.php deleted file mode 100644 index f65e18b..0000000 --- a/src/API/Tracking/RetrackTrackingBySlugTrackingNumberResponse.php +++ /dev/null @@ -1,16 +0,0 @@ - + * @var string Tracking ID. */ - public $tracking; + public $id; + /** + * @var string The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. + */ + public $legacy_id; + /** + * @var string The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $created_at; + /** + * @var string The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. + */ + public $updated_at; + /** + * @var string Tracking number. + */ + public $tracking_number; + /** + * @var string Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . + */ + public $slug; + /** + * @var bool Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. + */ + public $active; + /** + * @var array|null Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. + */ + public $custom_fields; + /** + * @var int|null Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. + */ + public $transit_time; + /** + * @var string|null The for the origin country/region. E.g. USA for the United States. + */ + public $origin_country_region; + /** + * @var string|null The state of the sender’s address. + */ + public $origin_state; + /** + * @var string|null The city of the sender’s address. + */ + public $origin_city; + /** + * @var string|null The postal code of the sender’s address. + */ + public $origin_postal_code; + /** + * @var string|null The sender address that the shipment is shipping from. + */ + public $origin_raw_location; + /** + * @var string|null The for the destination country/region. E.g. USA for the United States. + */ + public $destination_country_region; + /** + * @var string|null The state of the recipient’s address. + */ + public $destination_state; + /** + * @var string|null The city of the recipient’s address. + */ + public $destination_city; + /** + * @var string|null The postal code of the recipient’s address. + */ + public $destination_postal_code; + /** + * @var string|null The shipping address that the shipment is shipping to. + */ + public $destination_raw_location; + /** + * @var string|null Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. + */ + public $courier_destination_country_region; + /** + * @var CourierEstimatedDeliveryDateUpdateTrackingByIdResponse The field contains the estimated delivery date provided by the carrier. + */ + public $courier_estimated_delivery_date; + /** + * @var string|null Text field for the note. + */ + public $note; + /** + * @var string|null A globally-unique identifier for the order. + */ + public $order_id; + /** + * @var string|null The URL for the order in your system or store. + */ + public $order_id_path; + /** + * @var string|null The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. + */ + public $order_date; + /** + * @var int|float|null Number of packages under the tracking. + */ + public $shipment_package_count; + /** + * @var string|null The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_pickup_date; + /** + * @var string|null The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $shipment_delivery_date; + /** + * @var string|null The carrier service type for the shipment. + */ + public $shipment_type; + /** + * @var ShipmentWeightUpdateTrackingByIdResponse The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + */ + public $shipment_weight; + /** + * @var string|null Signed by information for delivered shipment. + */ + public $signed_by; + /** + * @var string Source of how this tracking is added. + */ + public $source; + /** + * @var string|null|\Tracking\Model\TagV1 Current status of tracking. ( + */ + public $tag; + /** + * @var string Current subtag of tracking. ( + */ + public $subtag; + /** + * @var string Normalized tracking message. ( + */ + public $subtag_message; + /** + * @var string By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). + */ + public $title; + /** + * @var int|float Number of attempts AfterShip tracks at courier's system. + */ + public $tracked_count; + /** + * @var bool|null Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null + */ + public $last_mile_tracking_supported; + /** + * @var string|null The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. + */ + public $language; + /** + * @var string Deprecated + */ + public $unique_token; + /** + * @var \Tracking\Model\Checkpoint[] Array of checkpoint object describes the checkpoint information. + */ + public $checkpoints; + /** + * @var array[] Phone number(s) subscribed to receive sms notifications. + */ + public $subscribed_smses; + /** + * @var array[] Email address(es) subscribed to receive email notifications. + */ + public $subscribed_emails; + /** + * @var bool Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. + */ + public $return_to_sender; + /** + * @var string|null The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $order_promised_delivery_date; + /** + * @var string|null Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + */ + public $delivery_type; + /** + * @var string|null Shipment pickup location for receiver + */ + public $pickup_location; + /** + * @var string|null Shipment pickup note for receiver + */ + public $pickup_note; + /** + * @var string|null Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_tracking_link; + /** + * @var string|null The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + */ + public $first_attempted_at; + /** + * @var string|null Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. + */ + public $courier_redirect_link; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. + */ + public $tracking_account_number; + /** + * @var string|null Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. + */ + public $tracking_key; + /** + * @var string|null The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. + */ + public $tracking_ship_date; + /** + * @var string|null Whether the tracking is delivered on time or not. + */ + public $on_time_status; + /** + * @var int|float|null The difference days of the on time. + */ + public $on_time_difference; + /** + * @var array[] The tags of the order. + */ + public $order_tags; + /** + * @var AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $aftership_estimated_delivery_date; + /** + * @var CustomEstimatedDeliveryDateUpdateTrackingByIdResponse Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + */ + public $custom_estimated_delivery_date; + /** + * @var string|null A unique, human-readable identifier for the order. + */ + public $order_number; + /** + * @var FirstEstimatedDeliveryUpdateTrackingByIdResponse The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $first_estimated_delivery; + /** + * @var LatestEstimatedDeliveryUpdateTrackingByIdResponse The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + */ + public $latest_estimated_delivery; + /** + * @var array[] Used to add tags to your shipments to help categorize and filter them easily. + */ + public $shipment_tags; + /** + * @var string|null If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. + */ + public $courier_connection_id; + /** + * @var string|null (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_origin_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. + */ + public $tracking_destination_country_region; + /** + * @var string|null (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_postal_code; + /** + * @var string|null (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. + */ + public $tracking_state; + /** + * @var CarbonEmissionsUpdateTrackingByIdResponse The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + */ + public $carbon_emissions; + /** + * @var string|null The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . + */ + public $location_id; + /** + * @var string|null The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. + */ + public $shipping_method; + /** + * @var int|null By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. + */ + public $failed_delivery_attempts; + /** + * @var string|null|string The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ */ + public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; + /** + * @var string|null The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_url; + /** + * @var string|null The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_order_url; + /** + * @var FirstMileUpdateTrackingByIdResponse The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. + */ + public $first_mile; + /** + * @var LastMileUpdateTrackingByIdResponse This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + */ + public $last_mile; + /** + * @var CustomersUpdateTrackingByIdResponse[] The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. + */ + public $customers; } diff --git a/src/API/Tracking/UpdateTrackingBySlugTrackingNumberQuery.php b/src/API/Tracking/UpdateTrackingBySlugTrackingNumberQuery.php deleted file mode 100644 index bb3738d..0000000 --- a/src/API/Tracking/UpdateTrackingBySlugTrackingNumberQuery.php +++ /dev/null @@ -1,74 +0,0 @@ -tracking_account_number = $tracking_account_number; - return $this; - } - public function setTrackingOriginCountry(string $tracking_origin_country): UpdateTrackingBySlugTrackingNumberQuery - { - $this->tracking_origin_country = $tracking_origin_country; - return $this; - } - public function setTrackingDestinationCountry(string $tracking_destination_country): UpdateTrackingBySlugTrackingNumberQuery - { - $this->tracking_destination_country = $tracking_destination_country; - return $this; - } - public function setTrackingKey(string $tracking_key): UpdateTrackingBySlugTrackingNumberQuery - { - $this->tracking_key = $tracking_key; - return $this; - } - public function setTrackingPostalCode(string $tracking_postal_code): UpdateTrackingBySlugTrackingNumberQuery - { - $this->tracking_postal_code = $tracking_postal_code; - return $this; - } - public function setTrackingShipDate(string $tracking_ship_date): UpdateTrackingBySlugTrackingNumberQuery - { - $this->tracking_ship_date = $tracking_ship_date; - return $this; - } - public function setTrackingState(string $tracking_state): UpdateTrackingBySlugTrackingNumberQuery - { - $this->tracking_state = $tracking_state; - return $this; - } -} diff --git a/src/API/Tracking/UpdateTrackingBySlugTrackingNumberRequest.php b/src/API/Tracking/UpdateTrackingBySlugTrackingNumberRequest.php deleted file mode 100644 index 82a3e1d..0000000 --- a/src/API/Tracking/UpdateTrackingBySlugTrackingNumberRequest.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ - public $tracking; -} diff --git a/src/Client.php b/src/Client.php index 9cc3bba..65b5421 100644 --- a/src/Client.php +++ b/src/Client.php @@ -5,11 +5,9 @@ */ namespace Tracking; -use Tracking\API\Notification; +use Tracking\API\EstimatedDeliveryDate; use Tracking\API\Tracking; use Tracking\API\Courier; -use Tracking\API\EstimatedDeliveryDate; -use Tracking\API\LastCheckpoint; use Tracking\Exception\AfterShipError; class Client @@ -19,9 +17,9 @@ class Client private static $instance = null; /** - * @var Notification + * @var EstimatedDeliveryDate */ - public $notification; + public $estimated_delivery_date; /** * @var Tracking */ @@ -30,14 +28,6 @@ class Client * @var Courier */ public $courier; - /** - * @var EstimatedDeliveryDate - */ - public $estimated_delivery_date; - /** - * @var LastCheckpoint - */ - public $last_checkpoint; /** * @throws AfterShipError */ @@ -46,11 +36,9 @@ public function __construct(array $conf = []) $config = new Config($conf); $this->config = $config; - $this->notification = new Notification(new Transport\Http($config)); + $this->estimated_delivery_date = new EstimatedDeliveryDate(new Transport\Http($config)); $this->tracking = new Tracking(new Transport\Http($config)); $this->courier = new Courier(new Transport\Http($config)); - $this->estimated_delivery_date = new EstimatedDeliveryDate(new Transport\Http($config)); - $this->last_checkpoint = new LastCheckpoint(new Transport\Http($config)); } /** diff --git a/src/Exception/AfterShipError.php b/src/Exception/AfterShipError.php index 227ede2..391268a 100644 --- a/src/Exception/AfterShipError.php +++ b/src/Exception/AfterShipError.php @@ -12,8 +12,9 @@ class AfterShipError extends \Exception protected $statusCode; protected $message; protected $responseBody; + protected $responseHeader; - public function __construct($message, $errorCode, $statusCode, $metaCode = null, $responseBody = null) + public function __construct($message, $errorCode, $statusCode, $metaCode = null, $responseBody = null, $responseHeader = null) { parent::__construct($message, $statusCode); $this->metaCode = $metaCode; @@ -21,6 +22,7 @@ public function __construct($message, $errorCode, $statusCode, $metaCode = null, $this->errorCode = $errorCode; $this->statusCode = $statusCode; $this->responseBody = $responseBody; + $this->responseHeader = $responseHeader; } public function getErrorCode() @@ -42,4 +44,9 @@ public function getResponseBody() { return $this->responseBody; } + + public function getResponseHeader() + { + return $this->responseHeader; + } } diff --git a/src/Exception/ErrorCode.php b/src/Exception/ErrorCode.php index 5bcb3cb..20b8e4b 100644 --- a/src/Exception/ErrorCode.php +++ b/src/Exception/ErrorCode.php @@ -93,10 +93,10 @@ class ErrorCode self::INTERNAL_ERROR => "Something went wrong on AfterShip's end.", ]; - public static function genRemoteError($statusCode, $metaCode, $responseBody = null, $message = null): AfterShipError + public static function genRemoteError($statusCode, $metaCode, $responseBody = null, $message = null, $responseHeader = null): AfterShipError { $errorCode = self::locateErrorCode($metaCode); - return self::genError($errorCode, $statusCode, $metaCode, $responseBody, $message); + return self::genError($errorCode, $statusCode, $metaCode, $responseBody, $message, $responseHeader); } public static function genLocalError($errorCode, $message = null): AfterShipError @@ -104,12 +104,12 @@ public static function genLocalError($errorCode, $message = null): AfterShipErro return self::genError($errorCode, null, null, null, $message); } - public static function genError($errorCode, $statusCode, $metaCode, $responseBody = null, $message = null): AfterShipError + public static function genError($errorCode, $statusCode, $metaCode, $responseBody = null, $message = null, $responseHeader = null): AfterShipError { if (empty($message)) { $message = self::$errorMessageMap[$errorCode] ?? "Unknown error"; } - return new AfterShipError($message, $errorCode, $statusCode, $metaCode, $responseBody); + return new AfterShipError($message, $errorCode, $statusCode, $metaCode, $responseBody, $responseHeader); } private static function locateErrorCode($metaCode): string diff --git a/src/Model/AdditionalFieldsV1.php b/src/Model/AdditionalFieldsV1.php index f722f45..90538d6 100644 --- a/src/Model/AdditionalFieldsV1.php +++ b/src/Model/AdditionalFieldsV1.php @@ -13,7 +13,7 @@ class AdditionalFieldsV1 const TRACKING_POSTAL_CODE = "tracking_postal_code"; const TRACKING_SHIP_DATE = "tracking_ship_date"; const TRACKING_KEY = "tracking_key"; - const TRACKING_ORIGIN_COUNTRY = "tracking_origin_country"; - const TRACKING_DESTINATION_COUNTRY = "tracking_destination_country"; + const TRACKING_ORIGIN_COUNTRY_REGION = "tracking_origin_country_region"; + const TRACKING_DESTINATION_COUNTRY_REGION = "tracking_destination_country_region"; const TRACKING_STATE = "tracking_state"; } diff --git a/src/Model/Checkpoint.php b/src/Model/Checkpoint.php index 71243ff..1eece9b 100644 --- a/src/Model/Checkpoint.php +++ b/src/Model/Checkpoint.php @@ -44,11 +44,11 @@ class Checkpoint extends Base /** * @var string|null Country/Region ISO Alpha-3 (three letters) of the checkpoint */ - public $country_iso3; + public $country_region; /** * @var string|null Country/Region name of the checkpoint, may also contain other location info. */ - public $country_name; + public $country_region_name; /** * @var string Checkpoint message */ @@ -73,4 +73,8 @@ class Checkpoint extends Base * @var EventsCheckpoint[] The array provides details about specific event(s) that occurred to a shipment, such as "returned_to_sender". You can find the full list of events and reasons - The events' value for the same checkpoint message is subject to change as we consistently strive to enhance the performance of this feature. */ public $events; + /** + * @var string|null|string The source of the checkpoint, which can either be from the carrier or when the user marks the tracking as completed. + */ + public $source; } diff --git a/src/Model/Courier.php b/src/Model/Courier.php index 875fe1b..d0f978a 100644 --- a/src/Model/Courier.php +++ b/src/Model/Courier.php @@ -30,7 +30,7 @@ class Courier extends Base */ public $web_url; /** - * @var array[] The extra fields need for tracking, such as `tracking_account_number`, `tracking_postal_code`, `tracking_ship_date`, `tracking_key`, `tracking_destination_country` + * @var array[] The extra fields need for tracking, such as `tracking_account_number`, `tracking_postal_code`, `tracking_ship_date`, `tracking_key`, `tracking_destination_country_region` */ public $required_fields; /** @@ -48,5 +48,5 @@ class Courier extends Base /** * @var array[] Country/Region code (ISO Alpha-3) where the courier provides service */ - public $service_from_country_iso3; + public $service_from_country_regions; } diff --git a/src/Model/CourierEstimatedDeliveryDateTracking.php b/src/Model/CourierEstimatedDeliveryDateTracking.php new file mode 100644 index 0000000..9dfd0a2 --- /dev/null +++ b/src/Model/CourierEstimatedDeliveryDateTracking.php @@ -0,0 +1,24 @@ + - */ - public $tracking; -} diff --git a/src/Model/DestinationAddressEstimatedDeliveryDateRequest.php b/src/Model/DestinationAddressEstimatedDeliveryDateRequest.php index 93b5d40..bcfa092 100644 --- a/src/Model/DestinationAddressEstimatedDeliveryDateRequest.php +++ b/src/Model/DestinationAddressEstimatedDeliveryDateRequest.php @@ -12,7 +12,7 @@ class DestinationAddressEstimatedDeliveryDateRequest extends Base /** * @var string The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code. */ - public $country; + public $country_region; /** * @var string|null State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. */ diff --git a/src/Model/DestinationAddressEstimatedDeliveryDateResponse.php b/src/Model/DestinationAddressEstimatedDeliveryDateResponse.php index 498b54b..181315b 100644 --- a/src/Model/DestinationAddressEstimatedDeliveryDateResponse.php +++ b/src/Model/DestinationAddressEstimatedDeliveryDateResponse.php @@ -12,7 +12,7 @@ class DestinationAddressEstimatedDeliveryDateResponse extends Base /** * @var string The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code. */ - public $country; + public $country_region; /** * @var string|null State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. */ diff --git a/src/Model/EstimatedDeliveryDateResponse.php b/src/Model/EstimatedDeliveryDateResponse.php index 0fc5bc8..801a602 100644 --- a/src/Model/EstimatedDeliveryDateResponse.php +++ b/src/Model/EstimatedDeliveryDateResponse.php @@ -9,6 +9,10 @@ class EstimatedDeliveryDateResponse extends Base { + /** + * @var string A string that acts as a unique identifier for the estimated delivery date value generated by AfterShip Predict API + */ + public $id; /** * @var string AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download. */ diff --git a/src/Model/FirstMileTracking.php b/src/Model/FirstMileTracking.php new file mode 100644 index 0000000..c1ba09e --- /dev/null +++ b/src/Model/FirstMileTracking.php @@ -0,0 +1,32 @@ +total = $data['total'] ?? null; - $pagination->next_cursor = $data['next_cursor']; - $pagination->previous_cursor = $data['previous_cursor']; - return $pagination; - } -} diff --git a/src/Model/PaginationDataTrackingResponseGetMultipleV1.php b/src/Model/PaginationDataTrackingResponseGetMultipleV1.php new file mode 100644 index 0000000..e85ea32 --- /dev/null +++ b/src/Model/PaginationDataTrackingResponseGetMultipleV1.php @@ -0,0 +1,24 @@ +total = $data['count'] ?? $data['total'] ?? null; - $paginationPage->page = $data['page'] ?? null; - $paginationPage->limit = $data['limit'] ?? null; - $paginationPage->has_next_page = $data['has_next_page'] ?? null; - return $paginationPage; - } -} diff --git a/src/Model/PartialDeleteTracking.php b/src/Model/PartialDeleteTracking.php deleted file mode 100644 index f263be1..0000000 --- a/src/Model/PartialDeleteTracking.php +++ /dev/null @@ -1,52 +0,0 @@ - */ public $signature_requirement; + /** + * @var string|null The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. + */ + public $delivery_location_type; + /** + * @var string|null The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_url; + /** + * @var string|null The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. + */ + public $aftership_tracking_order_url; + /** + * @var FirstMileTracking The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. + */ + public $first_mile; + /** + * @var LastMileTracking This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + */ + public $last_mile; + /** + * @var CustomersTracking[] The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. + */ + public $customers; } diff --git a/src/Model/TrackingDeleteResponseV1.php b/src/Model/TrackingDeleteResponseV1.php deleted file mode 100644 index 958a6ae..0000000 --- a/src/Model/TrackingDeleteResponseV1.php +++ /dev/null @@ -1,20 +0,0 @@ - */ public $data; } diff --git a/src/Transport/Http.php b/src/Transport/Http.php index 5b044dc..328bb48 100644 --- a/src/Transport/Http.php +++ b/src/Transport/Http.php @@ -21,7 +21,7 @@ class Http private $config; const CONTENT_TYPE = 'application/json'; - const SDK_VERSION = '7.0.0'; + const SDK_VERSION = '10.0.0'; public function __construct(Config $config) { diff --git a/test.php b/test.php new file mode 100644 index 0000000..1331d72 --- /dev/null +++ b/test.php @@ -0,0 +1,91 @@ + 'asat_870416d3ea2742dba0eb68e23ddfcbe9', + 'authenticationType' => \Tracking\Config::AUTHENTICATION_TYPE_API_KEY, +]); + +try { + // $query = new \Tracking\API\Tracking\GetTrackingsQuery(); + // $query + // ->setLimit(1); + // $trackingInfo = $client->tracking->getTrackings($query); + // echo json_encode($trackingInfo); + // $trackingInfo = $client->tracking->getTrackingById('cf03101d27004e7ea95a5a916d96216b'); + // echo json_encode($trackingInfo->checkpoints); + + // $payload = new \Tracking\API\Tracking\CreateTrackingRequest(); + // $payload->tracking_number = '9400136208070372945747'; + // $payload->slug = 'usps'; + // $trackingInfo = $client->tracking->createTracking($payload); + // echo json_encode($trackingInfo); + + // $payload = new \Tracking\API\Tracking\CreateTrackingRequest(); + // $payload->tracking_number = '420927089200190379641400070444'; + // $payload->slug = 'usps'; + // $trackingInfo = $client->tracking->createTracking($payload); + // echo json_encode($trackingInfo); + // d6356ff8fe8b40e697159743ed4f5a71 + + // $trackingInfo = $client->tracking->getTrackingById('c27f1f4c368044988a6d2f45ff5c04f9'); + // echo json_encode($trackingInfo); + + // $payload = new \Tracking\API\Tracking\UpdateTrackingByIdRequest(); + // $payload->title = 'test'; + // $trackingInfo = $client->tracking->updateTrackingById('c27f1f4c368044988a6d2f45ff5c04f9', $payload); + // echo json_encode($trackingInfo); + + // $trackingInfo = $client->tracking->retrackTrackingById('d6356ff8fe8b40e697159743ed4f5a71'); + // echo json_encode($trackingInfo); + + // $payload = new \Tracking\API\Tracking\MarkTrackingCompletedByIdRequest(); + // $payload->reason = 'DELIVERED'; + // $trackingInfo = $client->tracking->markTrackingCompletedById('c27f1f4c368044988a6d2f45ff5c04f9', $payload); + // echo json_encode($trackingInfo); + + // $couriers = $client->courier->getUserCouriers(); + // echo json_encode($couriers); + + // $couriers = $client->courier->getAllCouriers(); + // echo json_encode($couriers); + + // $payload = new \Tracking\API\EstimatedDeliveryDate\PredictBatchRequest(); + // $edd = new \Tracking\Model\EstimatedDeliveryDateRequest(); + // $edd->slug = 'ups'; + // $edd->pickup_time = '2024-08-01 06:42:30'; + // $orginAddress = new \Tracking\Model\OriginAddressEstimatedDeliveryDateRequest(); + // $orginAddress->country_region = 'USA'; + // $orginAddress->state = 'USA'; + // $edd->origin_address = $orginAddress; + + // $destAddress = new \Tracking\Model\DestinationAddressEstimatedDeliveryDateRequest(); + // $destAddress->country_region = 'USA'; + // $destAddress->state = 'USA'; + // $edd->destination_address = $destAddress; + // $payload->estimated_delivery_dates = [$edd]; + // $notification = $client->estimated_delivery_date->predictBatch($payload); + // echo json_encode($notification); + + $payload = new \Tracking\API\EstimatedDeliveryDate\PredictBatchRequest(); + $edd = new \Tracking\Model\EstimatedDeliveryDateRequest(); + $edd->slug = 'ups'; + $edd->pickup_time = '2024-08-01 06:42:30'; + $orginAddress = new \Tracking\Model\OriginAddressEstimatedDeliveryDateRequest(); + $orginAddress->country_region = 'USA'; + $orginAddress->state = 'USA'; + $edd->origin_address = $orginAddress; + + $destAddress = new \Tracking\Model\DestinationAddressEstimatedDeliveryDateRequest(); + $destAddress->country_region = 'USA'; + $destAddress->state = 'USA'; + $edd->destination_address = $destAddress; + $payload->estimated_delivery_dates = [$edd]; + $notification = $client->estimated_delivery_date->predictBatch($payload); + echo json_encode($notification); +} catch (\Tracking\Exception\AfterShipError $e) { + // Handle the error + var_dump($e->getErrorCode()); + var_dump($e->getStatusCode()); +}