superfaceai / station

Comlink metadata for self-integrating applications.
https://superface.ai/catalog
MIT License
22 stars 5 forks source link

fix(deepl): Send payload in body, parametrize provider #369

Closed jnv closed 1 year ago

jnv commented 1 year ago

This PR changes the deepl provider!

Description

Current DeepL map for language/translate is broken, basic request returns 400. It looks like DeepL stopped accepting payload in query parameters, and requires data to be passed in body.

Furthermore, it's not possible to use DeepL API Pro in current map, so I've added new SUBDOMAIN parameter. It defaults to api-free for the free API.

One caveat though: DeepL defines the following authentication schema in HTTP header:

Authorization: DeepL-Auth-Key [yourAuthKey]

However, we don't have any schema which allows formatting the Authorization header. Luckily the currently used scheme with auth_key query parameter works, but it's not documented and probably shouldn't be used.

Motivation and Context

Reported by user on Discord.

Types of changes

Checklist:

freaz commented 1 year ago

Provider updated. Merging to publish new map.