@onelyid/client 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/middleware.ts","../src/db/index.ts","../src/oauth-client.ts","../src/storage.ts","../src/utils/req-utils.ts","../src/utils/utils.ts","../src/const.ts","../src/lock.ts","../src/db/queries.ts","../src/id-resolver.ts","../src/session.ts","../../internal/generated/lexicon/lexicons.ts","../../internal/generated/lexicon/util.ts","../../internal/generated/lexicon/types/app/bsky/actor/profile.ts","../src/data/trusted.json"],"sourcesContent":["import './types/globals.d.ts'\nexport { authMiddleware, redirect, setAuth } from './middleware'\nexport type { AuthMiddlewareConfig, UserInfo, LoginPageProps } from './types/common'\n","import express from 'express'\nimport type { Handler, Request, Response, NextFunction, RequestHandler, Router } from 'express'\nimport { OAuthResolverError } from '@atproto/oauth-client-node'\nimport { authBodyParser, assertOrigin, assertPath, getHostname, getOrigin, isLocalHostname, openState, sealState, packState, unpackState, getMainAuthDomain, getAuthClientMountPath, getMainAuthDomainVariants, getCustomHeaderNames, assertRequestMode, Environment, getMainAuthDomainsList } from '@onelyid/common'\nimport { createDb, migrateToLatest } from './db'\nimport { OAuthClientFactory } from './oauth-client'\nimport { getOrCreateCookieSecret, getOrCreateStateSecret } from './db/queries'\nimport { createBidirectionalResolver, createIdResolver } from './id-resolver'\nimport { getSession, getSessionUser, setSession } from './session'\nimport { assertPublicUrl, getConsoleLogger, getDatabasePath, isValidHandle } from './utils/utils'\nimport { getDocRoutes } from './utils/req-utils'\nimport { AppContext, AuthMiddlewareConfig, InternalGlobals, LoginPageProps, RespGlobals, UserInfo } from './types/common'\nimport { INVALID } from './const'\n\n// Helper function for defining routes\nconst handler =\n (fn: Handler) =>\n async (\n req: Request,\n res: Response,\n next: NextFunction\n ) => {\n try {\n await fn(req, res, next)\n } catch (err) {\n next(err)\n }\n }\n\n// NOTE: Only use `iGlobals` where the usage is not direcly via `authMiddleware` setup\n// E.g. `setAuth` and `redirect` middlewares\nconst iGlobals: InternalGlobals = {\n ctx: null,\n globals: null,\n};\n\nexport const authMiddleware = (config?: AuthMiddlewareConfig): RequestHandler => {\n const router = express.Router()\n\n router.use(authBodyParser)\n\n const globals: RespGlobals = {\n // initialized on mount\n cookieSecret: '',\n stateSecret: '',\n mountPath: '',\n publicUrl: '',\n };\n\n const authClientMountPath = getAuthClientMountPath()\n\n globals.cookieSecret = config?.cookieSecret ?? '';\n globals.stateSecret = config?.stateSecret ?? '';\n globals.mountPath = assertPath(authClientMountPath);\n globals.publicUrl = assertPublicUrl(config?.publicUrl);\n\n let initError: unknown = null\n const ctx: AppContext = {\n logger: config?.logger ?? getConsoleLogger(),\n db: null,\n resolver: null,\n oauthClientFactory: null,\n };\n\n iGlobals.ctx = ctx;\n iGlobals.globals = globals;\n\n // kick off async initialization immediately\n ;(async () => {\n try {\n const dbPath = config?.dbPath || getDatabasePath()\n ctx.db = createDb(dbPath)\n await migrateToLatest(ctx.db)\n\n if (!globals.cookieSecret) {\n globals.cookieSecret = await getOrCreateCookieSecret(ctx.db)\n }\n if (!globals.stateSecret) {\n globals.stateSecret = await getOrCreateStateSecret(ctx.db)\n }\n\n const baseIdResolver = createIdResolver()\n ctx.resolver = createBidirectionalResolver(baseIdResolver)\n\n ctx.oauthClientFactory = new OAuthClientFactory()\n\n registerRoutes(router, ctx, globals, config)\n } catch (err) {\n initError = err\n }\n })()\n\n // gate middleware\n router.use(async (req, res, next) => {\n if (initError) {\n return next(initError)\n }\n if (!ctx.db || !globals.cookieSecret || !globals.stateSecret || !ctx.resolver || !ctx.oauthClientFactory) {\n return res.status(503).send('Service initializing')\n }\n if (globals.publicUrl === INVALID) {\n return res.status(503).send('Invalid publicUrl provided! Valid example: https://example.com')\n }\n if (req.baseUrl) {\n const message = `authMiddleware() must be mounted at root, not at \\`${req.baseUrl}\\``\n throw new Error(message);\n }\n\n req.ctx = {\n oauthClient: await ctx.oauthClientFactory.create(req, ctx, globals)\n };\n\n const modeConfigured = assertRequestMode(config?.mode)\n const modeInferred = getRequestMode(req, globals)\n if (modeConfigured && modeInferred && modeConfigured !== modeInferred) {\n const message = `Environment (request mode) mismatch! ${modeConfigured} ${modeInferred}`\n const acceptsJSON = req.accepts(['json', 'html']) === 'json'\n\n res.status(500)\n if (acceptsJSON) {\n res.json({ error: message })\n } else {\n res.send(message)\n }\n return\n }\n\n const requestMode = modeConfigured || modeInferred\n if (requestMode) {\n req.mode = requestMode\n } else if (req.path !== `${globals.mountPath}/callback`) {\n // NOTE: The (OAuth) callback route finalises `req.mode` separately\n req.mode = Environment.Prod // finalise `req.mode`\n }\n\n req.authFlow = () => initAuthFlow(req, res);\n req.getAuth = () => setReqAuth(req, res);\n\n res.clearAuth = () => deleteSession(req, res, globals);\n\n // custom json response\n res.json = (data: unknown) => sendJson(res, data)\n\n next()\n })\n\n return router\n}\n\nasync function initAuthFlow(req: Request, res: Response): Promise<LoginPageProps | void> {\n const searchParams = new URLSearchParams(req.query as Record<string, string>)\n let redirectUrl = searchParams.get('continue') || '/'\n if (await req.getAuth()) {\n return res.redirect(redirectUrl)\n }\n\n const { isMainAuthDomain, isMainAuthDomainVariant } = getMainAuthDomainVariants(req)\n if (!isMainAuthDomain) {\n if (!isMainAuthDomainVariant) {\n const authClientMountPath = getAuthClientMountPath()\n\n const searchParams = new URLSearchParams()\n searchParams.set('continue', redirectUrl)\n if (req.mode) {\n searchParams.set('request_mode', req.mode)\n }\n\n return res.redirect(`${authClientMountPath}/login/redirect?${searchParams.toString()}`)\n } else {\n return res.redirect(redirectUrl)\n }\n }\n\n let authOrigin = ''\n\n const state = searchParams.get('state') ?? ''\n if (state) {\n const stateObj = unpackState(state)\n redirectUrl = stateObj.redirectUrl || redirectUrl\n authOrigin = stateObj.authOrigin\n }\n\n const authClientMountPath = getAuthClientMountPath()\n const authActioUrl = `${authOrigin || ''}${authClientMountPath}/login`;\n\n const loginProps: LoginPageProps = { redirectUrl, authActioUrl }\n if (req.mode) {\n loginProps.requestMode = req.mode\n }\n return loginProps\n}\n\nasync function initOAuthFlow(handle: string, redirectUrl: string | undefined, req: Request, res: Response, globals: RespGlobals, config: AuthMiddlewareConfig | undefined, devMode?: boolean) {\n let loginRedirect = redirectUrl || assertPath(config?.loginRedirect);\n if (!loginRedirect) {\n if (devMode) {\n loginRedirect = `${globals.mountPath}/userinfo`\n } else {\n loginRedirect = '/'\n }\n }\n\n let localAuth = ''\n const hostname = getHostname(req)\n if (isLocalHostname(hostname)) {\n localAuth = hostname\n }\n\n const purpose = req.get('Sec-Purpose') ?? req.get('Purpose')\n const parts = purpose?.split(/[;,]/) ?? []\n const isSpeculative = parts.includes('prefetch') || parts.includes('prerender')\n if (isSpeculative) {\n res.send('')\n return\n }\n\n if (!handle) {\n return res.redirect(loginRedirect)\n }\n\n const stateObj: any = { loginRedirect }\n if (req.mode) {\n stateObj.requestMode = req.mode\n }\n if (localAuth) {\n stateObj.localAuth = localAuth\n }\n\n const url = await req.ctx.oauthClient!.authorize(handle, {\n scope: 'atproto transition:email',\n state: JSON.stringify(stateObj),\n })\n return res.redirect(url.toString())\n}\n\nexport const setAuth: RequestHandler = async (req, res, next) => {\n await setReqAuth(req, res)\n next()\n};\n\nexport const redirect: (path: string) => RequestHandler = (redirectPath: string) => (async (req, res, next) => {\n await setReqAuth(req, res)\n if (!req.auth) {\n const path = assertPath(redirectPath ?? '/');\n return res.redirect(path)\n }\n next()\n}) satisfies RequestHandler;\n\nasync function setReqAuth(req: Request, res: Response): Promise<UserInfo | null> {\n if (req.auth) {\n return req.auth\n }\n\n if (iGlobals.ctx && iGlobals.globals?.cookieSecret) {\n const { user, error } = await getSessionUser(req, res, iGlobals.ctx, iGlobals.globals.cookieSecret)\n if (!error && user) {\n req.auth = user\n }\n }\n if (!req.auth) {\n req.auth = null\n }\n return req.auth\n}\n\nasync function deleteSession(req: Request, res: Response, globals: RespGlobals) {\n const session = await getSession(req, res, globals.cookieSecret);\n await session.destroy()\n}\n\nfunction getRequestMode(req: Request, globals: RespGlobals): Environment | undefined {\n let requestMode: Environment | undefined = undefined\n const searchParams = new URLSearchParams(req.query as Record<string, string>)\n\n const customHeaders = getCustomHeaderNames()\n const requestModeValue = req.get(customHeaders.requestMode)\n requestMode = assertRequestMode(requestModeValue)\n\n if (!requestMode) {\n let _requestModeValue = searchParams.get('request_mode')\n if (!_requestModeValue && req.body) {\n _requestModeValue = (req.body.requestMode as string)\n }\n\n if (_requestModeValue) {\n const _requestMode = assertRequestMode(_requestModeValue)\n if (_requestMode) {\n requestMode = _requestMode\n }\n }\n }\n\n if (!requestMode && req.path === '/login') {\n const state = searchParams.get('state')\n if (state) {\n const stateObj = unpackState(state)\n const _requestMode = assertRequestMode(stateObj.requestMode)\n if (_requestMode) {\n requestMode = _requestMode\n }\n }\n }\n\n if (!requestMode && req.path === `${globals.mountPath}/transfer-local-session`) {\n const sealedState = searchParams.get('xstate')\n if (sealedState) {\n const stateObj = openState(sealedState, globals.stateSecret)\n const _requestMode = assertRequestMode(stateObj.requestMode)\n if (_requestMode) {\n requestMode = _requestMode\n }\n }\n }\n\n if (!requestMode) {\n const hostname = getHostname(req)\n for (const [mode, authDomain] of Object.entries(getMainAuthDomainsList())) {\n if (hostname === authDomain) {\n const _requestMode = assertRequestMode(mode)\n requestMode = _requestMode\n }\n }\n }\n\n return requestMode\n}\n\nfunction registerRoutes(router: Router, ctx: AppContext, globals: RespGlobals, config?: AuthMiddlewareConfig) {\n // OAuth metadata\n router.get(\n '/oauth-client-metadata.json',\n handler((req, res) => {\n return res.json(req.ctx.oauthClient!.clientMetadata)\n })\n )\n\n // Middleware root (base)\n router.get(\n `${globals.mountPath ?? '/'}`,\n handler((req, res) => {\n const { login, logout, userinfo } = getDocRoutes(req, globals)\n return res.json({\n info: \"middleware root endpoint\",\n try: [{ login, logout, userinfo }],\n })\n })\n )\n\n // OAuth callback to complete session creation\n router.get(\n `${globals.mountPath}/callback`,\n handler(async (req, res) => {\n let loginRedirect: string | undefined;\n const params = new URLSearchParams(req.originalUrl.split('?')[1])\n try {\n const { session, state } = await req.ctx.oauthClient!.callback(params)\n if (state) {\n const stateObj = JSON.parse(state)\n loginRedirect = stateObj.loginRedirect\n const requestMode = stateObj.requestMode\n\n // finalise `req.mode` for (OAuth) callback route\n if (!req.mode) {\n req.mode = requestMode || Environment.Prod\n }\n\n const customHeaders = getCustomHeaderNames()\n let proxyOrigin = req.get(customHeaders.proxyOrigin)\n proxyOrigin = assertOrigin(proxyOrigin)\n const localAuth = stateObj.localAuth\n const hostname = getHostname(req)\n\n const transferLocalAuth = proxyOrigin && localAuth && isLocalHostname(localAuth) && isLocalHostname(hostname) && localAuth !== hostname\n if (transferLocalAuth) {\n const state: any = { loginRedirect, did: session.did }\n if (req.mode) {\n state.requestMode = req.mode\n }\n const sealedState = sealState(state, globals.stateSecret)\n\n const url = new URL(`${getOrigin(req)}${globals.mountPath}/transfer-local-session`)\n url.hostname = localAuth\n url.searchParams.set('xstate', sealedState)\n\n return res.redirect(url.href)\n } else {\n await setSession(req, res, globals.cookieSecret, { did: session.did })\n }\n }\n } catch (err) {\n ctx.logger.error({ err }, 'oauth callback failed')\n return res.redirect('/?error')\n }\n\n if (!loginRedirect) {\n loginRedirect = '/'\n }\n\n return res.redirect(loginRedirect)\n })\n )\n\n // Login redirect handler\n router.get(\n `${globals.mountPath}/login/redirect`,\n handler(async (req, res) => {\n const searchParams = new URLSearchParams(req.query as Record<string, string>)\n const redirectUrl = searchParams.get('continue') || '/'\n const authOrigin = getOrigin(req)\n\n const stateObj: any = { redirectUrl, authOrigin }\n if (req.mode) {\n stateObj.requestMode = req.mode\n }\n const state = packState(stateObj)\n\n const mainAuthDomain = getMainAuthDomain(req)\n const url = new URL(`https://${mainAuthDomain}/login`)\n url.searchParams.set('state', state);\n return res.redirect(url.href)\n })\n )\n\n // Login handler\n router.route(`${globals.mountPath}/login`)\n .get(handler(async (req, res) => {\n const searchParams = new URLSearchParams(req.query as Record<string, string>)\n const handle = searchParams.get('handle')\n if (handle) {\n await handleLoginFlow(handle, undefined, req, res, true)\n }\n }))\n .post(handler(async (req, res) => {\n const handle = req.body?.handle\n const redirectUrl = req.body?.redirectUrl\n if (handle) {\n await handleLoginFlow(handle, redirectUrl, req, res)\n }\n }))\n\n // Logout handler\n // TODO: Can make it as POST-only later, with an info message for GET\n router.all(\n `${globals.mountPath}/logout`,\n handler(async (req, res) => {\n await deleteSession(req, res, globals)\n\n const acceptsJSON = req.accepts(['json', 'html']) === 'json'\n if (acceptsJSON) {\n return res.json({ ok: true })\n } else {\n return res.redirect('/')\n }\n })\n )\n\n // User info for current session\n router.get(\n `${globals.mountPath}/userinfo`,\n handler(async (req, res) => {\n const { login, logout, userinfo } = getDocRoutes(req, globals)\n const { user, error } = await getSessionUser(req, res, ctx, globals.cookieSecret)\n if (user === null) {\n return res.json({ ok: true, user, info: 'not logged-in', try: [{ login, userinfo }] })\n } else if (!user) {\n return res.json({ ok: true, user: null, error, try: [{ login, userinfo }] })\n }\n return res.json({ ok: true, user, try: [{ logout, userinfo }] })\n })\n )\n\n // Transfer local session (e.g. 127.0.0.1 --> localhost)\n router.get(\n `${globals.mountPath}/transfer-local-session`,\n handler(async (req, res) => {\n const customHeaders = getCustomHeaderNames()\n let proxyOrigin = req.get(customHeaders.proxyOrigin)\n proxyOrigin = assertOrigin(proxyOrigin)\n const hostname = getHostname(req)\n\n const transferLocalAuth = proxyOrigin && isLocalHostname(hostname)\n const sealedState = new URLSearchParams(req.query as Record<string, string>).get('xstate')\n if (transferLocalAuth && sealedState) {\n const stateObj = openState(sealedState, globals.stateSecret)\n if (stateObj) {\n const { loginRedirect, did } = stateObj\n await setSession(req, res, globals.cookieSecret, { did })\n return res.redirect(loginRedirect)\n }\n }\n\n return res.redirect('/')\n })\n )\n\n async function handleLoginFlow(handle: string, redirectUrl: string | undefined, req: Request, res: Response, devMode?: boolean) {\n const { login, userinfo } = getDocRoutes(req, globals)\n // const isPost = req.method === 'POST'\n\n // Validate\n if (!isValidHandle(handle)) {\n ctx.logger.error(`Invalid handle: ${handle}`)\n return res.json({\n handle: `${handle ?? ''}`,\n error: 'Invalid handle',\n try: [{ login, userinfo }],\n })\n }\n\n // Initiate the OAuth flow\n try {\n await initOAuthFlow(handle, redirectUrl, req, res, globals, config, devMode)\n } catch (err) {\n ctx.logger.error({ err }, 'oauth authorize failed')\n return res.json({\n error:\n err instanceof OAuthResolverError\n ? err.message\n : \"couldn't initiate login\",\n })\n }\n }\n}\n\nfunction sendJson(res: Response, data: unknown) {\n const dataStr = JSON.stringify(data, null, 2)\n return res.type('json').send(dataStr)\n}\n","import SqliteDb from 'better-sqlite3'\nimport {\n Kysely,\n Migrator,\n SqliteDialect,\n Migration,\n MigrationProvider,\n} from 'kysely'\n\n// Types\n\nexport type DatabaseSchema = {\n auth_session: AuthSession\n auth_state: AuthState\n app_secrets: AppSecrets\n oauth_lock: OAuthLock\n}\n\nexport type AuthSession = {\n key: string\n session: AuthSessionJson\n}\n\nexport type AuthState = {\n key: string\n state: AuthStateJson\n}\n\nexport type AppSecrets = {\n key: string\n value: string\n}\n\nexport type OAuthLock = {\n key: string\n}\n\ntype AuthStateJson = string\n\ntype AuthSessionJson = string\n\n// Migrations\n\nconst migrations: Record<string, Migration> = {}\n\nconst migrationProvider: MigrationProvider = {\n async getMigrations() {\n return migrations\n },\n}\n\nmigrations['001'] = {\n async up(db: Kysely<unknown>) {\n await db.schema\n .createTable('auth_session')\n .addColumn('key', 'varchar', (col) => col.primaryKey())\n .addColumn('session', 'varchar', (col) => col.notNull())\n .execute()\n await db.schema\n .createTable('auth_state')\n .addColumn('key', 'varchar', (col) => col.primaryKey())\n .addColumn('state', 'varchar', (col) => col.notNull())\n .execute()\n },\n async down(db: Kysely<unknown>) {\n await db.schema.dropTable('auth_state').execute()\n await db.schema.dropTable('auth_session').execute()\n },\n}\n\nmigrations['002'] = {\n async up(db: Kysely<unknown>) {\n await db.schema\n .createTable('app_secrets')\n .addColumn('key', 'varchar', (col) =>\n col.primaryKey()\n )\n .addColumn('value', 'varchar', (col) =>\n col.notNull()\n )\n .execute()\n },\n\n async down(db: Kysely<unknown>) {\n await db.schema.dropTable('app_secrets').execute()\n },\n}\n\nmigrations['003'] = {\n async up(db: Kysely<unknown>) {\n await db.schema\n .createTable('oauth_lock')\n .addColumn('key', 'varchar', (col) => col.primaryKey())\n .execute()\n },\n\n async down(db: Kysely<unknown>) {\n await db.schema.dropTable('oauth_lock').execute()\n },\n}\n\n// APIs\n\nexport const createDb = (location: string): Database => {\n return new Kysely<DatabaseSchema>({\n dialect: new SqliteDialect({\n database: new SqliteDb(location),\n }),\n })\n}\n\nexport const migrateToLatest = async (db: Database) => {\n const migrator = new Migrator({ db, provider: migrationProvider })\n const { error } = await migrator.migrateToLatest()\n if (error) throw error\n}\n\nexport type Database = Kysely<DatabaseSchema>\n","import { NodeOAuthClient, OAuthClient } from '@atproto/oauth-client-node'\nimport type { Request } from 'express'\nimport type { AppContext, RespGlobals } from './types/common'\nimport { SessionStore, StateStore } from './storage'\nimport { getBaseUrls } from './utils/req-utils'\nimport { sqliteRequestLock } from './lock'\n\nconst createClient = async (ctx: AppContext, publicUrl: string, baseUrl: string, basePath: string) => {\n const enc = encodeURIComponent\n return new NodeOAuthClient({\n clientMetadata: {\n client_name: 'ATProto client',\n client_id: publicUrl\n ? `${baseUrl}/oauth-client-metadata.json`\n : `http://localhost?redirect_uri=${enc(`${basePath}/callback`)}&scope=${enc('atproto transition:generic transition:email')}`,\n client_uri: baseUrl,\n redirect_uris: [`${basePath}/callback`],\n scope: 'atproto transition:generic transition:email',\n grant_types: ['authorization_code', 'refresh_token'],\n response_types: ['code'],\n application_type: 'web',\n token_endpoint_auth_method: 'none',\n dpop_bound_access_tokens: true,\n },\n stateStore: new StateStore(ctx.db!),\n sessionStore: new SessionStore(ctx.db!),\n requestLock: sqliteRequestLock(ctx.db!),\n })\n}\n\nexport class OAuthClientFactory {\n private readonly cache = new Map<string, Promise<OAuthClient>>();\n\n create(req: Request, ctx: AppContext, globals: RespGlobals): Promise<OAuthClient> {\n const { publicUrl, baseUrl, basePath } = getBaseUrls(req, globals)\n\n let cached = this.cache.get(baseUrl)\n if (!cached) {\n cached = createClient(ctx, publicUrl, baseUrl, basePath).catch(err => {\n this.cache.delete(baseUrl);\n throw err;\n })\n this.cache.set(baseUrl, cached)\n }\n return cached\n }\n}\n","import type {\n NodeSavedSession,\n NodeSavedSessionStore,\n NodeSavedState,\n NodeSavedStateStore,\n} from '@atproto/oauth-client-node'\nimport type { Database } from './types/common'\n\nexport class StateStore implements NodeSavedStateStore {\n constructor(private db: Database) {}\n async get(key: string): Promise<NodeSavedState | undefined> {\n const result = await this.db.selectFrom('auth_state').selectAll().where('key', '=', key).executeTakeFirst()\n if (!result) return\n return JSON.parse(result.state) as NodeSavedState\n }\n async set(key: string, val: NodeSavedState) {\n const state = JSON.stringify(val)\n await this.db\n .insertInto('auth_state')\n .values({ key, state })\n .onConflict((oc) => oc.doUpdateSet({ state }))\n .execute()\n }\n async del(key: string) {\n await this.db.deleteFrom('auth_state').where('key', '=', key).execute()\n }\n}\n\nexport class SessionStore implements NodeSavedSessionStore {\n constructor(private db: Database) {}\n async get(key: string): Promise<NodeSavedSession | undefined> {\n const result = await this.db.selectFrom('auth_session').selectAll().where('key', '=', key).executeTakeFirst()\n if (!result) return\n return JSON.parse(result.session) as NodeSavedSession\n }\n async set(key: string, val: NodeSavedSession) {\n const session = JSON.stringify(val)\n await this.db\n .insertInto('auth_session')\n .values({ key, session })\n .onConflict((oc) => oc.doUpdateSet({ session }))\n .execute()\n }\n async del(key: string) {\n await this.db.deleteFrom('auth_session').where('key', '=', key).execute()\n }\n}\n","import type { Request } from 'express'\nimport { getOrigin } from '@onelyid/common'\nimport { assertPublicUrl } from './utils';\nimport { RespGlobals } from '../types/common';\nimport { DEMO_HANDLE } from '../const';\n\nexport function getBaseUrls(req: Request, globals: RespGlobals) {\n const origin = getOrigin(req)\n const host = new URL(origin).host\n const publicUrl = globals.publicUrl || assertPublicUrl(origin)\n\n // NOTE: `publicUrl` remains empty string ('') for localhost/127.0.0.1\n let baseUrl: string;\n if (publicUrl) {\n baseUrl = publicUrl\n } else {\n let port = host?.split(':')[1] ?? ''\n if (port === '80') {\n port = ''\n }\n baseUrl = `http://127.0.0.1${port ? `:${port}` : ''}`\n }\n const basePath = `${baseUrl}${globals.mountPath}`\n return { publicUrl, baseUrl, basePath }\n}\n\nexport function getDocRoutes(req: Request, globals: RespGlobals) {\n const demoHandle = DEMO_HANDLE;\n const { basePath } = getBaseUrls(req, globals)\n\n const login = `${basePath}/login?handle=${demoHandle}`;\n const logout = `${basePath}/logout`;\n const userinfo = `${basePath}/userinfo`;\n return { login, logout, userinfo }\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport os from 'node:os'\nimport { isValidHandle as isValidHandleSyntax } from '@atproto/syntax'\nimport { isLocalHostname } from '@onelyid/common'\nimport { Logger } from '../types/common'\nimport { DEFAULT_DBFILE_DIR, DEFAULT_DBFILE_NAME, INVALID } from '../const'\n\nexport function getConsoleLogger(): Logger {\n return {\n info: console.info,\n warn: console.warn,\n error: console.error,\n }\n}\n\n// NOTE: `publicUrl` remains empty string ('') for localhost/127.0.0.1\nexport function assertPublicUrl(url?: string) {\n let publicUrl = url ?? '';\n publicUrl = publicUrl.trim();\n if (!publicUrl) return publicUrl;\n \n publicUrl = publicUrl.toLowerCase()\n if (publicUrl.endsWith('/')) {\n publicUrl = publicUrl.substring(0, publicUrl.length-1)\n }\n if (!publicUrl.startsWith('http://') && !publicUrl.startsWith('https://')) {\n return INVALID\n }\n\n try {\n const urlObj = new URL(publicUrl)\n if (isLocalHostname(urlObj.hostname)) {\n return ''\n } else {\n return publicUrl\n }\n } catch(err) {\n return INVALID\n }\n}\n\nexport function isValidHandle(handle?: string) {\n if (!handle || typeof handle !== 'string') {\n return false\n }\n return isValidHandleSyntax(handle);\n}\n\nfunction getAppPackageName(): string | null {\n let dir = process.cwd()\n\n while (true) {\n const pkgPath = path.join(dir, 'package.json')\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))\n return pkg.name ?? null\n } catch {\n return null\n }\n }\n\n const parent = path.dirname(dir)\n if (parent === dir) break\n dir = parent\n }\n\n return null\n}\n\nexport function getDatabasePath() {\n // local db file\n return DEFAULT_DBFILE_NAME\n\n let dbFile = DEFAULT_DBFILE_NAME;\n const packageName = getAppPackageName()\n if (packageName) {\n dbFile = `${packageName}-${dbFile}`\n }\n dbFile = dbFile.replace(/\\s+/g, '-');\n\n const dir = path.join(os.homedir(), DEFAULT_DBFILE_DIR, 'db')\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n\n const file = path.join(dir, dbFile)\n return file\n}\n","export const INVALID = 'invalid';\nexport const DEFAULT_DBFILE_NAME = 'database.sqlite';\nexport const DEFAULT_DBFILE_DIR = '.onelyid';\nexport const COOKIE_SECRET_KEY = 'cookie_secret';\nexport const STATE_SECRET_KEY = 'state_secret';\nexport const DEMO_HANDLE = 'abraj.dev';\n","import type { RuntimeLock } from '@atproto/oauth-client'\nimport type { Database } from './types/common'\n\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))\n\nexport const sqliteRequestLock =\n (db: Database): RuntimeLock =>\n async <T>(\n name: string,\n fn: () => T | PromiseLike<T>\n ): Promise<T> => {\n // acquire\n while (true) {\n try {\n await db\n .insertInto('oauth_lock')\n .values({ key: name })\n .execute()\n break\n } catch {\n await sleep(50)\n }\n }\n\n try {\n return await fn()\n } finally {\n // release\n await db\n .deleteFrom('oauth_lock')\n .where('key', '=', name)\n .execute()\n }\n }\n","import crypto from 'node:crypto'\nimport type { Database } from './index';\nimport { COOKIE_SECRET_KEY, STATE_SECRET_KEY } from '../const';\n\nexport async function getOrCreateAppSecret(db: Database, keyName: string, bytesLength = 32) {\n const existing = await db\n .selectFrom('app_secrets')\n .select('value')\n .where('key', '=', keyName)\n .executeTakeFirst()\n\n if (existing) {\n return existing.value\n }\n\n // equivalent to `openssl rand -hex 32`\n const secret = crypto.randomBytes(bytesLength).toString('hex')\n\n await db\n .insertInto('app_secrets')\n .values({\n key: keyName,\n value: secret,\n })\n .onConflict((oc) => oc.doNothing())\n .execute()\n\n return secret\n}\n\nexport async function getOrCreateCookieSecret(db: Database) {\n return getOrCreateAppSecret(db, COOKIE_SECRET_KEY)\n}\n\nexport async function getOrCreateStateSecret(db: Database) {\n return getOrCreateAppSecret(db, STATE_SECRET_KEY)\n}\n","import { IdResolver, MemoryCache } from '@atproto/identity'\n\nconst HOUR = 60e3 * 60\nconst DAY = HOUR * 24\n\n\nexport function createIdResolver() {\n return new IdResolver({\n didCache: new MemoryCache(HOUR, DAY),\n })\n}\n\nexport interface BidirectionalResolver {\n resolveDidToHandle(did: string): Promise<string>\n resolveDidsToHandles(dids: string[]): Promise<Record<string, string>>\n}\n\nexport function createBidirectionalResolver(resolver: IdResolver) {\n return {\n async resolveDidToHandle(did: string): Promise<string> {\n const didDoc = await resolver.did.resolveAtprotoData(did)\n const resolvedHandle = await resolver.handle.resolve(didDoc.handle)\n if (resolvedHandle === did) {\n return didDoc.handle\n }\n return did\n },\n\n async resolveDidsToHandles(\n dids: string[]\n ): Promise<Record<string, string>> {\n const didHandleMap: Record<string, string> = {}\n const resolves = await Promise.all(\n dids.map((did) => this.resolveDidToHandle(did).catch((_) => did))\n )\n for (let i = 0; i < dids.length; i++) {\n didHandleMap[dids[i] ?? ''] = resolves[i] ?? ''\n }\n return didHandleMap\n },\n }\n}\n","import type { IncomingMessage, ServerResponse } from 'node:http'\nimport { Agent } from '@atproto/api'\nimport { OAuthServerAgent } from '@atproto/oauth-client-node'\nimport { getIronSession } from 'iron-session'\nimport { getBaseDomain, getHostname, getMainAuthDomain, isLocalHostname } from '@onelyid/common'\nimport { AppContext, UserInfo, Session } from './types/common'\nimport * as Profile from '#/internal/generated/lexicon/types/app/bsky/actor/profile'\nimport dataTrusted from './data/trusted.json'\n\nexport async function getSession(\n req: IncomingMessage,\n res: ServerResponse<IncomingMessage>,\n cookieSecret: string,\n) {\n const hostname = getHostname(req as any)\n const isLocalhost = isLocalHostname(hostname)\n const baseDomainObj = getBaseDomain(req)\n const mainAuthDomain = getMainAuthDomain(req)\n\n let cookieDomain = baseDomainObj ? baseDomainObj.baseDomain : undefined\n if (cookieDomain === mainAuthDomain || baseDomainObj?.isLocalhost || !baseDomainObj?.isVerified) {\n cookieDomain = undefined; // Host-only cookie\n }\n if (cookieDomain) {\n cookieDomain = `.${cookieDomain}`\n }\n\n const session = await getIronSession<Session>(req, res, {\n cookieName: 'sid',\n password: cookieSecret,\n cookieOptions: { // NOTE: the same cookie options are used for cookie deletion also\n domain: cookieDomain,\n path: '/',\n httpOnly: true,\n secure: !isLocalhost && process.env.NODE_ENV === 'production',\n sameSite: 'lax',\n maxAge: 60 * 60 * 24 * 7, // 7 days\n }\n })\n return session;\n}\n\nexport async function setSession(\n req: IncomingMessage,\n res: ServerResponse<IncomingMessage>,\n cookieSecret: string,\n session: any,\n) {\n if (!session) return\n const clientSession = await getSession(req, res, cookieSecret);\n // assert(!clientSession.did, 'session already exists')\n if (session.did) clientSession.did = session.did\n await clientSession.save()\n}\n\n// Helper function to get the Atproto Agent for the active session\nexport async function getSessionAgent(\n req: IncomingMessage,\n res: ServerResponse<IncomingMessage>,\n ctx: AppContext,\n cookieSecret: string,\n): Promise<{ agent?: Agent | null, issuer?: string, error?: string }> {\n const session = await getSession(req, res, cookieSecret);\n if (!session.did) return { agent: null }\n try {\n const oauthSession = await (req as any).ctx.oauthClient!.restore(session.did)\n\n let issuer: OAuthServerAgent['issuer'] | null = oauthSession.server.issuer;\n if (!issuer || issuer !== oauthSession.serverMetadata.issuer) {\n return { error: 'invalid issuer' }\n }\n\n const agent = oauthSession ? new Agent(oauthSession) : null\n return { agent, issuer }\n } catch (err) {\n const error = 'oauth restore failed'\n ctx.logger.warn({ err }, error)\n await session.destroy()\n return { error }\n }\n}\n\nexport async function getSessionUser(\n req: IncomingMessage,\n res: ServerResponse<IncomingMessage>,\n ctx: AppContext,\n cookieSecret: string,\n): Promise<{ user?: UserInfo | null, error?: string }> {\n // If the user is signed in, get an agent which communicates with their server\n const { agent, issuer } = await getSessionAgent(req, res, ctx, cookieSecret);\n\n if (!agent || !issuer) {\n return { user: null }\n }\n\n const issuerTrusted = dataTrusted.trustedIssuers.includes(issuer)\n\n // Fetch user info (current auth session)\n const userSessionPr = agent.com.atproto.server.getSession().catch(() => undefined);\n\n // Fetch additional information about the logged-in user\n const profileResponsePr = agent.com.atproto.repo.getRecord({\n repo: agent.assertDid,\n collection: 'app.bsky.actor.profile',\n rkey: 'self',\n }).catch(() => undefined);\n\n const [userSession, profileResponse] = await Promise.all([userSessionPr, profileResponsePr]);\n\n const profileRecord = profileResponse?.data;\n const userInfo = userSession?.data;\n\n let profile: Profile.Record | null = null\n if (profileRecord && Profile.isRecord(profileRecord.value)) {\n const validateResult = Profile.validateRecord(profileRecord.value)\n if (validateResult.success) {\n profile = profileRecord.value\n } else {\n console.error('[getSessionUser] Error: Unable to validate profileRecord!');\n }\n }\n\n const handle = userInfo?.handle;\n const email = userInfo?.email;\n const emailConfirmed = userInfo?.emailConfirmed;\n\n // TODO: email verification in case of untrusted issuer\n const emailTrusted = issuerTrusted;\n\n if (!handle) {\n const error = 'handle missing'\n ctx.logger.error(error)\n ctx.logger.warn('userSession:', userSession)\n return { error }\n }\n\n if (!email || !emailConfirmed) {\n const error = 'no verified email found'\n ctx.logger.error(error)\n ctx.logger.warn('email:', email, `[${emailConfirmed}]`)\n ctx.logger.warn('user:', { did: agent.assertDid, handle, displayName: profile?.displayName ?? '' })\n return { error }\n }\n\n const profileData: UserInfo = {\n did: agent.assertDid,\n handle,\n email,\n emailTrusted,\n displayName: profile?.displayName ?? '',\n avatar: 'BlobRef{ref,mimeType,size,original}', // profile.avatar\n // profile.createdAt\n // profile.description\n };\n\n return { user: profileData }\n}\n","/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport {\n type LexiconDoc,\n Lexicons,\n ValidationError,\n type ValidationResult,\n} from '@atproto/lexicon'\nimport { type $Typed, is$typed, maybe$typed } from './util.js'\n\nexport const schemaDict = {\n ComAtprotoLabelDefs: {\n lexicon: 1,\n id: 'com.atproto.label.defs',\n defs: {\n label: {\n type: 'object',\n description:\n 'Metadata tag on an atproto resource (eg, repo or record).',\n required: ['src', 'uri', 'val', 'cts'],\n properties: {\n ver: {\n type: 'integer',\n description: 'The AT Protocol version of the label object.',\n },\n src: {\n type: 'string',\n format: 'did',\n description: 'DID of the actor who created this label.',\n },\n uri: {\n type: 'string',\n format: 'uri',\n description:\n 'AT URI of the record, repository (account), or other resource that this label applies to.',\n },\n cid: {\n type: 'string',\n format: 'cid',\n description:\n \"Optionally, CID specifying the specific version of 'uri' resource this label applies to.\",\n },\n val: {\n type: 'string',\n maxLength: 128,\n description:\n 'The short string name of the value or type of this label.',\n },\n neg: {\n type: 'boolean',\n description:\n 'If true, this is a negation label, overwriting a previous label.',\n },\n cts: {\n type: 'string',\n format: 'datetime',\n description: 'Timestamp when this label was created.',\n },\n exp: {\n type: 'string',\n format: 'datetime',\n description:\n 'Timestamp at which this label expires (no longer applies).',\n },\n sig: {\n type: 'bytes',\n description: 'Signature of dag-cbor encoded label.',\n },\n },\n },\n selfLabels: {\n type: 'object',\n description:\n 'Metadata tags on an atproto record, published by the author within the record.',\n required: ['values'],\n properties: {\n values: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#selfLabel',\n },\n maxLength: 10,\n },\n },\n },\n selfLabel: {\n type: 'object',\n description:\n 'Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.',\n required: ['val'],\n properties: {\n val: {\n type: 'string',\n maxLength: 128,\n description:\n 'The short string name of the value or type of this label.',\n },\n },\n },\n labelValueDefinition: {\n type: 'object',\n description:\n 'Declares a label value and its expected interpretations and behaviors.',\n required: ['identifier', 'severity', 'blurs', 'locales'],\n properties: {\n identifier: {\n type: 'string',\n description:\n \"The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).\",\n maxLength: 100,\n maxGraphemes: 100,\n },\n severity: {\n type: 'string',\n description:\n \"How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.\",\n knownValues: ['inform', 'alert', 'none'],\n },\n blurs: {\n type: 'string',\n description:\n \"What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.\",\n knownValues: ['content', 'media', 'none'],\n },\n defaultSetting: {\n type: 'string',\n description: 'The default setting for this label.',\n knownValues: ['ignore', 'warn', 'hide'],\n default: 'warn',\n },\n adultOnly: {\n type: 'boolean',\n description:\n 'Does the user need to have adult content enabled in order to configure this label?',\n },\n locales: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#labelValueDefinitionStrings',\n },\n },\n },\n },\n labelValueDefinitionStrings: {\n type: 'object',\n description:\n 'Strings which describe the label in the UI, localized into a specific language.',\n required: ['lang', 'name', 'description'],\n properties: {\n lang: {\n type: 'string',\n description:\n 'The code of the language these strings are written in.',\n format: 'language',\n },\n name: {\n type: 'string',\n description: 'A short human-readable name for the label.',\n maxGraphemes: 64,\n maxLength: 640,\n },\n description: {\n type: 'string',\n description:\n 'A longer description of what the label means and why it might be applied.',\n maxGraphemes: 10000,\n maxLength: 100000,\n },\n },\n },\n labelValue: {\n type: 'string',\n knownValues: [\n '!hide',\n '!no-promote',\n '!warn',\n '!no-unauthenticated',\n 'dmca-violation',\n 'doxxing',\n 'porn',\n 'sexual',\n 'nudity',\n 'nsfl',\n 'gore',\n ],\n },\n },\n },\n AppBskyActorProfile: {\n lexicon: 1,\n id: 'app.bsky.actor.profile',\n defs: {\n main: {\n type: 'record',\n description: 'A declaration of a Bluesky account profile.',\n key: 'literal:self',\n record: {\n type: 'object',\n properties: {\n displayName: {\n type: 'string',\n maxGraphemes: 64,\n maxLength: 640,\n },\n description: {\n type: 'string',\n description: 'Free-form profile description text.',\n maxGraphemes: 256,\n maxLength: 2560,\n },\n avatar: {\n type: 'blob',\n description:\n \"Small image to be displayed next to posts from account. AKA, 'profile picture'\",\n accept: ['image/png', 'image/jpeg'],\n maxSize: 1000000,\n },\n banner: {\n type: 'blob',\n description:\n 'Larger horizontal image to display behind profile view.',\n accept: ['image/png', 'image/jpeg'],\n maxSize: 1000000,\n },\n labels: {\n type: 'union',\n description:\n 'Self-label values, specific to the Bluesky application, on the overall account.',\n refs: ['lex:com.atproto.label.defs#selfLabels'],\n },\n joinedViaStarterPack: {\n type: 'ref',\n ref: 'lex:com.atproto.repo.strongRef',\n },\n createdAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n },\n },\n },\n ComAtprotoRepoStrongRef: {\n lexicon: 1,\n id: 'com.atproto.repo.strongRef',\n description: 'A URI with a content-hash fingerprint.',\n defs: {\n main: {\n type: 'object',\n required: ['uri', 'cid'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n },\n },\n },\n },\n} as const satisfies Record<string, LexiconDoc>\nexport const schemas = Object.values(schemaDict) satisfies LexiconDoc[]\nexport const lexicons: Lexicons = new Lexicons(schemas)\n\nexport function validate<T extends { $type: string }>(\n v: unknown,\n id: string,\n hash: string,\n requiredType: true,\n): ValidationResult<T>\nexport function validate<T extends { $type?: string }>(\n v: unknown,\n id: string,\n hash: string,\n requiredType?: false,\n): ValidationResult<T>\nexport function validate(\n v: unknown,\n id: string,\n hash: string,\n requiredType?: boolean,\n): ValidationResult {\n return (requiredType ? is$typed : maybe$typed)(v, id, hash)\n ? lexicons.validate(`${id}#${hash}`, v)\n : {\n success: false,\n error: new ValidationError(\n `Must be an object with \"${hash === 'main' ? id : `${id}#${hash}`}\" $type property`,\n ),\n }\n}\n\nexport const ids = {\n ComAtprotoLabelDefs: 'com.atproto.label.defs',\n AppBskyActorProfile: 'app.bsky.actor.profile',\n ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',\n} as const\n","/**\n * GENERATED CODE - DO NOT MODIFY\n */\n\nimport { type ValidationResult } from '@atproto/lexicon'\n\nexport type OmitKey<T, K extends keyof T> = {\n [K2 in keyof T as K2 extends K ? never : K2]: T[K2]\n}\n\nexport type $Typed<V, T extends string = string> = V & { $type: T }\nexport type Un$Typed<V extends { $type?: string }> = OmitKey<V, '$type'>\n\nexport type $Type<Id extends string, Hash extends string> = Hash extends 'main'\n ? Id\n : `${Id}#${Hash}`\n\nfunction isObject<V>(v: V): v is V & object {\n return v != null && typeof v === 'object'\n}\n\nfunction is$type<Id extends string, Hash extends string>(\n $type: unknown,\n id: Id,\n hash: Hash,\n): $type is $Type<Id, Hash> {\n return hash === 'main'\n ? $type === id\n : // $type === `${id}#${hash}`\n typeof $type === 'string' &&\n $type.length === id.length + 1 + hash.length &&\n $type.charCodeAt(id.length) === 35 /* '#' */ &&\n $type.startsWith(id) &&\n $type.endsWith(hash)\n}\n\nexport type $TypedObject<\n V,\n Id extends string,\n Hash extends string,\n> = V extends {\n $type: $Type<Id, Hash>\n}\n ? V\n : V extends { $type?: string }\n ? V extends { $type?: infer T extends $Type<Id, Hash> }\n ? V & { $type: T }\n : never\n : V & { $type: $Type<Id, Hash> }\n\nexport function is$typed<V, Id extends string, Hash extends string>(\n v: V,\n id: Id,\n hash: Hash,\n): v is $TypedObject<V, Id, Hash> {\n return isObject(v) && '$type' in v && is$type(v.$type, id, hash)\n}\n\nexport function maybe$typed<V, Id extends string, Hash extends string>(\n v: V,\n id: Id,\n hash: Hash,\n): v is V & object & { $type?: $Type<Id, Hash> } {\n return (\n isObject(v) &&\n ('$type' in v ? v.$type === undefined || is$type(v.$type, id, hash) : true)\n )\n}\n\nexport type Validator<R = unknown> = (v: unknown) => ValidationResult<R>\nexport type ValidatorParam<V extends Validator> =\n V extends Validator<infer R> ? R : never\n\n/**\n * Utility function that allows to convert a \"validate*\" utility function into a\n * type predicate.\n */\nexport function asPredicate<V extends Validator>(validate: V) {\n return function <T>(v: T): v is T & ValidatorParam<V> {\n return validate(v).success\n }\n}\n","/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'\nimport type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'app.bsky.actor.profile'\n\nexport interface Main {\n $type: 'app.bsky.actor.profile'\n displayName?: string\n /** Free-form profile description text. */\n description?: string\n /** Small image to be displayed next to posts from account. AKA, 'profile picture' */\n avatar?: BlobRef\n /** Larger horizontal image to display behind profile view. */\n banner?: BlobRef\n labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string }\n joinedViaStarterPack?: ComAtprotoRepoStrongRef.Main\n createdAt?: string\n [k: string]: unknown\n}\n\nconst hashMain = 'main'\n\nexport function isMain<V>(v: V) {\n return is$typed(v, id, hashMain)\n}\n\nexport function validateMain<V>(v: V) {\n return validate<Main & V>(v, id, hashMain, true)\n}\n\nexport {\n type Main as Record,\n isMain as isRecord,\n validateMain as validateRecord,\n}\n","{\n \"trustedIssuers\": [\"https://bsky.social\"]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,qBAAoB;AAEpB,IAAAA,4BAAmC;AACnC,IAAAC,iBAAoS;;;ACHpS,4BAAqB;AACrB,oBAMO;AAoCP,IAAM,aAAwC,CAAC;AAE/C,IAAM,oBAAuC;AAAA,EAC3C,MAAM,gBAAgB;AACpB,WAAO;AAAA,EACT;AACF;AAEA,WAAW,KAAK,IAAI;AAAA,EAClB,MAAM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AgB,IAAI,KAA+B,EAAE,IAAI,QAAQ;AACzF,UAAI,qBAAqB,aAAa;AACpC,cAAM,eAAW,0BAAU,aAAa,QAAQ,WAAW;AAC3D,YAAI,UAAU;AACZ,gBAAM,EAAE,eAAe,IAAI,IAAI;AAC/B,gBAAM,WAAW,KAAK,KAAK,QAAQ,cAAc,EAAE,IAAI,CAAC;AACxD,iBAAO,IAAI,SAAS,aAAa;AAAA,QACnC;AAAA,MACF;AAEA,aAAO,IAAI,SAAS,GAAG;AAAA,IACzB,CAAC;AAAA,EACH;AAEA,iBAAe,gBAAgB,QAAgB,aAAiC,KAAc,KAAe,SAAmB;AAC9H,UAAM,EAAE,OAAO,SAAS,IAAI,aAAa,KAAK,OAAO;AAIrD,QAAI,CAAC,cAAc,MAAM,GAAG;AAC1B,UAAI,OAAO,MAAM,mBAAmB,MAAM,EAAE;AAC5C,aAAO,IAAI,KAAK;AAAA,QACd,QAAQ,GAAG,UAAU,EAAE;AAAA,QACvB,OAAO;AAAA,QACP,KAAK,CAAC,EAAE,OAAO,SAAS,CAAC;AAAA,MAC3B,CAAC;AAAA,IACH;AAGA,QAAI;AACF,YAAM,cAAc,QAAQ,aAAa,KAAK,KAAK,SAAS,QAAQ,OAAO;AAAA,IAC7E,SAAS,KAAK;AACZ,UAAI,OAAO,MAAM,EAAE,IAAI,GAAG,wBAAwB;AAClD,aAAO,IAAI,KAAK;AAAA,QACd,OACE,eAAe,+CACX,IAAI,UACJ;AAAA,MACR,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,SAAS,SAAS,KAAe,MAAe;AAC9C,QAAM,UAAU,KAAK,UAAU,MAAM,MAAM,CAAC;AAC5C,SAAO,IAAI,KAAK,MAAM,EAAE,KAAK,OAAO;AACtC;","names":["import_oauth_client_node","import_common","SqliteDb","import_common","isValidHandleSyntax","path","fs","os","crypto","import_common","id","id","is$typed","validate","express","authClientMountPath","searchParams","path","state"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/middleware.ts","../src/db/index.ts","../src/oauth-client.ts","../src/storage.ts","../src/utils/req-utils.ts","../src/utils/utils.ts","../src/const.ts","../src/lock.ts","../src/db/queries.ts","../src/id-resolver.ts","../src/session.ts","../../internal/generated/lexicon/lexicons.ts","../../internal/generated/lexicon/util.ts","../../internal/generated/lexicon/types/app/bsky/actor/defs.ts","../src/data/trusted.json"],"sourcesContent":["import './types/globals.d.ts'\nexport { authMiddleware, redirect, setAuth } from './middleware'\nexport type { AuthMiddlewareConfig, UserInfo, LoginPageProps } from './types/common'\n","import express from 'express'\nimport type { Handler, Request, Response, NextFunction, RequestHandler, Router } from 'express'\nimport { OAuthResolverError } from '@atproto/oauth-client-node'\nimport { authBodyParser, assertOrigin, assertPath, getHostname, getOrigin, isLocalHostname, openState, sealState, packState, unpackState, getMainAuthDomain, getAuthClientMountPath, getMainAuthDomainVariants, getCustomHeaderNames, assertRequestMode, Environment, getMainAuthDomainsList } from '@onelyid/common'\nimport { createDb, migrateToLatest } from './db'\nimport { OAuthClientFactory } from './oauth-client'\nimport { getOrCreateCookieSecret, getOrCreateStateSecret } from './db/queries'\nimport { createBidirectionalResolver, createIdResolver } from './id-resolver'\nimport { getSession, getSessionUser, setSession } from './session'\nimport { assertPublicUrl, getConsoleLogger, getDatabasePath, isValidHandle } from './utils/utils'\nimport { getDocRoutes } from './utils/req-utils'\nimport { AppContext, AuthMiddlewareConfig, InternalGlobals, LoginPageProps, RespGlobals, UserInfo } from './types/common'\nimport { INVALID } from './const'\n\n// Helper function for defining routes\nconst handler =\n (fn: Handler) =>\n async (\n req: Request,\n res: Response,\n next: NextFunction\n ) => {\n try {\n await fn(req, res, next)\n } catch (err) {\n next(err)\n }\n }\n\n// NOTE: Only use `iGlobals` where the usage is not direcly via `authMiddleware` setup\n// E.g. `setAuth` and `redirect` middlewares\nconst iGlobals: InternalGlobals = {\n ctx: null,\n globals: null,\n};\n\nexport const authMiddleware = (config?: AuthMiddlewareConfig): RequestHandler => {\n const router = express.Router()\n\n router.use(authBodyParser)\n\n const globals: RespGlobals = {\n // initialized on mount\n cookieSecret: '',\n stateSecret: '',\n mountPath: '',\n publicUrl: '',\n };\n\n const authClientMountPath = getAuthClientMountPath()\n\n globals.cookieSecret = config?.cookieSecret ?? '';\n globals.stateSecret = config?.stateSecret ?? '';\n globals.mountPath = assertPath(authClientMountPath);\n globals.publicUrl = assertPublicUrl(config?.publicUrl);\n\n let initError: unknown = null\n const ctx: AppContext = {\n logger: config?.logger ?? getConsoleLogger(),\n db: null,\n resolver: null,\n oauthClientFactory: null,\n };\n\n iGlobals.ctx = ctx;\n iGlobals.globals = globals;\n\n // kick off async initialization immediately\n ;(async () => {\n try {\n const dbPath = config?.dbPath || getDatabasePath()\n ctx.db = createDb(dbPath)\n await migrateToLatest(ctx.db)\n\n if (!globals.cookieSecret) {\n globals.cookieSecret = await getOrCreateCookieSecret(ctx.db)\n }\n if (!globals.stateSecret) {\n globals.stateSecret = await getOrCreateStateSecret(ctx.db)\n }\n\n const baseIdResolver = createIdResolver()\n ctx.resolver = createBidirectionalResolver(baseIdResolver)\n\n ctx.oauthClientFactory = new OAuthClientFactory()\n\n registerRoutes(router, ctx, globals, config)\n } catch (err) {\n initError = err\n }\n })()\n\n // gate middleware\n router.use(async (req, res, next) => {\n if (initError) {\n return next(initError)\n }\n if (!ctx.db || !globals.cookieSecret || !globals.stateSecret || !ctx.resolver || !ctx.oauthClientFactory) {\n return res.status(503).send('Service initializing')\n }\n if (globals.publicUrl === INVALID) {\n return res.status(503).send('Invalid publicUrl provided! Valid example: https://example.com')\n }\n if (req.baseUrl) {\n const message = `authMiddleware() must be mounted at root, not at \\`${req.baseUrl}\\``\n throw new Error(message);\n }\n\n req.ctx = {\n oauthClient: await ctx.oauthClientFactory.create(req, ctx, globals)\n };\n\n const modeConfigured = assertRequestMode(config?.mode)\n const modeInferred = getRequestMode(req, globals)\n if (modeConfigured && modeInferred && modeConfigured !== modeInferred) {\n const message = `Environment (request mode) mismatch! ${modeConfigured} ${modeInferred}`\n const acceptsJSON = req.accepts(['json', 'html']) === 'json'\n\n res.status(500)\n if (acceptsJSON) {\n res.json({ error: message })\n } else {\n res.send(message)\n }\n return\n }\n\n const requestMode = modeConfigured || modeInferred\n if (requestMode) {\n req.mode = requestMode\n } else if (req.path !== `${globals.mountPath}/callback`) {\n // NOTE: The (OAuth) callback route finalises `req.mode` separately\n req.mode = Environment.Prod // finalise `req.mode`\n }\n\n req.authFlow = () => initAuthFlow(req, res);\n req.getAuth = () => setReqAuth(req, res);\n\n res.clearAuth = () => deleteSession(req, res, globals);\n\n // custom json response\n res.json = (data: unknown) => sendJson(res, data)\n\n next()\n })\n\n return router\n}\n\nasync function initAuthFlow(req: Request, res: Response): Promise<LoginPageProps | void> {\n const searchParams = new URLSearchParams(req.query as Record<string, string>)\n let redirectUrl = searchParams.get('continue') || '/'\n if (await req.getAuth()) {\n return res.redirect(redirectUrl)\n }\n\n const { isMainAuthDomain, isMainAuthDomainVariant } = getMainAuthDomainVariants(req)\n if (!isMainAuthDomain) {\n if (!isMainAuthDomainVariant) {\n const authClientMountPath = getAuthClientMountPath()\n\n const searchParams = new URLSearchParams()\n searchParams.set('continue', redirectUrl)\n if (req.mode) {\n searchParams.set('request_mode', req.mode)\n }\n\n return res.redirect(`${authClientMountPath}/login/redirect?${searchParams.toString()}`)\n } else {\n return res.redirect(redirectUrl)\n }\n }\n\n let authOrigin = ''\n\n const state = searchParams.get('state') ?? ''\n if (state) {\n const stateObj = unpackState(state)\n redirectUrl = stateObj.redirectUrl || redirectUrl\n authOrigin = stateObj.authOrigin\n }\n\n const authClientMountPath = getAuthClientMountPath()\n const authActioUrl = `${authOrigin || ''}${authClientMountPath}/login`;\n\n const loginProps: LoginPageProps = { redirectUrl, authActioUrl }\n if (req.mode) {\n loginProps.requestMode = req.mode\n }\n return loginProps\n}\n\nasync function initOAuthFlow(handle: string, redirectUrl: string | undefined, req: Request, res: Response, globals: RespGlobals, config: AuthMiddlewareConfig | undefined, devMode?: boolean) {\n let loginRedirect = redirectUrl || assertPath(config?.loginRedirect);\n if (!loginRedirect) {\n if (devMode) {\n loginRedirect = `${globals.mountPath}/userinfo`\n } else {\n loginRedirect = '/'\n }\n }\n\n let localAuth = ''\n const hostname = getHostname(req)\n if (isLocalHostname(hostname)) {\n localAuth = hostname\n }\n\n const purpose = req.get('Sec-Purpose') ?? req.get('Purpose')\n const parts = purpose?.split(/[;,]/) ?? []\n const isSpeculative = parts.includes('prefetch') || parts.includes('prerender')\n if (isSpeculative) {\n res.send('')\n return\n }\n\n if (!handle) {\n return res.redirect(loginRedirect)\n }\n\n const stateObj: any = { loginRedirect }\n if (req.mode) {\n stateObj.requestMode = req.mode\n }\n if (localAuth) {\n stateObj.localAuth = localAuth\n }\n\n const url = await req.ctx.oauthClient!.authorize(handle, {\n scope: 'atproto transition:email',\n state: JSON.stringify(stateObj),\n })\n return res.redirect(url.toString())\n}\n\nexport const setAuth: RequestHandler = async (req, res, next) => {\n await setReqAuth(req, res)\n next()\n};\n\nexport const redirect: (path: string) => RequestHandler = (redirectPath: string) => (async (req, res, next) => {\n await setReqAuth(req, res)\n if (!req.auth) {\n const path = assertPath(redirectPath ?? '/');\n return res.redirect(path)\n }\n next()\n}) satisfies RequestHandler;\n\nasync function setReqAuth(req: Request, res: Response): Promise<UserInfo | null> {\n if (req.auth) {\n return req.auth\n }\n\n if (iGlobals.ctx && iGlobals.globals?.cookieSecret) {\n const { user, error } = await getSessionUser(req, res, iGlobals.ctx, iGlobals.globals.cookieSecret)\n if (!error && user) {\n req.auth = user\n }\n }\n if (!req.auth) {\n req.auth = null\n }\n return req.auth\n}\n\nasync function deleteSession(req: Request, res: Response, globals: RespGlobals) {\n const session = await getSession(req, res, globals.cookieSecret);\n await session.destroy()\n}\n\nfunction getRequestMode(req: Request, globals: RespGlobals): Environment | undefined {\n let requestMode: Environment | undefined = undefined\n const searchParams = new URLSearchParams(req.query as Record<string, string>)\n\n const customHeaders = getCustomHeaderNames()\n const requestModeValue = req.get(customHeaders.requestMode)\n requestMode = assertRequestMode(requestModeValue)\n\n if (!requestMode) {\n let _requestModeValue = searchParams.get('request_mode')\n if (!_requestModeValue && req.body) {\n _requestModeValue = (req.body.requestMode as string)\n }\n\n if (_requestModeValue) {\n const _requestMode = assertRequestMode(_requestModeValue)\n if (_requestMode) {\n requestMode = _requestMode\n }\n }\n }\n\n if (!requestMode && req.path === '/login') {\n const state = searchParams.get('state')\n if (state) {\n const stateObj = unpackState(state)\n const _requestMode = assertRequestMode(stateObj.requestMode)\n if (_requestMode) {\n requestMode = _requestMode\n }\n }\n }\n\n if (!requestMode && req.path === `${globals.mountPath}/transfer-local-session`) {\n const sealedState = searchParams.get('xstate')\n if (sealedState) {\n const stateObj = openState(sealedState, globals.stateSecret)\n const _requestMode = assertRequestMode(stateObj.requestMode)\n if (_requestMode) {\n requestMode = _requestMode\n }\n }\n }\n\n if (!requestMode) {\n const hostname = getHostname(req)\n for (const [mode, authDomain] of Object.entries(getMainAuthDomainsList())) {\n if (hostname === authDomain) {\n const _requestMode = assertRequestMode(mode)\n requestMode = _requestMode\n }\n }\n }\n\n return requestMode\n}\n\nfunction registerRoutes(router: Router, ctx: AppContext, globals: RespGlobals, config?: AuthMiddlewareConfig) {\n // OAuth metadata\n router.get(\n '/oauth-client-metadata.json',\n handler((req, res) => {\n return res.json(req.ctx.oauthClient!.clientMetadata)\n })\n )\n\n // Middleware root (base)\n router.get(\n `${globals.mountPath ?? '/'}`,\n handler((req, res) => {\n const { login, logout, userinfo } = getDocRoutes(req, globals)\n return res.json({\n info: \"middleware root endpoint\",\n try: [{ login, logout, userinfo }],\n })\n })\n )\n\n // OAuth callback to complete session creation\n router.get(\n `${globals.mountPath}/callback`,\n handler(async (req, res) => {\n let loginRedirect: string | undefined;\n const params = new URLSearchParams(req.originalUrl.split('?')[1])\n try {\n const { session, state } = await req.ctx.oauthClient!.callback(params)\n if (state) {\n const stateObj = JSON.parse(state)\n loginRedirect = stateObj.loginRedirect\n const requestMode = stateObj.requestMode\n\n // finalise `req.mode` for (OAuth) callback route\n if (!req.mode) {\n req.mode = requestMode || Environment.Prod\n }\n\n const customHeaders = getCustomHeaderNames()\n let proxyOrigin = req.get(customHeaders.proxyOrigin)\n proxyOrigin = assertOrigin(proxyOrigin)\n const localAuth = stateObj.localAuth\n const hostname = getHostname(req)\n\n const transferLocalAuth = proxyOrigin && localAuth && isLocalHostname(localAuth) && isLocalHostname(hostname) && localAuth !== hostname\n if (transferLocalAuth) {\n const state: any = { loginRedirect, did: session.did }\n if (req.mode) {\n state.requestMode = req.mode\n }\n const sealedState = sealState(state, globals.stateSecret)\n\n const url = new URL(`${getOrigin(req)}${globals.mountPath}/transfer-local-session`)\n url.hostname = localAuth\n url.searchParams.set('xstate', sealedState)\n\n return res.redirect(url.href)\n } else {\n await setSession(req, res, globals.cookieSecret, { did: session.did })\n }\n }\n } catch (err) {\n ctx.logger.error({ err }, 'oauth callback failed')\n return res.redirect('/?error')\n }\n\n if (!loginRedirect) {\n loginRedirect = '/'\n }\n\n return res.redirect(loginRedirect)\n })\n )\n\n // Login redirect handler\n router.get(\n `${globals.mountPath}/login/redirect`,\n handler(async (req, res) => {\n const searchParams = new URLSearchParams(req.query as Record<string, string>)\n const redirectUrl = searchParams.get('continue') || '/'\n const authOrigin = getOrigin(req)\n\n const stateObj: any = { redirectUrl, authOrigin }\n if (req.mode) {\n stateObj.requestMode = req.mode\n }\n const state = packState(stateObj)\n\n const mainAuthDomain = getMainAuthDomain(req)\n const url = new URL(`https://${mainAuthDomain}/login`)\n url.searchParams.set('state', state);\n return res.redirect(url.href)\n })\n )\n\n // Login handler\n router.route(`${globals.mountPath}/login`)\n .get(handler(async (req, res) => {\n const searchParams = new URLSearchParams(req.query as Record<string, string>)\n const handle = searchParams.get('handle')\n if (handle) {\n await handleLoginFlow(handle, undefined, req, res, true)\n }\n }))\n .post(handler(async (req, res) => {\n const handle = req.body?.handle\n const redirectUrl = req.body?.redirectUrl\n if (handle) {\n await handleLoginFlow(handle, redirectUrl, req, res)\n }\n }))\n\n // Logout handler\n // TODO: Can make it as POST-only later, with an info message for GET\n router.all(\n `${globals.mountPath}/logout`,\n handler(async (req, res) => {\n await deleteSession(req, res, globals)\n\n const acceptsJSON = req.accepts(['json', 'html']) === 'json'\n if (acceptsJSON) {\n return res.json({ ok: true })\n } else {\n return res.redirect('/')\n }\n })\n )\n\n // User info for current session\n router.get(\n `${globals.mountPath}/userinfo`,\n handler(async (req, res) => {\n const { login, logout, userinfo } = getDocRoutes(req, globals)\n const { user, error } = await getSessionUser(req, res, ctx, globals.cookieSecret)\n if (user === null) {\n return res.json({ ok: true, user, info: 'not logged-in', try: [{ login, userinfo }] })\n } else if (!user) {\n return res.json({ ok: true, user: null, error, try: [{ login, userinfo }] })\n }\n return res.json({ ok: true, user, try: [{ logout, userinfo }] })\n })\n )\n\n // Transfer local session (e.g. 127.0.0.1 --> localhost)\n router.get(\n `${globals.mountPath}/transfer-local-session`,\n handler(async (req, res) => {\n const customHeaders = getCustomHeaderNames()\n let proxyOrigin = req.get(customHeaders.proxyOrigin)\n proxyOrigin = assertOrigin(proxyOrigin)\n const hostname = getHostname(req)\n\n const transferLocalAuth = proxyOrigin && isLocalHostname(hostname)\n const sealedState = new URLSearchParams(req.query as Record<string, string>).get('xstate')\n if (transferLocalAuth && sealedState) {\n const stateObj = openState(sealedState, globals.stateSecret)\n if (stateObj) {\n const { loginRedirect, did } = stateObj\n await setSession(req, res, globals.cookieSecret, { did })\n return res.redirect(loginRedirect)\n }\n }\n\n return res.redirect('/')\n })\n )\n\n async function handleLoginFlow(handle: string, redirectUrl: string | undefined, req: Request, res: Response, devMode?: boolean) {\n const { login, userinfo } = getDocRoutes(req, globals)\n // const isPost = req.method === 'POST'\n\n // Validate\n if (!isValidHandle(handle)) {\n ctx.logger.error(`Invalid handle: ${handle}`)\n return res.json({\n handle: `${handle ?? ''}`,\n error: 'Invalid handle',\n try: [{ login, userinfo }],\n })\n }\n\n // Initiate the OAuth flow\n try {\n await initOAuthFlow(handle, redirectUrl, req, res, globals, config, devMode)\n } catch (err) {\n ctx.logger.error({ err }, 'oauth authorize failed')\n return res.json({\n error:\n err instanceof OAuthResolverError\n ? err.message\n : \"couldn't initiate login\",\n })\n }\n }\n}\n\nfunction sendJson(res: Response, data: unknown) {\n const dataStr = JSON.stringify(data, null, 2)\n return res.type('json').send(dataStr)\n}\n","import SqliteDb from 'better-sqlite3'\nimport {\n Kysely,\n Migrator,\n SqliteDialect,\n Migration,\n MigrationProvider,\n} from 'kysely'\n\n// Types\n\nexport type DatabaseSchema = {\n auth_session: AuthSession\n auth_state: AuthState\n app_secrets: AppSecrets\n oauth_lock: OAuthLock\n}\n\nexport type AuthSession = {\n key: string\n session: AuthSessionJson\n}\n\nexport type AuthState = {\n key: string\n state: AuthStateJson\n}\n\nexport type AppSecrets = {\n key: string\n value: string\n}\n\nexport type OAuthLock = {\n key: string\n}\n\ntype AuthStateJson = string\n\ntype AuthSessionJson = string\n\n// Migrations\n\nconst migrations: Record<string, Migration> = {}\n\nconst migrationProvider: MigrationProvider = {\n async getMigrations() {\n return migrations\n },\n}\n\nmigrations['001'] = {\n async up(db: Kysely<unknown>) {\n await db.schema\n .createTable('auth_session')\n .addColumn('key', 'varchar', (col) => col.primaryKey())\n .addColumn('session', 'varchar', (col) => col.notNull())\n .execute()\n await db.schema\n .createTable('auth_state')\n .addColumn('key', 'varchar', (col) => col.primaryKey())\n .addColumn('state', 'varchar', (col) => col.notNull())\n .execute()\n },\n async down(db: Kysely<unknown>) {\n await db.schema.dropTable('auth_state').execute()\n await db.schema.dropTable('auth_session').execute()\n },\n}\n\nmigrations['002'] = {\n async up(db: Kysely<unknown>) {\n await db.schema\n .createTable('app_secrets')\n .addColumn('key', 'varchar', (col) =>\n col.primaryKey()\n )\n .addColumn('value', 'varchar', (col) =>\n col.notNull()\n )\n .execute()\n },\n\n async down(db: Kysely<unknown>) {\n await db.schema.dropTable('app_secrets').execute()\n },\n}\n\nmigrations['003'] = {\n async up(db: Kysely<unknown>) {\n await db.schema\n .createTable('oauth_lock')\n .addColumn('key', 'varchar', (col) => col.primaryKey())\n .execute()\n },\n\n async down(db: Kysely<unknown>) {\n await db.schema.dropTable('oauth_lock').execute()\n },\n}\n\n// APIs\n\nexport const createDb = (location: string): Database => {\n return new Kysely<DatabaseSchema>({\n dialect: new SqliteDialect({\n database: new SqliteDb(location),\n }),\n })\n}\n\nexport const migrateToLatest = async (db: Database) => {\n const migrator = new Migrator({ db, provider: migrationProvider })\n const { error } = await migrator.migrateToLatest()\n if (error) throw error\n}\n\nexport type Database = Kysely<DatabaseSchema>\n","import { NodeOAuthClient, OAuthClient } from '@atproto/oauth-client-node'\nimport type { Request } from 'express'\nimport type { AppContext, RespGlobals } from './types/common'\nimport { SessionStore, StateStore } from './storage'\nimport { getBaseUrls } from './utils/req-utils'\nimport { sqliteRequestLock } from './lock'\n\nconst createClient = async (ctx: AppContext, publicUrl: string, baseUrl: string, basePath: string) => {\n const enc = encodeURIComponent\n return new NodeOAuthClient({\n clientMetadata: {\n client_name: 'ATProto client',\n client_id: publicUrl\n ? `${baseUrl}/oauth-client-metadata.json`\n : `http://localhost?redirect_uri=${enc(`${basePath}/callback`)}&scope=${enc('atproto transition:generic transition:email')}`,\n client_uri: baseUrl,\n redirect_uris: [`${basePath}/callback`],\n scope: 'atproto transition:generic transition:email',\n grant_types: ['authorization_code', 'refresh_token'],\n response_types: ['code'],\n application_type: 'web',\n token_endpoint_auth_method: 'none',\n dpop_bound_access_tokens: true,\n },\n stateStore: new StateStore(ctx.db!),\n sessionStore: new SessionStore(ctx.db!),\n requestLock: sqliteRequestLock(ctx.db!),\n })\n}\n\nexport class OAuthClientFactory {\n private readonly cache = new Map<string, Promise<OAuthClient>>();\n\n create(req: Request, ctx: AppContext, globals: RespGlobals): Promise<OAuthClient> {\n const { publicUrl, baseUrl, basePath } = getBaseUrls(req, globals)\n\n let cached = this.cache.get(baseUrl)\n if (!cached) {\n cached = createClient(ctx, publicUrl, baseUrl, basePath).catch(err => {\n this.cache.delete(baseUrl);\n throw err;\n })\n this.cache.set(baseUrl, cached)\n }\n return cached\n }\n}\n","import type {\n NodeSavedSession,\n NodeSavedSessionStore,\n NodeSavedState,\n NodeSavedStateStore,\n} from '@atproto/oauth-client-node'\nimport type { Database } from './types/common'\n\nexport class StateStore implements NodeSavedStateStore {\n constructor(private db: Database) {}\n async get(key: string): Promise<NodeSavedState | undefined> {\n const result = await this.db.selectFrom('auth_state').selectAll().where('key', '=', key).executeTakeFirst()\n if (!result) return\n return JSON.parse(result.state) as NodeSavedState\n }\n async set(key: string, val: NodeSavedState) {\n const state = JSON.stringify(val)\n await this.db\n .insertInto('auth_state')\n .values({ key, state })\n .onConflict((oc) => oc.doUpdateSet({ state }))\n .execute()\n }\n async del(key: string) {\n await this.db.deleteFrom('auth_state').where('key', '=', key).execute()\n }\n}\n\nexport class SessionStore implements NodeSavedSessionStore {\n constructor(private db: Database) {}\n async get(key: string): Promise<NodeSavedSession | undefined> {\n const result = await this.db.selectFrom('auth_session').selectAll().where('key', '=', key).executeTakeFirst()\n if (!result) return\n return JSON.parse(result.session) as NodeSavedSession\n }\n async set(key: string, val: NodeSavedSession) {\n const session = JSON.stringify(val)\n await this.db\n .insertInto('auth_session')\n .values({ key, session })\n .onConflict((oc) => oc.doUpdateSet({ session }))\n .execute()\n }\n async del(key: string) {\n await this.db.deleteFrom('auth_session').where('key', '=', key).execute()\n }\n}\n","import type { Request } from 'express'\nimport { getOrigin } from '@onelyid/common'\nimport { assertPublicUrl } from './utils';\nimport { RespGlobals } from '../types/common';\nimport { DEMO_HANDLE } from '../const';\n\nexport function getBaseUrls(req: Request, globals: RespGlobals) {\n const origin = getOrigin(req)\n const host = new URL(origin).host\n const publicUrl = globals.publicUrl || assertPublicUrl(origin)\n\n // NOTE: `publicUrl` remains empty string ('') for localhost/127.0.0.1\n let baseUrl: string;\n if (publicUrl) {\n baseUrl = publicUrl\n } else {\n let port = host?.split(':')[1] ?? ''\n if (port === '80') {\n port = ''\n }\n baseUrl = `http://127.0.0.1${port ? `:${port}` : ''}`\n }\n const basePath = `${baseUrl}${globals.mountPath}`\n return { publicUrl, baseUrl, basePath }\n}\n\nexport function getDocRoutes(req: Request, globals: RespGlobals) {\n const demoHandle = DEMO_HANDLE;\n const { basePath } = getBaseUrls(req, globals)\n\n const login = `${basePath}/login?handle=${demoHandle}`;\n const logout = `${basePath}/logout`;\n const userinfo = `${basePath}/userinfo`;\n return { login, logout, userinfo }\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport os from 'node:os'\nimport { isValidHandle as isValidHandleSyntax } from '@atproto/syntax'\nimport { isLocalHostname } from '@onelyid/common'\nimport { Logger } from '../types/common'\nimport { DEFAULT_DBFILE_DIR, DEFAULT_DBFILE_NAME, INVALID } from '../const'\n\nexport function getConsoleLogger(): Logger {\n return {\n info: console.info,\n warn: console.warn,\n error: console.error,\n }\n}\n\n// NOTE: `publicUrl` remains empty string ('') for localhost/127.0.0.1\nexport function assertPublicUrl(url?: string) {\n let publicUrl = url ?? '';\n publicUrl = publicUrl.trim();\n if (!publicUrl) return publicUrl;\n \n publicUrl = publicUrl.toLowerCase()\n if (publicUrl.endsWith('/')) {\n publicUrl = publicUrl.substring(0, publicUrl.length-1)\n }\n if (!publicUrl.startsWith('http://') && !publicUrl.startsWith('https://')) {\n return INVALID\n }\n\n try {\n const urlObj = new URL(publicUrl)\n if (isLocalHostname(urlObj.hostname)) {\n return ''\n } else {\n return publicUrl\n }\n } catch(err) {\n return INVALID\n }\n}\n\nexport function isValidHandle(handle?: string) {\n if (!handle || typeof handle !== 'string') {\n return false\n }\n return isValidHandleSyntax(handle);\n}\n\nfunction getAppPackageName(): string | null {\n let dir = process.cwd()\n\n while (true) {\n const pkgPath = path.join(dir, 'package.json')\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))\n return pkg.name ?? null\n } catch {\n return null\n }\n }\n\n const parent = path.dirname(dir)\n if (parent === dir) break\n dir = parent\n }\n\n return null\n}\n\nexport function getDatabasePath() {\n // local db file\n return DEFAULT_DBFILE_NAME\n\n let dbFile = DEFAULT_DBFILE_NAME;\n const packageName = getAppPackageName()\n if (packageName) {\n dbFile = `${packageName}-${dbFile}`\n }\n dbFile = dbFile.replace(/\\s+/g, '-');\n\n const dir = path.join(os.homedir(), DEFAULT_DBFILE_DIR, 'db')\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n\n const file = path.join(dir, dbFile)\n return file\n}\n","export const INVALID = 'invalid';\nexport const DEFAULT_DBFILE_NAME = 'database.sqlite';\nexport const DEFAULT_DBFILE_DIR = '.onelyid';\nexport const COOKIE_SECRET_KEY = 'cookie_secret';\nexport const STATE_SECRET_KEY = 'state_secret';\nexport const DEMO_HANDLE = 'abraj.dev';\n","import type { RuntimeLock } from '@atproto/oauth-client'\nimport type { Database } from './types/common'\n\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))\n\nexport const sqliteRequestLock =\n (db: Database): RuntimeLock =>\n async <T>(\n name: string,\n fn: () => T | PromiseLike<T>\n ): Promise<T> => {\n // acquire\n while (true) {\n try {\n await db\n .insertInto('oauth_lock')\n .values({ key: name })\n .execute()\n break\n } catch {\n await sleep(50)\n }\n }\n\n try {\n return await fn()\n } finally {\n // release\n await db\n .deleteFrom('oauth_lock')\n .where('key', '=', name)\n .execute()\n }\n }\n","import crypto from 'node:crypto'\nimport type { Database } from './index';\nimport { COOKIE_SECRET_KEY, STATE_SECRET_KEY } from '../const';\n\nexport async function getOrCreateAppSecret(db: Database, keyName: string, bytesLength = 32) {\n const existing = await db\n .selectFrom('app_secrets')\n .select('value')\n .where('key', '=', keyName)\n .executeTakeFirst()\n\n if (existing) {\n return existing.value\n }\n\n // equivalent to `openssl rand -hex 32`\n const secret = crypto.randomBytes(bytesLength).toString('hex')\n\n await db\n .insertInto('app_secrets')\n .values({\n key: keyName,\n value: secret,\n })\n .onConflict((oc) => oc.doNothing())\n .execute()\n\n return secret\n}\n\nexport async function getOrCreateCookieSecret(db: Database) {\n return getOrCreateAppSecret(db, COOKIE_SECRET_KEY)\n}\n\nexport async function getOrCreateStateSecret(db: Database) {\n return getOrCreateAppSecret(db, STATE_SECRET_KEY)\n}\n","import { IdResolver, MemoryCache } from '@atproto/identity'\n\nconst HOUR = 60e3 * 60\nconst DAY = HOUR * 24\n\n\nexport function createIdResolver() {\n return new IdResolver({\n didCache: new MemoryCache(HOUR, DAY),\n })\n}\n\nexport interface BidirectionalResolver {\n resolveDidToHandle(did: string): Promise<string>\n resolveDidsToHandles(dids: string[]): Promise<Record<string, string>>\n}\n\nexport function createBidirectionalResolver(resolver: IdResolver) {\n return {\n async resolveDidToHandle(did: string): Promise<string> {\n const didDoc = await resolver.did.resolveAtprotoData(did)\n const resolvedHandle = await resolver.handle.resolve(didDoc.handle)\n if (resolvedHandle === did) {\n return didDoc.handle\n }\n return did\n },\n\n async resolveDidsToHandles(\n dids: string[]\n ): Promise<Record<string, string>> {\n const didHandleMap: Record<string, string> = {}\n const resolves = await Promise.all(\n dids.map((did) => this.resolveDidToHandle(did).catch((_) => did))\n )\n for (let i = 0; i < dids.length; i++) {\n didHandleMap[dids[i] ?? ''] = resolves[i] ?? ''\n }\n return didHandleMap\n },\n }\n}\n","import type { IncomingMessage, ServerResponse } from 'node:http'\nimport { Agent } from '@atproto/api'\nimport { OAuthServerAgent } from '@atproto/oauth-client-node'\nimport { getIronSession } from 'iron-session'\nimport { getBaseDomain, getHostname, getMainAuthDomain, isLocalHostname } from '@onelyid/common'\nimport { AppContext, UserInfo, Session } from './types/common'\nimport * as Profile from '#/internal/generated/lexicon/types/app/bsky/actor/profile'\nimport * as Actor from '#/internal/generated/lexicon/types/app/bsky/actor/defs'\nimport dataTrusted from './data/trusted.json'\n\nconst errorLogger = (err: any) => {\n console.error(err);\n return undefined; // `void` return type interferes with intellisense\n};\n\nexport async function getSession(\n req: IncomingMessage,\n res: ServerResponse<IncomingMessage>,\n cookieSecret: string,\n) {\n const hostname = getHostname(req as any)\n const isLocalhost = isLocalHostname(hostname)\n const baseDomainObj = getBaseDomain(req)\n const mainAuthDomain = getMainAuthDomain(req)\n\n let cookieDomain = baseDomainObj ? baseDomainObj.baseDomain : undefined\n if (cookieDomain === mainAuthDomain || baseDomainObj?.isLocalhost || !baseDomainObj?.isVerified) {\n cookieDomain = undefined; // Host-only cookie\n }\n if (cookieDomain) {\n cookieDomain = `.${cookieDomain}`\n }\n\n const session = await getIronSession<Session>(req, res, {\n cookieName: 'sid',\n password: cookieSecret,\n cookieOptions: { // NOTE: the same cookie options are used for cookie deletion also\n domain: cookieDomain,\n path: '/',\n httpOnly: true,\n secure: !isLocalhost && process.env.NODE_ENV === 'production',\n sameSite: 'lax',\n maxAge: 60 * 60 * 24 * 7, // 7 days\n }\n })\n return session;\n}\n\nexport async function setSession(\n req: IncomingMessage,\n res: ServerResponse<IncomingMessage>,\n cookieSecret: string,\n session: any,\n) {\n if (!session) return\n const clientSession = await getSession(req, res, cookieSecret);\n // assert(!clientSession.did, 'session already exists')\n if (session.did) clientSession.did = session.did\n await clientSession.save()\n}\n\n// Helper function to get the Atproto Agent for the active session\nexport async function getSessionAgent(\n req: IncomingMessage,\n res: ServerResponse<IncomingMessage>,\n ctx: AppContext,\n cookieSecret: string,\n): Promise<{ agent?: Agent | null, issuer?: string, error?: string }> {\n const session = await getSession(req, res, cookieSecret);\n if (!session.did) return { agent: null }\n try {\n const oauthSession = await (req as any).ctx.oauthClient!.restore(session.did)\n\n let issuer: OAuthServerAgent['issuer'] | null = oauthSession.server.issuer;\n if (!issuer || issuer !== oauthSession.serverMetadata.issuer) {\n return { error: 'invalid issuer' }\n }\n\n const agent = oauthSession ? new Agent(oauthSession) : null\n return { agent, issuer }\n } catch (err) {\n const error = 'oauth restore failed'\n ctx.logger.warn({ err }, error)\n await session.destroy()\n return { error }\n }\n}\n\n// Helper function to get the AppView Agent (defaults to Bluesky AppView)\nexport function getAppViewAgent(appViewUrl?: string) {\n /*\n NOTE `https://public.api.bsky.app` is a more cached (read-only) version of Bluesky AppView\n which is okay for raw cURL requests\n e.g. curl \"https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=abraj.dev\" | jq\n --\n For SDKs, using `https://api.bsky.app` is preferred\n */\n const service = appViewUrl || 'https://api.bsky.app'\n const appViewAgent = new Agent({ service });\n return appViewAgent\n}\n\nexport async function getSessionUser(\n req: IncomingMessage,\n res: ServerResponse<IncomingMessage>,\n ctx: AppContext,\n cookieSecret: string,\n): Promise<{ user?: UserInfo | null, error?: string }> {\n // If the user is signed in, get an agent which communicates with their server\n const { agent, issuer } = await getSessionAgent(req, res, ctx, cookieSecret);\n\n if (!agent || !issuer) {\n return { user: null }\n }\n\n const issuerTrusted = dataTrusted.trustedIssuers.includes(issuer)\n\n // Fetch user info (current auth session)\n const userSessionPr = agent.com.atproto.server.getSession().catch(errorLogger);\n\n // Fetch additional information about the logged-in user\n // const profilePr = getProfileFromPds(agent.assertDid, agent)\n const profilePr = getProfileFromAppView(agent.assertDid)\n\n const [userSession, profile] = await Promise.all([userSessionPr, profilePr]);\n const userInfo = userSession?.data;\n\n const handle = userInfo?.handle;\n const email = userInfo?.email;\n const emailConfirmed = userInfo?.emailConfirmed;\n const displayName = profile?.displayName ?? '';\n\n // TODO: email verification in case of untrusted issuer\n const emailVerified = !!(issuerTrusted && emailConfirmed);\n\n let avatar = ''\n if (profile?.avatar) {\n if (typeof profile.avatar == 'string') {\n // [AppView]\n avatar = profile.avatar\n } else {\n // [PDS]\n // avatar = 'BlobRef{ref,mimeType,size,original}'\n }\n }\n\n if (!handle) {\n const error = 'handle missing'\n ctx.logger.error(error)\n ctx.logger.warn('userSession:', userSession)\n return { error }\n }\n\n if (!email || !emailConfirmed) {\n const error = 'no verified email found'\n ctx.logger.error(error)\n ctx.logger.warn('email:', email, `[${emailConfirmed}]`)\n ctx.logger.warn('user:', { did: agent.assertDid, handle, displayName })\n return { error }\n }\n\n const profileData: UserInfo = {\n did: agent.assertDid,\n handle,\n email,\n emailVerified,\n displayName,\n avatar,\n // profile.createdAt\n // profile.description\n };\n\n return { user: profileData }\n}\n\nasync function getProfileFromPds(did: string, agent: Agent) {\n const profileResponse = await agent.com.atproto.repo.getRecord({\n repo: did,\n collection: 'app.bsky.actor.profile',\n rkey: 'self',\n }).catch(errorLogger);\n const profileRecord = profileResponse?.data;\n\n // Validate profile record\n let profile: Profile.Record | null = null\n if (profileRecord && Profile.isRecord(profileRecord.value)) {\n const validateResult = Profile.validateRecord(profileRecord.value)\n if (validateResult.success) {\n profile = profileRecord.value\n } else {\n console.error('[getSessionUser] Error: Unable to validate profileRecord!');\n }\n }\n\n // // Get raw image bytes and create image file yourself\n // if (profile?.avatar) {\n // const blobResponse = await agent.com.atproto.sync.getBlob({\n // did: agent.assertDid,\n // cid: profile.avatar.ref.toString(),\n // }).catch(errorLogger)\n // if (blobResponse) {\n // const bytes: Uint8Array = blobResponse.data\n // const contentType = blobResponse.headers['content-type']\n // const buffer = Buffer.from(bytes)\n // const ext = contentType === 'image/png'\n // ? 'png'\n // : contentType === 'image/jpeg'\n // ? 'jpg'\n // : 'bin'\n // const fileName = `avatar.${ext}`\n // // import { writeFile } from 'node:fs/promises'\n // await writeFile(fileName, buffer) // can also pass `bytes` directly here\n // }\n // }\n\n return profile\n}\n\nasync function getProfileFromAppView(did: string) {\n const appViewAgent = getAppViewAgent();\n\n const profileResponse = await appViewAgent.app.bsky.actor.getProfile({\n actor: did,\n }).catch(errorLogger);\n const profileRecord = profileResponse?.data;\n\n // Validate profile record\n let profile: Actor.ProfileViewDetailed | null = null\n if (profileRecord) {\n if (!profileRecord.$type) {\n profileRecord.$type = 'app.bsky.actor.defs#profileViewDetailed'\n }\n if (Actor.isProfileViewDetailed(profileRecord)) {\n const validateResult = Actor.validateProfileViewDetailed(profileRecord)\n if (validateResult.success) {\n profile = profileRecord\n } else {\n console.error('[getSessionUser] Error: Unable to validate profileRecord!');\n }\n }\n }\n\n return profile\n}\n\n/*\n# -------\n# OAuthSession:\n{\n server: OAuthServerAgent {\n authMethod: { method: 'none' },\n dpopKey: JoseKey {\n jwk: [Object],\n 'get algorithms': [Getter],\n 'get isSymetric': [Getter],\n 'get bareJwk': [Getter],\n 'get isPrivate': [Getter]\n },\n serverMetadata: {\n issuer: 'https://bsky.social',\n request_parameter_supported: true,\n request_uri_parameter_supported: true,\n require_request_uri_registration: true,\n scopes_supported: [Array],\n subject_types_supported: [Array],\n response_types_supported: [Array],\n response_modes_supported: [Array],\n grant_types_supported: [Array],\n code_challenge_methods_supported: [Array],\n ui_locales_supported: [Array],\n display_values_supported: [Array],\n request_object_signing_alg_values_supported: [Array],\n authorization_response_iss_parameter_supported: true,\n request_object_encryption_alg_values_supported: [],\n request_object_encryption_enc_values_supported: [],\n jwks_uri: 'https://bsky.social/oauth/jwks',\n authorization_endpoint: 'https://bsky.social/oauth/authorize',\n token_endpoint: 'https://bsky.social/oauth/token',\n token_endpoint_auth_methods_supported: [Array],\n token_endpoint_auth_signing_alg_values_supported: [Array],\n revocation_endpoint: 'https://bsky.social/oauth/revoke',\n pushed_authorization_request_endpoint: 'https://bsky.social/oauth/par',\n require_pushed_authorization_requests: true,\n dpop_signing_alg_values_supported: [Array],\n client_id_metadata_document_supported: true,\n prompt_values_supported: [Array]\n },\n clientMetadata: {\n redirect_uris: [Array],\n response_types: [Array],\n grant_types: [Array],\n scope: 'atproto transition:generic transition:email',\n token_endpoint_auth_method: 'none',\n application_type: 'web',\n subject_type: 'public',\n authorization_signed_response_alg: 'RS256',\n client_id: 'http://localhost?redirect_uri=http%3A%2F%2F127.0.0.1%3A5500%2F%40onelyid%2Fclient%2Fcallback&scope=atproto%20transition%3Ageneric%20transition%3Aemail',\n client_name: 'ATProto client',\n client_uri: 'http://127.0.0.1:5500',\n dpop_bound_access_tokens: true\n },\n dpopNonces: SimpleStoreMemory {},\n oauthResolver: OAuthResolver {\n identityResolver: [AtprotoIdentityResolver],\n protectedResourceMetadataResolver: [OAuthProtectedResourceMetadataResolver],\n authorizationServerMetadataResolver: [OAuthAuthorizationServerMetadataResolver]\n },\n runtime: Runtime {\n implementation: [Object],\n hasImplementationLock: true,\n usingLock: [Function: bound ] AsyncFunction\n },\n keyset: undefined,\n dpopFetch: [AsyncFunction (anonymous)],\n clientCredentialsFactory: [Function (anonymous)]\n },\n sub: 'did:plc:4podqwoafivhmszrb7ctl4b7',\n sessionGetter: SessionGetter {\n getter: [AsyncFunction (anonymous)],\n store: {\n set: [AsyncFunction: set],\n get: [AsyncFunction: get],\n del: [Function: bound del] AsyncFunction,\n clear: undefined\n },\n options: {\n isStale: [Function: isStale],\n onStoreError: [AsyncFunction: onStoreError],\n deleteOnError: [AsyncFunction: deleteOnError]\n },\n pending: Map(0) {},\n runtime: Runtime {\n implementation: [Object],\n hasImplementationLock: true,\n usingLock: [Function: bound ] AsyncFunction\n },\n eventTarget: CustomEventTarget { eventTarget: EventTarget }\n },\n dpopFetch: [AsyncFunction (anonymous)]\n}\n# -------\n# userInfo:\n{\n \"handle\": \"abraj.dev\",\n \"did\": \"did:plc:4podqwoafivhmszrb7ctl4b7\",\n \"didDoc\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\",\n \"https://w3id.org/security/multikey/v1\",\n \"https://w3id.org/security/suites/secp256k1-2019/v1\"\n ],\n \"id\": \"did:plc:4podqwoafivhmszrb7ctl4b7\",\n \"alsoKnownAs\": [\n \"at://abraj.dev\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:plc:4podqwoafivhmszrb7ctl4b7#atproto\",\n \"type\": \"Multikey\",\n \"controller\": \"did:plc:4podqwoafivhmszrb7ctl4b7\",\n \"publicKeyMultibase\": \"zQ3shhSr24qyq5YSitSWCYuN1To7aPAPm5fAj2sun7h9ct6gd\"\n }\n ],\n \"service\": [\n {\n \"id\": \"#atproto_pds\",\n \"type\": \"AtprotoPersonalDataServer\",\n \"serviceEndpoint\": \"https://blewit.us-west.host.bsky.network\"\n }\n ]\n },\n \"email\": \"abhi@raj.me\",\n \"emailConfirmed\": true,\n \"emailAuthFactor\": true,\n \"active\": true\n}\n# -------\n# profile: [PDS]\n{\n \"$type\": \"app.bsky.actor.profile\",\n \"avatar\": BlobRef {\n \"$type\": \"blob\",\n \"ref\": CID {\n \"$link\": \"bafkreielylpnwizly4ey7wase2m7igmntlkt2bfp5erj76kppalnfmhcfe\"\n },\n \"mimeType\": \"image/jpeg\",\n \"size\": 23192,\n \"original\": {\n '$type': 'blob',\n ref: CID(bafkreielylpnwizly4ey7wase2m7igmntlkt2bfp5erj76kppalnfmhcfe),\n mimeType: 'image/jpeg',\n size: 23192\n }\n },\n \"createdAt\": \"2024-09-08T21:05:38.291Z\",\n \"description\": \"\",\n \"displayName\": \"abraj\"\n}\n# -------\n# profile: [AppView]\n{\n did: 'did:plc:4podqwoafivhmszrb7ctl4b7',\n handle: 'abraj.dev',\n displayName: 'abraj',\n avatar: 'https://cdn.bsky.app/img/avatar/plain/did:plc:4podqwoafivhmszrb7ctl4b7/bafkreielylpnwizly4ey7wase2m7igmntlkt2bfp5erj76kppalnfmhcfe@jpeg',\n associated: {\n lists: 0,\n feedgens: 0,\n starterPacks: 0,\n labeler: false,\n activitySubscription: { allowSubscriptions: 'followers' }\n },\n labels: [],\n createdAt: '2024-09-08T21:05:40.027Z',\n indexedAt: '2024-12-25T13:40:05.043Z',\n followersCount: 22,\n followsCount: 20,\n postsCount: 0\n}\n# -------\n*/\n","/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport {\n type LexiconDoc,\n Lexicons,\n ValidationError,\n type ValidationResult,\n} from '@atproto/lexicon'\nimport { type $Typed, is$typed, maybe$typed } from './util.js'\n\nexport const schemaDict = {\n AppBskyActorDefs: {\n lexicon: 1,\n id: 'app.bsky.actor.defs',\n defs: {\n profileViewBasic: {\n type: 'object',\n required: ['did', 'handle'],\n properties: {\n did: {\n type: 'string',\n format: 'did',\n },\n handle: {\n type: 'string',\n format: 'handle',\n },\n displayName: {\n type: 'string',\n maxGraphemes: 64,\n maxLength: 640,\n },\n pronouns: {\n type: 'string',\n },\n avatar: {\n type: 'string',\n format: 'uri',\n },\n associated: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileAssociated',\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#viewerState',\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n createdAt: {\n type: 'string',\n format: 'datetime',\n },\n verification: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#verificationState',\n },\n status: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#statusView',\n },\n debug: {\n type: 'unknown',\n description: 'Debug information for internal development',\n },\n },\n },\n profileView: {\n type: 'object',\n required: ['did', 'handle'],\n properties: {\n did: {\n type: 'string',\n format: 'did',\n },\n handle: {\n type: 'string',\n format: 'handle',\n },\n displayName: {\n type: 'string',\n maxGraphemes: 64,\n maxLength: 640,\n },\n pronouns: {\n type: 'string',\n },\n description: {\n type: 'string',\n maxGraphemes: 256,\n maxLength: 2560,\n },\n avatar: {\n type: 'string',\n format: 'uri',\n },\n associated: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileAssociated',\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n createdAt: {\n type: 'string',\n format: 'datetime',\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#viewerState',\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n verification: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#verificationState',\n },\n status: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#statusView',\n },\n debug: {\n type: 'unknown',\n description: 'Debug information for internal development',\n },\n },\n },\n profileViewDetailed: {\n type: 'object',\n required: ['did', 'handle'],\n properties: {\n did: {\n type: 'string',\n format: 'did',\n },\n handle: {\n type: 'string',\n format: 'handle',\n },\n displayName: {\n type: 'string',\n maxGraphemes: 64,\n maxLength: 640,\n },\n description: {\n type: 'string',\n maxGraphemes: 256,\n maxLength: 2560,\n },\n pronouns: {\n type: 'string',\n },\n website: {\n type: 'string',\n format: 'uri',\n },\n avatar: {\n type: 'string',\n format: 'uri',\n },\n banner: {\n type: 'string',\n format: 'uri',\n },\n followersCount: {\n type: 'integer',\n },\n followsCount: {\n type: 'integer',\n },\n postsCount: {\n type: 'integer',\n },\n associated: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileAssociated',\n },\n joinedViaStarterPack: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#starterPackViewBasic',\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n createdAt: {\n type: 'string',\n format: 'datetime',\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#viewerState',\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n pinnedPost: {\n type: 'ref',\n ref: 'lex:com.atproto.repo.strongRef',\n },\n verification: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#verificationState',\n },\n status: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#statusView',\n },\n debug: {\n type: 'unknown',\n description: 'Debug information for internal development',\n },\n },\n },\n profileAssociated: {\n type: 'object',\n properties: {\n lists: {\n type: 'integer',\n },\n feedgens: {\n type: 'integer',\n },\n starterPacks: {\n type: 'integer',\n },\n labeler: {\n type: 'boolean',\n },\n chat: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileAssociatedChat',\n },\n activitySubscription: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileAssociatedActivitySubscription',\n },\n germ: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileAssociatedGerm',\n },\n },\n },\n profileAssociatedChat: {\n type: 'object',\n required: ['allowIncoming'],\n properties: {\n allowIncoming: {\n type: 'string',\n knownValues: ['all', 'none', 'following'],\n },\n },\n },\n profileAssociatedGerm: {\n type: 'object',\n required: ['showButtonTo', 'messageMeUrl'],\n properties: {\n messageMeUrl: {\n type: 'string',\n format: 'uri',\n },\n showButtonTo: {\n type: 'string',\n knownValues: ['usersIFollow', 'everyone'],\n },\n },\n },\n profileAssociatedActivitySubscription: {\n type: 'object',\n required: ['allowSubscriptions'],\n properties: {\n allowSubscriptions: {\n type: 'string',\n knownValues: ['followers', 'mutuals', 'none'],\n },\n },\n },\n viewerState: {\n type: 'object',\n description:\n \"Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.\",\n properties: {\n muted: {\n type: 'boolean',\n },\n mutedByList: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listViewBasic',\n },\n blockedBy: {\n type: 'boolean',\n },\n blocking: {\n type: 'string',\n format: 'at-uri',\n },\n blockingByList: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listViewBasic',\n },\n following: {\n type: 'string',\n format: 'at-uri',\n },\n followedBy: {\n type: 'string',\n format: 'at-uri',\n },\n knownFollowers: {\n description:\n 'This property is present only in selected cases, as an optimization.',\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#knownFollowers',\n },\n activitySubscription: {\n description:\n 'This property is present only in selected cases, as an optimization.',\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#activitySubscription',\n },\n },\n },\n knownFollowers: {\n type: 'object',\n description: \"The subject's followers whom you also follow\",\n required: ['count', 'followers'],\n properties: {\n count: {\n type: 'integer',\n },\n followers: {\n type: 'array',\n minLength: 0,\n maxLength: 5,\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileViewBasic',\n },\n },\n },\n },\n verificationState: {\n type: 'object',\n description:\n 'Represents the verification information about the user this object is attached to.',\n required: ['verifications', 'verifiedStatus', 'trustedVerifierStatus'],\n properties: {\n verifications: {\n type: 'array',\n description:\n 'All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#verificationView',\n },\n },\n verifiedStatus: {\n type: 'string',\n description: \"The user's status as a verified account.\",\n knownValues: ['valid', 'invalid', 'none'],\n },\n trustedVerifierStatus: {\n type: 'string',\n description: \"The user's status as a trusted verifier.\",\n knownValues: ['valid', 'invalid', 'none'],\n },\n },\n },\n verificationView: {\n type: 'object',\n description: 'An individual verification for an associated subject.',\n required: ['issuer', 'uri', 'isValid', 'createdAt'],\n properties: {\n issuer: {\n type: 'string',\n description: 'The user who issued this verification.',\n format: 'did',\n },\n uri: {\n type: 'string',\n description: 'The AT-URI of the verification record.',\n format: 'at-uri',\n },\n isValid: {\n type: 'boolean',\n description:\n 'True if the verification passes validation, otherwise false.',\n },\n createdAt: {\n type: 'string',\n description: 'Timestamp when the verification was created.',\n format: 'datetime',\n },\n },\n },\n preferences: {\n type: 'array',\n items: {\n type: 'union',\n refs: [\n 'lex:app.bsky.actor.defs#adultContentPref',\n 'lex:app.bsky.actor.defs#contentLabelPref',\n 'lex:app.bsky.actor.defs#savedFeedsPref',\n 'lex:app.bsky.actor.defs#savedFeedsPrefV2',\n 'lex:app.bsky.actor.defs#personalDetailsPref',\n 'lex:app.bsky.actor.defs#declaredAgePref',\n 'lex:app.bsky.actor.defs#feedViewPref',\n 'lex:app.bsky.actor.defs#threadViewPref',\n 'lex:app.bsky.actor.defs#interestsPref',\n 'lex:app.bsky.actor.defs#mutedWordsPref',\n 'lex:app.bsky.actor.defs#hiddenPostsPref',\n 'lex:app.bsky.actor.defs#bskyAppStatePref',\n 'lex:app.bsky.actor.defs#labelersPref',\n 'lex:app.bsky.actor.defs#postInteractionSettingsPref',\n 'lex:app.bsky.actor.defs#verificationPrefs',\n 'lex:app.bsky.actor.defs#liveEventPreferences',\n ],\n },\n },\n adultContentPref: {\n type: 'object',\n required: ['enabled'],\n properties: {\n enabled: {\n type: 'boolean',\n default: false,\n },\n },\n },\n contentLabelPref: {\n type: 'object',\n required: ['label', 'visibility'],\n properties: {\n labelerDid: {\n type: 'string',\n description:\n 'Which labeler does this preference apply to? If undefined, applies globally.',\n format: 'did',\n },\n label: {\n type: 'string',\n },\n visibility: {\n type: 'string',\n knownValues: ['ignore', 'show', 'warn', 'hide'],\n },\n },\n },\n savedFeed: {\n type: 'object',\n required: ['id', 'type', 'value', 'pinned'],\n properties: {\n id: {\n type: 'string',\n },\n type: {\n type: 'string',\n knownValues: ['feed', 'list', 'timeline'],\n },\n value: {\n type: 'string',\n },\n pinned: {\n type: 'boolean',\n },\n },\n },\n savedFeedsPrefV2: {\n type: 'object',\n required: ['items'],\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#savedFeed',\n },\n },\n },\n },\n savedFeedsPref: {\n type: 'object',\n required: ['pinned', 'saved'],\n properties: {\n pinned: {\n type: 'array',\n items: {\n type: 'string',\n format: 'at-uri',\n },\n },\n saved: {\n type: 'array',\n items: {\n type: 'string',\n format: 'at-uri',\n },\n },\n timelineIndex: {\n type: 'integer',\n },\n },\n },\n personalDetailsPref: {\n type: 'object',\n properties: {\n birthDate: {\n type: 'string',\n format: 'datetime',\n description: 'The birth date of account owner.',\n },\n },\n },\n declaredAgePref: {\n type: 'object',\n description:\n \"Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration.\",\n properties: {\n isOverAge13: {\n type: 'boolean',\n description:\n 'Indicates if the user has declared that they are over 13 years of age.',\n },\n isOverAge16: {\n type: 'boolean',\n description:\n 'Indicates if the user has declared that they are over 16 years of age.',\n },\n isOverAge18: {\n type: 'boolean',\n description:\n 'Indicates if the user has declared that they are over 18 years of age.',\n },\n },\n },\n feedViewPref: {\n type: 'object',\n required: ['feed'],\n properties: {\n feed: {\n type: 'string',\n description:\n 'The URI of the feed, or an identifier which describes the feed.',\n },\n hideReplies: {\n type: 'boolean',\n description: 'Hide replies in the feed.',\n },\n hideRepliesByUnfollowed: {\n type: 'boolean',\n description:\n 'Hide replies in the feed if they are not by followed users.',\n default: true,\n },\n hideRepliesByLikeCount: {\n type: 'integer',\n description:\n 'Hide replies in the feed if they do not have this number of likes.',\n },\n hideReposts: {\n type: 'boolean',\n description: 'Hide reposts in the feed.',\n },\n hideQuotePosts: {\n type: 'boolean',\n description: 'Hide quote posts in the feed.',\n },\n },\n },\n threadViewPref: {\n type: 'object',\n properties: {\n sort: {\n type: 'string',\n description: 'Sorting mode for threads.',\n knownValues: [\n 'oldest',\n 'newest',\n 'most-likes',\n 'random',\n 'hotness',\n ],\n },\n },\n },\n interestsPref: {\n type: 'object',\n required: ['tags'],\n properties: {\n tags: {\n type: 'array',\n maxLength: 100,\n items: {\n type: 'string',\n maxLength: 640,\n maxGraphemes: 64,\n },\n description:\n \"A list of tags which describe the account owner's interests gathered during onboarding.\",\n },\n },\n },\n mutedWordTarget: {\n type: 'string',\n knownValues: ['content', 'tag'],\n maxLength: 640,\n maxGraphemes: 64,\n },\n mutedWord: {\n type: 'object',\n description: 'A word that the account owner has muted.',\n required: ['value', 'targets'],\n properties: {\n id: {\n type: 'string',\n },\n value: {\n type: 'string',\n description: 'The muted word itself.',\n maxLength: 10000,\n maxGraphemes: 1000,\n },\n targets: {\n type: 'array',\n description: 'The intended targets of the muted word.',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#mutedWordTarget',\n },\n },\n actorTarget: {\n type: 'string',\n description:\n 'Groups of users to apply the muted word to. If undefined, applies to all users.',\n knownValues: ['all', 'exclude-following'],\n default: 'all',\n },\n expiresAt: {\n type: 'string',\n format: 'datetime',\n description:\n 'The date and time at which the muted word will expire and no longer be applied.',\n },\n },\n },\n mutedWordsPref: {\n type: 'object',\n required: ['items'],\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#mutedWord',\n },\n description: 'A list of words the account owner has muted.',\n },\n },\n },\n hiddenPostsPref: {\n type: 'object',\n required: ['items'],\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'string',\n format: 'at-uri',\n },\n description:\n 'A list of URIs of posts the account owner has hidden.',\n },\n },\n },\n labelersPref: {\n type: 'object',\n required: ['labelers'],\n properties: {\n labelers: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#labelerPrefItem',\n },\n },\n },\n },\n labelerPrefItem: {\n type: 'object',\n required: ['did'],\n properties: {\n did: {\n type: 'string',\n format: 'did',\n },\n },\n },\n bskyAppStatePref: {\n description:\n \"A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.\",\n type: 'object',\n properties: {\n activeProgressGuide: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#bskyAppProgressGuide',\n },\n queuedNudges: {\n description:\n 'An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.',\n type: 'array',\n maxLength: 1000,\n items: {\n type: 'string',\n maxLength: 100,\n },\n },\n nuxs: {\n description: 'Storage for NUXs the user has encountered.',\n type: 'array',\n maxLength: 100,\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#nux',\n },\n },\n },\n },\n bskyAppProgressGuide: {\n description:\n 'If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.',\n type: 'object',\n required: ['guide'],\n properties: {\n guide: {\n type: 'string',\n maxLength: 100,\n },\n },\n },\n nux: {\n type: 'object',\n description: 'A new user experiences (NUX) storage object',\n required: ['id', 'completed'],\n properties: {\n id: {\n type: 'string',\n maxLength: 100,\n },\n completed: {\n type: 'boolean',\n default: false,\n },\n data: {\n description:\n 'Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.',\n type: 'string',\n maxLength: 3000,\n maxGraphemes: 300,\n },\n expiresAt: {\n type: 'string',\n format: 'datetime',\n description:\n 'The date and time at which the NUX will expire and should be considered completed.',\n },\n },\n },\n verificationPrefs: {\n type: 'object',\n description: 'Preferences for how verified accounts appear in the app.',\n required: [],\n properties: {\n hideBadges: {\n description:\n 'Hide the blue check badges for verified accounts and trusted verifiers.',\n type: 'boolean',\n default: false,\n },\n },\n },\n liveEventPreferences: {\n type: 'object',\n description: 'Preferences for live events.',\n properties: {\n hiddenFeedIds: {\n description:\n 'A list of feed IDs that the user has hidden from live events.',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n hideAllFeeds: {\n description: 'Whether to hide all feeds from live events.',\n type: 'boolean',\n default: false,\n },\n },\n },\n postInteractionSettingsPref: {\n type: 'object',\n description:\n 'Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.',\n required: [],\n properties: {\n threadgateAllowRules: {\n description:\n 'Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.',\n type: 'array',\n maxLength: 5,\n items: {\n type: 'union',\n refs: [\n 'lex:app.bsky.feed.threadgate#mentionRule',\n 'lex:app.bsky.feed.threadgate#followerRule',\n 'lex:app.bsky.feed.threadgate#followingRule',\n 'lex:app.bsky.feed.threadgate#listRule',\n ],\n },\n },\n postgateEmbeddingRules: {\n description:\n 'Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.',\n type: 'array',\n maxLength: 5,\n items: {\n type: 'union',\n refs: ['lex:app.bsky.feed.postgate#disableRule'],\n },\n },\n },\n },\n statusView: {\n type: 'object',\n required: ['status', 'record'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n status: {\n type: 'string',\n description: 'The status for the account.',\n knownValues: ['app.bsky.actor.status#live'],\n },\n record: {\n type: 'unknown',\n },\n embed: {\n type: 'union',\n description: 'An optional embed associated with the status.',\n refs: ['lex:app.bsky.embed.external#view'],\n },\n expiresAt: {\n type: 'string',\n description:\n 'The date when this status will expire. The application might choose to no longer return the status after expiration.',\n format: 'datetime',\n },\n isActive: {\n type: 'boolean',\n description:\n 'True if the status is not expired, false if it is expired. Only present if expiration was set.',\n },\n isDisabled: {\n type: 'boolean',\n description:\n \"True if the user's go-live access has been disabled by a moderator, false otherwise.\",\n },\n },\n },\n },\n },\n AppBskyActorProfile: {\n lexicon: 1,\n id: 'app.bsky.actor.profile',\n defs: {\n main: {\n type: 'record',\n description: 'A declaration of a Bluesky account profile.',\n key: 'literal:self',\n record: {\n type: 'object',\n properties: {\n displayName: {\n type: 'string',\n maxGraphemes: 64,\n maxLength: 640,\n },\n description: {\n type: 'string',\n description: 'Free-form profile description text.',\n maxGraphemes: 256,\n maxLength: 2560,\n },\n avatar: {\n type: 'blob',\n description:\n \"Small image to be displayed next to posts from account. AKA, 'profile picture'\",\n accept: ['image/png', 'image/jpeg'],\n maxSize: 1000000,\n },\n banner: {\n type: 'blob',\n description:\n 'Larger horizontal image to display behind profile view.',\n accept: ['image/png', 'image/jpeg'],\n maxSize: 1000000,\n },\n labels: {\n type: 'union',\n description:\n 'Self-label values, specific to the Bluesky application, on the overall account.',\n refs: ['lex:com.atproto.label.defs#selfLabels'],\n },\n joinedViaStarterPack: {\n type: 'ref',\n ref: 'lex:com.atproto.repo.strongRef',\n },\n createdAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n },\n },\n },\n AppBskyEmbedDefs: {\n lexicon: 1,\n id: 'app.bsky.embed.defs',\n defs: {\n aspectRatio: {\n type: 'object',\n description:\n 'width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.',\n required: ['width', 'height'],\n properties: {\n width: {\n type: 'integer',\n minimum: 1,\n },\n height: {\n type: 'integer',\n minimum: 1,\n },\n },\n },\n },\n },\n AppBskyEmbedExternal: {\n lexicon: 1,\n id: 'app.bsky.embed.external',\n defs: {\n main: {\n type: 'object',\n description:\n \"A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).\",\n required: ['external'],\n properties: {\n external: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.external#external',\n },\n },\n },\n external: {\n type: 'object',\n required: ['uri', 'title', 'description'],\n properties: {\n uri: {\n type: 'string',\n format: 'uri',\n },\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n thumb: {\n type: 'blob',\n accept: ['image/*'],\n maxSize: 1000000,\n },\n },\n },\n view: {\n type: 'object',\n required: ['external'],\n properties: {\n external: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.external#viewExternal',\n },\n },\n },\n viewExternal: {\n type: 'object',\n required: ['uri', 'title', 'description'],\n properties: {\n uri: {\n type: 'string',\n format: 'uri',\n },\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n thumb: {\n type: 'string',\n format: 'uri',\n },\n },\n },\n },\n },\n AppBskyEmbedImages: {\n lexicon: 1,\n id: 'app.bsky.embed.images',\n description: 'A set of images embedded in a Bluesky record (eg, a post).',\n defs: {\n main: {\n type: 'object',\n required: ['images'],\n properties: {\n images: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.images#image',\n },\n maxLength: 4,\n },\n },\n },\n image: {\n type: 'object',\n required: ['image', 'alt'],\n properties: {\n image: {\n type: 'blob',\n accept: ['image/*'],\n maxSize: 1000000,\n },\n alt: {\n type: 'string',\n description:\n 'Alt text description of the image, for accessibility.',\n },\n aspectRatio: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.defs#aspectRatio',\n },\n },\n },\n view: {\n type: 'object',\n required: ['images'],\n properties: {\n images: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.images#viewImage',\n },\n maxLength: 4,\n },\n },\n },\n viewImage: {\n type: 'object',\n required: ['thumb', 'fullsize', 'alt'],\n properties: {\n thumb: {\n type: 'string',\n format: 'uri',\n description:\n 'Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.',\n },\n fullsize: {\n type: 'string',\n format: 'uri',\n description:\n 'Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.',\n },\n alt: {\n type: 'string',\n description:\n 'Alt text description of the image, for accessibility.',\n },\n aspectRatio: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.defs#aspectRatio',\n },\n },\n },\n },\n },\n AppBskyEmbedRecord: {\n lexicon: 1,\n id: 'app.bsky.embed.record',\n description:\n 'A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.',\n defs: {\n main: {\n type: 'object',\n required: ['record'],\n properties: {\n record: {\n type: 'ref',\n ref: 'lex:com.atproto.repo.strongRef',\n },\n },\n },\n view: {\n type: 'object',\n required: ['record'],\n properties: {\n record: {\n type: 'union',\n refs: [\n 'lex:app.bsky.embed.record#viewRecord',\n 'lex:app.bsky.embed.record#viewNotFound',\n 'lex:app.bsky.embed.record#viewBlocked',\n 'lex:app.bsky.embed.record#viewDetached',\n 'lex:app.bsky.feed.defs#generatorView',\n 'lex:app.bsky.graph.defs#listView',\n 'lex:app.bsky.labeler.defs#labelerView',\n 'lex:app.bsky.graph.defs#starterPackViewBasic',\n ],\n },\n },\n },\n viewRecord: {\n type: 'object',\n required: ['uri', 'cid', 'author', 'value', 'indexedAt'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n author: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileViewBasic',\n },\n value: {\n type: 'unknown',\n description: 'The record data itself.',\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n replyCount: {\n type: 'integer',\n },\n repostCount: {\n type: 'integer',\n },\n likeCount: {\n type: 'integer',\n },\n quoteCount: {\n type: 'integer',\n },\n embeds: {\n type: 'array',\n items: {\n type: 'union',\n refs: [\n 'lex:app.bsky.embed.images#view',\n 'lex:app.bsky.embed.video#view',\n 'lex:app.bsky.embed.external#view',\n 'lex:app.bsky.embed.record#view',\n 'lex:app.bsky.embed.recordWithMedia#view',\n ],\n },\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n viewNotFound: {\n type: 'object',\n required: ['uri', 'notFound'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n notFound: {\n type: 'boolean',\n const: true,\n },\n },\n },\n viewBlocked: {\n type: 'object',\n required: ['uri', 'blocked', 'author'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n blocked: {\n type: 'boolean',\n const: true,\n },\n author: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#blockedAuthor',\n },\n },\n },\n viewDetached: {\n type: 'object',\n required: ['uri', 'detached'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n detached: {\n type: 'boolean',\n const: true,\n },\n },\n },\n },\n },\n AppBskyEmbedRecordWithMedia: {\n lexicon: 1,\n id: 'app.bsky.embed.recordWithMedia',\n description:\n 'A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.',\n defs: {\n main: {\n type: 'object',\n required: ['record', 'media'],\n properties: {\n record: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.record',\n },\n media: {\n type: 'union',\n refs: [\n 'lex:app.bsky.embed.images',\n 'lex:app.bsky.embed.video',\n 'lex:app.bsky.embed.external',\n ],\n },\n },\n },\n view: {\n type: 'object',\n required: ['record', 'media'],\n properties: {\n record: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.record#view',\n },\n media: {\n type: 'union',\n refs: [\n 'lex:app.bsky.embed.images#view',\n 'lex:app.bsky.embed.video#view',\n 'lex:app.bsky.embed.external#view',\n ],\n },\n },\n },\n },\n },\n AppBskyEmbedVideo: {\n lexicon: 1,\n id: 'app.bsky.embed.video',\n description: 'A video embedded in a Bluesky record (eg, a post).',\n defs: {\n main: {\n type: 'object',\n required: ['video'],\n properties: {\n video: {\n type: 'blob',\n description:\n 'The mp4 video file. May be up to 100mb, formerly limited to 50mb.',\n accept: ['video/mp4'],\n maxSize: 100000000,\n },\n captions: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.video#caption',\n },\n maxLength: 20,\n },\n alt: {\n type: 'string',\n description:\n 'Alt text description of the video, for accessibility.',\n maxGraphemes: 1000,\n maxLength: 10000,\n },\n aspectRatio: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.defs#aspectRatio',\n },\n presentation: {\n type: 'string',\n description: 'A hint to the client about how to present the video.',\n knownValues: ['default', 'gif'],\n },\n },\n },\n caption: {\n type: 'object',\n required: ['lang', 'file'],\n properties: {\n lang: {\n type: 'string',\n format: 'language',\n },\n file: {\n type: 'blob',\n accept: ['text/vtt'],\n maxSize: 20000,\n },\n },\n },\n view: {\n type: 'object',\n required: ['cid', 'playlist'],\n properties: {\n cid: {\n type: 'string',\n format: 'cid',\n },\n playlist: {\n type: 'string',\n format: 'uri',\n },\n thumbnail: {\n type: 'string',\n format: 'uri',\n },\n alt: {\n type: 'string',\n maxGraphemes: 1000,\n maxLength: 10000,\n },\n aspectRatio: {\n type: 'ref',\n ref: 'lex:app.bsky.embed.defs#aspectRatio',\n },\n presentation: {\n type: 'string',\n description: 'A hint to the client about how to present the video.',\n knownValues: ['default', 'gif'],\n },\n },\n },\n },\n },\n AppBskyFeedDefs: {\n lexicon: 1,\n id: 'app.bsky.feed.defs',\n defs: {\n postView: {\n type: 'object',\n required: ['uri', 'cid', 'author', 'record', 'indexedAt'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n author: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileViewBasic',\n },\n record: {\n type: 'unknown',\n },\n embed: {\n type: 'union',\n refs: [\n 'lex:app.bsky.embed.images#view',\n 'lex:app.bsky.embed.video#view',\n 'lex:app.bsky.embed.external#view',\n 'lex:app.bsky.embed.record#view',\n 'lex:app.bsky.embed.recordWithMedia#view',\n ],\n },\n bookmarkCount: {\n type: 'integer',\n },\n replyCount: {\n type: 'integer',\n },\n repostCount: {\n type: 'integer',\n },\n likeCount: {\n type: 'integer',\n },\n quoteCount: {\n type: 'integer',\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#viewerState',\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n threadgate: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#threadgateView',\n },\n debug: {\n type: 'unknown',\n description: 'Debug information for internal development',\n },\n },\n },\n viewerState: {\n type: 'object',\n description:\n \"Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.\",\n properties: {\n repost: {\n type: 'string',\n format: 'at-uri',\n },\n like: {\n type: 'string',\n format: 'at-uri',\n },\n bookmarked: {\n type: 'boolean',\n },\n threadMuted: {\n type: 'boolean',\n },\n replyDisabled: {\n type: 'boolean',\n },\n embeddingDisabled: {\n type: 'boolean',\n },\n pinned: {\n type: 'boolean',\n },\n },\n },\n threadContext: {\n type: 'object',\n description:\n 'Metadata about this post within the context of the thread it is in.',\n properties: {\n rootAuthorLike: {\n type: 'string',\n format: 'at-uri',\n },\n },\n },\n feedViewPost: {\n type: 'object',\n required: ['post'],\n properties: {\n post: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#postView',\n },\n reply: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#replyRef',\n },\n reason: {\n type: 'union',\n refs: [\n 'lex:app.bsky.feed.defs#reasonRepost',\n 'lex:app.bsky.feed.defs#reasonPin',\n ],\n },\n feedContext: {\n type: 'string',\n description:\n 'Context provided by feed generator that may be passed back alongside interactions.',\n maxLength: 2000,\n },\n reqId: {\n type: 'string',\n description:\n 'Unique identifier per request that may be passed back alongside interactions.',\n maxLength: 100,\n },\n },\n },\n replyRef: {\n type: 'object',\n required: ['root', 'parent'],\n properties: {\n root: {\n type: 'union',\n refs: [\n 'lex:app.bsky.feed.defs#postView',\n 'lex:app.bsky.feed.defs#notFoundPost',\n 'lex:app.bsky.feed.defs#blockedPost',\n ],\n },\n parent: {\n type: 'union',\n refs: [\n 'lex:app.bsky.feed.defs#postView',\n 'lex:app.bsky.feed.defs#notFoundPost',\n 'lex:app.bsky.feed.defs#blockedPost',\n ],\n },\n grandparentAuthor: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileViewBasic',\n description:\n 'When parent is a reply to another post, this is the author of that post.',\n },\n },\n },\n reasonRepost: {\n type: 'object',\n required: ['by', 'indexedAt'],\n properties: {\n by: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileViewBasic',\n },\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n reasonPin: {\n type: 'object',\n properties: {},\n },\n threadViewPost: {\n type: 'object',\n required: ['post'],\n properties: {\n post: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#postView',\n },\n parent: {\n type: 'union',\n refs: [\n 'lex:app.bsky.feed.defs#threadViewPost',\n 'lex:app.bsky.feed.defs#notFoundPost',\n 'lex:app.bsky.feed.defs#blockedPost',\n ],\n },\n replies: {\n type: 'array',\n items: {\n type: 'union',\n refs: [\n 'lex:app.bsky.feed.defs#threadViewPost',\n 'lex:app.bsky.feed.defs#notFoundPost',\n 'lex:app.bsky.feed.defs#blockedPost',\n ],\n },\n },\n threadContext: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#threadContext',\n },\n },\n },\n notFoundPost: {\n type: 'object',\n required: ['uri', 'notFound'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n notFound: {\n type: 'boolean',\n const: true,\n },\n },\n },\n blockedPost: {\n type: 'object',\n required: ['uri', 'blocked', 'author'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n blocked: {\n type: 'boolean',\n const: true,\n },\n author: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#blockedAuthor',\n },\n },\n },\n blockedAuthor: {\n type: 'object',\n required: ['did'],\n properties: {\n did: {\n type: 'string',\n format: 'did',\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#viewerState',\n },\n },\n },\n generatorView: {\n type: 'object',\n required: ['uri', 'cid', 'did', 'creator', 'displayName', 'indexedAt'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n did: {\n type: 'string',\n format: 'did',\n },\n creator: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileView',\n },\n displayName: {\n type: 'string',\n },\n description: {\n type: 'string',\n maxGraphemes: 300,\n maxLength: 3000,\n },\n descriptionFacets: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.richtext.facet',\n },\n },\n avatar: {\n type: 'string',\n format: 'uri',\n },\n likeCount: {\n type: 'integer',\n minimum: 0,\n },\n acceptsInteractions: {\n type: 'boolean',\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#generatorViewerState',\n },\n contentMode: {\n type: 'string',\n knownValues: [\n 'app.bsky.feed.defs#contentModeUnspecified',\n 'app.bsky.feed.defs#contentModeVideo',\n ],\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n generatorViewerState: {\n type: 'object',\n properties: {\n like: {\n type: 'string',\n format: 'at-uri',\n },\n },\n },\n skeletonFeedPost: {\n type: 'object',\n required: ['post'],\n properties: {\n post: {\n type: 'string',\n format: 'at-uri',\n },\n reason: {\n type: 'union',\n refs: [\n 'lex:app.bsky.feed.defs#skeletonReasonRepost',\n 'lex:app.bsky.feed.defs#skeletonReasonPin',\n ],\n },\n feedContext: {\n type: 'string',\n description:\n 'Context that will be passed through to client and may be passed to feed generator back alongside interactions.',\n maxLength: 2000,\n },\n },\n },\n skeletonReasonRepost: {\n type: 'object',\n required: ['repost'],\n properties: {\n repost: {\n type: 'string',\n format: 'at-uri',\n },\n },\n },\n skeletonReasonPin: {\n type: 'object',\n properties: {},\n },\n threadgateView: {\n type: 'object',\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n record: {\n type: 'unknown',\n },\n lists: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listViewBasic',\n },\n },\n },\n },\n interaction: {\n type: 'object',\n properties: {\n item: {\n type: 'string',\n format: 'at-uri',\n },\n event: {\n type: 'string',\n knownValues: [\n 'app.bsky.feed.defs#requestLess',\n 'app.bsky.feed.defs#requestMore',\n 'app.bsky.feed.defs#clickthroughItem',\n 'app.bsky.feed.defs#clickthroughAuthor',\n 'app.bsky.feed.defs#clickthroughReposter',\n 'app.bsky.feed.defs#clickthroughEmbed',\n 'app.bsky.feed.defs#interactionSeen',\n 'app.bsky.feed.defs#interactionLike',\n 'app.bsky.feed.defs#interactionRepost',\n 'app.bsky.feed.defs#interactionReply',\n 'app.bsky.feed.defs#interactionQuote',\n 'app.bsky.feed.defs#interactionShare',\n ],\n },\n feedContext: {\n type: 'string',\n description:\n 'Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.',\n maxLength: 2000,\n },\n reqId: {\n type: 'string',\n description:\n 'Unique identifier per request that may be passed back alongside interactions.',\n maxLength: 100,\n },\n },\n },\n requestLess: {\n type: 'token',\n description:\n 'Request that less content like the given feed item be shown in the feed',\n },\n requestMore: {\n type: 'token',\n description:\n 'Request that more content like the given feed item be shown in the feed',\n },\n clickthroughItem: {\n type: 'token',\n description: 'User clicked through to the feed item',\n },\n clickthroughAuthor: {\n type: 'token',\n description: 'User clicked through to the author of the feed item',\n },\n clickthroughReposter: {\n type: 'token',\n description: 'User clicked through to the reposter of the feed item',\n },\n clickthroughEmbed: {\n type: 'token',\n description:\n 'User clicked through to the embedded content of the feed item',\n },\n contentModeUnspecified: {\n type: 'token',\n description: 'Declares the feed generator returns any types of posts.',\n },\n contentModeVideo: {\n type: 'token',\n description:\n 'Declares the feed generator returns posts containing app.bsky.embed.video embeds.',\n },\n interactionSeen: {\n type: 'token',\n description: 'Feed item was seen by user',\n },\n interactionLike: {\n type: 'token',\n description: 'User liked the feed item',\n },\n interactionRepost: {\n type: 'token',\n description: 'User reposted the feed item',\n },\n interactionReply: {\n type: 'token',\n description: 'User replied to the feed item',\n },\n interactionQuote: {\n type: 'token',\n description: 'User quoted the feed item',\n },\n interactionShare: {\n type: 'token',\n description: 'User shared the feed item',\n },\n },\n },\n AppBskyFeedPostgate: {\n lexicon: 1,\n id: 'app.bsky.feed.postgate',\n defs: {\n main: {\n type: 'record',\n key: 'tid',\n description:\n 'Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository.',\n record: {\n type: 'object',\n required: ['post', 'createdAt'],\n properties: {\n createdAt: {\n type: 'string',\n format: 'datetime',\n },\n post: {\n type: 'string',\n format: 'at-uri',\n description: 'Reference (AT-URI) to the post record.',\n },\n detachedEmbeddingUris: {\n type: 'array',\n maxLength: 50,\n items: {\n type: 'string',\n format: 'at-uri',\n },\n description:\n 'List of AT-URIs embedding this post that the author has detached from.',\n },\n embeddingRules: {\n description:\n 'List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed.',\n type: 'array',\n maxLength: 5,\n items: {\n type: 'union',\n refs: ['lex:app.bsky.feed.postgate#disableRule'],\n },\n },\n },\n },\n },\n disableRule: {\n type: 'object',\n description: 'Disables embedding of this post.',\n properties: {},\n },\n },\n },\n AppBskyFeedThreadgate: {\n lexicon: 1,\n id: 'app.bsky.feed.threadgate',\n defs: {\n main: {\n type: 'record',\n key: 'tid',\n description:\n \"Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.\",\n record: {\n type: 'object',\n required: ['post', 'createdAt'],\n properties: {\n post: {\n type: 'string',\n format: 'at-uri',\n description: 'Reference (AT-URI) to the post record.',\n },\n allow: {\n description:\n 'List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.',\n type: 'array',\n maxLength: 5,\n items: {\n type: 'union',\n refs: [\n 'lex:app.bsky.feed.threadgate#mentionRule',\n 'lex:app.bsky.feed.threadgate#followerRule',\n 'lex:app.bsky.feed.threadgate#followingRule',\n 'lex:app.bsky.feed.threadgate#listRule',\n ],\n },\n },\n createdAt: {\n type: 'string',\n format: 'datetime',\n },\n hiddenReplies: {\n type: 'array',\n maxLength: 300,\n items: {\n type: 'string',\n format: 'at-uri',\n },\n description: 'List of hidden reply URIs.',\n },\n },\n },\n },\n mentionRule: {\n type: 'object',\n description: 'Allow replies from actors mentioned in your post.',\n properties: {},\n },\n followerRule: {\n type: 'object',\n description: 'Allow replies from actors who follow you.',\n properties: {},\n },\n followingRule: {\n type: 'object',\n description: 'Allow replies from actors you follow.',\n properties: {},\n },\n listRule: {\n type: 'object',\n description: 'Allow replies from actors on a list.',\n required: ['list'],\n properties: {\n list: {\n type: 'string',\n format: 'at-uri',\n },\n },\n },\n },\n },\n AppBskyGraphDefs: {\n lexicon: 1,\n id: 'app.bsky.graph.defs',\n defs: {\n listViewBasic: {\n type: 'object',\n required: ['uri', 'cid', 'name', 'purpose'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n name: {\n type: 'string',\n maxLength: 64,\n minLength: 1,\n },\n purpose: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listPurpose',\n },\n avatar: {\n type: 'string',\n format: 'uri',\n },\n listItemCount: {\n type: 'integer',\n minimum: 0,\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listViewerState',\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n listView: {\n type: 'object',\n required: ['uri', 'cid', 'creator', 'name', 'purpose', 'indexedAt'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n creator: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileView',\n },\n name: {\n type: 'string',\n maxLength: 64,\n minLength: 1,\n },\n purpose: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listPurpose',\n },\n description: {\n type: 'string',\n maxGraphemes: 300,\n maxLength: 3000,\n },\n descriptionFacets: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.richtext.facet',\n },\n },\n avatar: {\n type: 'string',\n format: 'uri',\n },\n listItemCount: {\n type: 'integer',\n minimum: 0,\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listViewerState',\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n listItemView: {\n type: 'object',\n required: ['uri', 'subject'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n subject: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileView',\n },\n },\n },\n starterPackView: {\n type: 'object',\n required: ['uri', 'cid', 'record', 'creator', 'indexedAt'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n record: {\n type: 'unknown',\n },\n creator: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileViewBasic',\n },\n list: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listViewBasic',\n },\n listItemsSample: {\n type: 'array',\n maxLength: 12,\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.graph.defs#listItemView',\n },\n },\n feeds: {\n type: 'array',\n maxLength: 3,\n items: {\n type: 'ref',\n ref: 'lex:app.bsky.feed.defs#generatorView',\n },\n },\n joinedWeekCount: {\n type: 'integer',\n minimum: 0,\n },\n joinedAllTimeCount: {\n type: 'integer',\n minimum: 0,\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n starterPackViewBasic: {\n type: 'object',\n required: ['uri', 'cid', 'record', 'creator', 'indexedAt'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n record: {\n type: 'unknown',\n },\n creator: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileViewBasic',\n },\n listItemCount: {\n type: 'integer',\n minimum: 0,\n },\n joinedWeekCount: {\n type: 'integer',\n minimum: 0,\n },\n joinedAllTimeCount: {\n type: 'integer',\n minimum: 0,\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n },\n },\n listPurpose: {\n type: 'string',\n knownValues: [\n 'app.bsky.graph.defs#modlist',\n 'app.bsky.graph.defs#curatelist',\n 'app.bsky.graph.defs#referencelist',\n ],\n },\n modlist: {\n type: 'token',\n description:\n 'A list of actors to apply an aggregate moderation action (mute/block) on.',\n },\n curatelist: {\n type: 'token',\n description:\n 'A list of actors used for curation purposes such as list feeds or interaction gating.',\n },\n referencelist: {\n type: 'token',\n description:\n 'A list of actors used for only for reference purposes such as within a starter pack.',\n },\n listViewerState: {\n type: 'object',\n properties: {\n muted: {\n type: 'boolean',\n },\n blocked: {\n type: 'string',\n format: 'at-uri',\n },\n },\n },\n notFoundActor: {\n type: 'object',\n description: 'indicates that a handle or DID could not be resolved',\n required: ['actor', 'notFound'],\n properties: {\n actor: {\n type: 'string',\n format: 'at-identifier',\n },\n notFound: {\n type: 'boolean',\n const: true,\n },\n },\n },\n relationship: {\n type: 'object',\n description:\n 'lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)',\n required: ['did'],\n properties: {\n did: {\n type: 'string',\n format: 'did',\n },\n following: {\n type: 'string',\n format: 'at-uri',\n description:\n 'if the actor follows this DID, this is the AT-URI of the follow record',\n },\n followedBy: {\n type: 'string',\n format: 'at-uri',\n description:\n 'if the actor is followed by this DID, contains the AT-URI of the follow record',\n },\n blocking: {\n type: 'string',\n format: 'at-uri',\n description:\n 'if the actor blocks this DID, this is the AT-URI of the block record',\n },\n blockedBy: {\n type: 'string',\n format: 'at-uri',\n description:\n 'if the actor is blocked by this DID, contains the AT-URI of the block record',\n },\n blockingByList: {\n type: 'string',\n format: 'at-uri',\n description:\n 'if the actor blocks this DID via a block list, this is the AT-URI of the listblock record',\n },\n blockedByList: {\n type: 'string',\n format: 'at-uri',\n description:\n 'if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record',\n },\n },\n },\n },\n },\n ComAtprotoLabelDefs: {\n lexicon: 1,\n id: 'com.atproto.label.defs',\n defs: {\n label: {\n type: 'object',\n description:\n 'Metadata tag on an atproto resource (eg, repo or record).',\n required: ['src', 'uri', 'val', 'cts'],\n properties: {\n ver: {\n type: 'integer',\n description: 'The AT Protocol version of the label object.',\n },\n src: {\n type: 'string',\n format: 'did',\n description: 'DID of the actor who created this label.',\n },\n uri: {\n type: 'string',\n format: 'uri',\n description:\n 'AT URI of the record, repository (account), or other resource that this label applies to.',\n },\n cid: {\n type: 'string',\n format: 'cid',\n description:\n \"Optionally, CID specifying the specific version of 'uri' resource this label applies to.\",\n },\n val: {\n type: 'string',\n maxLength: 128,\n description:\n 'The short string name of the value or type of this label.',\n },\n neg: {\n type: 'boolean',\n description:\n 'If true, this is a negation label, overwriting a previous label.',\n },\n cts: {\n type: 'string',\n format: 'datetime',\n description: 'Timestamp when this label was created.',\n },\n exp: {\n type: 'string',\n format: 'datetime',\n description:\n 'Timestamp at which this label expires (no longer applies).',\n },\n sig: {\n type: 'bytes',\n description: 'Signature of dag-cbor encoded label.',\n },\n },\n },\n selfLabels: {\n type: 'object',\n description:\n 'Metadata tags on an atproto record, published by the author within the record.',\n required: ['values'],\n properties: {\n values: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#selfLabel',\n },\n maxLength: 10,\n },\n },\n },\n selfLabel: {\n type: 'object',\n description:\n 'Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.',\n required: ['val'],\n properties: {\n val: {\n type: 'string',\n maxLength: 128,\n description:\n 'The short string name of the value or type of this label.',\n },\n },\n },\n labelValueDefinition: {\n type: 'object',\n description:\n 'Declares a label value and its expected interpretations and behaviors.',\n required: ['identifier', 'severity', 'blurs', 'locales'],\n properties: {\n identifier: {\n type: 'string',\n description:\n \"The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).\",\n maxLength: 100,\n maxGraphemes: 100,\n },\n severity: {\n type: 'string',\n description:\n \"How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.\",\n knownValues: ['inform', 'alert', 'none'],\n },\n blurs: {\n type: 'string',\n description:\n \"What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.\",\n knownValues: ['content', 'media', 'none'],\n },\n defaultSetting: {\n type: 'string',\n description: 'The default setting for this label.',\n knownValues: ['ignore', 'warn', 'hide'],\n default: 'warn',\n },\n adultOnly: {\n type: 'boolean',\n description:\n 'Does the user need to have adult content enabled in order to configure this label?',\n },\n locales: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#labelValueDefinitionStrings',\n },\n },\n },\n },\n labelValueDefinitionStrings: {\n type: 'object',\n description:\n 'Strings which describe the label in the UI, localized into a specific language.',\n required: ['lang', 'name', 'description'],\n properties: {\n lang: {\n type: 'string',\n description:\n 'The code of the language these strings are written in.',\n format: 'language',\n },\n name: {\n type: 'string',\n description: 'A short human-readable name for the label.',\n maxGraphemes: 64,\n maxLength: 640,\n },\n description: {\n type: 'string',\n description:\n 'A longer description of what the label means and why it might be applied.',\n maxGraphemes: 10000,\n maxLength: 100000,\n },\n },\n },\n labelValue: {\n type: 'string',\n knownValues: [\n '!hide',\n '!no-promote',\n '!warn',\n '!no-unauthenticated',\n 'dmca-violation',\n 'doxxing',\n 'porn',\n 'sexual',\n 'nudity',\n 'nsfl',\n 'gore',\n ],\n },\n },\n },\n AppBskyLabelerDefs: {\n lexicon: 1,\n id: 'app.bsky.labeler.defs',\n defs: {\n labelerView: {\n type: 'object',\n required: ['uri', 'cid', 'creator', 'indexedAt'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n creator: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileView',\n },\n likeCount: {\n type: 'integer',\n minimum: 0,\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.labeler.defs#labelerViewerState',\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n },\n },\n labelerViewDetailed: {\n type: 'object',\n required: ['uri', 'cid', 'creator', 'policies', 'indexedAt'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n creator: {\n type: 'ref',\n ref: 'lex:app.bsky.actor.defs#profileView',\n },\n policies: {\n type: 'ref',\n ref: 'lex:app.bsky.labeler.defs#labelerPolicies',\n },\n likeCount: {\n type: 'integer',\n minimum: 0,\n },\n viewer: {\n type: 'ref',\n ref: 'lex:app.bsky.labeler.defs#labelerViewerState',\n },\n indexedAt: {\n type: 'string',\n format: 'datetime',\n },\n labels: {\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#label',\n },\n },\n reasonTypes: {\n description:\n \"The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.\",\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.moderation.defs#reasonType',\n },\n },\n subjectTypes: {\n description:\n 'The set of subject types (account, record, etc) this service accepts reports on.',\n type: 'array',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.moderation.defs#subjectType',\n },\n },\n subjectCollections: {\n type: 'array',\n description:\n 'Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.',\n items: {\n type: 'string',\n format: 'nsid',\n },\n },\n },\n },\n labelerViewerState: {\n type: 'object',\n properties: {\n like: {\n type: 'string',\n format: 'at-uri',\n },\n },\n },\n labelerPolicies: {\n type: 'object',\n required: ['labelValues'],\n properties: {\n labelValues: {\n type: 'array',\n description:\n 'The label values which this labeler publishes. May include global or custom labels.',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#labelValue',\n },\n },\n labelValueDefinitions: {\n type: 'array',\n description:\n 'Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.',\n items: {\n type: 'ref',\n ref: 'lex:com.atproto.label.defs#labelValueDefinition',\n },\n },\n },\n },\n },\n },\n ComAtprotoModerationDefs: {\n lexicon: 1,\n id: 'com.atproto.moderation.defs',\n defs: {\n reasonType: {\n type: 'string',\n knownValues: [\n 'com.atproto.moderation.defs#reasonSpam',\n 'com.atproto.moderation.defs#reasonViolation',\n 'com.atproto.moderation.defs#reasonMisleading',\n 'com.atproto.moderation.defs#reasonSexual',\n 'com.atproto.moderation.defs#reasonRude',\n 'com.atproto.moderation.defs#reasonOther',\n 'com.atproto.moderation.defs#reasonAppeal',\n 'tools.ozone.report.defs#reasonAppeal',\n 'tools.ozone.report.defs#reasonOther',\n 'tools.ozone.report.defs#reasonViolenceAnimal',\n 'tools.ozone.report.defs#reasonViolenceThreats',\n 'tools.ozone.report.defs#reasonViolenceGraphicContent',\n 'tools.ozone.report.defs#reasonViolenceGlorification',\n 'tools.ozone.report.defs#reasonViolenceExtremistContent',\n 'tools.ozone.report.defs#reasonViolenceTrafficking',\n 'tools.ozone.report.defs#reasonViolenceOther',\n 'tools.ozone.report.defs#reasonSexualAbuseContent',\n 'tools.ozone.report.defs#reasonSexualNCII',\n 'tools.ozone.report.defs#reasonSexualDeepfake',\n 'tools.ozone.report.defs#reasonSexualAnimal',\n 'tools.ozone.report.defs#reasonSexualUnlabeled',\n 'tools.ozone.report.defs#reasonSexualOther',\n 'tools.ozone.report.defs#reasonChildSafetyCSAM',\n 'tools.ozone.report.defs#reasonChildSafetyGroom',\n 'tools.ozone.report.defs#reasonChildSafetyPrivacy',\n 'tools.ozone.report.defs#reasonChildSafetyHarassment',\n 'tools.ozone.report.defs#reasonChildSafetyOther',\n 'tools.ozone.report.defs#reasonHarassmentTroll',\n 'tools.ozone.report.defs#reasonHarassmentTargeted',\n 'tools.ozone.report.defs#reasonHarassmentHateSpeech',\n 'tools.ozone.report.defs#reasonHarassmentDoxxing',\n 'tools.ozone.report.defs#reasonHarassmentOther',\n 'tools.ozone.report.defs#reasonMisleadingBot',\n 'tools.ozone.report.defs#reasonMisleadingImpersonation',\n 'tools.ozone.report.defs#reasonMisleadingSpam',\n 'tools.ozone.report.defs#reasonMisleadingScam',\n 'tools.ozone.report.defs#reasonMisleadingElections',\n 'tools.ozone.report.defs#reasonMisleadingOther',\n 'tools.ozone.report.defs#reasonRuleSiteSecurity',\n 'tools.ozone.report.defs#reasonRuleProhibitedSales',\n 'tools.ozone.report.defs#reasonRuleBanEvasion',\n 'tools.ozone.report.defs#reasonRuleOther',\n 'tools.ozone.report.defs#reasonSelfHarmContent',\n 'tools.ozone.report.defs#reasonSelfHarmED',\n 'tools.ozone.report.defs#reasonSelfHarmStunts',\n 'tools.ozone.report.defs#reasonSelfHarmSubstances',\n 'tools.ozone.report.defs#reasonSelfHarmOther',\n ],\n },\n reasonSpam: {\n type: 'token',\n description:\n 'Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`.',\n },\n reasonViolation: {\n type: 'token',\n description:\n 'Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`.',\n },\n reasonMisleading: {\n type: 'token',\n description:\n 'Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`.',\n },\n reasonSexual: {\n type: 'token',\n description:\n 'Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`.',\n },\n reasonRude: {\n type: 'token',\n description:\n 'Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`.',\n },\n reasonOther: {\n type: 'token',\n description:\n 'Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`.',\n },\n reasonAppeal: {\n type: 'token',\n description: 'Appeal a previously taken moderation action',\n },\n subjectType: {\n type: 'string',\n description: 'Tag describing a type of subject that might be reported.',\n knownValues: ['account', 'record', 'chat'],\n },\n },\n },\n AppBskyNotificationDefs: {\n lexicon: 1,\n id: 'app.bsky.notification.defs',\n defs: {\n recordDeleted: {\n type: 'object',\n properties: {},\n },\n chatPreference: {\n type: 'object',\n required: ['include', 'push'],\n properties: {\n include: {\n type: 'string',\n knownValues: ['all', 'accepted'],\n },\n push: {\n type: 'boolean',\n },\n },\n },\n filterablePreference: {\n type: 'object',\n required: ['include', 'list', 'push'],\n properties: {\n include: {\n type: 'string',\n knownValues: ['all', 'follows'],\n },\n list: {\n type: 'boolean',\n },\n push: {\n type: 'boolean',\n },\n },\n },\n preference: {\n type: 'object',\n required: ['list', 'push'],\n properties: {\n list: {\n type: 'boolean',\n },\n push: {\n type: 'boolean',\n },\n },\n },\n preferences: {\n type: 'object',\n required: [\n 'chat',\n 'follow',\n 'like',\n 'likeViaRepost',\n 'mention',\n 'quote',\n 'reply',\n 'repost',\n 'repostViaRepost',\n 'starterpackJoined',\n 'subscribedPost',\n 'unverified',\n 'verified',\n ],\n properties: {\n chat: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#chatPreference',\n },\n follow: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#filterablePreference',\n },\n like: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#filterablePreference',\n },\n likeViaRepost: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#filterablePreference',\n },\n mention: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#filterablePreference',\n },\n quote: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#filterablePreference',\n },\n reply: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#filterablePreference',\n },\n repost: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#filterablePreference',\n },\n repostViaRepost: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#filterablePreference',\n },\n starterpackJoined: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#preference',\n },\n subscribedPost: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#preference',\n },\n unverified: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#preference',\n },\n verified: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#preference',\n },\n },\n },\n activitySubscription: {\n type: 'object',\n required: ['post', 'reply'],\n properties: {\n post: {\n type: 'boolean',\n },\n reply: {\n type: 'boolean',\n },\n },\n },\n subjectActivitySubscription: {\n description:\n 'Object used to store activity subscription data in stash.',\n type: 'object',\n required: ['subject', 'activitySubscription'],\n properties: {\n subject: {\n type: 'string',\n format: 'did',\n },\n activitySubscription: {\n type: 'ref',\n ref: 'lex:app.bsky.notification.defs#activitySubscription',\n },\n },\n },\n },\n },\n AppBskyRichtextFacet: {\n lexicon: 1,\n id: 'app.bsky.richtext.facet',\n defs: {\n main: {\n type: 'object',\n description: 'Annotation of a sub-string within rich text.',\n required: ['index', 'features'],\n properties: {\n index: {\n type: 'ref',\n ref: 'lex:app.bsky.richtext.facet#byteSlice',\n },\n features: {\n type: 'array',\n items: {\n type: 'union',\n refs: [\n 'lex:app.bsky.richtext.facet#mention',\n 'lex:app.bsky.richtext.facet#link',\n 'lex:app.bsky.richtext.facet#tag',\n ],\n },\n },\n },\n },\n mention: {\n type: 'object',\n description:\n \"Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.\",\n required: ['did'],\n properties: {\n did: {\n type: 'string',\n format: 'did',\n },\n },\n },\n link: {\n type: 'object',\n description:\n 'Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.',\n required: ['uri'],\n properties: {\n uri: {\n type: 'string',\n format: 'uri',\n },\n },\n },\n tag: {\n type: 'object',\n description:\n \"Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').\",\n required: ['tag'],\n properties: {\n tag: {\n type: 'string',\n maxLength: 640,\n maxGraphemes: 64,\n },\n },\n },\n byteSlice: {\n type: 'object',\n description:\n 'Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.',\n required: ['byteStart', 'byteEnd'],\n properties: {\n byteStart: {\n type: 'integer',\n minimum: 0,\n },\n byteEnd: {\n type: 'integer',\n minimum: 0,\n },\n },\n },\n },\n },\n ComAtprotoRepoStrongRef: {\n lexicon: 1,\n id: 'com.atproto.repo.strongRef',\n description: 'A URI with a content-hash fingerprint.',\n defs: {\n main: {\n type: 'object',\n required: ['uri', 'cid'],\n properties: {\n uri: {\n type: 'string',\n format: 'at-uri',\n },\n cid: {\n type: 'string',\n format: 'cid',\n },\n },\n },\n },\n },\n} as const satisfies Record<string, LexiconDoc>\nexport const schemas = Object.values(schemaDict) satisfies LexiconDoc[]\nexport const lexicons: Lexicons = new Lexicons(schemas)\n\nexport function validate<T extends { $type: string }>(\n v: unknown,\n id: string,\n hash: string,\n requiredType: true,\n): ValidationResult<T>\nexport function validate<T extends { $type?: string }>(\n v: unknown,\n id: string,\n hash: string,\n requiredType?: false,\n): ValidationResult<T>\nexport function validate(\n v: unknown,\n id: string,\n hash: string,\n requiredType?: boolean,\n): ValidationResult {\n return (requiredType ? is$typed : maybe$typed)(v, id, hash)\n ? lexicons.validate(`${id}#${hash}`, v)\n : {\n success: false,\n error: new ValidationError(\n `Must be an object with \"${hash === 'main' ? id : `${id}#${hash}`}\" $type property`,\n ),\n }\n}\n\nexport const ids = {\n AppBskyActorDefs: 'app.bsky.actor.defs',\n AppBskyActorProfile: 'app.bsky.actor.profile',\n AppBskyEmbedDefs: 'app.bsky.embed.defs',\n AppBskyEmbedExternal: 'app.bsky.embed.external',\n AppBskyEmbedImages: 'app.bsky.embed.images',\n AppBskyEmbedRecord: 'app.bsky.embed.record',\n AppBskyEmbedRecordWithMedia: 'app.bsky.embed.recordWithMedia',\n AppBskyEmbedVideo: 'app.bsky.embed.video',\n AppBskyFeedDefs: 'app.bsky.feed.defs',\n AppBskyFeedPostgate: 'app.bsky.feed.postgate',\n AppBskyFeedThreadgate: 'app.bsky.feed.threadgate',\n AppBskyGraphDefs: 'app.bsky.graph.defs',\n ComAtprotoLabelDefs: 'com.atproto.label.defs',\n AppBskyLabelerDefs: 'app.bsky.labeler.defs',\n ComAtprotoModerationDefs: 'com.atproto.moderation.defs',\n AppBskyNotificationDefs: 'app.bsky.notification.defs',\n AppBskyRichtextFacet: 'app.bsky.richtext.facet',\n ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',\n} as const\n","/**\n * GENERATED CODE - DO NOT MODIFY\n */\n\nimport { type ValidationResult } from '@atproto/lexicon'\n\nexport type OmitKey<T, K extends keyof T> = {\n [K2 in keyof T as K2 extends K ? never : K2]: T[K2]\n}\n\nexport type $Typed<V, T extends string = string> = V & { $type: T }\nexport type Un$Typed<V extends { $type?: string }> = OmitKey<V, '$type'>\n\nexport type $Type<Id extends string, Hash extends string> = Hash extends 'main'\n ? Id\n : `${Id}#${Hash}`\n\nfunction isObject<V>(v: V): v is V & object {\n return v != null && typeof v === 'object'\n}\n\nfunction is$type<Id extends string, Hash extends string>(\n $type: unknown,\n id: Id,\n hash: Hash,\n): $type is $Type<Id, Hash> {\n return hash === 'main'\n ? $type === id\n : // $type === `${id}#${hash}`\n typeof $type === 'string' &&\n $type.length === id.length + 1 + hash.length &&\n $type.charCodeAt(id.length) === 35 /* '#' */ &&\n $type.startsWith(id) &&\n $type.endsWith(hash)\n}\n\nexport type $TypedObject<\n V,\n Id extends string,\n Hash extends string,\n> = V extends {\n $type: $Type<Id, Hash>\n}\n ? V\n : V extends { $type?: string }\n ? V extends { $type?: infer T extends $Type<Id, Hash> }\n ? V & { $type: T }\n : never\n : V & { $type: $Type<Id, Hash> }\n\nexport function is$typed<V, Id extends string, Hash extends string>(\n v: V,\n id: Id,\n hash: Hash,\n): v is $TypedObject<V, Id, Hash> {\n return isObject(v) && '$type' in v && is$type(v.$type, id, hash)\n}\n\nexport function maybe$typed<V, Id extends string, Hash extends string>(\n v: V,\n id: Id,\n hash: Hash,\n): v is V & object & { $type?: $Type<Id, Hash> } {\n return (\n isObject(v) &&\n ('$type' in v ? v.$type === undefined || is$type(v.$type, id, hash) : true)\n )\n}\n\nexport type Validator<R = unknown> = (v: unknown) => ValidationResult<R>\nexport type ValidatorParam<V extends Validator> =\n V extends Validator<infer R> ? R : never\n\n/**\n * Utility function that allows to convert a \"validate*\" utility function into a\n * type predicate.\n */\nexport function asPredicate<V extends Validator>(validate: V) {\n return function <T>(v: T): v is T & ValidatorParam<V> {\n return validate(v).success\n }\n}\n","/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'\nimport type * as AppBskyGraphDefs from '../graph/defs.js'\nimport type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'\nimport type * as AppBskyNotificationDefs from '../notification/defs.js'\nimport type * as AppBskyFeedThreadgate from '../feed/threadgate.js'\nimport type * as AppBskyFeedPostgate from '../feed/postgate.js'\nimport type * as AppBskyEmbedExternal from '../embed/external.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'app.bsky.actor.defs'\n\nexport interface ProfileViewBasic {\n $type?: 'app.bsky.actor.defs#profileViewBasic'\n did: string\n handle: string\n displayName?: string\n pronouns?: string\n avatar?: string\n associated?: ProfileAssociated\n viewer?: ViewerState\n labels?: ComAtprotoLabelDefs.Label[]\n createdAt?: string\n verification?: VerificationState\n status?: StatusView\n /** Debug information for internal development */\n debug?: { [_ in string]: unknown }\n}\n\nconst hashProfileViewBasic = 'profileViewBasic'\n\nexport function isProfileViewBasic<V>(v: V) {\n return is$typed(v, id, hashProfileViewBasic)\n}\n\nexport function validateProfileViewBasic<V>(v: V) {\n return validate<ProfileViewBasic & V>(v, id, hashProfileViewBasic)\n}\n\nexport interface ProfileView {\n $type?: 'app.bsky.actor.defs#profileView'\n did: string\n handle: string\n displayName?: string\n pronouns?: string\n description?: string\n avatar?: string\n associated?: ProfileAssociated\n indexedAt?: string\n createdAt?: string\n viewer?: ViewerState\n labels?: ComAtprotoLabelDefs.Label[]\n verification?: VerificationState\n status?: StatusView\n /** Debug information for internal development */\n debug?: { [_ in string]: unknown }\n}\n\nconst hashProfileView = 'profileView'\n\nexport function isProfileView<V>(v: V) {\n return is$typed(v, id, hashProfileView)\n}\n\nexport function validateProfileView<V>(v: V) {\n return validate<ProfileView & V>(v, id, hashProfileView)\n}\n\nexport interface ProfileViewDetailed {\n $type?: 'app.bsky.actor.defs#profileViewDetailed'\n did: string\n handle: string\n displayName?: string\n description?: string\n pronouns?: string\n website?: string\n avatar?: string\n banner?: string\n followersCount?: number\n followsCount?: number\n postsCount?: number\n associated?: ProfileAssociated\n joinedViaStarterPack?: AppBskyGraphDefs.StarterPackViewBasic\n indexedAt?: string\n createdAt?: string\n viewer?: ViewerState\n labels?: ComAtprotoLabelDefs.Label[]\n pinnedPost?: ComAtprotoRepoStrongRef.Main\n verification?: VerificationState\n status?: StatusView\n /** Debug information for internal development */\n debug?: { [_ in string]: unknown }\n}\n\nconst hashProfileViewDetailed = 'profileViewDetailed'\n\nexport function isProfileViewDetailed<V>(v: V) {\n return is$typed(v, id, hashProfileViewDetailed)\n}\n\nexport function validateProfileViewDetailed<V>(v: V) {\n return validate<ProfileViewDetailed & V>(v, id, hashProfileViewDetailed)\n}\n\nexport interface ProfileAssociated {\n $type?: 'app.bsky.actor.defs#profileAssociated'\n lists?: number\n feedgens?: number\n starterPacks?: number\n labeler?: boolean\n chat?: ProfileAssociatedChat\n activitySubscription?: ProfileAssociatedActivitySubscription\n germ?: ProfileAssociatedGerm\n}\n\nconst hashProfileAssociated = 'profileAssociated'\n\nexport function isProfileAssociated<V>(v: V) {\n return is$typed(v, id, hashProfileAssociated)\n}\n\nexport function validateProfileAssociated<V>(v: V) {\n return validate<ProfileAssociated & V>(v, id, hashProfileAssociated)\n}\n\nexport interface ProfileAssociatedChat {\n $type?: 'app.bsky.actor.defs#profileAssociatedChat'\n allowIncoming: 'all' | 'none' | 'following' | (string & {})\n}\n\nconst hashProfileAssociatedChat = 'profileAssociatedChat'\n\nexport function isProfileAssociatedChat<V>(v: V) {\n return is$typed(v, id, hashProfileAssociatedChat)\n}\n\nexport function validateProfileAssociatedChat<V>(v: V) {\n return validate<ProfileAssociatedChat & V>(v, id, hashProfileAssociatedChat)\n}\n\nexport interface ProfileAssociatedGerm {\n $type?: 'app.bsky.actor.defs#profileAssociatedGerm'\n messageMeUrl: string\n showButtonTo: 'usersIFollow' | 'everyone' | (string & {})\n}\n\nconst hashProfileAssociatedGerm = 'profileAssociatedGerm'\n\nexport function isProfileAssociatedGerm<V>(v: V) {\n return is$typed(v, id, hashProfileAssociatedGerm)\n}\n\nexport function validateProfileAssociatedGerm<V>(v: V) {\n return validate<ProfileAssociatedGerm & V>(v, id, hashProfileAssociatedGerm)\n}\n\nexport interface ProfileAssociatedActivitySubscription {\n $type?: 'app.bsky.actor.defs#profileAssociatedActivitySubscription'\n allowSubscriptions: 'followers' | 'mutuals' | 'none' | (string & {})\n}\n\nconst hashProfileAssociatedActivitySubscription =\n 'profileAssociatedActivitySubscription'\n\nexport function isProfileAssociatedActivitySubscription<V>(v: V) {\n return is$typed(v, id, hashProfileAssociatedActivitySubscription)\n}\n\nexport function validateProfileAssociatedActivitySubscription<V>(v: V) {\n return validate<ProfileAssociatedActivitySubscription & V>(\n v,\n id,\n hashProfileAssociatedActivitySubscription,\n )\n}\n\n/** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */\nexport interface ViewerState {\n $type?: 'app.bsky.actor.defs#viewerState'\n muted?: boolean\n mutedByList?: AppBskyGraphDefs.ListViewBasic\n blockedBy?: boolean\n blocking?: string\n blockingByList?: AppBskyGraphDefs.ListViewBasic\n following?: string\n followedBy?: string\n knownFollowers?: KnownFollowers\n activitySubscription?: AppBskyNotificationDefs.ActivitySubscription\n}\n\nconst hashViewerState = 'viewerState'\n\nexport function isViewerState<V>(v: V) {\n return is$typed(v, id, hashViewerState)\n}\n\nexport function validateViewerState<V>(v: V) {\n return validate<ViewerState & V>(v, id, hashViewerState)\n}\n\n/** The subject's followers whom you also follow */\nexport interface KnownFollowers {\n $type?: 'app.bsky.actor.defs#knownFollowers'\n count: number\n followers: ProfileViewBasic[]\n}\n\nconst hashKnownFollowers = 'knownFollowers'\n\nexport function isKnownFollowers<V>(v: V) {\n return is$typed(v, id, hashKnownFollowers)\n}\n\nexport function validateKnownFollowers<V>(v: V) {\n return validate<KnownFollowers & V>(v, id, hashKnownFollowers)\n}\n\n/** Represents the verification information about the user this object is attached to. */\nexport interface VerificationState {\n $type?: 'app.bsky.actor.defs#verificationState'\n /** All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included. */\n verifications: VerificationView[]\n /** The user's status as a verified account. */\n verifiedStatus: 'valid' | 'invalid' | 'none' | (string & {})\n /** The user's status as a trusted verifier. */\n trustedVerifierStatus: 'valid' | 'invalid' | 'none' | (string & {})\n}\n\nconst hashVerificationState = 'verificationState'\n\nexport function isVerificationState<V>(v: V) {\n return is$typed(v, id, hashVerificationState)\n}\n\nexport function validateVerificationState<V>(v: V) {\n return validate<VerificationState & V>(v, id, hashVerificationState)\n}\n\n/** An individual verification for an associated subject. */\nexport interface VerificationView {\n $type?: 'app.bsky.actor.defs#verificationView'\n /** The user who issued this verification. */\n issuer: string\n /** The AT-URI of the verification record. */\n uri: string\n /** True if the verification passes validation, otherwise false. */\n isValid: boolean\n /** Timestamp when the verification was created. */\n createdAt: string\n}\n\nconst hashVerificationView = 'verificationView'\n\nexport function isVerificationView<V>(v: V) {\n return is$typed(v, id, hashVerificationView)\n}\n\nexport function validateVerificationView<V>(v: V) {\n return validate<VerificationView & V>(v, id, hashVerificationView)\n}\n\nexport type Preferences = (\n | $Typed<AdultContentPref>\n | $Typed<ContentLabelPref>\n | $Typed<SavedFeedsPref>\n | $Typed<SavedFeedsPrefV2>\n | $Typed<PersonalDetailsPref>\n | $Typed<DeclaredAgePref>\n | $Typed<FeedViewPref>\n | $Typed<ThreadViewPref>\n | $Typed<InterestsPref>\n | $Typed<MutedWordsPref>\n | $Typed<HiddenPostsPref>\n | $Typed<BskyAppStatePref>\n | $Typed<LabelersPref>\n | $Typed<PostInteractionSettingsPref>\n | $Typed<VerificationPrefs>\n | $Typed<LiveEventPreferences>\n | { $type: string }\n)[]\n\nexport interface AdultContentPref {\n $type?: 'app.bsky.actor.defs#adultContentPref'\n enabled: boolean\n}\n\nconst hashAdultContentPref = 'adultContentPref'\n\nexport function isAdultContentPref<V>(v: V) {\n return is$typed(v, id, hashAdultContentPref)\n}\n\nexport function validateAdultContentPref<V>(v: V) {\n return validate<AdultContentPref & V>(v, id, hashAdultContentPref)\n}\n\nexport interface ContentLabelPref {\n $type?: 'app.bsky.actor.defs#contentLabelPref'\n /** Which labeler does this preference apply to? If undefined, applies globally. */\n labelerDid?: string\n label: string\n visibility: 'ignore' | 'show' | 'warn' | 'hide' | (string & {})\n}\n\nconst hashContentLabelPref = 'contentLabelPref'\n\nexport function isContentLabelPref<V>(v: V) {\n return is$typed(v, id, hashContentLabelPref)\n}\n\nexport function validateContentLabelPref<V>(v: V) {\n return validate<ContentLabelPref & V>(v, id, hashContentLabelPref)\n}\n\nexport interface SavedFeed {\n $type?: 'app.bsky.actor.defs#savedFeed'\n id: string\n type: 'feed' | 'list' | 'timeline' | (string & {})\n value: string\n pinned: boolean\n}\n\nconst hashSavedFeed = 'savedFeed'\n\nexport function isSavedFeed<V>(v: V) {\n return is$typed(v, id, hashSavedFeed)\n}\n\nexport function validateSavedFeed<V>(v: V) {\n return validate<SavedFeed & V>(v, id, hashSavedFeed)\n}\n\nexport interface SavedFeedsPrefV2 {\n $type?: 'app.bsky.actor.defs#savedFeedsPrefV2'\n items: SavedFeed[]\n}\n\nconst hashSavedFeedsPrefV2 = 'savedFeedsPrefV2'\n\nexport function isSavedFeedsPrefV2<V>(v: V) {\n return is$typed(v, id, hashSavedFeedsPrefV2)\n}\n\nexport function validateSavedFeedsPrefV2<V>(v: V) {\n return validate<SavedFeedsPrefV2 & V>(v, id, hashSavedFeedsPrefV2)\n}\n\nexport interface SavedFeedsPref {\n $type?: 'app.bsky.actor.defs#savedFeedsPref'\n pinned: string[]\n saved: string[]\n timelineIndex?: number\n}\n\nconst hashSavedFeedsPref = 'savedFeedsPref'\n\nexport function isSavedFeedsPref<V>(v: V) {\n return is$typed(v, id, hashSavedFeedsPref)\n}\n\nexport function validateSavedFeedsPref<V>(v: V) {\n return validate<SavedFeedsPref & V>(v, id, hashSavedFeedsPref)\n}\n\nexport interface PersonalDetailsPref {\n $type?: 'app.bsky.actor.defs#personalDetailsPref'\n /** The birth date of account owner. */\n birthDate?: string\n}\n\nconst hashPersonalDetailsPref = 'personalDetailsPref'\n\nexport function isPersonalDetailsPref<V>(v: V) {\n return is$typed(v, id, hashPersonalDetailsPref)\n}\n\nexport function validatePersonalDetailsPref<V>(v: V) {\n return validate<PersonalDetailsPref & V>(v, id, hashPersonalDetailsPref)\n}\n\n/** Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration. */\nexport interface DeclaredAgePref {\n $type?: 'app.bsky.actor.defs#declaredAgePref'\n /** Indicates if the user has declared that they are over 13 years of age. */\n isOverAge13?: boolean\n /** Indicates if the user has declared that they are over 16 years of age. */\n isOverAge16?: boolean\n /** Indicates if the user has declared that they are over 18 years of age. */\n isOverAge18?: boolean\n}\n\nconst hashDeclaredAgePref = 'declaredAgePref'\n\nexport function isDeclaredAgePref<V>(v: V) {\n return is$typed(v, id, hashDeclaredAgePref)\n}\n\nexport function validateDeclaredAgePref<V>(v: V) {\n return validate<DeclaredAgePref & V>(v, id, hashDeclaredAgePref)\n}\n\nexport interface FeedViewPref {\n $type?: 'app.bsky.actor.defs#feedViewPref'\n /** The URI of the feed, or an identifier which describes the feed. */\n feed: string\n /** Hide replies in the feed. */\n hideReplies?: boolean\n /** Hide replies in the feed if they are not by followed users. */\n hideRepliesByUnfollowed: boolean\n /** Hide replies in the feed if they do not have this number of likes. */\n hideRepliesByLikeCount?: number\n /** Hide reposts in the feed. */\n hideReposts?: boolean\n /** Hide quote posts in the feed. */\n hideQuotePosts?: boolean\n}\n\nconst hashFeedViewPref = 'feedViewPref'\n\nexport function isFeedViewPref<V>(v: V) {\n return is$typed(v, id, hashFeedViewPref)\n}\n\nexport function validateFeedViewPref<V>(v: V) {\n return validate<FeedViewPref & V>(v, id, hashFeedViewPref)\n}\n\nexport interface ThreadViewPref {\n $type?: 'app.bsky.actor.defs#threadViewPref'\n /** Sorting mode for threads. */\n sort?:\n | 'oldest'\n | 'newest'\n | 'most-likes'\n | 'random'\n | 'hotness'\n | (string & {})\n}\n\nconst hashThreadViewPref = 'threadViewPref'\n\nexport function isThreadViewPref<V>(v: V) {\n return is$typed(v, id, hashThreadViewPref)\n}\n\nexport function validateThreadViewPref<V>(v: V) {\n return validate<ThreadViewPref & V>(v, id, hashThreadViewPref)\n}\n\nexport interface InterestsPref {\n $type?: 'app.bsky.actor.defs#interestsPref'\n /** A list of tags which describe the account owner's interests gathered during onboarding. */\n tags: string[]\n}\n\nconst hashInterestsPref = 'interestsPref'\n\nexport function isInterestsPref<V>(v: V) {\n return is$typed(v, id, hashInterestsPref)\n}\n\nexport function validateInterestsPref<V>(v: V) {\n return validate<InterestsPref & V>(v, id, hashInterestsPref)\n}\n\nexport type MutedWordTarget = 'content' | 'tag' | (string & {})\n\n/** A word that the account owner has muted. */\nexport interface MutedWord {\n $type?: 'app.bsky.actor.defs#mutedWord'\n id?: string\n /** The muted word itself. */\n value: string\n /** The intended targets of the muted word. */\n targets: MutedWordTarget[]\n /** Groups of users to apply the muted word to. If undefined, applies to all users. */\n actorTarget: 'all' | 'exclude-following' | (string & {})\n /** The date and time at which the muted word will expire and no longer be applied. */\n expiresAt?: string\n}\n\nconst hashMutedWord = 'mutedWord'\n\nexport function isMutedWord<V>(v: V) {\n return is$typed(v, id, hashMutedWord)\n}\n\nexport function validateMutedWord<V>(v: V) {\n return validate<MutedWord & V>(v, id, hashMutedWord)\n}\n\nexport interface MutedWordsPref {\n $type?: 'app.bsky.actor.defs#mutedWordsPref'\n /** A list of words the account owner has muted. */\n items: MutedWord[]\n}\n\nconst hashMutedWordsPref = 'mutedWordsPref'\n\nexport function isMutedWordsPref<V>(v: V) {\n return is$typed(v, id, hashMutedWordsPref)\n}\n\nexport function validateMutedWordsPref<V>(v: V) {\n return validate<MutedWordsPref & V>(v, id, hashMutedWordsPref)\n}\n\nexport interface HiddenPostsPref {\n $type?: 'app.bsky.actor.defs#hiddenPostsPref'\n /** A list of URIs of posts the account owner has hidden. */\n items: string[]\n}\n\nconst hashHiddenPostsPref = 'hiddenPostsPref'\n\nexport function isHiddenPostsPref<V>(v: V) {\n return is$typed(v, id, hashHiddenPostsPref)\n}\n\nexport function validateHiddenPostsPref<V>(v: V) {\n return validate<HiddenPostsPref & V>(v, id, hashHiddenPostsPref)\n}\n\nexport interface LabelersPref {\n $type?: 'app.bsky.actor.defs#labelersPref'\n labelers: LabelerPrefItem[]\n}\n\nconst hashLabelersPref = 'labelersPref'\n\nexport function isLabelersPref<V>(v: V) {\n return is$typed(v, id, hashLabelersPref)\n}\n\nexport function validateLabelersPref<V>(v: V) {\n return validate<LabelersPref & V>(v, id, hashLabelersPref)\n}\n\nexport interface LabelerPrefItem {\n $type?: 'app.bsky.actor.defs#labelerPrefItem'\n did: string\n}\n\nconst hashLabelerPrefItem = 'labelerPrefItem'\n\nexport function isLabelerPrefItem<V>(v: V) {\n return is$typed(v, id, hashLabelerPrefItem)\n}\n\nexport function validateLabelerPrefItem<V>(v: V) {\n return validate<LabelerPrefItem & V>(v, id, hashLabelerPrefItem)\n}\n\n/** A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this. */\nexport interface BskyAppStatePref {\n $type?: 'app.bsky.actor.defs#bskyAppStatePref'\n activeProgressGuide?: BskyAppProgressGuide\n /** An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. */\n queuedNudges?: string[]\n /** Storage for NUXs the user has encountered. */\n nuxs?: Nux[]\n}\n\nconst hashBskyAppStatePref = 'bskyAppStatePref'\n\nexport function isBskyAppStatePref<V>(v: V) {\n return is$typed(v, id, hashBskyAppStatePref)\n}\n\nexport function validateBskyAppStatePref<V>(v: V) {\n return validate<BskyAppStatePref & V>(v, id, hashBskyAppStatePref)\n}\n\n/** If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. */\nexport interface BskyAppProgressGuide {\n $type?: 'app.bsky.actor.defs#bskyAppProgressGuide'\n guide: string\n}\n\nconst hashBskyAppProgressGuide = 'bskyAppProgressGuide'\n\nexport function isBskyAppProgressGuide<V>(v: V) {\n return is$typed(v, id, hashBskyAppProgressGuide)\n}\n\nexport function validateBskyAppProgressGuide<V>(v: V) {\n return validate<BskyAppProgressGuide & V>(v, id, hashBskyAppProgressGuide)\n}\n\n/** A new user experiences (NUX) storage object */\nexport interface Nux {\n $type?: 'app.bsky.actor.defs#nux'\n id: string\n completed: boolean\n /** Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. */\n data?: string\n /** The date and time at which the NUX will expire and should be considered completed. */\n expiresAt?: string\n}\n\nconst hashNux = 'nux'\n\nexport function isNux<V>(v: V) {\n return is$typed(v, id, hashNux)\n}\n\nexport function validateNux<V>(v: V) {\n return validate<Nux & V>(v, id, hashNux)\n}\n\n/** Preferences for how verified accounts appear in the app. */\nexport interface VerificationPrefs {\n $type?: 'app.bsky.actor.defs#verificationPrefs'\n /** Hide the blue check badges for verified accounts and trusted verifiers. */\n hideBadges: boolean\n}\n\nconst hashVerificationPrefs = 'verificationPrefs'\n\nexport function isVerificationPrefs<V>(v: V) {\n return is$typed(v, id, hashVerificationPrefs)\n}\n\nexport function validateVerificationPrefs<V>(v: V) {\n return validate<VerificationPrefs & V>(v, id, hashVerificationPrefs)\n}\n\n/** Preferences for live events. */\nexport interface LiveEventPreferences {\n $type?: 'app.bsky.actor.defs#liveEventPreferences'\n /** A list of feed IDs that the user has hidden from live events. */\n hiddenFeedIds?: string[]\n /** Whether to hide all feeds from live events. */\n hideAllFeeds: boolean\n}\n\nconst hashLiveEventPreferences = 'liveEventPreferences'\n\nexport function isLiveEventPreferences<V>(v: V) {\n return is$typed(v, id, hashLiveEventPreferences)\n}\n\nexport function validateLiveEventPreferences<V>(v: V) {\n return validate<LiveEventPreferences & V>(v, id, hashLiveEventPreferences)\n}\n\n/** Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly. */\nexport interface PostInteractionSettingsPref {\n $type?: 'app.bsky.actor.defs#postInteractionSettingsPref'\n /** Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply. */\n threadgateAllowRules?: (\n | $Typed<AppBskyFeedThreadgate.MentionRule>\n | $Typed<AppBskyFeedThreadgate.FollowerRule>\n | $Typed<AppBskyFeedThreadgate.FollowingRule>\n | $Typed<AppBskyFeedThreadgate.ListRule>\n | { $type: string }\n )[]\n /** Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */\n postgateEmbeddingRules?: (\n | $Typed<AppBskyFeedPostgate.DisableRule>\n | { $type: string }\n )[]\n}\n\nconst hashPostInteractionSettingsPref = 'postInteractionSettingsPref'\n\nexport function isPostInteractionSettingsPref<V>(v: V) {\n return is$typed(v, id, hashPostInteractionSettingsPref)\n}\n\nexport function validatePostInteractionSettingsPref<V>(v: V) {\n return validate<PostInteractionSettingsPref & V>(\n v,\n id,\n hashPostInteractionSettingsPref,\n )\n}\n\nexport interface StatusView {\n $type?: 'app.bsky.actor.defs#statusView'\n uri?: string\n cid?: string\n /** The status for the account. */\n status: 'app.bsky.actor.status#live' | (string & {})\n record: { [_ in string]: unknown }\n embed?: $Typed<AppBskyEmbedExternal.View> | { $type: string }\n /** The date when this status will expire. The application might choose to no longer return the status after expiration. */\n expiresAt?: string\n /** True if the status is not expired, false if it is expired. Only present if expiration was set. */\n isActive?: boolean\n /** True if the user's go-live access has been disabled by a moderator, false otherwise. */\n isDisabled?: boolean\n}\n\nconst hashStatusView = 'statusView'\n\nexport function isStatusView<V>(v: V) {\n return is$typed(v, id, hashStatusView)\n}\n\nexport function validateStatusView<V>(v: V) {\n return validate<StatusView & V>(v, id, hashStatusView)\n}\n","{\n \"trustedIssuers\": [\"https://bsky.social\"]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,qBAAoB;AAEpB,IAAAA,4BAAmC;AACnC,IAAAC,iBAAoS;;;ACHpS,4BAAqB;AACrB,oBAMO;AAoCP,IAAM,aAAwC,CAAC;AAE/C,IAAM,oBAAuC;AAAA,EAC3C,MAAM,gBAAgB;AACpB,WAAO;AAAA,EACT;AACF;AAEA,WAAW,KAAK,IAAI;AAAA,EAClB,MAAM,GAAG,IAAqB;AAC5B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AAO;AAAA,IAC7E,SAAS,KAAK;AACZ,UAAI,OAAO,MAAM,EAAE,IAAI,GAAG,wBAAwB;AAClD,aAAO,IAAI,KAAK;AAAA,QACd,OACE,eAAe,+CACX,IAAI,UACJ;AAAA,MACR,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,SAAS,SAAS,KAAe,MAAe;AAC9C,QAAM,UAAU,KAAK,UAAU,MAAM,MAAM,CAAC;AAC5C,SAAO,IAAI,KAAK,MAAM,EAAE,KAAK,OAAO;AACtC;","names":["import_oauth_client_node","import_common","SqliteDb","import_common","isValidHandleSyntax","path","fs","os","crypto","import_common","id","id","is$typed","validate","is$typed","validate","express","authClientMountPath","searchParams","path","state"]}