MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / summaryFromApiKey

Function summaryFromApiKey

apps/cloud/src/auth/api-keys.ts:199–210  ·  view source on GitHub ↗
(apiKey: typeof ApiKey.Type)

Source from the content-addressed store, hash-verified

197 });
198
199const summaryFromApiKey = (apiKey: typeof ApiKey.Type): ApiKeySummary | null => {
200 const organizationId = apiKey.owner.organizationId ?? apiKey.owner.organization_id;
201 if (!organizationId) return null;
202 return {
203 id: apiKey.id,
204 name: apiKey.name ?? "API key",
205 obfuscatedValue: apiKey.obfuscatedValue ?? apiKey.obfuscated_value ?? "",
206 createdAt: apiKey.createdAt ?? apiKey.created_at ?? "",
207 updatedAt: apiKey.updatedAt ?? apiKey.updated_at ?? "",
208 lastUsedAt: apiKey.lastUsedAt ?? apiKey.last_used_at ?? null,
209 };
210};
211
212const listFromResponse = (value: unknown): readonly ApiKeySummary[] =>
213 Option.match(decodeListApiKeysResponse(value), {

Callers 2

listFromResponseFunction · 0.85
createdFromResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected