17 Commits

Author SHA1 Message Date
Pierre-Yves Bigourdan
04254e5905 Ensure social category badges are rendered with social style and logo; affects [gitlab keybase lemmy modrinth thunderstore twitch] gist github reddit (#9859)
* Ensure social category badges are rendered with social style and logo

* Fix Twitch auth test
2023-12-31 14:08:55 +00:00
chris48s
4f67ab7a09 migrate examples to openApi part5; affects [itunes jetbrains jitpack keybase lemmy luarocks maintenance openvsx] (#9431)
* migrate some services from examples to openApi

* improve and de-dupe service titles

* revert changes to jsdelivr

* Update services/jetbrains/jetbrains-downloads.service.js

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>

---------

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>
2023-08-21 11:16:01 +01:00
dependabot[bot]
b9d96755ec chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 (#9357)
* chore(deps-dev): bump prettier from 2.8.8 to 3.0.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* reformat all the things (prettier 3)

* update tests to await calls to prettier.format()

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chris48s <git@chris-shaw.dev>
2023-07-10 09:27:51 +00:00
chris48s
c73072deed Remove requestOptions2GotOptions compatibility layer (#7270)
* gzip --> decompress

* strictSSL --> https.rejectUnauthorized

* auth --> username/password

* qs --> searchParams

* fix base service auth docs

* completely remove requestOptions2GotOptions layer

* update the docs

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-11-15 19:56:08 +00:00
chris48s
8983c39f74 Re-apply 'Migrate request to got (part 1)' (#6755)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-07-11 13:28:14 +00:00
Pierre-Yves B
23c0406bed Migrate from CommonJS to ESM (#6651) 2021-07-09 12:53:55 +01:00
chris48s
e0510ca761 Revert request --> got migration (for now) (#6277)
* Revert "send custom user agent when using got (#6256)"
This reverts commit fd7eddc7bb.

* Revert "Migrate request to got (part 1 of many) (#6160)"
This reverts commit 2359eb278b.

* install got as a prod dependency, allow npm 7
2021-03-17 20:10:38 +00:00
chris48s
2359eb278b Migrate request to got (part 1 of many) (#6160)
* install new packages

* migrate request to got

* update dynamic json test

This is a behavioural difference between request and got

request will send the request, then we'll get a
`400 Bad Request` back and re-throw at as invalid

got will pick up that the URL is invalid and throw
`RequestError: URI malformed` before attempting to send it
which we'll re-throw as inaccessible

* fix OPM service

* fix wordpress querystring

Got doesn't natively support assmebling a querystring
from nested objects because it uses node's URLSearchParams
internally. Use qs and pass qs a string.

Wordpress is the only service that needs this,
so we could build the string manually in this case
if we don't want to take qs as a prod dependency.
It is mostly hard-coded values anyway.

* fix wercker

got overwrites any ?foo=bar in the URL string if
searchParams is also passed whereas request appends
see https://github.com/sindresorhus/got#url

* fix keybase

* add tests for got wrapper

* bootstrap global agent in server start
2021-03-09 20:03:52 +00:00
homersimpsons
3597b7e80f Refactor forgotten static get in services (#5794)
Co-authored-by: Guillaume <g.alabre@thecodingmachine.com>
2020-11-05 20:35:10 +00:00
chris48s
504015c0ba migrate hapi/joi to joi (#5624)
* update joi + joi-extension-semver

* @hapi/joi --> joi

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-09-30 17:51:02 +00:00
Thakur Karthik
4c34b14b4a Refactor jira,jitpack,jsdelivr,keybase service files (#5581) 2020-09-20 15:44:47 +00:00
chris48s
13d75e0607 upgrade to prettier 2 (#5051)
* arrowParens: avoid
* remove trailingComma setting
2020-05-05 21:07:43 +01:00
chris48s
8621fe42d7 Upgrade Joi (#3505)
* upgrade joi
* find & replace ALL THE THINGS
* update related deps
2019-06-02 21:59:55 +01:00
Paul Melnikow
f8aeb56129 Unify order of more services (#3358)
Ref #3353
2019-04-24 15:08:26 -04:00
Pierre-Yves B
1f29c22d3d Migrated most service tests to use new expectBadge (#3122) 2019-02-28 21:43:23 +00:00
Paul Melnikow
4bd16f93e8 Sort imports and requires (#3056)
This will definitely save time, and ensure more uniformity.

It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.

Closes #2701
2019-02-21 22:14:40 -05:00
Skyper
6bfa9b1b41 Add badges for [Keybase] (#2969)
* Add Keybase PGP badge

* Return 'not found' if the key is not present

* Change the default colour

* Add more constraints to the schema

* Render 64-bit fingerprints

* Add example

* Add a 'hex()' constraint to the fingerprint

* Improve error handling

* Add class 'KeybaseProfile'

* Add unit tests for Keybase PGP

* Add Keybase BTC

* Add unit tests for Keybase BTC

* Add Keybase ZEC

* Add unit tests for Keybase ZEC

* Add Keybase XLM

* Add unit tests for Keybase XLM

* Validate the BTC address using a regex

Regex taken from
https://mokagio.github.io/tech-journal/2014/11/21/regex-bitcoin.html.

* Exclude 'not found' from addresses' value in unit tests

* Remove useless keywords

* Add the link to the Keybase API documentation

* Move the colour into 'defaultBadgeData'

* Remove the HTTP method

'GET' is already the default one.

* Improve the error handling for Keybase BTC

* Add more constraints to the Keybase BTC schema

* Update one unit test for Keybase BTC

* Fix the error handling for Keybase BTC

* Add more unit tests for Keybase BTC

* Improve the error handling for Keybase ZEC

* Improve the error handling for Keybase PGP

* Improve the error handling for Keybase XLM

* Display a real username value in the examples

* Include the status code in the schemas

* Move the category to the base class

The same category is used by all badges.

* Add function 'transform' to the base class

The function 'transform' is used to encapsulate the error handling logic
as it is the same in each service.
2019-02-15 11:33:06 -06:00