// utils/x-headers.util.ts
export const X_BEARER_TOKEN =
    'AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA';

export const X_COOKIE_NAME = {
    'kdt': '2JWxVxk3NZUEjkorxsQE6ilftoYnFQDI8u5IgsBz',
    'auth_token':  'f5574950a0d98cf49ca2e574cc6a4139cc8a2d81',
    'cto': '75db96b40f4814925670722e3335840467b87c7eb403aab14fbe719297bf465347810f92dc2116c3d30f15153a332976c50d856983dfe19046d4f10413b3d1cd8bac6f7a99e5b03c6949bafdad0f01c0'
}

export function buildXHeaders(authToken: string, ct0: string) {
    return {
        authority: 'x.com',
        accept: '*/*',
        'accept-language': 'en-US,en;q=0.9',
        authorization: `Bearer ${X_BEARER_TOKEN}`,
        'content-type': 'application/json',
        cookie: `auth_token=${authToken}; ct0=${ct0}; kdt=${X_COOKIE_NAME.kdt}`,
        origin: 'https://x.com',
        referer: 'https://x.com/home',
        host: 'api.x.com',
        'user-agent':
            'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Safari/605.1.15',
        'x-csrf-token': ct0,
        'x-twitter-active-user': 'yes',
        'x-twitter-auth-type': 'OAuth2Session',
        'x-twitter-client-language': 'en',
    };
}

export function buildXCookies(accountId = 'realflashkaze') {
    return [
        {
            name: "ct0",
            value: X_COOKIE_NAME.cto
        },
        {
            name: "auth_token",
            value: X_COOKIE_NAME.auth_token,
        },
        {name: "dnt", value: "1"},
        {name: "lang", value: "en"},
        {name: "twid", value: "u%3D2043937828644536320"},
    ];
}
