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

Function orgListFromResponse

apps/cloud/src/auth/api-keys.ts:241–256  ·  view source on GitHub ↗
(value: unknown, organizationId: string)

Source from the content-addressed store, hash-verified

239};
240
241const orgListFromResponse = (value: unknown, organizationId: string): readonly ApiKeySummary[] =>
242 Option.match(decodeListOrgApiKeysResponse(value), {
243 onNone: () => [],
244 onSome: ({ data }) =>
245 data.flatMap((entry) =>
246 Option.match(decodeOrgApiKey(entry), {
247 // Not an org-owned key (a user key sharing the listing, or a shape we
248 // don't recognize) — skip the row, keep the rest.
249 onNone: () => [],
250 onSome: (apiKey) => {
251 const summary = summaryFromOrgApiKey(apiKey, organizationId);
252 return summary ? [summary] : [];
253 },
254 }),
255 ),
256 });
257
258const orgCreatedFromResponse = (value: unknown, organizationId: string): CreatedApiKey | null =>
259 Option.match(decodeCreateOrgApiKeyResponse(value), {

Callers 1

ApiKeyServiceClass · 0.85

Calls 1

summaryFromOrgApiKeyFunction · 0.85

Tested by

no test coverage detected