"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAuthToken = getAuthToken;
async function getAuthToken(request, auth) {
    const response = await request('https://api.amazon.com/auth/o2/token', {
        method: 'POST',
        body: new URLSearchParams({
            grant_type: 'refresh_token',
            refresh_token: auth?.refreshToken,
            client_id: process.env.ACTIONS_AMAZON_CONVERSIONS_API_CLIENT_ID || '',
            client_secret: process.env.ACTIONS_AMAZON_CONVERSIONS_API_CLIENT_SECRET || ''
        }),
        headers: {
            authorization: ''
        },
        timeout: 2500
    });
    return response.data.access_token;
}
//# sourceMappingURL=utils.js.map