openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.42 kB
JavaScript
import{a as e,r as t}from"./openclaw-state-read-kysely-sync-DQyYiAw5.mjs";import"./openclaw-state-read-sqlite-worker-operation-admission-DTfv_SKu.mjs";import{a as n}from"./openclaw-state-read-sqlite-transaction-V1rK3HH2.mjs";import{o as r}from"./openclaw-state-read-openclaw-state-db-schema-helpers-BkqUYEFY.mjs";import{n as i,r as a,t as o}from"./openclaw-state-read-user-github-connections.kernel-C1MHC6oB.mjs";import"node:crypto";function listUserGitHubConnections(n){if(!r(n,`secret_store_entries`)||!r(n,`user_profiles`))return[];let i=e(n);return t(n,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:n(t,()=>a(t,e))}),"userGitHubConnections.readCanonical":({profile:e},t)=>({type:`userGitHubConnections.readCanonical`,canonical:n(t,()=>i(t,e))}),"userGitHubConnections.list":(e,t)=>({type:`userGitHubConnections.list`,connections:listUserGitHubConnections(t)})};export{s as userGitHubConnectionReadOperations};