API 룰

<aside> 💬

API 명세 작성 규칙

WebSocket API 명세

워크스페이스 관련 이벤트

이벤트 설명 요청 데이터 응답 이벤트 응답 데이터
leave/workspace 워크스페이스 퇴장 { workspaceId: string, userId: string } workspace/user/left { workspaceId: string, userName: string, message: string }
invite/workspace 워크스페이스 초대 { email: string, workspaceId: string } invite/workspace/success 또는 invite/workspace/fail { email: string, workspaceId: string, message: string }
workspace/rename 워크스페이스 이름 변경 { workspaceId: string, newName: string } workspace/list 업데이트된 워크스페이스 목록

페이지 관련 이벤트

이벤트 설명 요청 데이터 응답 이벤트 응답 데이터
join/page 페이지 참여 { pageId: string } join/page { pageId: string, serializedPage: Page }
leave/page 페이지 퇴장 { pageId: string } - -
create/page 페이지 생성 RemotePageCreateOperation create/page { type: "pageCreate", workspaceId: string, clientId: number, page: SerializedPage }
delete/page 페이지 삭제 RemotePageDeleteOperation delete/page { type: "pageDelete", workspaceId: string, pageId: string, pageTitle: string }
update/page 페이지 업데이트 { pageId: string, title?: string, icon?: string } update/page { type: "pageUpdate", workspaceId: string, pageId: string, title?: string, icon?: string }

블록 관련 이벤트

이벤트 설명 요청 데이터 응답 이벤트
insert/block 블록 삽입 RemoteBlockInsertOperation insert/block
delete/block 블록 삭제 RemoteBlockDeleteOperation delete/block
update/block 블록 업데이트 RemoteBlockUpdateOperation update/block
reorder/block 블록 순서 변경 RemoteBlockReorderOperation reorder/block
checkbox/block 체크박스 상태 변경 RemoteBlockCheckboxOperation checkbox/block

문자(Character) 관련 이벤트

이벤트 설명 요청 데이터 응답 이벤트
insert/char 문자 삽입 RemoteCharInsertOperation insert/char
delete/char 문자 삭제 RemoteCharDeleteOperation delete/char
update/char 문자 업데이트 RemoteCharUpdateOperation update/char

기타 이벤트

이벤트 설명 요청 데이터 응답 이벤트
cursor 커서 위치 업데이트 CursorPosition cursor
batch/operations 다중 작업 처리 Operation[] batch/operations
- 워크스페이스 접속자 수 갱신 - workspace/connections

자동 발생 이벤트

이벤트 설명 발생 시점 데이터
assign/clientId 클라이언트 ID 할당 연결 시 number (클라이언트 ID)
workspace 워크스페이스 정보 전송 연결 시 현재 워크스페이스 정보
workspace/list 워크스페이스 목록 전송 연결 시 접근 가능한 워크스페이스 목록
workspace/user/join 사용자 입장 알림 워크스페이스 입장 시 { workspaceId: string, userName: string, message: string }

Auth API 명세

Method Endpoint 설명 요청 데이터 응답 데이터 상태 코드
POST /auth/register 회원가입 { email: string, password: string, name: string } - • 201: 가입 성공<br>• 400: 유효하지 않은 이메일<br>• 409: 중복 이메일
POST /auth/login 로그인 { email: string, password: string } { id: string, email: string, name: string } • 200: 로그인 성공<br>• 401: 인증 실패
POST /auth/logout 로그아웃 - - • 200: 로그아웃 성공<br>• 401: 인증 실패
GET /auth/profile 프로필 조회 - { id: string, email: string, name: string } • 200: 조회 성공<br>• 401: 인증 실패
GET /auth/refresh 토큰 갱신 - { id: string, email: string, name: string } • 200: 갱신 성공<br>• 401: 인증 실패

인증 헤더