* add renderSizeBadge helper, use it everywhere
- switch from pretty-bytes to byte-size
- add renderSizeBadge() helper function
- match upstream conventions for metric/IEC units
- add new test helpers and use them in service tests
* unrelated: fix npm unpacked size query param schema
not strictly related to this PR
but I noticed it was broken
* chromewebstore: reformat size string, test against isIecFileSize
* allow user to set dockerhub credentials
* add withJwtAuth function to AuthHelper
* use withJwtAuth in DockerHub badges
* add unit tests for JWT auth
* use auth when calling docker cloud
* refactor and assert fetch helpers call withJwtAuth
* store token for a max duration (defaults to 1 hour)
* tangent: update test example
* allow serviceData to override cacheSeconds with a longer value
* prevent [endpoint] json cacheSeconds property exceeding service default
* allow ShieldsRuntimeError to specify a cacheSeconds property
By default error responses use the cacheLength of
the service class throwing the error.
This allows error to tell the handling layer the maxAge
that should be set on the error badge response.
* add customExceptions param
This
1. allows us to specify custom properties to pass to the exception
constructor if we throw any of the standard got errors
e.g: `ETIMEDOUT`, `ECONNRESET`, etc
2. uses a custom `cacheSeconds` property (if set on the exception)
to set the response maxAge
* customExceptions --> systemErrors
* errorMessages --> httpErrors
* Add [Docker] image size badge
* Add [Docker] version/tag badge
* [Docker] allow version badge to retrieve results from multiple pages
* [Docker] allow size badge to retrieve results from multiple pages
* [Docker] clean up size and version badges before squash
* [Docker] Size badge change API call to explicit tag
* [Docker] Conditionally include tag route param for badges
* [Docker] Implement feedback for size and version badges
* [Docker] Implement feedback round 2 for size and version badges
* [Docker] Optimise API lookups and remove date sorting on tag badge
* [Docker] Implement feedback round 3 for version badge
* [Docker] Implement feedback round 4 for version badge
* [Docker] Adjust unit and service tests for version badge
* [Docker] Move unit test data into fixtures
* [Docker] Fix Docker version badge route prefix
* [Docker] Add date and semver lookup for size badge
* [Docker] Implement feedback round 5 for version badge
* [Docker] Implement feedback round 6
* [Docker] Tweak error messaging for consistent wording
* [Docker] Adjust badge titles
* [Docker] Guard and treat images with missing digest
* [Docker] Guard and treat images with missing digest