apick-api 4.0.0 → 4.1.0
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/CHANGELOG.md +176 -159
- package/README.md +19 -5
- package/docs/guide.en.md +26 -4
- package/docs/guide.ko.md +26 -3
- package/docs/skill-artifacts.md +24 -24
- package/examples/basic.mjs +10 -10
- package/examples/commonjs.cjs +12 -12
- package/examples/files.mjs +9 -9
- package/package.json +1 -1
- package/src/form.cjs +28 -28
- package/src/index.cjs +1199 -1036
- package/src/index.d.ts +648 -472
- package/src/index.js +15 -15
package/src/index.d.ts
CHANGED
|
@@ -1,209 +1,370 @@
|
|
|
1
|
-
export interface ApickClientOptions {
|
|
2
|
-
apiKey: string;
|
|
3
|
-
baseUrl?: string;
|
|
4
|
-
timeoutMs?: number;
|
|
5
|
-
/** Requests with a body use native FormData; GET requests have no body. */
|
|
6
|
-
fetch?: typeof fetch;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface ApickMeta {
|
|
10
|
-
readonly cost: number | null;
|
|
11
|
-
readonly durationMs: number | null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface ApickResult<T = Record<string, unknown>> {
|
|
15
|
-
readonly data: T;
|
|
16
|
-
readonly meta: ApickMeta;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export interface
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
export interface ApickClientOptions {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
timeoutMs?: number;
|
|
5
|
+
/** Requests with a body use native FormData; GET requests have no body. */
|
|
6
|
+
fetch?: typeof fetch;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ApickMeta {
|
|
10
|
+
readonly cost: number | null;
|
|
11
|
+
readonly durationMs: number | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ApickResult<T = Record<string, unknown>> {
|
|
15
|
+
readonly data: T;
|
|
16
|
+
readonly meta: ApickMeta;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface SearchList<T> {
|
|
20
|
+
readonly keyword: string;
|
|
21
|
+
readonly page?: number;
|
|
22
|
+
readonly count: number;
|
|
23
|
+
readonly items: readonly T[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface NewsItem {
|
|
27
|
+
readonly rank: number;
|
|
28
|
+
readonly title: string;
|
|
29
|
+
readonly link: string;
|
|
30
|
+
readonly source: string;
|
|
31
|
+
readonly published: string;
|
|
32
|
+
readonly description: string;
|
|
33
|
+
readonly image_url: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ShoppingItem {
|
|
37
|
+
readonly rank: number;
|
|
38
|
+
readonly title: string;
|
|
39
|
+
readonly price: string;
|
|
40
|
+
readonly old_price: string;
|
|
41
|
+
readonly shop: string;
|
|
42
|
+
readonly rating: number | null;
|
|
43
|
+
readonly reviews: number | null;
|
|
44
|
+
readonly link: string;
|
|
45
|
+
readonly image_url: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface PlaceItem {
|
|
49
|
+
readonly rank: number;
|
|
50
|
+
readonly name: string;
|
|
51
|
+
readonly address: string;
|
|
52
|
+
readonly phone: string;
|
|
53
|
+
readonly categories: readonly string[];
|
|
54
|
+
readonly rating: number | null;
|
|
55
|
+
readonly reviews: number | null;
|
|
56
|
+
readonly price_range: string;
|
|
57
|
+
readonly open_status: string;
|
|
58
|
+
readonly open_hours: Readonly<Record<string, string>>;
|
|
59
|
+
readonly website: string;
|
|
60
|
+
readonly latitude: number | null;
|
|
61
|
+
readonly longitude: number | null;
|
|
62
|
+
readonly place_id: string;
|
|
63
|
+
readonly map_link: string;
|
|
64
|
+
readonly thumbnail: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface RankCheck {
|
|
68
|
+
readonly keyword: string;
|
|
69
|
+
readonly domain: string;
|
|
70
|
+
readonly found: boolean;
|
|
71
|
+
readonly rank: number | null;
|
|
72
|
+
readonly matches: readonly { readonly rank: number; readonly title: string; readonly link: string }[];
|
|
73
|
+
readonly checked_results: number;
|
|
74
|
+
/** 확인한 10위 구간 수(최대 10). */
|
|
75
|
+
readonly checked_pages: number;
|
|
76
|
+
/** 1~100위를 모두 확인했거나 앞에서부터 끊김 없이 확인한 구간에서 찾았으면 true. false 면 확인한 구간 비율만큼만 과금된다. */
|
|
77
|
+
readonly complete: boolean;
|
|
78
|
+
/** 확인하지 못한 순위 구간(예: "41-50"). */
|
|
79
|
+
readonly unchecked_ranks: readonly string[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface InstagramProfile {
|
|
83
|
+
readonly username: string;
|
|
84
|
+
readonly full_name: string;
|
|
85
|
+
readonly biography: string;
|
|
86
|
+
readonly followers: number | null;
|
|
87
|
+
readonly following: number | null;
|
|
88
|
+
readonly posts_count: number | null;
|
|
89
|
+
readonly is_verified: boolean;
|
|
90
|
+
readonly is_private: boolean;
|
|
91
|
+
readonly external_urls: readonly string[];
|
|
92
|
+
readonly highlights_count: number | null;
|
|
93
|
+
readonly profile_image_url: string;
|
|
94
|
+
readonly profile_url: string;
|
|
95
|
+
readonly recent_posts: readonly { readonly url: string; readonly content_type: string; readonly caption: string; readonly posted_at: string; readonly image_url: string; readonly hashtags: readonly string[] }[];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface InstagramPost {
|
|
99
|
+
readonly url: string;
|
|
100
|
+
readonly shortcode: string;
|
|
101
|
+
readonly username: string;
|
|
102
|
+
readonly caption: string;
|
|
103
|
+
readonly content_type: string;
|
|
104
|
+
readonly posted_at: string;
|
|
105
|
+
readonly likes: number | null;
|
|
106
|
+
readonly comments: number | null;
|
|
107
|
+
readonly views: number | null;
|
|
108
|
+
readonly duration_sec: number | null;
|
|
109
|
+
readonly hashtags: readonly string[];
|
|
110
|
+
readonly is_paid_partnership: boolean;
|
|
111
|
+
readonly coauthors: readonly string[];
|
|
112
|
+
readonly thumbnail_url: string;
|
|
113
|
+
readonly image_urls: readonly string[];
|
|
114
|
+
readonly video_url: string;
|
|
115
|
+
readonly author: { readonly followers: number | null; readonly is_verified: boolean; readonly profile_url: string };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface TiktokProfile {
|
|
119
|
+
readonly username: string;
|
|
120
|
+
readonly nickname: string;
|
|
121
|
+
readonly biography: string;
|
|
122
|
+
readonly followers: number | null;
|
|
123
|
+
readonly following: number | null;
|
|
124
|
+
readonly likes: number | null;
|
|
125
|
+
readonly videos_count: number | null;
|
|
126
|
+
readonly is_verified: boolean;
|
|
127
|
+
readonly is_private: boolean;
|
|
128
|
+
readonly bio_link: string;
|
|
129
|
+
readonly engagement_rate: number | null;
|
|
130
|
+
readonly created_at: string;
|
|
131
|
+
readonly profile_image_url: string;
|
|
132
|
+
readonly profile_url: string;
|
|
133
|
+
readonly recent_videos: readonly { readonly video_id: string; readonly url: string; readonly views: number | null; readonly likes: number | null; readonly comments: number | null; readonly shares: number | null; readonly posted_at: string; readonly cover_image_url: string }[];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface BinaryInput {
|
|
137
|
+
readonly size?: number;
|
|
138
|
+
readonly type?: string;
|
|
139
|
+
readonly name?: string;
|
|
140
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface OcrOptions {
|
|
144
|
+
filename?: string;
|
|
145
|
+
contentType?: 'image/png' | 'image/jpeg';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export type ImageAiFormat = 'png' | 'jpeg' | 'webp';
|
|
149
|
+
export type ImageAiBackground = 'auto' | 'opaque' | 'transparent';
|
|
150
|
+
export type ImageAiSize = '1024x1024' | '1536x1024' | '1024x1536' | '1152x864' | '864x1152';
|
|
151
|
+
/** basic 40P(default) · advanced 350P · premium 1,400P per image */
|
|
152
|
+
export type ImageAiQuality = 'basic' | 'advanced' | 'premium';
|
|
153
|
+
export type ImageAiStatus = 'waiting' | 'processing' | 'completed' | 'completed_partial' | 'failed';
|
|
154
|
+
export type ApickImageErrorCode = `APICK_IMAGE_${string}`;
|
|
155
|
+
export interface ImageAiOptions { imageCount?: number; size?: ImageAiSize; outputFormat?: ImageAiFormat; background?: ImageAiBackground; quality?: ImageAiQuality;
|
|
156
|
+
/** @deprecated Ignored. Every image request is generated and charged as a new request. */
|
|
157
|
+
idempotencyKey?: string; }
|
|
158
|
+
export interface ImageAiGenerateOptions extends ImageAiOptions { referenceImage?: string|BinaryInput|ArrayBuffer|ArrayBufferView; referenceFilename?: string; referenceContentType?: 'image/png'|'image/jpeg'|'image/webp'; }
|
|
159
|
+
export interface ImageAiEditOptions extends ImageAiOptions { filename?: string; contentType?: 'image/png'|'image/jpeg'|'image/webp'; }
|
|
160
|
+
export interface ImageAiResultImage { index:number; b64_json:string; mime_type:'image/png'|'image/jpeg'|'image/webp'; width:number; height:number; }
|
|
40
161
|
export interface ImageAiResultData { request_id:string; image_count:number; images:ImageAiResultImage[]; idempotent_replay?:boolean; }
|
|
41
162
|
export interface ImageAiPendingData {request_id:string;job_id:string;status:'processing';billing_status:'pending';reserved_point:number;}
|
|
42
|
-
export interface ImageAiJobData { job_id:string; status:ImageAiStatus; requested_count:number; completed_count?:number; failed_count?:number; prepaid_point?:number; charged_point?:number; refunded_point?:number; result_available?:boolean; expires_at?:string|null; error_code?:ApickImageErrorCode|null; }
|
|
43
|
-
|
|
44
|
-
export interface MaskResidentNumberOptions extends OcrOptions {
|
|
45
|
-
type: 1 | 2 | 3 | 4;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const AUTH_PROVIDERS: readonly [
|
|
49
|
-
'kakao', 'naver', 'toss', 'pass', 'samsung', 'kb', 'shinhan', 'hana', 'woori', 'ibk', 'nh', 'kakaobank', 'banksalad'
|
|
50
|
-
];
|
|
51
|
-
export type AuthProvider = typeof AUTH_PROVIDERS[number];
|
|
52
|
-
|
|
53
|
-
/** 간편인증 기반 조회 상품(재직·소득·연금·면허·건강검진 등)의 공통 입력. */
|
|
54
|
-
export interface DataRequestInput {
|
|
55
|
-
name: string;
|
|
56
|
-
birthDate: string;
|
|
57
|
-
phone: string;
|
|
58
|
-
authProvider: AuthProvider;
|
|
59
|
-
}
|
|
60
|
-
export interface RequestEmploymentInput extends DataRequestInput { insuranceYears?: number; }
|
|
61
|
-
export interface RequestPersonalIncomeInput extends DataRequestInput { incomeYears?: number; }
|
|
62
|
-
export interface RequestNpsJoinHistoryInput extends DataRequestInput { from?: string; to?: string; }
|
|
63
|
-
export interface RequestDrivingLicenseInput extends DataRequestInput {}
|
|
64
|
-
export interface RequestHealthCheckupInput extends DataRequestInput {}
|
|
65
|
-
export interface RequestCashReceiptDeductionInput extends DataRequestInput { incomeYears?: number; }
|
|
66
|
-
export interface RequestTaxReturnHistoryInput extends DataRequestInput { years?: number; }
|
|
67
|
-
|
|
68
|
-
export type DataRequestStatus =
|
|
69
|
-
| 'AUTH_REQUESTED' | 'AUTH_WAITING' | 'AUTH_COMPLETED' | 'AUTH_REJECTED' | 'AUTH_EXPIRED'
|
|
70
|
-
| 'COLLECTING' | 'COLLECTED' | 'PARTIAL_SUCCESS' | 'SUCCESS' | 'FAILED';
|
|
71
|
-
export type DataRequestErrorCode = 'RESULT_EXPIRED' | 'AUTH_EXPIRED' | 'AUTH_REJECTED' | 'COLLECT_FAILED';
|
|
72
|
-
export interface DataRequestSource { source: string; type: string; status: string; }
|
|
73
|
-
|
|
74
|
-
/** `request*()` (POST /rest/req_*) 응답의 `data`. */
|
|
75
|
-
export interface DataRequestAcceptedData {
|
|
76
|
-
schemaVersion: string;
|
|
77
|
-
transactionId: string;
|
|
78
|
-
product: string;
|
|
79
|
-
status: DataRequestStatus;
|
|
80
|
-
resultAvailable: boolean;
|
|
81
|
-
charged: boolean;
|
|
82
|
-
sources: DataRequestSource[];
|
|
83
|
-
message: string;
|
|
84
|
-
expiresAt: string;
|
|
85
|
-
success: number;
|
|
86
|
-
approvals?: number;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** `get*()` (POST /rest/get_*) 응답의 `data`. `result`는 결과가 있을 때만 온다. */
|
|
90
|
-
export interface DataRequestResult<T> {
|
|
91
|
-
schemaVersion: string;
|
|
92
|
-
transactionId: string;
|
|
93
|
-
product: string;
|
|
94
|
-
status: DataRequestStatus;
|
|
95
|
-
resultAvailable: boolean;
|
|
96
|
-
charged: boolean;
|
|
97
|
-
sources: DataRequestSource[];
|
|
98
|
-
message: string;
|
|
99
|
-
expiresAt?: string;
|
|
100
|
-
success: number;
|
|
101
|
-
progress?: { total: number; completed: number };
|
|
102
|
-
checkedAt?: string;
|
|
103
|
-
resultExpiresAt?: string;
|
|
104
|
-
result?: T;
|
|
105
|
-
errorCode?: DataRequestErrorCode;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface EmploymentHistoryEntry { 사업장: string; 취득일: string; 상실일: string; 자격구분: string; }
|
|
109
|
-
export interface EmploymentPremiumEntry {
|
|
110
|
-
사업장: string; 고지년월: string; 보수월액: number;
|
|
111
|
-
'건강보험 산정보험료': number; '건강보험 정산보험료': number; '건강보험 고지보험료': number; '건강보험 연말정산보험료': number;
|
|
112
|
-
'장기요양 산정보험료': number; '장기요양 정산보험료': number; '장기요양 고지보험료': number; '장기요양 연말정산보험료': number;
|
|
113
|
-
가입자부담금: number;
|
|
114
|
-
}
|
|
115
|
-
export interface EmploymentInfo {
|
|
116
|
-
재직상태: 'EMPLOYED' | 'UNEMPLOYED' | 'UNKNOWN';
|
|
117
|
-
현재사업장?: string;
|
|
118
|
-
취득일?: string;
|
|
119
|
-
이력: EmploymentHistoryEntry[];
|
|
120
|
-
보험료연도: string[];
|
|
121
|
-
보험료: EmploymentPremiumEntry[];
|
|
122
|
-
}
|
|
123
|
-
export interface EmploymentResultPayload { employment: EmploymentInfo; }
|
|
124
|
-
|
|
125
|
-
export interface PersonalIncomeAmount { 건수: number; 소득금액: number; 소득세: number; 지방소득세: number; 농어촌특별세: number; 세액합계: number; }
|
|
126
|
-
export interface PersonalIncomeYear {
|
|
127
|
-
귀속연도: string;
|
|
128
|
-
소득종류별: { 이자소득?: PersonalIncomeAmount; 배당소득?: PersonalIncomeAmount };
|
|
129
|
-
합계: PersonalIncomeAmount;
|
|
130
|
-
}
|
|
131
|
-
export interface PersonalIncomeInfo { 조회연도: string[]; 연도별: PersonalIncomeYear[]; }
|
|
132
|
-
export interface PersonalIncomeResultPayload { personalIncome: PersonalIncomeInfo; }
|
|
133
|
-
|
|
134
|
-
export interface NpsJoinHistoryEntry {
|
|
135
|
-
시작: string; 종료: string; 기준소득월액: number;
|
|
136
|
-
납부개월: number; 납부금액: number; 미납개월: number; 미납금액: number;
|
|
137
|
-
가입자구분: string; 사업장: string;
|
|
138
|
-
}
|
|
139
|
-
export interface NpsJoinHistoryInfo {
|
|
140
|
-
조회기간: { 시작: string; 종료: string };
|
|
141
|
-
합계: { 납부개월: number; 납부금액: number; 미납개월: number; 미납금액: number };
|
|
142
|
-
가입내역: NpsJoinHistoryEntry[];
|
|
143
|
-
}
|
|
144
|
-
export interface NpsJoinHistoryResultPayload { npsJoinHistory: NpsJoinHistoryInfo; }
|
|
145
|
-
|
|
146
|
-
export interface DrivingLicenseAcquisition {
|
|
147
|
-
면허종류코드: string; 발급일자: string; 합격일자: string; 발급지역: string; 발급일련번호: string;
|
|
148
|
-
학원명: string; 졸업일자: string; 공고시험장: string; 등록일자: string; 면허조건: string;
|
|
149
|
-
}
|
|
150
|
-
export interface DrivingLicenseInfo {
|
|
151
|
-
이름?: string; 주소?: string; 면허번호?: string; 관할경찰서?: string; 국적?: string; 면허상태?: string;
|
|
152
|
-
취소일자?: string; 적성검사일자?: string; 적성검사기관?: string; 적성검사유효기간?: string;
|
|
153
|
-
적성검사시작?: string; 적성검사종료?: string; 정지기간?: string; 정지사유?: string;
|
|
154
|
-
재교부일자?: string; 재교부사유?: string;
|
|
155
|
-
subList?: unknown[];
|
|
156
|
-
취득이력?: DrivingLicenseAcquisition[];
|
|
157
|
-
조회결과?: string;
|
|
158
|
-
}
|
|
159
|
-
export interface DrivingLicenseResultPayload { drivingLicense: DrivingLicenseInfo; }
|
|
160
|
-
|
|
161
|
-
export interface HealthCheckupEntry { 검진연도: string; 검진종류: string; 검진일자: string; 검진기관: string; }
|
|
162
|
-
export interface HealthCheckupInfo { 이름: string; 건수: number; 검진내역: HealthCheckupEntry[]; }
|
|
163
|
-
export interface HealthCheckupResultPayload { healthCheckup: HealthCheckupInfo; }
|
|
164
|
-
|
|
165
|
-
export interface CashReceiptTotals { 건수: number; 사용금액: number; 소득공제건수: number; 소득공제금액: number; }
|
|
166
|
-
export interface CashReceiptEntry {
|
|
167
|
-
거래일시: string; 가맹점: string; 금액: number; 승인번호: string;
|
|
168
|
-
거래구분: string; 거래상태: string; 소득공제대상: boolean; 소득공제반영: boolean;
|
|
169
|
-
}
|
|
170
|
-
export interface CashReceiptYear { 귀속연도: string; 합계: CashReceiptTotals; 사용내역: CashReceiptEntry[]; }
|
|
171
|
-
export interface CashReceiptDeductionInfo { 조회연도: string[]; 전체합계: CashReceiptTotals; 연도별: CashReceiptYear[]; }
|
|
172
|
-
export interface CashReceiptDeductionResultPayload { cashReceiptDeduction: CashReceiptDeductionInfo; }
|
|
173
|
-
|
|
174
|
-
export interface TaxReturnEntry {
|
|
175
|
-
신고일: string; 과세기간: string; 신고서: string; 신고구분: string; 신고상세: string;
|
|
176
|
-
세목: string; 작성방법: string; 납부년월: string; 납부금액: number; 고지금액: number;
|
|
177
|
-
}
|
|
178
|
-
export interface TaxReturnHistoryInfo {
|
|
179
|
-
조회기간: { 시작: string; 끝: string };
|
|
180
|
-
합계: { 건수: number; 납부금액: number; 고지금액: number };
|
|
181
|
-
신고내역: TaxReturnEntry[];
|
|
182
|
-
}
|
|
183
|
-
export interface TaxReturnHistoryResultPayload { taxReturnHistory: TaxReturnHistoryInfo; }
|
|
184
|
-
|
|
185
|
-
export interface YoutubeThumbnail { url: string; width: number; height: number; }
|
|
186
|
-
export interface YoutubeChapter { title: string; start_time: number | null; end_time: number | null; }
|
|
187
|
-
export interface YoutubeMetadata {
|
|
188
|
-
video_id: string; url: string; title: string | null; description: string;
|
|
189
|
-
channel: { id: string | null; name: string | null; url: string | null; handle: string | null; follower_count: number | null; is_verified: boolean };
|
|
190
|
-
upload_date: string | null; duration: number | null; view_count: number | null; like_count: number | null; comment_count: number | null;
|
|
191
|
-
categories: string[]; tags: string[]; language: string | null; live_status: string | null; availability: string | null;
|
|
192
|
-
age_limit: number | null; chapters: YoutubeChapter[]; thumbnail: string | null; thumbnails: YoutubeThumbnail[];
|
|
193
|
-
subtitle_languages: string[]; automatic_caption_count: number;
|
|
194
|
-
}
|
|
195
|
-
export interface YoutubeSubtitleTrack { lang: string; name: string | null; auto: boolean; formats: string[]; translated?: boolean; }
|
|
196
|
-
export interface YoutubeSubtitleList {
|
|
197
|
-
video_id: string; title: string | null; original_language: string | null;
|
|
198
|
-
subtitle_count: number; automatic_caption_count: number;
|
|
199
|
-
subtitles: YoutubeSubtitleTrack[]; automatic_captions: YoutubeSubtitleTrack[];
|
|
200
|
-
}
|
|
201
|
-
export interface YoutubeSubtitleOptions { format?: 'vtt' | 'srt' | 'txt'; type?: 'any' | 'manual' | 'auto'; }
|
|
202
|
-
|
|
163
|
+
export interface ImageAiJobData { job_id:string; status:ImageAiStatus; requested_count:number; completed_count?:number; failed_count?:number; prepaid_point?:number; charged_point?:number; refunded_point?:number; result_available?:boolean; expires_at?:string|null; error_code?:ApickImageErrorCode|null; }
|
|
164
|
+
|
|
165
|
+
export interface MaskResidentNumberOptions extends OcrOptions {
|
|
166
|
+
type: 1 | 2 | 3 | 4;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export const AUTH_PROVIDERS: readonly [
|
|
170
|
+
'kakao', 'naver', 'toss', 'pass', 'samsung', 'kb', 'shinhan', 'hana', 'woori', 'ibk', 'nh', 'kakaobank', 'banksalad'
|
|
171
|
+
];
|
|
172
|
+
export type AuthProvider = typeof AUTH_PROVIDERS[number];
|
|
173
|
+
|
|
174
|
+
/** 간편인증 기반 조회 상품(재직·소득·연금·면허·건강검진 등)의 공통 입력. */
|
|
175
|
+
export interface DataRequestInput {
|
|
176
|
+
name: string;
|
|
177
|
+
birthDate: string;
|
|
178
|
+
phone: string;
|
|
179
|
+
authProvider: AuthProvider;
|
|
180
|
+
}
|
|
181
|
+
export interface RequestEmploymentInput extends DataRequestInput { insuranceYears?: number; }
|
|
182
|
+
export interface RequestPersonalIncomeInput extends DataRequestInput { incomeYears?: number; }
|
|
183
|
+
export interface RequestNpsJoinHistoryInput extends DataRequestInput { from?: string; to?: string; }
|
|
184
|
+
export interface RequestDrivingLicenseInput extends DataRequestInput {}
|
|
185
|
+
export interface RequestHealthCheckupInput extends DataRequestInput {}
|
|
186
|
+
export interface RequestCashReceiptDeductionInput extends DataRequestInput { incomeYears?: number; }
|
|
187
|
+
export interface RequestTaxReturnHistoryInput extends DataRequestInput { years?: number; }
|
|
188
|
+
|
|
189
|
+
export type DataRequestStatus =
|
|
190
|
+
| 'AUTH_REQUESTED' | 'AUTH_WAITING' | 'AUTH_COMPLETED' | 'AUTH_REJECTED' | 'AUTH_EXPIRED'
|
|
191
|
+
| 'COLLECTING' | 'COLLECTED' | 'PARTIAL_SUCCESS' | 'SUCCESS' | 'FAILED';
|
|
192
|
+
export type DataRequestErrorCode = 'RESULT_EXPIRED' | 'AUTH_EXPIRED' | 'AUTH_REJECTED' | 'COLLECT_FAILED';
|
|
193
|
+
export interface DataRequestSource { source: string; type: string; status: string; }
|
|
194
|
+
|
|
195
|
+
/** `request*()` (POST /rest/req_*) 응답의 `data`. */
|
|
196
|
+
export interface DataRequestAcceptedData {
|
|
197
|
+
schemaVersion: string;
|
|
198
|
+
transactionId: string;
|
|
199
|
+
product: string;
|
|
200
|
+
status: DataRequestStatus;
|
|
201
|
+
resultAvailable: boolean;
|
|
202
|
+
charged: boolean;
|
|
203
|
+
sources: DataRequestSource[];
|
|
204
|
+
message: string;
|
|
205
|
+
expiresAt: string;
|
|
206
|
+
success: number;
|
|
207
|
+
approvals?: number;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** `get*()` (POST /rest/get_*) 응답의 `data`. `result`는 결과가 있을 때만 온다. */
|
|
211
|
+
export interface DataRequestResult<T> {
|
|
212
|
+
schemaVersion: string;
|
|
213
|
+
transactionId: string;
|
|
214
|
+
product: string;
|
|
215
|
+
status: DataRequestStatus;
|
|
216
|
+
resultAvailable: boolean;
|
|
217
|
+
charged: boolean;
|
|
218
|
+
sources: DataRequestSource[];
|
|
219
|
+
message: string;
|
|
220
|
+
expiresAt?: string;
|
|
221
|
+
success: number;
|
|
222
|
+
progress?: { total: number; completed: number };
|
|
223
|
+
checkedAt?: string;
|
|
224
|
+
resultExpiresAt?: string;
|
|
225
|
+
result?: T;
|
|
226
|
+
errorCode?: DataRequestErrorCode;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface EmploymentHistoryEntry { 사업장: string; 취득일: string; 상실일: string; 자격구분: string; }
|
|
230
|
+
export interface EmploymentPremiumEntry {
|
|
231
|
+
사업장: string; 고지년월: string; 보수월액: number;
|
|
232
|
+
'건강보험 산정보험료': number; '건강보험 정산보험료': number; '건강보험 고지보험료': number; '건강보험 연말정산보험료': number;
|
|
233
|
+
'장기요양 산정보험료': number; '장기요양 정산보험료': number; '장기요양 고지보험료': number; '장기요양 연말정산보험료': number;
|
|
234
|
+
가입자부담금: number;
|
|
235
|
+
}
|
|
236
|
+
export interface EmploymentInfo {
|
|
237
|
+
재직상태: 'EMPLOYED' | 'UNEMPLOYED' | 'UNKNOWN';
|
|
238
|
+
현재사업장?: string;
|
|
239
|
+
취득일?: string;
|
|
240
|
+
이력: EmploymentHistoryEntry[];
|
|
241
|
+
보험료연도: string[];
|
|
242
|
+
보험료: EmploymentPremiumEntry[];
|
|
243
|
+
}
|
|
244
|
+
export interface EmploymentResultPayload { employment: EmploymentInfo; }
|
|
245
|
+
|
|
246
|
+
export interface PersonalIncomeAmount { 건수: number; 소득금액: number; 소득세: number; 지방소득세: number; 농어촌특별세: number; 세액합계: number; }
|
|
247
|
+
export interface PersonalIncomeYear {
|
|
248
|
+
귀속연도: string;
|
|
249
|
+
소득종류별: { 이자소득?: PersonalIncomeAmount; 배당소득?: PersonalIncomeAmount };
|
|
250
|
+
합계: PersonalIncomeAmount;
|
|
251
|
+
}
|
|
252
|
+
export interface PersonalIncomeInfo { 조회연도: string[]; 연도별: PersonalIncomeYear[]; }
|
|
253
|
+
export interface PersonalIncomeResultPayload { personalIncome: PersonalIncomeInfo; }
|
|
254
|
+
|
|
255
|
+
export interface NpsJoinHistoryEntry {
|
|
256
|
+
시작: string; 종료: string; 기준소득월액: number;
|
|
257
|
+
납부개월: number; 납부금액: number; 미납개월: number; 미납금액: number;
|
|
258
|
+
가입자구분: string; 사업장: string;
|
|
259
|
+
}
|
|
260
|
+
export interface NpsJoinHistoryInfo {
|
|
261
|
+
조회기간: { 시작: string; 종료: string };
|
|
262
|
+
합계: { 납부개월: number; 납부금액: number; 미납개월: number; 미납금액: number };
|
|
263
|
+
가입내역: NpsJoinHistoryEntry[];
|
|
264
|
+
}
|
|
265
|
+
export interface NpsJoinHistoryResultPayload { npsJoinHistory: NpsJoinHistoryInfo; }
|
|
266
|
+
|
|
267
|
+
export interface DrivingLicenseAcquisition {
|
|
268
|
+
면허종류코드: string; 발급일자: string; 합격일자: string; 발급지역: string; 발급일련번호: string;
|
|
269
|
+
학원명: string; 졸업일자: string; 공고시험장: string; 등록일자: string; 면허조건: string;
|
|
270
|
+
}
|
|
271
|
+
export interface DrivingLicenseInfo {
|
|
272
|
+
이름?: string; 주소?: string; 면허번호?: string; 관할경찰서?: string; 국적?: string; 면허상태?: string;
|
|
273
|
+
취소일자?: string; 적성검사일자?: string; 적성검사기관?: string; 적성검사유효기간?: string;
|
|
274
|
+
적성검사시작?: string; 적성검사종료?: string; 정지기간?: string; 정지사유?: string;
|
|
275
|
+
재교부일자?: string; 재교부사유?: string;
|
|
276
|
+
subList?: unknown[];
|
|
277
|
+
취득이력?: DrivingLicenseAcquisition[];
|
|
278
|
+
조회결과?: string;
|
|
279
|
+
}
|
|
280
|
+
export interface DrivingLicenseResultPayload { drivingLicense: DrivingLicenseInfo; }
|
|
281
|
+
|
|
282
|
+
export interface HealthCheckupEntry { 검진연도: string; 검진종류: string; 검진일자: string; 검진기관: string; }
|
|
283
|
+
export interface HealthCheckupInfo { 이름: string; 건수: number; 검진내역: HealthCheckupEntry[]; }
|
|
284
|
+
export interface HealthCheckupResultPayload { healthCheckup: HealthCheckupInfo; }
|
|
285
|
+
|
|
286
|
+
export interface CashReceiptTotals { 건수: number; 사용금액: number; 소득공제건수: number; 소득공제금액: number; }
|
|
287
|
+
export interface CashReceiptEntry {
|
|
288
|
+
거래일시: string; 가맹점: string; 금액: number; 승인번호: string;
|
|
289
|
+
거래구분: string; 거래상태: string; 소득공제대상: boolean; 소득공제반영: boolean;
|
|
290
|
+
}
|
|
291
|
+
export interface CashReceiptYear { 귀속연도: string; 합계: CashReceiptTotals; 사용내역: CashReceiptEntry[]; }
|
|
292
|
+
export interface CashReceiptDeductionInfo { 조회연도: string[]; 전체합계: CashReceiptTotals; 연도별: CashReceiptYear[]; }
|
|
293
|
+
export interface CashReceiptDeductionResultPayload { cashReceiptDeduction: CashReceiptDeductionInfo; }
|
|
294
|
+
|
|
295
|
+
export interface TaxReturnEntry {
|
|
296
|
+
신고일: string; 과세기간: string; 신고서: string; 신고구분: string; 신고상세: string;
|
|
297
|
+
세목: string; 작성방법: string; 납부년월: string; 납부금액: number; 고지금액: number;
|
|
298
|
+
}
|
|
299
|
+
export interface TaxReturnHistoryInfo {
|
|
300
|
+
조회기간: { 시작: string; 끝: string };
|
|
301
|
+
합계: { 건수: number; 납부금액: number; 고지금액: number };
|
|
302
|
+
신고내역: TaxReturnEntry[];
|
|
303
|
+
}
|
|
304
|
+
export interface TaxReturnHistoryResultPayload { taxReturnHistory: TaxReturnHistoryInfo; }
|
|
305
|
+
|
|
306
|
+
export interface YoutubeThumbnail { url: string; width: number; height: number; }
|
|
307
|
+
export interface YoutubeChapter { title: string; start_time: number | null; end_time: number | null; }
|
|
308
|
+
export interface YoutubeMetadata {
|
|
309
|
+
video_id: string; url: string; title: string | null; description: string;
|
|
310
|
+
channel: { id: string | null; name: string | null; url: string | null; handle: string | null; follower_count: number | null; is_verified: boolean };
|
|
311
|
+
upload_date: string | null; duration: number | null; view_count: number | null; like_count: number | null; comment_count: number | null;
|
|
312
|
+
categories: string[]; tags: string[]; language: string | null; live_status: string | null; availability: string | null;
|
|
313
|
+
age_limit: number | null; chapters: YoutubeChapter[]; thumbnail: string | null; thumbnails: YoutubeThumbnail[];
|
|
314
|
+
subtitle_languages: string[]; automatic_caption_count: number;
|
|
315
|
+
}
|
|
316
|
+
export interface YoutubeSubtitleTrack { lang: string; name: string | null; auto: boolean; formats: string[]; translated?: boolean; }
|
|
317
|
+
export interface YoutubeSubtitleList {
|
|
318
|
+
video_id: string; title: string | null; original_language: string | null;
|
|
319
|
+
subtitle_count: number; automatic_caption_count: number;
|
|
320
|
+
subtitles: YoutubeSubtitleTrack[]; automatic_captions: YoutubeSubtitleTrack[];
|
|
321
|
+
}
|
|
322
|
+
export interface YoutubeSubtitleOptions { format?: 'vtt' | 'srt' | 'txt'; type?: 'any' | 'manual' | 'auto'; }
|
|
323
|
+
export interface YoutubeChannelRef { id: string | null; name: string | null; url: string | null; handle: string | null; }
|
|
324
|
+
export interface YoutubeListItem {
|
|
325
|
+
type: 'video' | 'short' | 'channel' | 'playlist'; id: string; url: string; title: string | null; thumbnail: string | null;
|
|
326
|
+
description?: string | null; duration?: number | null; view_count?: number | null; live_status?: string | null; published_at?: string | null;
|
|
327
|
+
channel?: YoutubeChannelRef | null; handle?: string | null; follower_count?: number | null; is_verified?: boolean; video_count?: number | null;
|
|
328
|
+
}
|
|
329
|
+
export interface YoutubeSearchOptions {
|
|
330
|
+
count?: number; sort?: 'relevance' | 'date' | 'views' | 'rating'; type?: 'any' | 'video' | 'channel' | 'playlist' | 'movie';
|
|
331
|
+
uploadDate?: 'any' | 'hour' | 'today' | 'week' | 'month' | 'year'; duration?: 'any' | 'short' | 'medium' | 'long';
|
|
332
|
+
}
|
|
333
|
+
export interface YoutubeSearchResult { query: string; count: number; results: YoutubeListItem[]; }
|
|
334
|
+
export interface YoutubeChannelResult {
|
|
335
|
+
channel: YoutubeChannelRef & { description: string; follower_count: number | null; is_verified: boolean; tags: string[]; thumbnail: string | null };
|
|
336
|
+
tab: 'videos' | 'shorts' | 'streams' | 'playlists'; count: number; items: YoutubeListItem[];
|
|
337
|
+
}
|
|
338
|
+
export interface YoutubePlaylistResult {
|
|
339
|
+
playlist_id: string; url: string; title: string | null; description: string; channel: YoutubeChannelRef | null;
|
|
340
|
+
video_count: number | null; view_count: number | null; modified_date: string | null; count: number; videos: YoutubeListItem[];
|
|
341
|
+
}
|
|
342
|
+
export interface YoutubeHashtagResult { hashtag: string; count: number; videos: YoutubeListItem[]; }
|
|
343
|
+
export interface YoutubeVideoFormat { quality: string; width: number | null; height: number; fps: number | null; codec: string | null; hdr: boolean; has_audio: boolean; bitrate_kbps: number | null; filesize: number | null; filesize_estimated: boolean; }
|
|
344
|
+
export interface YoutubeAudioFormat { codec: string | null; bitrate_kbps: number | null; sample_rate: number | null; channels: number | null; language: string | null; filesize: number | null; filesize_estimated: boolean; }
|
|
345
|
+
export interface YoutubeFormats {
|
|
346
|
+
video_id: string; title: string | null; duration: number | null; live_status: string | null; downloadable: boolean;
|
|
347
|
+
video_formats: YoutubeVideoFormat[]; audio_formats: YoutubeAudioFormat[];
|
|
348
|
+
download_options: { video: { quality: string; estimated_size: number; estimated_cost: number }[]; audio: { format: 'mp3' | 'm4a' | 'opus'; bitrate: number | null; estimated_size: number; estimated_cost: number }[] };
|
|
349
|
+
}
|
|
350
|
+
export interface YoutubeComment {
|
|
351
|
+
id: string; parent_id: string | null; text: string; author: string | null; author_channel_id: string | null; author_url: string | null; author_thumbnail: string | null;
|
|
352
|
+
author_is_uploader: boolean; author_is_verified: boolean; like_count: number | null; is_pinned: boolean; is_hearted: boolean; published_at: string | null;
|
|
353
|
+
}
|
|
354
|
+
export interface YoutubeComments { video_id: string; title: string | null; sort: 'top' | 'new'; include_replies: boolean; count: number; comments: YoutubeComment[]; }
|
|
355
|
+
export interface YoutubeCommentsOptions { count?: number; sort?: 'top' | 'new'; replies?: boolean; }
|
|
356
|
+
export interface YoutubeDownloadLink {
|
|
357
|
+
video_id: string | null; title: string | null; duration: number | null; size: number; size_units: number; content_type: string; filename: string;
|
|
358
|
+
download_url: string; expires_at: string; quality?: string | null; format?: 'mp3' | 'm4a' | 'opus'; bitrate?: number | null;
|
|
359
|
+
billing: { base: number; size_unit_cost: number; size_cost: number; total: number };
|
|
360
|
+
}
|
|
361
|
+
export interface YoutubeVideoDownloadOptions { quality?: 'best' | '2160' | '1440' | '1080' | '720' | '480' | '360' | '240' | '144' | number; codec?: 'any' | 'h264'; start?: string | number; end?: string | number; }
|
|
362
|
+
export interface YoutubeAudioDownloadOptions { format?: 'mp3' | 'm4a' | 'opus'; bitrate?: 128 | 192 | 320 | '128' | '192' | '320'; start?: string | number; end?: string | number; }
|
|
363
|
+
|
|
203
364
|
/** @deprecated Retired APICK voice IDs. Query listGeminiTtsVoices or listOpenAiTtsVoices. */
|
|
204
365
|
export const TTS_VOICE_IDS: readonly [
|
|
205
|
-
'v2_ann_m_30s_01', 'v2_ann_m_30s_02', 'v2_ann_m_30s_04', 'v2_ann_m_30s_05', 'v2_ann_f_30s_02', 'v2_ann_f_30s_03', 'v2_ann_f_30s_04', 'v2_ann_f_30s_05', 'v2_m_teen_01', 'v2_m_young_01', 'v2_m_mid_01', 'v2_m_senior_01', 'v2_f_young_01', 'v2_f_senior_01'
|
|
206
|
-
];
|
|
366
|
+
'v2_ann_m_30s_01', 'v2_ann_m_30s_02', 'v2_ann_m_30s_04', 'v2_ann_m_30s_05', 'v2_ann_f_30s_02', 'v2_ann_f_30s_03', 'v2_ann_f_30s_04', 'v2_ann_f_30s_05', 'v2_m_teen_01', 'v2_m_young_01', 'v2_m_mid_01', 'v2_m_senior_01', 'v2_f_young_01', 'v2_f_senior_01'
|
|
367
|
+
];
|
|
207
368
|
export type TtsVoiceId = string;
|
|
208
369
|
/** @deprecated Automatic fallback is no longer supported. */
|
|
209
370
|
export type TtsFallbackPolicy = 'never' | 'queue_full' | 'busy';
|
|
@@ -218,97 +379,112 @@ export interface OpenAiTtsInput extends GeminiTtsInput {}
|
|
|
218
379
|
export interface TtsOptions { voiceId?:TtsVoiceId; normalizeText?:boolean; idempotencyKey?:string; }
|
|
219
380
|
export interface GeminiTtsVoice { voice_id:string; name:string; gender:string|null; tone:string; age_band:string|null; age_years?:number|null; age_verified?:boolean; age_basis?:'catalog_description'|'reviewed'; age_source?:string; description?:string; language_code?:string|null; reviewed_at?:string; library:string; }
|
|
220
381
|
export interface TtsQuote { synthesis:number; normalization:number; estimated_total:number; maximum:number; synthesis_maximum:number; normalization_maximum:number; estimated_only:true; currency:'POINT'; fallback_price_may_change:boolean; }
|
|
221
|
-
|
|
222
|
-
export interface TtsJobData {
|
|
223
|
-
job_id: string;
|
|
224
|
-
status: 'waiting' | 'processing' | 'completed' | 'cancelled' | 'failed';
|
|
382
|
+
|
|
383
|
+
export interface TtsJobData {
|
|
384
|
+
job_id: string;
|
|
385
|
+
status: 'waiting' | 'processing' | 'completed' | 'cancelled' | 'failed';
|
|
225
386
|
voice_id?: string;
|
|
226
387
|
synthesis?: {engine:'apick'|'gemini'|'openai';model:string;voice_id:string;fallback_reason:string|null;age_verified:boolean;notice:string|null};
|
|
227
388
|
normalization?: {enabled:boolean;run_id:string|null;status:string;skill_id:string|null};
|
|
228
389
|
billing?: {status:string;synthesis:number;skill:number;total:number;reserved:number;refunded:number;released:number;currency:'POINT'};
|
|
229
390
|
expires_at?:string|null;
|
|
230
|
-
character_count?: number;
|
|
231
|
-
result_available?: boolean;
|
|
232
|
-
subtitles_available?: boolean;
|
|
233
|
-
resume_revision?: number;
|
|
234
|
-
operation_revision?: number;
|
|
235
|
-
quality?: TtsQualityData | null;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export interface TtsQualityData {
|
|
239
|
-
job_id?: string;
|
|
240
|
-
resume_revision?: number;
|
|
241
|
-
phase?: string;
|
|
242
|
-
accepted_utterances?: number;
|
|
243
|
-
failed_utterances?: number;
|
|
244
|
-
total_utterances?: number;
|
|
245
|
-
utterances?: Array<{ id: string; status: string; attempt?: number; reasons?: string[];
|
|
246
|
-
speech_rate?: { chars: number; duration_sec: number; cps: number; expected_sec: number; duration_ratio: number | null; status: string } }>;
|
|
247
|
-
candidates?: Array<{ candidate_id: string; utterance_id: string; status: string; attempt: number; audio_available?: boolean }>;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export class ApickApiError extends Error {
|
|
251
|
-
readonly status: number;
|
|
252
|
-
readonly code: string;
|
|
253
|
-
readonly serviceCode?: string;
|
|
254
|
-
/** Skills 오류의 부가 정보. 예: INVALID_INPUT 의 `errors` 목록 */
|
|
255
|
-
readonly details?: Record<string, unknown>;
|
|
256
|
-
toJSON(): {
|
|
257
|
-
name: string;
|
|
258
|
-
message: string;
|
|
259
|
-
status: number;
|
|
260
|
-
code: string;
|
|
261
|
-
serviceCode?: string;
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export class ApickBinaryResult {
|
|
266
|
-
readonly bytes: Uint8Array;
|
|
267
|
-
readonly contentType: string;
|
|
268
|
-
readonly filename: string;
|
|
269
|
-
readonly meta: ApickMeta;
|
|
270
|
-
readonly size: number;
|
|
271
|
-
toArrayBuffer(): ArrayBuffer;
|
|
272
|
-
toBlob(): Blob;
|
|
273
|
-
save(filePath: string): Promise<string>;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export const DEFAULT_BASE_URL: 'https://apick.app';
|
|
277
|
-
|
|
278
|
-
export const SERVICES: Readonly<Record<string, Readonly<{
|
|
279
|
-
endpoint: string;
|
|
280
|
-
output: 'json' | 'binary';
|
|
281
|
-
}>>>;
|
|
282
|
-
|
|
283
|
-
export class ApickClient {
|
|
284
|
-
createVideoJob(model: VideoModel, prompt: string, options?: VideoJobOptions): Promise<ApickResult<VideoJobData>>;
|
|
285
|
-
getVideoJob(model: VideoModel, jobId: string): Promise<ApickResult<VideoJobData>>;
|
|
286
|
-
downloadVideoResult(model: VideoModel, jobId: string): Promise<ApickBinaryResult>;
|
|
287
|
-
constructor(apiKeyOrOptions: string | ApickClientOptions);
|
|
288
|
-
businessDetails(businessNumber: string): Promise<ApickResult>;
|
|
289
|
-
ventureBusiness(businessNumber: string): Promise<ApickResult>;
|
|
290
|
-
trackParcel(carrier: string, trackingNumber: string): Promise<ApickResult>;
|
|
291
|
-
trackParcelAuto(trackingNumber: string): Promise<ApickResult>;
|
|
292
|
-
validateEmail(email: string): Promise<ApickResult>;
|
|
293
|
-
validatePhone(number: string): Promise<ApickResult>;
|
|
294
|
-
holidays(year: number | string, month: number | string): Promise<ApickResult>;
|
|
295
|
-
searchAddress(query: string, options?: { page?: number }): Promise<ApickResult>;
|
|
296
|
-
ocr(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
297
|
-
maskResidentNumber(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options: MaskResidentNumberOptions): Promise<ApickBinaryResult>;
|
|
298
|
-
maskResidenceCard(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
299
|
-
maskPassport(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
300
|
-
maskIdCard(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
301
|
-
maskDriverLicense(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
302
|
-
dnsLookup(domain: string): Promise<ApickResult>;
|
|
303
|
-
geolocate(address: string): Promise<ApickResult>;
|
|
304
|
-
whois(address: string): Promise<ApickResult>;
|
|
305
|
-
googleSearch(keyword: string, options?: { page?: number }): Promise<ApickResult>;
|
|
306
|
-
googleImageSearch(keyword: string, options?: { page?: number }): Promise<ApickResult>;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
391
|
+
character_count?: number;
|
|
392
|
+
result_available?: boolean;
|
|
393
|
+
subtitles_available?: boolean;
|
|
394
|
+
resume_revision?: number;
|
|
395
|
+
operation_revision?: number;
|
|
396
|
+
quality?: TtsQualityData | null;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export interface TtsQualityData {
|
|
400
|
+
job_id?: string;
|
|
401
|
+
resume_revision?: number;
|
|
402
|
+
phase?: string;
|
|
403
|
+
accepted_utterances?: number;
|
|
404
|
+
failed_utterances?: number;
|
|
405
|
+
total_utterances?: number;
|
|
406
|
+
utterances?: Array<{ id: string; status: string; attempt?: number; reasons?: string[];
|
|
407
|
+
speech_rate?: { chars: number; duration_sec: number; cps: number; expected_sec: number; duration_ratio: number | null; status: string } }>;
|
|
408
|
+
candidates?: Array<{ candidate_id: string; utterance_id: string; status: string; attempt: number; audio_available?: boolean }>;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export class ApickApiError extends Error {
|
|
412
|
+
readonly status: number;
|
|
413
|
+
readonly code: string;
|
|
414
|
+
readonly serviceCode?: string;
|
|
415
|
+
/** Skills 오류의 부가 정보. 예: INVALID_INPUT 의 `errors` 목록 */
|
|
416
|
+
readonly details?: Record<string, unknown>;
|
|
417
|
+
toJSON(): {
|
|
418
|
+
name: string;
|
|
419
|
+
message: string;
|
|
420
|
+
status: number;
|
|
421
|
+
code: string;
|
|
422
|
+
serviceCode?: string;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export class ApickBinaryResult {
|
|
427
|
+
readonly bytes: Uint8Array;
|
|
428
|
+
readonly contentType: string;
|
|
429
|
+
readonly filename: string;
|
|
430
|
+
readonly meta: ApickMeta;
|
|
431
|
+
readonly size: number;
|
|
432
|
+
toArrayBuffer(): ArrayBuffer;
|
|
433
|
+
toBlob(): Blob;
|
|
434
|
+
save(filePath: string): Promise<string>;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export const DEFAULT_BASE_URL: 'https://apick.app';
|
|
438
|
+
|
|
439
|
+
export const SERVICES: Readonly<Record<string, Readonly<{
|
|
440
|
+
endpoint: string;
|
|
441
|
+
output: 'json' | 'binary';
|
|
442
|
+
}>>>;
|
|
443
|
+
|
|
444
|
+
export class ApickClient {
|
|
445
|
+
createVideoJob(model: VideoModel, prompt: string, options?: VideoJobOptions): Promise<ApickResult<VideoJobData>>;
|
|
446
|
+
getVideoJob(model: VideoModel, jobId: string): Promise<ApickResult<VideoJobData>>;
|
|
447
|
+
downloadVideoResult(model: VideoModel, jobId: string): Promise<ApickBinaryResult>;
|
|
448
|
+
constructor(apiKeyOrOptions: string | ApickClientOptions);
|
|
449
|
+
businessDetails(businessNumber: string): Promise<ApickResult>;
|
|
450
|
+
ventureBusiness(businessNumber: string): Promise<ApickResult>;
|
|
451
|
+
trackParcel(carrier: string, trackingNumber: string): Promise<ApickResult>;
|
|
452
|
+
trackParcelAuto(trackingNumber: string): Promise<ApickResult>;
|
|
453
|
+
validateEmail(email: string): Promise<ApickResult>;
|
|
454
|
+
validatePhone(number: string): Promise<ApickResult>;
|
|
455
|
+
holidays(year: number | string, month: number | string): Promise<ApickResult>;
|
|
456
|
+
searchAddress(query: string, options?: { page?: number }): Promise<ApickResult>;
|
|
457
|
+
ocr(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
458
|
+
maskResidentNumber(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options: MaskResidentNumberOptions): Promise<ApickBinaryResult>;
|
|
459
|
+
maskResidenceCard(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
460
|
+
maskPassport(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
461
|
+
maskIdCard(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
462
|
+
maskDriverLicense(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
|
|
463
|
+
dnsLookup(domain: string): Promise<ApickResult>;
|
|
464
|
+
geolocate(address: string): Promise<ApickResult>;
|
|
465
|
+
whois(address: string): Promise<ApickResult>;
|
|
466
|
+
googleSearch(keyword: string, options?: { page?: number }): Promise<ApickResult>;
|
|
467
|
+
googleImageSearch(keyword: string, options?: { page?: number }): Promise<ApickResult>;
|
|
468
|
+
googleNewsSearch(keyword: string, options?: { page?: number }): Promise<ApickResult<SearchList<NewsItem>>>;
|
|
469
|
+
googleShoppingSearch(keyword: string, options?: { page?: number }): Promise<ApickResult<SearchList<ShoppingItem>>>;
|
|
470
|
+
googleMapsSearch(keyword: string): Promise<ApickResult<SearchList<PlaceItem>>>;
|
|
471
|
+
googleRankCheck(keyword: string, domain: string): Promise<ApickResult<RankCheck>>;
|
|
472
|
+
instagramProfile(usernameOrUrl: string): Promise<ApickResult<InstagramProfile>>;
|
|
473
|
+
instagramPost(url: string): Promise<ApickResult<InstagramPost>>;
|
|
474
|
+
tiktokProfile(usernameOrUrl: string): Promise<ApickResult<TiktokProfile>>;
|
|
475
|
+
screenshot(url: string): Promise<ApickBinaryResult>;
|
|
476
|
+
youtubeMetadata(url: string): Promise<ApickResult<YoutubeMetadata>>;
|
|
477
|
+
youtubeThumbnail(url: string): Promise<ApickBinaryResult>;
|
|
478
|
+
youtubeSubtitleList(url: string): Promise<ApickResult<YoutubeSubtitleList>>;
|
|
479
|
+
youtubeSubtitle(url: string, lang: string, options?: YoutubeSubtitleOptions): Promise<ApickBinaryResult>;
|
|
480
|
+
youtubeSearch(query: string, options?: YoutubeSearchOptions): Promise<ApickResult<YoutubeSearchResult>>;
|
|
481
|
+
youtubeChannel(channel: string, options?: { tab?: 'videos' | 'shorts' | 'streams' | 'playlists'; count?: number }): Promise<ApickResult<YoutubeChannelResult>>;
|
|
482
|
+
youtubePlaylist(url: string, options?: { count?: number }): Promise<ApickResult<YoutubePlaylistResult>>;
|
|
483
|
+
youtubeHashtag(hashtag: string, options?: { count?: number }): Promise<ApickResult<YoutubeHashtagResult>>;
|
|
484
|
+
youtubeFormats(url: string): Promise<ApickResult<YoutubeFormats>>;
|
|
485
|
+
youtubeComments(url: string, options?: YoutubeCommentsOptions): Promise<ApickResult<YoutubeComments>>;
|
|
486
|
+
downloadYoutubeVideo(url: string, options?: YoutubeVideoDownloadOptions): Promise<ApickResult<YoutubeDownloadLink>>;
|
|
487
|
+
downloadYoutubeAudio(url: string, options?: YoutubeAudioDownloadOptions): Promise<ApickResult<YoutubeDownloadLink>>;
|
|
312
488
|
createTtsJob(text: string | GeminiTtsInput, options?: TtsOptions): Promise<ApickResult<TtsJobData>>;
|
|
313
489
|
createGeminiTtsJob(input:GeminiTtsInput, options?:{idempotencyKey?:string}):Promise<ApickResult<TtsJobData>>;
|
|
314
490
|
listGeminiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
|
|
@@ -316,43 +492,43 @@ export class ApickClient {
|
|
|
316
492
|
listOpenAiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
|
|
317
493
|
getTtsOptions():Promise<ApickResult<{engines:Record<'gemini'|'openai',Record<string,unknown>>}>>;
|
|
318
494
|
quoteTts(input:GeminiTtsInput&{engine?:'gemini'|'openai'}):Promise<ApickResult<TtsQuote>>;
|
|
319
|
-
getTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
|
|
320
|
-
cancelTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
|
|
321
|
-
downloadTtsResult(jobId: string): Promise<ApickBinaryResult>;
|
|
322
|
-
downloadTtsSubtitles(jobId: string): Promise<ApickBinaryResult>;
|
|
495
|
+
getTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
|
|
496
|
+
cancelTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
|
|
497
|
+
downloadTtsResult(jobId: string): Promise<ApickBinaryResult>;
|
|
498
|
+
downloadTtsSubtitles(jobId: string): Promise<ApickBinaryResult>;
|
|
323
499
|
/** @deprecated Retired endpoint; the service returns HTTP 409. */
|
|
324
500
|
getTtsQuality(jobId: string): Promise<ApickResult<TtsQualityData>>;
|
|
325
501
|
/** @deprecated Retired endpoint; the service returns HTTP 409. */
|
|
326
502
|
retryTtsJob(jobId: string, utteranceIds: string[], idempotencyKey: string): Promise<ApickResult<TtsJobData>>;
|
|
327
503
|
/** @deprecated Retired endpoint; the service returns HTTP 409. */
|
|
328
|
-
downloadTtsCandidate(jobId: string, candidateId: string): Promise<ApickBinaryResult>;
|
|
329
|
-
htmlToPdf(html: string, options?: { pagination?: boolean }): Promise<ApickBinaryResult>;
|
|
330
|
-
jsonToExcel(data: unknown[], options?: { sheetName?: string }): Promise<ApickBinaryResult>;
|
|
331
|
-
summarize(text: string): Promise<ApickResult>;
|
|
332
|
-
polish(text: string): Promise<ApickResult>;
|
|
504
|
+
downloadTtsCandidate(jobId: string, candidateId: string): Promise<ApickBinaryResult>;
|
|
505
|
+
htmlToPdf(html: string, options?: { pagination?: boolean }): Promise<ApickBinaryResult>;
|
|
506
|
+
jsonToExcel(data: unknown[], options?: { sheetName?: string }): Promise<ApickBinaryResult>;
|
|
507
|
+
summarize(text: string): Promise<ApickResult>;
|
|
508
|
+
polish(text: string): Promise<ApickResult>;
|
|
333
509
|
generateImages(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
|
|
334
510
|
editImages(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
|
|
335
|
-
createImageGenerationJob(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiJobData>>;
|
|
336
|
-
createImageEditJob(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiJobData>>;
|
|
337
|
-
getImageJob(jobId:string): Promise<ApickResult<ImageAiJobData>>;
|
|
338
|
-
downloadImageJobImage(jobId:string,index:number): Promise<ApickBinaryResult>;
|
|
339
|
-
downloadImageJobArchive(jobId:string): Promise<ApickBinaryResult>;
|
|
340
|
-
requestEmployment(input: RequestEmploymentInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
341
|
-
getEmployment(transactionId: string): Promise<ApickResult<DataRequestResult<EmploymentResultPayload>>>;
|
|
342
|
-
requestPersonalIncome(input: RequestPersonalIncomeInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
343
|
-
getPersonalIncome(transactionId: string): Promise<ApickResult<DataRequestResult<PersonalIncomeResultPayload>>>;
|
|
344
|
-
requestNpsJoinHistory(input: RequestNpsJoinHistoryInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
345
|
-
getNpsJoinHistory(transactionId: string): Promise<ApickResult<DataRequestResult<NpsJoinHistoryResultPayload>>>;
|
|
346
|
-
requestDrivingLicense(input: RequestDrivingLicenseInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
347
|
-
getDrivingLicense(transactionId: string): Promise<ApickResult<DataRequestResult<DrivingLicenseResultPayload>>>;
|
|
348
|
-
requestHealthCheckup(input: RequestHealthCheckupInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
349
|
-
getHealthCheckup(transactionId: string): Promise<ApickResult<DataRequestResult<HealthCheckupResultPayload>>>;
|
|
350
|
-
requestCashReceiptDeduction(input: RequestCashReceiptDeductionInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
351
|
-
getCashReceiptDeduction(transactionId: string): Promise<ApickResult<DataRequestResult<CashReceiptDeductionResultPayload>>>;
|
|
352
|
-
requestTaxReturnHistory(input: RequestTaxReturnHistoryInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
353
|
-
getTaxReturnHistory(transactionId: string): Promise<ApickResult<DataRequestResult<TaxReturnHistoryResultPayload>>>;
|
|
354
|
-
searchSkills(options?: SkillSearchOptions): Promise<ApickResult<SkillPage<SkillSummary>>>;
|
|
355
|
-
/** Public measured results and methods; model scores are not accuracy guarantees. */
|
|
511
|
+
createImageGenerationJob(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiJobData>>;
|
|
512
|
+
createImageEditJob(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiJobData>>;
|
|
513
|
+
getImageJob(jobId:string): Promise<ApickResult<ImageAiJobData>>;
|
|
514
|
+
downloadImageJobImage(jobId:string,index:number): Promise<ApickBinaryResult>;
|
|
515
|
+
downloadImageJobArchive(jobId:string): Promise<ApickBinaryResult>;
|
|
516
|
+
requestEmployment(input: RequestEmploymentInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
517
|
+
getEmployment(transactionId: string): Promise<ApickResult<DataRequestResult<EmploymentResultPayload>>>;
|
|
518
|
+
requestPersonalIncome(input: RequestPersonalIncomeInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
519
|
+
getPersonalIncome(transactionId: string): Promise<ApickResult<DataRequestResult<PersonalIncomeResultPayload>>>;
|
|
520
|
+
requestNpsJoinHistory(input: RequestNpsJoinHistoryInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
521
|
+
getNpsJoinHistory(transactionId: string): Promise<ApickResult<DataRequestResult<NpsJoinHistoryResultPayload>>>;
|
|
522
|
+
requestDrivingLicense(input: RequestDrivingLicenseInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
523
|
+
getDrivingLicense(transactionId: string): Promise<ApickResult<DataRequestResult<DrivingLicenseResultPayload>>>;
|
|
524
|
+
requestHealthCheckup(input: RequestHealthCheckupInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
525
|
+
getHealthCheckup(transactionId: string): Promise<ApickResult<DataRequestResult<HealthCheckupResultPayload>>>;
|
|
526
|
+
requestCashReceiptDeduction(input: RequestCashReceiptDeductionInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
527
|
+
getCashReceiptDeduction(transactionId: string): Promise<ApickResult<DataRequestResult<CashReceiptDeductionResultPayload>>>;
|
|
528
|
+
requestTaxReturnHistory(input: RequestTaxReturnHistoryInput): Promise<ApickResult<DataRequestAcceptedData>>;
|
|
529
|
+
getTaxReturnHistory(transactionId: string): Promise<ApickResult<DataRequestResult<TaxReturnHistoryResultPayload>>>;
|
|
530
|
+
searchSkills(options?: SkillSearchOptions): Promise<ApickResult<SkillPage<SkillSummary>>>;
|
|
531
|
+
/** Public measured results and methods; model scores are not accuracy guarantees. */
|
|
356
532
|
getSkillPerformance(): Promise<ApickResult<SkillPerformanceReport>>;
|
|
357
533
|
subagentStatus(): Promise<ApickResult<Record<string, unknown>>>;
|
|
358
534
|
subagentUsage(): Promise<ApickResult<Record<string, unknown>>>;
|
|
@@ -367,162 +543,162 @@ export class ApickClient {
|
|
|
367
543
|
reviewSubagent(jobId:string,resultHash:string,decision:'accepted'|'rejected'): Promise<ApickResult<Record<string,unknown>>>;
|
|
368
544
|
cancelSubagent(jobId:string): Promise<ApickResult<SubagentJob>>;
|
|
369
545
|
deleteSubagentJob(jobId:string): Promise<ApickResult<Record<string,unknown>>>;
|
|
370
|
-
getSkill(skillId: string): Promise<ApickResult<SkillDetail>>;
|
|
371
|
-
quoteSkill(skillId: string, input: Record<string, unknown>, options?: { version?: string }): Promise<ApickResult<SkillQuote>>;
|
|
372
|
-
runSkill<T = Record<string, unknown>>(skillId: string, input: Record<string, unknown>, options: SkillRunOptions): Promise<ApickResult<SkillRun<T>>>;
|
|
373
|
-
getSkillRun<T = Record<string, unknown>>(runId: string): Promise<ApickResult<SkillRun<T>>>;
|
|
374
|
-
getSkillRunResult<T = Record<string, unknown>>(runId: string): Promise<ApickResult<SkillRunResult<T>>>;
|
|
375
|
-
/** 본인 실행의 결과 파일을 인증해 내려받습니다. / Download an artifact owned by this API key. */
|
|
376
|
-
getSkillArtifact(runId: string, fileId: string): Promise<ApickBinaryResult>;
|
|
377
|
-
cancelSkillRun(runId: string): Promise<ApickResult<SkillRun>>;
|
|
378
|
-
skillUsage(options?: { cursor?: string; limit?: number }): Promise<ApickResult<SkillPage<SkillRun>>>;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
export const SKILL_CATEGORIES: readonly ['data', 'ai', 'dev', 'document', 'marketing', 'finance', 'productivity', 'video', 'etc'];
|
|
382
|
-
export type SkillCategory = typeof SKILL_CATEGORIES[number];
|
|
383
|
-
/** 검색 순서. 생략하면 등록 순서 / search order; registration order when omitted */
|
|
384
|
-
export const SKILL_SORTS: readonly ['recommended', 'popular', 'used', 'likes', 'rating', 'new', 'mine', 'liked'];
|
|
385
|
-
export type SkillSort = typeof SKILL_SORTS[number];
|
|
386
|
-
export interface SkillPerformanceRate {
|
|
387
|
-
passed: number; total: number; percent: number; interval95: [number, number];
|
|
388
|
-
}
|
|
389
|
-
export interface SkillPerformanceReport {
|
|
390
|
-
schema_version: 1;
|
|
391
|
-
updated_at: string;
|
|
392
|
-
inventory_verified: boolean;
|
|
393
|
-
method: { minimum_cases: number; min_score: number; mean_score: number; min_improvement: number; critical_failures: number; description: string; limitations: string[]; interval_note: string; split: { normal: number; boundary: number; adversarial: number } };
|
|
394
|
-
calibration: { at: string; cases: number; true_positive: number; false_negative: number; false_positive: number; true_negative: number; automatic_release_allowed: boolean } | null;
|
|
395
|
-
additional_calibrations: Array<{ label: string; at: string; cases: number; detected: number; missed: number; false_positive: number; uncertain: number; automatic_release_allowed: boolean; scope: string }>;
|
|
396
|
-
skills: Array<{
|
|
397
|
-
key: string; title: string; group: string; origin: 'new' | 'existing'; published: boolean | null; url: string | null;
|
|
398
|
-
current: {
|
|
399
|
-
state: 'not_tested' | 'partial' | 'held' | 'passed' | 'stale'; at?: string;
|
|
400
|
-
cases: number; planned_cases: number; score: number | null; baseline_score: number | null;
|
|
401
|
-
score_samples?: number; evaluation_errors?: number;
|
|
402
|
-
delivery: SkillPerformanceRate | null; machine: SkillPerformanceRate | null;
|
|
403
|
-
median_seconds: number | null; p95_seconds: number | null; timing_samples?: number;
|
|
404
|
-
reasons: string[]; method?: string; sample_type?: string;
|
|
405
|
-
baseline_format_valid?: boolean;
|
|
406
|
-
evaluation_stage?: 'preliminary' | 'holdout';
|
|
407
|
-
dataset_composition?: { normal: number; boundary: number; adversarial: number; misplaced_rejections: number; valid: boolean };
|
|
408
|
-
min_score?: number | null; critical_cases?: number | null;
|
|
409
|
-
case_split?: { standard: number; boundary: number; adversarial: number };
|
|
410
|
-
extra_checks?: Array<{ name: string; passed: number; total: number }>;
|
|
411
|
-
tool_calls?: Array<{ label: string; samples: number; total: number | null; median: number | null; p95: number | null }>;
|
|
412
|
-
case_results?: Array<{ index: number; name: string; kind: 'standard' | 'boundary' | 'adversarial'; status: 'tested' | 'evaluation_error' | 'machine_only' | 'not_tested'; expected: 'success' | 'reject' | null; machine_pass: boolean; score: number | null; baseline_score: number | null; failed_checks: string[]; reason: string | null }>;
|
|
413
|
-
};
|
|
414
|
-
legacy: { cases: number; score: number; baseline_score: number; method: string; independent_holdout: false; at?: string } | null;
|
|
415
|
-
}>;
|
|
416
|
-
}
|
|
417
|
-
export type SkillRunStatus = 'queued' | 'running' | 'completing' | 'succeeded' | 'failed' | 'timed_out' | 'cancelled';
|
|
418
|
-
export type SkillBillingStatus = 'reserved' | 'captured' | 'released' | 'partially_refunded' | 'refunded';
|
|
419
|
-
export type SkillFailureCode = 'EXECUTION_FAILED' | 'OUTPUT_INVALID' | 'TIMED_OUT' | 'CANCELLED' | 'UPSTREAM_UNAVAILABLE';
|
|
420
|
-
/** `ApickApiError.serviceCode` 로 돌아오는 Skills 오류 코드 */
|
|
421
|
-
export type SkillErrorCode =
|
|
422
|
-
| 'INVALID_INPUT' | 'AUTH_REQUIRED' | 'NOT_ALLOWED' | 'PAYMENT_REQUIRED' | 'SKILL_OR_RUN_NOT_FOUND'
|
|
423
|
-
| 'IDEMPOTENCY_KEY_REQUIRED' | 'IDEMPOTENCY_CONFLICT' | 'QUOTE_EXPIRED' | 'VERSION_UNAVAILABLE'
|
|
424
|
-
| 'PRICE_EXCEEDS_LIMIT' | 'RUN_NOT_CANCELLABLE' | 'RESULT_NOT_READY' | 'RESULT_EXPIRED'
|
|
425
|
-
| 'INSUFFICIENT_POINTS' | 'RATE_LIMITED' | 'BUDGET_EXCEEDED' | 'TEMPORARILY_UNAVAILABLE';
|
|
426
|
-
export interface SkillSearchOptions {
|
|
427
|
-
query?: string; category?: SkillCategory;
|
|
428
|
-
/** `mine`·`liked` 는 인증키의 계정 기준 / `mine` and `liked` are scoped to the API key's account */
|
|
429
|
-
sort?: SkillSort;
|
|
430
|
-
cursor?: string; limit?: number;
|
|
431
|
-
}
|
|
432
|
-
export interface SkillRunOptions {
|
|
433
|
-
/** 이 실행을 구분하는 고유 값. 재시도할 때 같은 값을 씁니다. 영문·숫자와 `. _ : -` 1~128자 */
|
|
434
|
-
idempotencyKey: string;
|
|
435
|
-
version?: string;
|
|
436
|
-
quoteId?: string;
|
|
437
|
-
/** 가격이 이 값보다 높으면 실행하지 않습니다 */
|
|
438
|
-
maxCostPoints?: number;
|
|
439
|
-
/** 결과를 기다릴 시간(0~20초, 기본 20) */
|
|
440
|
-
waitSeconds?: number;
|
|
441
|
-
}
|
|
442
|
-
export interface SkillPage<T> { items: T[]; next_cursor: string | null; }
|
|
443
|
-
export interface SkillLimits { max_input_chars: number; timeout_seconds: number; }
|
|
444
|
-
export interface SkillSummary {
|
|
445
|
-
execution_info?: SkillExecutionInfo;
|
|
446
|
-
price_label?: string;
|
|
447
|
-
skill_id: string; slug: string; title: string; summary: string;
|
|
448
|
-
category: SkillCategory; category_label: string; version: string;
|
|
449
|
-
/** 실행마다 같은 기본 금액 / base amount charged on every run */
|
|
450
|
-
price_points: number;
|
|
451
|
-
/** 사용량까지 더한 예상 금액 / estimated amount including usage */
|
|
452
|
-
estimated_points: number | null;
|
|
453
|
-
/** true 면 실행마다 실제 사용량만큼 금액이 달라집니다 / amount varies per run with actual usage */
|
|
454
|
-
usage_priced: boolean;
|
|
455
|
-
seller: { name: string }; uses_generative_ai: boolean;
|
|
456
|
-
/** 사용 건수 구간. 예: `1,000회 미만`, `1,000+`, `1만+` / usage tier label, not an exact count */
|
|
457
|
-
usage_label: string;
|
|
458
|
-
like_count: number;
|
|
459
|
-
review_count: number;
|
|
460
|
-
/** 평점(1~5, 소수 첫째 자리). 리뷰가 없으면 null / average rating, null without reviews */
|
|
461
|
-
rating_average: number | null;
|
|
462
|
-
}
|
|
463
|
-
export interface SkillDetail extends SkillSummary {
|
|
546
|
+
getSkill(skillId: string): Promise<ApickResult<SkillDetail>>;
|
|
547
|
+
quoteSkill(skillId: string, input: Record<string, unknown>, options?: { version?: string }): Promise<ApickResult<SkillQuote>>;
|
|
548
|
+
runSkill<T = Record<string, unknown>>(skillId: string, input: Record<string, unknown>, options: SkillRunOptions): Promise<ApickResult<SkillRun<T>>>;
|
|
549
|
+
getSkillRun<T = Record<string, unknown>>(runId: string): Promise<ApickResult<SkillRun<T>>>;
|
|
550
|
+
getSkillRunResult<T = Record<string, unknown>>(runId: string): Promise<ApickResult<SkillRunResult<T>>>;
|
|
551
|
+
/** 본인 실행의 결과 파일을 인증해 내려받습니다. / Download an artifact owned by this API key. */
|
|
552
|
+
getSkillArtifact(runId: string, fileId: string): Promise<ApickBinaryResult>;
|
|
553
|
+
cancelSkillRun(runId: string): Promise<ApickResult<SkillRun>>;
|
|
554
|
+
skillUsage(options?: { cursor?: string; limit?: number }): Promise<ApickResult<SkillPage<SkillRun>>>;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export const SKILL_CATEGORIES: readonly ['data', 'ai', 'dev', 'document', 'marketing', 'finance', 'productivity', 'video', 'etc'];
|
|
558
|
+
export type SkillCategory = typeof SKILL_CATEGORIES[number];
|
|
559
|
+
/** 검색 순서. 생략하면 등록 순서 / search order; registration order when omitted */
|
|
560
|
+
export const SKILL_SORTS: readonly ['recommended', 'popular', 'used', 'likes', 'rating', 'new', 'mine', 'liked'];
|
|
561
|
+
export type SkillSort = typeof SKILL_SORTS[number];
|
|
562
|
+
export interface SkillPerformanceRate {
|
|
563
|
+
passed: number; total: number; percent: number; interval95: [number, number];
|
|
564
|
+
}
|
|
565
|
+
export interface SkillPerformanceReport {
|
|
566
|
+
schema_version: 1;
|
|
567
|
+
updated_at: string;
|
|
568
|
+
inventory_verified: boolean;
|
|
569
|
+
method: { minimum_cases: number; min_score: number; mean_score: number; min_improvement: number; critical_failures: number; description: string; limitations: string[]; interval_note: string; split: { normal: number; boundary: number; adversarial: number } };
|
|
570
|
+
calibration: { at: string; cases: number; true_positive: number; false_negative: number; false_positive: number; true_negative: number; automatic_release_allowed: boolean } | null;
|
|
571
|
+
additional_calibrations: Array<{ label: string; at: string; cases: number; detected: number; missed: number; false_positive: number; uncertain: number; automatic_release_allowed: boolean; scope: string }>;
|
|
572
|
+
skills: Array<{
|
|
573
|
+
key: string; title: string; group: string; origin: 'new' | 'existing'; published: boolean | null; url: string | null;
|
|
574
|
+
current: {
|
|
575
|
+
state: 'not_tested' | 'partial' | 'held' | 'passed' | 'stale'; at?: string;
|
|
576
|
+
cases: number; planned_cases: number; score: number | null; baseline_score: number | null;
|
|
577
|
+
score_samples?: number; evaluation_errors?: number;
|
|
578
|
+
delivery: SkillPerformanceRate | null; machine: SkillPerformanceRate | null;
|
|
579
|
+
median_seconds: number | null; p95_seconds: number | null; timing_samples?: number;
|
|
580
|
+
reasons: string[]; method?: string; sample_type?: string;
|
|
581
|
+
baseline_format_valid?: boolean;
|
|
582
|
+
evaluation_stage?: 'preliminary' | 'holdout';
|
|
583
|
+
dataset_composition?: { normal: number; boundary: number; adversarial: number; misplaced_rejections: number; valid: boolean };
|
|
584
|
+
min_score?: number | null; critical_cases?: number | null;
|
|
585
|
+
case_split?: { standard: number; boundary: number; adversarial: number };
|
|
586
|
+
extra_checks?: Array<{ name: string; passed: number; total: number }>;
|
|
587
|
+
tool_calls?: Array<{ label: string; samples: number; total: number | null; median: number | null; p95: number | null }>;
|
|
588
|
+
case_results?: Array<{ index: number; name: string; kind: 'standard' | 'boundary' | 'adversarial'; status: 'tested' | 'evaluation_error' | 'machine_only' | 'not_tested'; expected: 'success' | 'reject' | null; machine_pass: boolean; score: number | null; baseline_score: number | null; failed_checks: string[]; reason: string | null }>;
|
|
589
|
+
};
|
|
590
|
+
legacy: { cases: number; score: number; baseline_score: number; method: string; independent_holdout: false; at?: string } | null;
|
|
591
|
+
}>;
|
|
592
|
+
}
|
|
593
|
+
export type SkillRunStatus = 'queued' | 'running' | 'completing' | 'succeeded' | 'failed' | 'timed_out' | 'cancelled';
|
|
594
|
+
export type SkillBillingStatus = 'reserved' | 'captured' | 'released' | 'partially_refunded' | 'refunded';
|
|
595
|
+
export type SkillFailureCode = 'EXECUTION_FAILED' | 'OUTPUT_INVALID' | 'TIMED_OUT' | 'CANCELLED' | 'UPSTREAM_UNAVAILABLE';
|
|
596
|
+
/** `ApickApiError.serviceCode` 로 돌아오는 Skills 오류 코드 */
|
|
597
|
+
export type SkillErrorCode =
|
|
598
|
+
| 'INVALID_INPUT' | 'AUTH_REQUIRED' | 'NOT_ALLOWED' | 'PAYMENT_REQUIRED' | 'SKILL_OR_RUN_NOT_FOUND'
|
|
599
|
+
| 'IDEMPOTENCY_KEY_REQUIRED' | 'IDEMPOTENCY_CONFLICT' | 'QUOTE_EXPIRED' | 'VERSION_UNAVAILABLE'
|
|
600
|
+
| 'PRICE_EXCEEDS_LIMIT' | 'RUN_NOT_CANCELLABLE' | 'RESULT_NOT_READY' | 'RESULT_EXPIRED'
|
|
601
|
+
| 'INSUFFICIENT_POINTS' | 'RATE_LIMITED' | 'BUDGET_EXCEEDED' | 'TEMPORARILY_UNAVAILABLE';
|
|
602
|
+
export interface SkillSearchOptions {
|
|
603
|
+
query?: string; category?: SkillCategory;
|
|
604
|
+
/** `mine`·`liked` 는 인증키의 계정 기준 / `mine` and `liked` are scoped to the API key's account */
|
|
605
|
+
sort?: SkillSort;
|
|
606
|
+
cursor?: string; limit?: number;
|
|
607
|
+
}
|
|
608
|
+
export interface SkillRunOptions {
|
|
609
|
+
/** 이 실행을 구분하는 고유 값. 재시도할 때 같은 값을 씁니다. 영문·숫자와 `. _ : -` 1~128자 */
|
|
610
|
+
idempotencyKey: string;
|
|
611
|
+
version?: string;
|
|
612
|
+
quoteId?: string;
|
|
613
|
+
/** 가격이 이 값보다 높으면 실행하지 않습니다 */
|
|
614
|
+
maxCostPoints?: number;
|
|
615
|
+
/** 결과를 기다릴 시간(0~20초, 기본 20) */
|
|
616
|
+
waitSeconds?: number;
|
|
617
|
+
}
|
|
618
|
+
export interface SkillPage<T> { items: T[]; next_cursor: string | null; }
|
|
619
|
+
export interface SkillLimits { max_input_chars: number; timeout_seconds: number; }
|
|
620
|
+
export interface SkillSummary {
|
|
621
|
+
execution_info?: SkillExecutionInfo;
|
|
622
|
+
price_label?: string;
|
|
623
|
+
skill_id: string; slug: string; title: string; summary: string;
|
|
624
|
+
category: SkillCategory; category_label: string; version: string;
|
|
625
|
+
/** 실행마다 같은 기본 금액 / base amount charged on every run */
|
|
626
|
+
price_points: number;
|
|
627
|
+
/** 사용량까지 더한 예상 금액 / estimated amount including usage */
|
|
628
|
+
estimated_points: number | null;
|
|
629
|
+
/** true 면 실행마다 실제 사용량만큼 금액이 달라집니다 / amount varies per run with actual usage */
|
|
630
|
+
usage_priced: boolean;
|
|
631
|
+
seller: { name: string }; uses_generative_ai: boolean;
|
|
632
|
+
/** 사용 건수 구간. 예: `1,000회 미만`, `1,000+`, `1만+` / usage tier label, not an exact count */
|
|
633
|
+
usage_label: string;
|
|
634
|
+
like_count: number;
|
|
635
|
+
review_count: number;
|
|
636
|
+
/** 평점(1~5, 소수 첫째 자리). 리뷰가 없으면 null / average rating, null without reviews */
|
|
637
|
+
rating_average: number | null;
|
|
638
|
+
}
|
|
639
|
+
export interface SkillDetail extends SkillSummary {
|
|
464
640
|
description: string; billing_rule: 'validated_result' | 'subagent_usage'; limits: SkillLimits | null;
|
|
465
641
|
delivery?: 'installed_agent'; installation?: {package:string;command:string;api_key_env:string;guide:string;usage:string};
|
|
466
|
-
billing?: {markup_percent:number;installation_points:number;base_points:number;complete_cache_points:number;quota:null};
|
|
467
|
-
input_schema: Record<string, unknown>; output_schema: Record<string, unknown>;
|
|
468
|
-
examples: unknown[]; stats: Record<string, unknown> | null; published_at: string | null;
|
|
469
|
-
}
|
|
470
|
-
export interface SkillQuote {
|
|
471
|
-
execution_info?: SkillExecutionInfo;
|
|
472
|
-
quote_id: string; skill_id: string; version: string; price_points: number;
|
|
473
|
-
/** 이 입력의 예상 금액 / estimated amount for this input */
|
|
474
|
-
estimated_points: number;
|
|
475
|
-
/** 예약되는 최대 금액. 실제 차감액은 이 값을 넘지 않습니다 / maximum amount reserved; the charge never exceeds it */
|
|
476
|
-
max_points: number;
|
|
477
|
-
usage_priced: boolean;
|
|
478
|
-
expires_at: string; limits: SkillLimits; billing_rule: 'validated_result';
|
|
479
|
-
}
|
|
480
|
-
export interface SkillBilling { status: SkillBillingStatus; reserved_points: number; charged_points: number; refunded_points: number; }
|
|
481
|
-
export interface SkillExecutionInfo {
|
|
482
|
-
price_range: { min_points: number; max_points: number; variable: boolean };
|
|
483
|
-
duration: { min_seconds: number; max_seconds: number; basis: string };
|
|
484
|
-
tools: Array<{ name: string; typical_calls: number | string; max_calls: number | string; min_calls?: number }>;
|
|
485
|
-
billing_note: string;
|
|
486
|
-
}
|
|
487
|
-
export interface SkillArtifact {
|
|
488
|
-
id: string; name: string; mime_type: string; url: string; sha256: string; bytes: number;
|
|
489
|
-
label?: string; width?: number; height?: number; seconds?: number;
|
|
490
|
-
}
|
|
491
|
-
export interface SkillRun<T = Record<string, unknown>> {
|
|
492
|
-
run_id: string; status: SkillRunStatus;
|
|
493
|
-
skill: { id: string; version: string; title?: string };
|
|
494
|
-
billing: SkillBilling; created_at: string | null; completed_at: string | null;
|
|
495
|
-
links: { self: string; result?: string };
|
|
496
|
-
failure_code?: SkillFailureCode; result_expires_at?: string | null;
|
|
497
|
-
/** status 가 succeeded 일 때만 */
|
|
498
|
-
result?: T;
|
|
499
|
-
}
|
|
500
|
-
export interface SkillRunResult<T = Record<string, unknown>> {
|
|
501
|
-
run_id: string; skill: { id: string; version: string; title?: string };
|
|
502
|
-
result: T; result_expires_at: string | null;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
export default ApickClient;
|
|
506
|
-
|
|
507
|
-
export type VideoModel = 'seedance' | 'veo' | 'kling';
|
|
508
|
-
export interface VideoJobOptions {
|
|
509
|
-
version?: string; tier?: string; mode?: 'text' | 'image' | 'reference'; duration?: number;
|
|
510
|
-
aspectRatio?: string; resolution?: string; audio?: boolean; negativePrompt?: string;
|
|
511
|
-
seed?: number; cfgScale?: number; idempotencyKey?: string;
|
|
512
|
-
image?: string | BinaryInput | ArrayBuffer | ArrayBufferView;
|
|
513
|
-
lastImage?: string | BinaryInput | ArrayBuffer | ArrayBufferView;
|
|
514
|
-
referenceImages?: Array<string | BinaryInput | ArrayBuffer | ArrayBufferView>;
|
|
515
|
-
referenceVideos?: Array<string | BinaryInput>;
|
|
516
|
-
referenceAudios?: Array<string | BinaryInput>;
|
|
517
|
-
}
|
|
518
|
-
export interface VideoJobData {
|
|
519
|
-
job_id: string; model: VideoModel; version: string; mode: string; tier: string;
|
|
520
|
-
status: 'waiting' | 'processing' | 'completed' | 'failed' | 'cancelled';
|
|
521
|
-
duration: number; resolution?: string; audio?: boolean; point_per_second?: number;
|
|
522
|
-
charged_point?: number; result_available?: boolean; result_url?: string;
|
|
523
|
-
result_expires_at?: string | null; idempotent_replay?: boolean;
|
|
524
|
-
error?: { code: string; message: string };
|
|
525
|
-
}
|
|
642
|
+
billing?: {markup_percent:number;installation_points:number;base_points:number;complete_cache_points:number;quota:null};
|
|
643
|
+
input_schema: Record<string, unknown>; output_schema: Record<string, unknown>;
|
|
644
|
+
examples: unknown[]; stats: Record<string, unknown> | null; published_at: string | null;
|
|
645
|
+
}
|
|
646
|
+
export interface SkillQuote {
|
|
647
|
+
execution_info?: SkillExecutionInfo;
|
|
648
|
+
quote_id: string; skill_id: string; version: string; price_points: number;
|
|
649
|
+
/** 이 입력의 예상 금액 / estimated amount for this input */
|
|
650
|
+
estimated_points: number;
|
|
651
|
+
/** 예약되는 최대 금액. 실제 차감액은 이 값을 넘지 않습니다 / maximum amount reserved; the charge never exceeds it */
|
|
652
|
+
max_points: number;
|
|
653
|
+
usage_priced: boolean;
|
|
654
|
+
expires_at: string; limits: SkillLimits; billing_rule: 'validated_result';
|
|
655
|
+
}
|
|
656
|
+
export interface SkillBilling { status: SkillBillingStatus; reserved_points: number; charged_points: number; refunded_points: number; }
|
|
657
|
+
export interface SkillExecutionInfo {
|
|
658
|
+
price_range: { min_points: number; max_points: number; variable: boolean };
|
|
659
|
+
duration: { min_seconds: number; max_seconds: number; basis: string };
|
|
660
|
+
tools: Array<{ name: string; typical_calls: number | string; max_calls: number | string; min_calls?: number }>;
|
|
661
|
+
billing_note: string;
|
|
662
|
+
}
|
|
663
|
+
export interface SkillArtifact {
|
|
664
|
+
id: string; name: string; mime_type: string; url: string; sha256: string; bytes: number;
|
|
665
|
+
label?: string; width?: number; height?: number; seconds?: number;
|
|
666
|
+
}
|
|
667
|
+
export interface SkillRun<T = Record<string, unknown>> {
|
|
668
|
+
run_id: string; status: SkillRunStatus;
|
|
669
|
+
skill: { id: string; version: string; title?: string };
|
|
670
|
+
billing: SkillBilling; created_at: string | null; completed_at: string | null;
|
|
671
|
+
links: { self: string; result?: string };
|
|
672
|
+
failure_code?: SkillFailureCode; result_expires_at?: string | null;
|
|
673
|
+
/** status 가 succeeded 일 때만 */
|
|
674
|
+
result?: T;
|
|
675
|
+
}
|
|
676
|
+
export interface SkillRunResult<T = Record<string, unknown>> {
|
|
677
|
+
run_id: string; skill: { id: string; version: string; title?: string };
|
|
678
|
+
result: T; result_expires_at: string | null;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export default ApickClient;
|
|
682
|
+
|
|
683
|
+
export type VideoModel = 'seedance' | 'veo' | 'kling';
|
|
684
|
+
export interface VideoJobOptions {
|
|
685
|
+
version?: string; tier?: string; mode?: 'text' | 'image' | 'reference'; duration?: number;
|
|
686
|
+
aspectRatio?: string; resolution?: string; audio?: boolean; negativePrompt?: string;
|
|
687
|
+
seed?: number; cfgScale?: number; idempotencyKey?: string;
|
|
688
|
+
image?: string | BinaryInput | ArrayBuffer | ArrayBufferView;
|
|
689
|
+
lastImage?: string | BinaryInput | ArrayBuffer | ArrayBufferView;
|
|
690
|
+
referenceImages?: Array<string | BinaryInput | ArrayBuffer | ArrayBufferView>;
|
|
691
|
+
referenceVideos?: Array<string | BinaryInput>;
|
|
692
|
+
referenceAudios?: Array<string | BinaryInput>;
|
|
693
|
+
}
|
|
694
|
+
export interface VideoJobData {
|
|
695
|
+
job_id: string; model: VideoModel; version: string; mode: string; tier: string;
|
|
696
|
+
status: 'waiting' | 'processing' | 'completed' | 'failed' | 'cancelled';
|
|
697
|
+
duration: number; resolution?: string; audio?: boolean; point_per_second?: number;
|
|
698
|
+
charged_point?: number; result_available?: boolean; result_url?: string;
|
|
699
|
+
result_expires_at?: string | null; idempotent_replay?: boolean;
|
|
700
|
+
error?: { code: string; message: string };
|
|
701
|
+
}
|
|
526
702
|
|
|
527
703
|
export interface SubagentTask { kind:'inventory'|'extract'|'summarize'|'compare';goal:string;file_ids:string[];focus?:string[];acceptance?:string[];retention?:'seven_days'|'none'; }
|
|
528
704
|
export interface SubagentFile { file_id:string;path:string;sha256:string;bytes:number;state:string;expires_at:string;part_bytes?:number; }
|