export const getRequestOptions = (req, path) => {
    return {
        ...baseRequest(req, path),
        requestParams: prepareRequestParams(req),
    };
};
const prepareRequestParams = (req) => {
    const { trackingId, clientId, context, language, country, currency, page, perPage, facets, sort, } = req;
    return {
        trackingId,
        clientId,
        context,
        language,
        country,
        currency,
        page,
        perPage,
        facets,
        sort,
    };
};
export const baseRequest = (req, path) => {
    const { url, accessToken } = req;
    const baseUrl = `${url}/${path}`;
    return {
        accessToken,
        method: 'POST',
        contentType: 'application/json',
        url: baseUrl,
        origin: 'commerceApiFetch',
        requestMetadata: { method: path },
    };
};
