@taco_tsinghua/graphnode-sdk 0.1.17 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -333
- package/dist/client.d.ts +24 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +34 -8
- package/dist/client.js.map +1 -1
- package/dist/endpoints/ai.d.ts +25 -30
- package/dist/endpoints/ai.d.ts.map +1 -1
- package/dist/endpoints/ai.js +220 -31
- package/dist/endpoints/ai.js.map +1 -1
- package/dist/endpoints/graph.d.ts +4 -1
- package/dist/endpoints/graph.d.ts.map +1 -1
- package/dist/endpoints/graph.js +10 -0
- package/dist/endpoints/graph.js.map +1 -1
- package/dist/endpoints/graphAi.d.ts +21 -0
- package/dist/endpoints/graphAi.d.ts.map +1 -1
- package/dist/endpoints/graphAi.js +24 -0
- package/dist/endpoints/graphAi.js.map +1 -1
- package/dist/endpoints/notification.d.ts +13 -0
- package/dist/endpoints/notification.d.ts.map +1 -1
- package/dist/endpoints/notification.js +17 -0
- package/dist/endpoints/notification.js.map +1 -1
- package/dist/endpoints/sync.d.ts +3 -1
- package/dist/endpoints/sync.d.ts.map +1 -1
- package/dist/endpoints/sync.js.map +1 -1
- package/dist/http-builder.d.ts +38 -0
- package/dist/http-builder.d.ts.map +1 -1
- package/dist/http-builder.js +43 -6
- package/dist/http-builder.js.map +1 -1
- package/dist/types/graph.d.ts +66 -0
- package/dist/types/graph.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/client.ts +140 -0
- package/src/config.ts +9 -0
- package/src/endpoints/agent.ts +171 -0
- package/src/endpoints/ai.ts +296 -0
- package/src/endpoints/auth.apple.ts +39 -0
- package/src/endpoints/auth.google.ts +39 -0
- package/src/endpoints/conversations.ts +362 -0
- package/src/endpoints/graph.ts +398 -0
- package/src/endpoints/graphAi.ts +111 -0
- package/src/endpoints/health.ts +40 -0
- package/src/endpoints/me.ts +97 -0
- package/src/endpoints/note.ts +351 -0
- package/src/endpoints/notification.ts +69 -0
- package/src/endpoints/sync.ts +71 -0
- package/src/http-builder.ts +290 -0
- package/src/index.ts +60 -0
- package/src/types/aiInput.ts +111 -0
- package/src/types/conversation.ts +51 -0
- package/src/types/graph.ts +201 -0
- package/src/types/graphAi.ts +21 -0
- package/src/types/me.ts +49 -0
- package/src/types/message.ts +40 -0
- package/src/types/note.ts +89 -0
- package/src/types/problem.ts +22 -0
- package/src/types/sync.ts +35 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph AI Generation Response DTO
|
|
3
|
+
* @public
|
|
4
|
+
* @property message 상태 메시지
|
|
5
|
+
* @property taskId 백그라운드 작업의 ID
|
|
6
|
+
* @property status 작업의 상태 (예: 'queued')
|
|
7
|
+
*/
|
|
8
|
+
export interface GraphGenerationResponseDto {
|
|
9
|
+
/**
|
|
10
|
+
* Status message
|
|
11
|
+
*/
|
|
12
|
+
message: string;
|
|
13
|
+
/**
|
|
14
|
+
* The ID of the background task
|
|
15
|
+
*/
|
|
16
|
+
taskId: string;
|
|
17
|
+
/**
|
|
18
|
+
* The status of the task (e.g., 'queued')
|
|
19
|
+
*/
|
|
20
|
+
status: string;
|
|
21
|
+
}
|
package/src/types/me.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 사용자 프로필 DTO
|
|
3
|
+
* @public
|
|
4
|
+
* @property id 사용자 ID (UUID/ULID)
|
|
5
|
+
* @property email 이메일 (선택)
|
|
6
|
+
* @property displayName 표시 이름
|
|
7
|
+
* @property avatarUrl 아바타 URL (없으면 null)
|
|
8
|
+
*/
|
|
9
|
+
export interface UserProfileDto {
|
|
10
|
+
id: string;
|
|
11
|
+
email?: string | null;
|
|
12
|
+
displayName?: string | null;
|
|
13
|
+
avatarUrl?: string | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 내 정보 응답 DTO
|
|
18
|
+
* @public
|
|
19
|
+
* @property userId 사용자 ID
|
|
20
|
+
* @property profile 사용자 프로필 정보 (선택)
|
|
21
|
+
*/
|
|
22
|
+
export interface MeResponseDto {
|
|
23
|
+
userId: string;
|
|
24
|
+
profile?: UserProfileDto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* API Key 모델 타입
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export type ApiKeyModel = 'openai' | 'deepseek';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* GET /v1/me/api-keys 응답 DTO
|
|
35
|
+
* @public
|
|
36
|
+
* @property apiKey 마스킹된 API 키 또는 null
|
|
37
|
+
*/
|
|
38
|
+
export interface ApiKeysResponseDto {
|
|
39
|
+
apiKey: string | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* PATCH /v1/me/api-keys/:model 요청 DTO
|
|
44
|
+
* @public
|
|
45
|
+
* @property apiKey 설정할 API 키
|
|
46
|
+
*/
|
|
47
|
+
export interface UpdateApiKeyRequestDto {
|
|
48
|
+
apiKey: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 메시지(Message) DTO
|
|
3
|
+
* @public
|
|
4
|
+
* @property id 메시지 ID (UUID/ULID)
|
|
5
|
+
* @property role 메시지 역할 ('user' | 'assistant' | 'system')
|
|
6
|
+
* @property content 메시지 내용
|
|
7
|
+
* @property createdAt 생성 일시 (ISO 8601)
|
|
8
|
+
* @property updatedAt 수정 일시 (ISO 8601)
|
|
9
|
+
* @property deletedAt 삭제 일시 (ISO 8601, null이면 활성)
|
|
10
|
+
*/
|
|
11
|
+
export interface MessageDto {
|
|
12
|
+
id: string; // FE generated UUID/ULID
|
|
13
|
+
role: 'user' | 'assistant' | 'system';
|
|
14
|
+
content: string;
|
|
15
|
+
createdAt?: string; // ISO 8601
|
|
16
|
+
updatedAt?: string; // ISO 8601
|
|
17
|
+
deletedAt?: string | null; // ISO 8601
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 메시지 생성 요청 DTO
|
|
22
|
+
* @public
|
|
23
|
+
* @property id 메시지 ID (선택, 클라이언트 생성 시)
|
|
24
|
+
* @property role 메시지 역할
|
|
25
|
+
* @property content 메시지 내용
|
|
26
|
+
*/
|
|
27
|
+
export interface MessageCreateDto {
|
|
28
|
+
id?: string;
|
|
29
|
+
role: 'user' | 'assistant' | 'system';
|
|
30
|
+
content: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 메시지 수정 요청 DTO
|
|
35
|
+
* @public
|
|
36
|
+
* @property content 변경할 메시지 내용 (선택)
|
|
37
|
+
*/
|
|
38
|
+
export interface MessageUpdateDto {
|
|
39
|
+
content?: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note DTO
|
|
3
|
+
* @public
|
|
4
|
+
* @property id 노트 ID (UUID)
|
|
5
|
+
* @property title 노트 제목
|
|
6
|
+
* @property content 노트 내용 (Markdown)
|
|
7
|
+
* @property folderId 폴더 ID (null이면 최상위)
|
|
8
|
+
* @property createdAt 생성 일시 (ISO 8601)
|
|
9
|
+
* @property updatedAt 수정 일시 (ISO 8601)
|
|
10
|
+
* @property deletedAt 삭제 일시 (ISO 8601, null이면 활성)
|
|
11
|
+
*/
|
|
12
|
+
export interface NoteDto {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
content: string;
|
|
16
|
+
folderId: string | null;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
deletedAt?: string | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Folder DTO
|
|
24
|
+
* @public
|
|
25
|
+
* @property id 폴더 ID (UUID)
|
|
26
|
+
* @property name 폴더 이름
|
|
27
|
+
* @property parentId 상위 폴더 ID (null이면 최상위)
|
|
28
|
+
* @property createdAt 생성 일시 (ISO 8601)
|
|
29
|
+
* @property updatedAt 수정 일시 (ISO 8601)
|
|
30
|
+
* @property deletedAt 삭제 일시 (ISO 8601, null이면 활성)
|
|
31
|
+
*/
|
|
32
|
+
export interface FolderDto {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
parentId: string | null;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
deletedAt?: string | null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Note Create DTO
|
|
43
|
+
* @public
|
|
44
|
+
* @property id 노트 ID (UUID) - 클라이언트 생성
|
|
45
|
+
* @property title 노트 제목 (선택)
|
|
46
|
+
* @property content 노트 내용
|
|
47
|
+
* @property folderId 폴더 ID (선택)
|
|
48
|
+
*/
|
|
49
|
+
export interface NoteCreateDto {
|
|
50
|
+
id: string;
|
|
51
|
+
title?: string;
|
|
52
|
+
content: string;
|
|
53
|
+
folderId?: string | null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Note Update DTO
|
|
58
|
+
* @public
|
|
59
|
+
* @property title 노트 제목 (선택)
|
|
60
|
+
* @property content 노트 내용 (선택)
|
|
61
|
+
* @property folderId 폴더 ID (선택)
|
|
62
|
+
*/
|
|
63
|
+
export interface NoteUpdateDto {
|
|
64
|
+
title?: string;
|
|
65
|
+
content?: string;
|
|
66
|
+
folderId?: string | null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Folder Create DTO
|
|
71
|
+
* @public
|
|
72
|
+
* @property name 폴더 이름
|
|
73
|
+
* @property parentId 상위 폴더 ID (선택)
|
|
74
|
+
*/
|
|
75
|
+
export interface FolderCreateDto {
|
|
76
|
+
name: string;
|
|
77
|
+
parentId?: string | null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Folder Update DTO
|
|
82
|
+
* @public
|
|
83
|
+
* @property name 폴더 이름 (선택)
|
|
84
|
+
* @property parentId 상위 폴더 ID (선택)
|
|
85
|
+
*/
|
|
86
|
+
export interface FolderUpdateDto {
|
|
87
|
+
name?: string;
|
|
88
|
+
parentId?: string | null;
|
|
89
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 9457 Problem Details (에러 응답)
|
|
3
|
+
* @public
|
|
4
|
+
* @property type 문제 유형 URI
|
|
5
|
+
* @property title 문제 제목
|
|
6
|
+
* @property status HTTP 상태 코드
|
|
7
|
+
* @property detail 문제 상세 설명
|
|
8
|
+
* @property instance 문제 발생 리소스 URI
|
|
9
|
+
* @property correlationId 요청 추적 ID
|
|
10
|
+
* @property errors 세부 에러 목록 (선택)
|
|
11
|
+
* @property retryable 재시도 가능 여부 (선택)
|
|
12
|
+
*/
|
|
13
|
+
export interface ProblemDetails {
|
|
14
|
+
type: string;
|
|
15
|
+
title: string;
|
|
16
|
+
status: number;
|
|
17
|
+
detail: string;
|
|
18
|
+
instance: string;
|
|
19
|
+
correlationId?: string;
|
|
20
|
+
errors?: Array<Record<string, unknown>>;
|
|
21
|
+
retryable?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ConversationDto } from './conversation.js';
|
|
2
|
+
import type { MessageDto } from './message.js';
|
|
3
|
+
import type { NoteDto, FolderDto } from './note.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 동기화 푸시 요청 DTO
|
|
7
|
+
* @public
|
|
8
|
+
* @property conversations 변경된 대화 목록 (선택)
|
|
9
|
+
* @property messages 변경된 메시지 목록 (선택, conversationId 포함)
|
|
10
|
+
* @property notes 변경된 노트 목록 (선택)
|
|
11
|
+
* @property folders 변경된 폴더 목록 (선택)
|
|
12
|
+
*/
|
|
13
|
+
export interface SyncPushRequest {
|
|
14
|
+
conversations?: ConversationDto[];
|
|
15
|
+
messages?: (MessageDto & { conversationId: string })[];
|
|
16
|
+
notes?: NoteDto[];
|
|
17
|
+
folders?: FolderDto[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 동기화 풀 응답 DTO
|
|
22
|
+
* @public
|
|
23
|
+
* @property conversations 변경된 대화 목록
|
|
24
|
+
* @property messages 변경된 메시지 목록
|
|
25
|
+
* @property notes 변경된 노트 목록
|
|
26
|
+
* @property folders 변경된 폴더 목록
|
|
27
|
+
* @property serverTime 서버 현재 시각 (ISO 8601) - 다음 동기화 커서로 사용
|
|
28
|
+
*/
|
|
29
|
+
export interface SyncPullResponse {
|
|
30
|
+
conversations: ConversationDto[];
|
|
31
|
+
messages: MessageDto[];
|
|
32
|
+
notes: NoteDto[];
|
|
33
|
+
folders: FolderDto[];
|
|
34
|
+
serverTime: string; // ISO 8601
|
|
35
|
+
}
|