UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.42 kB
import"./openclaw-state-read-sqlite-worker-operation-admission-DdAi_0af.mjs";import{a as e,r as t}from"./openclaw-state-read-kysely-sync-Bcu0Qb7F.mjs";import{o as n}from"./openclaw-state-read-openclaw-state-db-schema-helpers-QFZd8aJI.mjs";import{a as r}from"./openclaw-state-read-sqlite-transaction-Bt-IwVhZ.mjs";import{n as i,r as a,t as o}from"./openclaw-state-read-user-github-connections.kernel-CdZA3NC_.mjs";import"node:crypto";function listUserGitHubConnections(r){if(!n(r,`secret_store_entries`)||!n(r,`user_profiles`))return[];let i=e(r);return t(r,i.selectFrom(`secret_store_entries`).innerJoin(`user_profiles`,`user_profiles.id`,`secret_store_entries.scope_id`).select([`scope_id`,`value`]).where(`scope_kind`,`=`,`identity`).where(`name`,`=`,`github-connection`).where(`kind`,`=`,`secret`).where(`allowed_hosts`,`is`,null).where(`deleted_at_ms`,`is`,null).where(`merged_into`,`is`,null).orderBy(`scope_id`)).rows.flatMap(e=>{try{return[{owner:e.scope_id,connection:o(e.value)}]}catch{return[]}})}const s={"userGitHubConnections.read":({owner:e},t)=>({type:`userGitHubConnections.read`,connection:r(t,()=>a(t,e))}),"userGitHubConnections.readCanonical":({profile:e},t)=>({type:`userGitHubConnections.readCanonical`,canonical:r(t,()=>i(t,e))}),"userGitHubConnections.list":(e,t)=>({type:`userGitHubConnections.list`,connections:listUserGitHubConnections(t)})};export{s as userGitHubConnectionReadOperations};