From 92f4249c7a0c892a054a294e6e00063bca5b521c Mon Sep 17 00:00:00 2001 From: junjuny0227 Date: Sun, 29 Mar 2026 02:55:38 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EC=84=9C=EB=B2=84=20=EC=B5=9C?= =?UTF-8?q?=EC=8B=A0=20=EB=B3=80=EA=B2=BD=EC=82=AC=ED=95=AD=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=B0=20=EB=8F=99=EC=95=84=EB=A6=AC/=ED=95=99?= =?UTF-8?q?=EC=83=9D=20=EC=A1=B0=ED=9A=8C=20=ED=95=84=ED=84=B0=20=EB=B0=8F?= =?UTF-8?q?=20=EC=9D=91=EB=8B=B5=20=ED=83=80=EC=9E=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/domains/clubs.ts | 2 ++ src/domains/students.ts | 2 ++ src/index.ts | 8 +++++++- src/types/clubs.ts | 27 ++++++++++++++------------- src/types/health.ts | 8 +++----- src/types/index.ts | 2 +- src/types/neis.ts | 16 ++++------------ src/types/projects.ts | 17 ++++++----------- src/types/students.ts | 37 ++++++++++++++++++------------------- 9 files changed, 57 insertions(+), 62 deletions(-) diff --git a/src/domains/clubs.ts b/src/domains/clubs.ts index 2449f46..8f4830b 100644 --- a/src/domains/clubs.ts +++ b/src/domains/clubs.ts @@ -12,6 +12,8 @@ export class ClubsApi { clubId: request.clubId, clubName: request.clubName, clubType: request.clubType, + clubStatus: request.clubStatus, + foundedYear: request.foundedYear, page: request.page, size: request.size, includeLeaderInParticipants: request.includeLeaderInParticipants, diff --git a/src/domains/students.ts b/src/domains/students.ts index 370f6a6..eccb537 100644 --- a/src/domains/students.ts +++ b/src/domains/students.ts @@ -19,6 +19,8 @@ export class StudentsApi { role: request.role, dormitoryRoom: request.dormitoryRoom, includeGraduates: request.includeGraduates, + includeWithdrawn: request.includeWithdrawn, + onlyEnrolled: request.onlyEnrolled, page: request.page, size: request.size, sortBy: request.sortBy, diff --git a/src/index.ts b/src/index.ts index 51f3ff7..4730952 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,7 +32,13 @@ export type { GetStudentsResponse, } from './types/students'; -export type { Club, ClubSortBy, GetClubsRequest, GetClubsResponse } from './types/clubs'; +export type { + Club, + ClubSortBy, + ClubStatus, + GetClubsRequest, + GetClubsResponse, +} from './types/clubs'; export type { Project, diff --git a/src/types/clubs.ts b/src/types/clubs.ts index 62c64ce..08b2edd 100644 --- a/src/types/clubs.ts +++ b/src/types/clubs.ts @@ -1,19 +1,25 @@ -import type { ClubType, ParticipantInfo, SortDirection } from './index'; +import type { ApiResponse, ClubType, ParticipantInfo, SortDirection } from './index'; -export type ClubSortBy = 'ID' | 'NAME' | 'TYPE'; +export type ClubStatus = 'ACTIVE' | 'ABOLISHED'; +export type ClubSortBy = 'ID' | 'NAME' | 'TYPE' | 'FOUNDED_YEAR' | 'STATUS'; export interface Club { id: number; name: string; type: ClubType; - leader: ParticipantInfo; + leader?: ParticipantInfo; participants: ParticipantInfo[]; + foundedYear: number; + status: ClubStatus; + abolishedYear?: number; } export interface GetClubsRequest { clubId?: number; clubName?: string; clubType?: ClubType; + clubStatus?: ClubStatus; + foundedYear?: number; page?: number; size?: number; includeLeaderInParticipants?: boolean; @@ -21,13 +27,8 @@ export interface GetClubsRequest { sortDirection?: SortDirection; } -export interface GetClubsResponse { - status: string; - code: number; - message: string; - data: { - totalPages: number; - totalElements: number; - clubs: Club[]; - }; -} +export type GetClubsResponse = ApiResponse<{ + totalPages: number; + totalElements: number; + clubs: Club[]; +}>; diff --git a/src/types/health.ts b/src/types/health.ts index c12903d..c5969bb 100644 --- a/src/types/health.ts +++ b/src/types/health.ts @@ -1,5 +1,3 @@ -export interface HealthCheckResponse { - status: string; - code: number; - message: string; -} +import type { ApiResponse } from './index'; + +export type HealthCheckResponse = Omit, 'data'>; diff --git a/src/types/index.ts b/src/types/index.ts index d0ab67b..da9a9ff 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,7 +1,7 @@ export type SortDirection = 'ASC' | 'DESC'; export type Sex = 'MAN' | 'WOMAN'; export type Major = 'SW_DEVELOPMENT' | 'SMART_IOT' | 'AI'; -export type ClubType = 'MAJOR_CLUB' | 'JOB_CLUB' | 'AUTONOMOUS_CLUB'; +export type ClubType = 'MAJOR_CLUB' | 'AUTONOMOUS_CLUB'; export interface ClubSummary { id: number; diff --git a/src/types/neis.ts b/src/types/neis.ts index a2a4cdb..4693726 100644 --- a/src/types/neis.ts +++ b/src/types/neis.ts @@ -1,3 +1,5 @@ +import type { ApiResponse } from './index'; + export type MealType = 'BREAKFAST' | 'LUNCH' | 'DINNER'; export interface Meal { @@ -22,12 +24,7 @@ export interface GetMealsRequest { toDate?: string; } -export interface GetMealsResponse { - status: string; - code: number; - message: string; - data: Meal[]; -} +export type GetMealsResponse = ApiResponse; export interface Schedule { scheduleId: string; @@ -51,9 +48,4 @@ export interface GetSchedulesRequest { toDate?: string; } -export interface GetSchedulesResponse { - status: string; - code: number; - message: string; - data: Schedule[]; -} +export type GetSchedulesResponse = ApiResponse; diff --git a/src/types/projects.ts b/src/types/projects.ts index e59e930..8d55d09 100644 --- a/src/types/projects.ts +++ b/src/types/projects.ts @@ -1,4 +1,4 @@ -import type { ClubSummary, ParticipantInfo, SortDirection } from './index'; +import type { ApiResponse, ClubSummary, ParticipantInfo, SortDirection } from './index'; export type ProjectSortBy = 'ID' | 'NAME'; @@ -20,13 +20,8 @@ export interface GetProjectsRequest { sortDirection?: SortDirection; } -export interface GetProjectsResponse { - status: string; - code: number; - message: string; - data: { - totalPages: number; - totalElements: number; - projects: Project[]; - }; -} +export type GetProjectsResponse = ApiResponse<{ + totalPages: number; + totalElements: number; + projects: Project[]; +}>; diff --git a/src/types/students.ts b/src/types/students.ts index f6b5796..e506058 100644 --- a/src/types/students.ts +++ b/src/types/students.ts @@ -1,4 +1,4 @@ -import type { Sex, Major, ClubSummary, SortDirection } from './index'; +import type { ApiResponse, ClubSummary, Major, Sex, SortDirection } from './index'; export type Role = | 'STUDENT_COUNCIL' @@ -24,17 +24,19 @@ export interface Student { name: string; sex: Sex; email: string; - grade: number; - classNum: number; - number: number; - studentNumber: number; - major: Major; + grade?: number; + classNum?: number; + number?: number; + studentNumber?: number; + major?: Major; + specialty?: string; role: Role; - dormitoryFloor: number; - dormitoryRoom: number; + dormitoryFloor?: number; + dormitoryRoom?: number; majorClub?: ClubSummary; - jobClub?: ClubSummary; autonomousClub?: ClubSummary; + githubId?: string; + githubUrl?: string; } export interface GetStudentsRequest { @@ -48,19 +50,16 @@ export interface GetStudentsRequest { role?: Role; dormitoryRoom?: number; includeGraduates?: boolean; + includeWithdrawn?: boolean; + onlyEnrolled?: boolean; page?: number; size?: number; sortBy?: SortBy; sortDirection?: SortDirection; } -export interface GetStudentsResponse { - status: string; - code: number; - message: string; - data: { - totalPages: number; - totalElements: number; - students: Student[]; - }; -} +export type GetStudentsResponse = ApiResponse<{ + totalPages: number; + totalElements: number; + students: Student[]; +}>; From 13d5aea3dfe1c057b23218c12de552f99efcc41c Mon Sep 17 00:00:00 2001 From: junjuny0227 Date: Sun, 29 Mar 2026 02:58:18 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=ED=8C=A8=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EB=B2=84=EC=A0=84=EC=9D=84=201.0.0=EC=97=90=EC=84=9C=201.1.0?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3096dd7..20a8aef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@themoment-team/datagsm-openapi", - "version": "1.0.0", + "version": "1.1.0", "description": "Official JavaScript/TypeScript SDK for DataGSM OpenAPI", "license": "MIT", "author": "themoment-team",