Use twitter safe relay
CI / test (pull_request) Has been cancelled

This commit is contained in:
2026-06-24 03:39:34 +09:00
parent b771e827aa
commit 1f6e228272
66 changed files with 597 additions and 1720 deletions
+4 -24
View File
@@ -31,17 +31,7 @@ export function registerSearchCommands(program: Command, ctx: CliContext): void
const quoteDepth = ctx.resolveQuoteDepthFromOptions(opts);
const count = Number.parseInt(cmdOpts.count || '10', 10);
const maxPages = cmdOpts.maxPages ? Number.parseInt(cmdOpts.maxPages, 10) : undefined;
const { cookies, warnings } = await ctx.resolveCredentialsFromOptions(opts);
for (const warning of warnings) {
console.error(`${ctx.p('warn')}${warning}`);
}
if (!cookies.authToken || !cookies.ct0) {
console.error(`${ctx.p('err')}Missing required credentials`);
process.exit(1);
}
const relayBaseUrl = ctx.resolveRelayBaseUrlFromOptions(opts);
const usePagination = cmdOpts.all || cmdOpts.cursor;
if (maxPages !== undefined && !usePagination) {
@@ -57,7 +47,7 @@ export function registerSearchCommands(program: Command, ctx: CliContext): void
process.exit(1);
}
const client = new TwitterClient({ cookies, timeoutMs, quoteDepth });
const client = new TwitterClient({ relayBaseUrl, timeoutMs, quoteDepth });
const includeRaw = cmdOpts.jsonFull ?? false;
const searchOptions = { includeRaw };
const paginationOptions = { includeRaw, maxPages, cursor: cmdOpts.cursor };
@@ -99,19 +89,9 @@ export function registerSearchCommands(program: Command, ctx: CliContext): void
}
let query: string | null = fromUserOpt.query;
const relayBaseUrl = ctx.resolveRelayBaseUrlFromOptions(opts);
const { cookies, warnings } = await ctx.resolveCredentialsFromOptions(opts);
for (const warning of warnings) {
console.error(`${ctx.p('warn')}${warning}`);
}
if (!cookies.authToken || !cookies.ct0) {
console.error(`${ctx.p('err')}Missing required credentials`);
process.exit(1);
}
const client = new TwitterClient({ cookies, timeoutMs, quoteDepth });
const client = new TwitterClient({ relayBaseUrl, timeoutMs, quoteDepth });
if (!query) {
const who = await client.getCurrentUser();