truckersmp / api-client Goto Github PK
View Code? Open in Web Editor NEWFeature-rich PHP client for TruckersMP API
Home Page: https://truckersmp.com/developers/api
License: MIT License
Feature-rich PHP client for TruckersMP API
Home Page: https://truckersmp.com/developers/api
License: MIT License
On https://github.com/TruckersMP/API-Client/blob/master/src/Requests/PlayerRequest.php#L56 method expects response
parameter as array, but if player do not exist under that ID API returns response
as a string.
Hello,
I tryed to set this up also i run the composer command given on the instruction given but it did not work what should i do
Right now, it is possible to make synchronous requests only. This is not viable if you want to, for example, fetch extending models of one object or multiple objects (players, ...) at once. Therefore, along with the standard usage, asynchronous requests should be available, too.
When running the test suite, we make a call to the TruckersMP API and use the response to assert our logic. However, this is definitely not how things should be done. This could cause issues if the API is offline for example.
Instead, we should update the test suite to instead mock the response (this could be done by loading an example response/schema from a JSON file) and then test our logic.
This will need a bit of investigation into how we can mock the response as some tests call multiple endpoints.
One thing to note with this is that if the schema was to change i.e. a value changes from a string
to a boolean
we wouldn't catch that due to the response being mocked. However, it is definitely better to mock the response rather than calling the API.
If possible, could guzzlehttp/guzzle be used? This would be more consistent with other uses within the Laravel Framework. php-http/guzzle6-adapter is not required by https://github.com/TruckersMP/Steam-Socialite so I am unsure why it is needed here.
C:\laragon\www\plasmagaming>composer require truckersmp/api-client
Using version ^1.2 for truckersmp/api-client
./composer.json has been updated
Running composer update truckersmp/api-client
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- php-http/guzzle6-adapter[dev-master, v1.0.0, ..., v1.1.1, v2.0.0, ..., v2.0.2] require guzzlehttp/guzzle ^6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but the package is fixed to 7.3.0 (lock file version) by a partial
update and that version does not match. Make sure you list it as an argument for the update command.
- truckersmp/api-client v1.2.0 requires php-http/guzzle6-adapter ^1.0 || ^2.0 -> satisfiable by php-http/guzzle6-adapter[v1.0.0, v1.1.0, v1.1.1, v2.0.0, v2.0.1, v2.0.2, 2.x-dev (alias of dev-master)].
- php-http/guzzle6-adapter 2.x-dev is an alias of php-http/guzzle6-adapter dev-master and thus requires it to be installed too.
- Root composer.json requires truckersmp/api-client ^1.2 -> satisfiable by truckersmp/api-client[v1.2.0].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Under https://github.com/TruckersMP/API-Client/wiki/Company-Request there doesn't appear to be any information regarding VTC Events - Could this functionality be supported by this client please?
Hello,
When I run the Composer command I get errors
`composer require truckersmp/api-client
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^1.2 for truckersmp/api-client
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package truckersmp/api-client No version set (parsed as 1.0.0) is satisfiable by truckersmp/api-client[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability.
Problem 2
- Installation request for truckersmp/api-client ^1.2 -> satisfiable by truckersmp/api-client[v1.2.0].
- truckersmp/api-client v1.2.0 requires nesbot/carbon ^2.16 -> satisfiable by nesbot/carbon[2.16.0, 2.16.1, 2.16.2, 2.16.3, 2.17.0, 2.17.1, 2.18.0, 2.19.0, 2.19.1, 2.19.2, 2.20.0, 2.21.0, 2.21.1, 2.21.2, 2.21.3, 2.22.0, 2.22.0-beta.1, 2.22.0-beta.2, 2.22.0-beta.3, 2.22.1, 2.22.2, 2.22.3, 2.23.0, 2.23.0-beta.1, 2.23.0-beta.2, 2.23.0-beta.3, 2.23.0-beta.4, 2.23.1, 2.24.0, 2.24.0-beta.1, 2.24.0-beta.2, 2.24.0-beta.3, 2.24.0-beta.4, 2.25.0, 2.25.0-beta.1, 2.25.0-beta.2, 2.25.0-beta.3, 2.25.1, 2.25.2, 2.25.3, 2.26.0, 2.27.0, 2.28.0, 2.28.0-beta.1, 2.29.0, 2.29.1, 2.30.0, 2.31.0, 2.32.0, 2.32.1, 2.32.2, 2.33.0, 2.34.0, 2.34.1, 2.34.2, 2.35.0, 2.36.0, 2.36.1, 2.37.0, 2.38.0, 2.x-dev] but these conflict with your requirements or minimum-stability.
Installation failed, reverting ./composer.json to its original content.`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.