MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / getUserApiKeys

Function getUserApiKeys

packages/web/src/actions.ts:172–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170 }));
171
172export const getUserApiKeys = async (): Promise<{ name: string; createdAt: Date; lastUsedAt: Date | null }[] | ServiceError> => sew(() =>
173 withAuth(async ({ org, user, prisma }) => {
174 const apiKeys = await prisma.apiKey.findMany({
175 where: {
176 orgId: org.id,
177 createdById: user.id,
178 },
179 orderBy: {
180 createdAt: 'desc',
181 }
182 });
183
184 return apiKeys.map((apiKey) => ({
185 name: apiKey.name,
186 createdAt: apiKey.createdAt,
187 lastUsedAt: apiKey.lastUsedAt,
188 }));
189 }));
190
191export const getRepos = async ({
192 where,

Callers 1

page.tsxFile · 0.90

Calls 2

sewFunction · 0.90
withAuthFunction · 0.90

Tested by

no test coverage detected