(apiKey: typeof ApiKey.Type)
| 197 | }); |
| 198 | |
| 199 | const 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 | |
| 212 | const listFromResponse = (value: unknown): readonly ApiKeySummary[] => |
| 213 | Option.match(decodeListApiKeysResponse(value), { |
no outgoing calls
no test coverage detected