@shinguakira/portfolio-api-types
v1.0.0
Published
TypeScript types for Shingu Akira Portfolio API responses
Maintainers
Readme
@shinguakira/portfolio-api-types
TypeScript types for Shingu Akira Portfolio API responses.
Installation
npm install @shinguakira/portfolio-api-typesUsage
import type {
ApiResponse,
ProfileResponse,
ExperienceResponse,
ProjectsResponse,
SkillsResponse,
EducationResponse,
CertificationsResponse,
FaqResponse,
StrongPointsResponse,
ChangelogResponse,
ContactResponse,
LinksResponse,
} from '@shinguakira/portfolio-api-types';
// Example: Fetch profile with type safety
async function fetchProfile(
lang: 'en' | 'ja'
): Promise<ProfileResponse | null> {
const response = await fetch(`/api/profile?lang=${lang}`);
const result: ApiResponse<ProfileResponse> = await response.json();
return result.data ?? null;
}
// Example: Fetch projects
async function fetchProjects(lang: 'en' | 'ja'): Promise<ProjectsResponse> {
const response = await fetch(`/api/projects?lang=${lang}`);
const result: ApiResponse<ProjectsResponse> = await response.json();
return result.data ?? [];
}Available Types
Response Types
| Type | Endpoint | Description |
| ------------------------ | ------------------------- | -------------------------------------- |
| ProfileResponse | GET /api/profile | Profile data with name, title, summary |
| ExperienceResponse | GET /api/experience | Work experience array |
| ProjectsResponse | GET /api/projects | Projects array |
| SkillsResponse | GET /api/skills | Skills array |
| EducationResponse | GET /api/education | Education history array |
| CertificationsResponse | GET /api/certifications | Certifications array |
| FaqResponse | GET /api/faq | FAQ items array |
| StrongPointsResponse | GET /api/strong-points | Strong points array |
| ChangelogResponse | GET /api/changelog | Changelog entries array |
| ContactResponse | GET /api/contact | Contact information |
| LinksResponse | GET /api/links | External links |
Base Types
WorkExperience- Single work experience itemProject- Single project itemSkillItem- Single skill itemEducationHistory- Single education itemCertificationItem- Single certification itemFaq- Single FAQ itemStrongPoint- Single strong point itemChangelogItem- Single changelog entryContact- Contact informationLinks- External linksSocialLink- Social media linkLocalizedProfileData- Localized profile content
Generic Wrapper
interface ApiResponse<T> {
message: string;
data?: T | null;
}API Endpoints
All endpoints support ?lang=ja or ?lang=en query parameter for localization (defaults to Japanese).
License
MIT
