(value: unknown, organizationId: string)
| 239 | }; |
| 240 | |
| 241 | const 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 | |
| 258 | const orgCreatedFromResponse = (value: unknown, organizationId: string): CreatedApiKey | null => |
| 259 | Option.match(decodeCreateOrgApiKeyResponse(value), { |
no test coverage detected