(accessToken, info)
| 1670 | } |
| 1671 | |
| 1672 | async function updateHuaweiAppLanguageInfo (accessToken, info) { |
| 1673 | try { |
| 1674 | const apiUrl = 'https://connect-api.cloud.huawei.com/api/publish/v2/upload-url' + |
| 1675 | '?appId=' + settings.huawei.app_id; |
| 1676 | const response = await postHttp(apiUrl, info, false, { |
| 1677 | headers: { |
| 1678 | 'client_id': settings.huawei.client_id, |
| 1679 | 'Authorization': 'Bearer ' + accessToken, |
| 1680 | 'User-Agent': 'Telegram-X-Publisher' |
| 1681 | } |
| 1682 | }); |
| 1683 | if (response.statusCode !== 200) { |
| 1684 | console.error('AGC update langauge info failed', response.statusCode, response.statusMessage, response.contentType, response.content); |
| 1685 | return null; |
| 1686 | } |
| 1687 | return JSON.parse(response.content); |
| 1688 | } catch (e) { |
| 1689 | console.error('Unable to update AGC language info', e); |
| 1690 | return null; |
| 1691 | } |
| 1692 | } |
| 1693 | |
| 1694 | async function submitHuaweiAppUpdate (accessToken) { |
| 1695 | try { |
no test coverage detected