chore: Run pnpm format:fix.

This commit is contained in:
cpojer
2026-01-31 21:13:13 +09:00
parent dcc2de15a6
commit 8cab78abbc
624 changed files with 10729 additions and 7514 deletions

View File

@@ -56,7 +56,7 @@ export const nostrPlugin: ChannelPlugin<ResolvedNostrAccount> = {
}),
resolveAllowFrom: ({ cfg, accountId }) =>
(resolveNostrAccount({ cfg, accountId }).config.allowFrom ?? []).map((entry) =>
String(entry)
String(entry),
),
formatAllowFrom: ({ allowFrom }) =>
allowFrom
@@ -203,7 +203,9 @@ export const nostrPlugin: ChannelPlugin<ResolvedNostrAccount> = {
accountId: account.accountId,
publicKey: account.publicKey,
});
ctx.log?.info(`[${account.accountId}] starting Nostr provider (pubkey: ${account.publicKey})`);
ctx.log?.info(
`[${account.accountId}] starting Nostr provider (pubkey: ${account.publicKey})`,
);
if (!account.configured) {
throw new Error("Nostr private key not configured");
@@ -251,9 +253,13 @@ export const nostrPlugin: ChannelPlugin<ResolvedNostrAccount> = {
if (event.name.startsWith("event.rejected.")) {
ctx.log?.debug(`[${account.accountId}] Metric: ${event.name}`, event.labels);
} else if (event.name === "relay.circuit_breaker.open") {
ctx.log?.warn(`[${account.accountId}] Circuit breaker opened for relay: ${event.labels?.relay}`);
ctx.log?.warn(
`[${account.accountId}] Circuit breaker opened for relay: ${event.labels?.relay}`,
);
} else if (event.name === "relay.circuit_breaker.close") {
ctx.log?.info(`[${account.accountId}] Circuit breaker closed for relay: ${event.labels?.relay}`);
ctx.log?.info(
`[${account.accountId}] Circuit breaker closed for relay: ${event.labels?.relay}`,
);
} else if (event.name === "relay.error") {
ctx.log?.debug(`[${account.accountId}] Relay error: ${event.labels?.relay}`);
}
@@ -269,7 +275,9 @@ export const nostrPlugin: ChannelPlugin<ResolvedNostrAccount> = {
// Store the bus handle
activeBuses.set(account.accountId, bus);
ctx.log?.info(`[${account.accountId}] Nostr provider started, connected to ${account.relays.length} relay(s)`);
ctx.log?.info(
`[${account.accountId}] Nostr provider started, connected to ${account.relays.length} relay(s)`,
);
// Return cleanup function
return {
@@ -288,7 +296,9 @@ export const nostrPlugin: ChannelPlugin<ResolvedNostrAccount> = {
* Get metrics snapshot for a Nostr account.
* Returns undefined if account is not running.
*/
export function getNostrMetrics(accountId: string = DEFAULT_ACCOUNT_ID): MetricsSnapshot | undefined {
export function getNostrMetrics(
accountId: string = DEFAULT_ACCOUNT_ID,
): MetricsSnapshot | undefined {
const bus = activeBuses.get(accountId);
if (bus) {
return bus.getMetrics();
@@ -313,7 +323,7 @@ export function getActiveNostrBuses(): Map<string, NostrBusHandle> {
*/
export async function publishNostrProfile(
accountId: string = DEFAULT_ACCOUNT_ID,
profile: NostrProfile
profile: NostrProfile,
): Promise<ProfilePublishResult> {
const bus = activeBuses.get(accountId);
if (!bus) {
@@ -327,9 +337,7 @@ export async function publishNostrProfile(
* @param accountId - Account ID (defaults to "default")
* @returns Profile publish state or null if account not running
*/
export async function getNostrProfileState(
accountId: string = DEFAULT_ACCOUNT_ID
): Promise<{
export async function getNostrProfileState(accountId: string = DEFAULT_ACCOUNT_ID): Promise<{
lastPublishedAt: number | null;
lastPublishedEventId: string | null;
lastPublishResults: Record<string, "ok" | "failed" | "timeout"> | null;