apick-api 4.3.0 → 4.4.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 +226 -215
- package/README.md +505 -508
- package/docs/guide.en.md +406 -408
- package/docs/guide.ko.md +415 -417
- package/docs/skill-artifacts.md +24 -24
- package/docs/subagent.md +39 -39
- package/docs/tts.md +34 -34
- package/examples/basic.mjs +10 -10
- package/examples/commonjs.cjs +12 -12
- package/examples/files.mjs +9 -9
- package/package.json +71 -71
- package/src/form.cjs +28 -28
- package/src/index.cjs +1308 -1351
- package/src/index.d.ts +872 -890
- package/src/index.js +15 -15
package/docs/skill-artifacts.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# 스킬 결과 파일 · Skill artifacts
|
|
2
|
-
|
|
3
|
-
스킬 상세와 견적의 `execution_info`는 예상 가격 범위, 처리 시간 범위, 도구별 보통·최대 호출 수를 제공합니다. 실측 표본에 따른 예상이며 입력에 따라 달라집니다. 실행 전 견적의 `max_points`를 확인하세요.
|
|
4
|
-
|
|
5
|
-
`execution_info` on Skill details and quotes describes estimated price and duration ranges and typical/maximum tool calls. These are estimates, not guarantees. Check `max_points` before running a Skill.
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
const quote = await apick.quoteSkill(skillId, input);
|
|
9
|
-
console.log(quote.data.execution_info);
|
|
10
|
-
const run = await apick.runSkill(skillId, input, {
|
|
11
|
-
idempotencyKey: 'my-unique-request',
|
|
12
|
-
quoteId: quote.data.quote_id,
|
|
13
|
-
maxCostPoints: quote.data.max_points
|
|
14
|
-
});
|
|
15
|
-
// Poll getSkillRun until status is succeeded, then:
|
|
16
|
-
const result = await apick.getSkillRunResult(run.data.run_id);
|
|
17
|
-
const file = result.data.result.artifacts[0];
|
|
18
|
-
const downloaded = await apick.getSkillArtifact(run.data.run_id, file.id);
|
|
19
|
-
await downloaded.save('./result.png');
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
파일의 `name`, `mime_type`, `bytes`, `sha256`을 확인하고 실제 형식에 맞는 확장자로 저장하세요. 인증키 소유자의 실행 파일만 내려받을 수 있고, 실행 결과가 만료되면 파일도 만료됩니다. 실패·취소·시간 초과는 예약액을 반환하며, 가변 요금 상품은 성공 시 실제 사용료를 정산합니다. 공급자 청구서와 대조한 확정 원가를 뜻하지 않습니다.
|
|
23
|
-
|
|
24
|
-
Use `name`, `mime_type`, `bytes`, and `sha256` to identify and verify each file; choose a matching extension. Downloads require the run owner's API key and expire with the result. Failed, cancelled, and timed-out runs release the reservation. Variable-price Skills settle recorded tool usage on success; calculated vendor costs are not invoice-reconciled amounts.
|
|
1
|
+
# 스킬 결과 파일 · Skill artifacts
|
|
2
|
+
|
|
3
|
+
스킬 상세와 견적의 `execution_info`는 예상 가격 범위, 처리 시간 범위, 도구별 보통·최대 호출 수를 제공합니다. 실측 표본에 따른 예상이며 입력에 따라 달라집니다. 실행 전 견적의 `max_points`를 확인하세요.
|
|
4
|
+
|
|
5
|
+
`execution_info` on Skill details and quotes describes estimated price and duration ranges and typical/maximum tool calls. These are estimates, not guarantees. Check `max_points` before running a Skill.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
const quote = await apick.quoteSkill(skillId, input);
|
|
9
|
+
console.log(quote.data.execution_info);
|
|
10
|
+
const run = await apick.runSkill(skillId, input, {
|
|
11
|
+
idempotencyKey: 'my-unique-request',
|
|
12
|
+
quoteId: quote.data.quote_id,
|
|
13
|
+
maxCostPoints: quote.data.max_points
|
|
14
|
+
});
|
|
15
|
+
// Poll getSkillRun until status is succeeded, then:
|
|
16
|
+
const result = await apick.getSkillRunResult(run.data.run_id);
|
|
17
|
+
const file = result.data.result.artifacts[0];
|
|
18
|
+
const downloaded = await apick.getSkillArtifact(run.data.run_id, file.id);
|
|
19
|
+
await downloaded.save('./result.png');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
파일의 `name`, `mime_type`, `bytes`, `sha256`을 확인하고 실제 형식에 맞는 확장자로 저장하세요. 인증키 소유자의 실행 파일만 내려받을 수 있고, 실행 결과가 만료되면 파일도 만료됩니다. 실패·취소·시간 초과는 예약액을 반환하며, 가변 요금 상품은 성공 시 실제 사용료를 정산합니다. 공급자 청구서와 대조한 확정 원가를 뜻하지 않습니다.
|
|
23
|
+
|
|
24
|
+
Use `name`, `mime_type`, `bytes`, and `sha256` to identify and verify each file; choose a matching extension. Downloads require the run owner's API key and expire with the result. Failed, cancelled, and timed-out runs release the reservation. Variable-price Skills settle recorded tool usage on success; calculated vendor costs are not invoice-reconciled amounts.
|
package/docs/subagent.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# 서브에이전트 / Subagent
|
|
2
|
-
|
|
3
|
-
`apick-agent`는 설치형 상품이며 `quoteSkill`·`runSkill` 대신 전용 API를 사용합니다. 성공 작업의 확인된 원가에 40%를
|
|
4
|
-
|
|
5
|
-
`apick-agent` is an installed-agent product. Use the dedicated API rather than `quoteSkill` or `runSkill`. Successful work is billed at confirmed model cost plus 40
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import { ApickClient } from 'apick-api';
|
|
9
|
-
import { createHash } from 'node:crypto';
|
|
10
|
-
const api = new ApickClient({ apiKey: process.env.APICK_API_KEY });
|
|
11
|
-
const bytes = Buffer.from('검토할 공개 문서입니다.');
|
|
12
|
-
const file = await api.createSubagentFile({
|
|
13
|
-
path: 'docs/sample.txt', bytes: bytes.length,
|
|
14
|
-
sha256: createHash('sha256').update(bytes).digest('hex'), retention: 'seven_days'
|
|
15
|
-
});
|
|
16
|
-
if (file.data.state !== 'ready') {
|
|
17
|
-
for (let offset = 0; offset < bytes.length; offset += file.data.part_bytes) {
|
|
18
|
-
await api.uploadSubagentPart(file.data.file_id, offset / file.data.part_bytes,
|
|
19
|
-
bytes.subarray(offset, offset + file.data.part_bytes).toString('base64'));
|
|
20
|
-
}
|
|
21
|
-
await api.completeSubagentFile(file.data.file_id);
|
|
22
|
-
}
|
|
23
|
-
const job = await api.dispatchSubagent({kind:'summarize', goal:'핵심 내용과 근거를 정리하세요',
|
|
24
|
-
file_ids:[file.data.file_id]}, {idempotencyKey:'sample-summary-20261004-001'});
|
|
25
|
-
const result = await api.collectSubagent(job.data.job_id);
|
|
26
|
-
// 완료 후 evidence_ids를 조회하여 인용·해시를 직접 검토하세요.
|
|
27
|
-
// Once complete, fetch evidence_ids and independently review quotes and hashes.
|
|
28
|
-
console.log(result.data.state);
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
접수 응답은 작업 ID를 신속히 반환합니다. 같은 멱등 키와 같은 내용은 기존 작업을 반환하며 내용이 다르면 409입니다. 연결 종료는 취소가 아닙니다. `cancelSubagent`로 명시적으로 취소하세요. `retention:'none'`은 검수 완료 후 삭제하고 임시 보관은 최대 1시간입니다.
|
|
32
|
-
|
|
33
|
-
Submission returns a job ID promptly. Replay the same idempotency key and payload after response loss; a changed payload conflicts with HTTP 409. Disconnecting does not cancel work; use `cancelSubagent`. `retention:'none'` deletes after review, with temporary retention capped at one hour.
|
|
34
|
-
|
|
35
|
-
`subagentUsage`는 호출·토큰·예약·청구·해제·캐시·전송 지표를 반환합니다. 캐시 예상 회피 비용은 동일 작업의 최초 계산 비용 기준이며 주 모델의 실제 청구 절감액이 아닙니다.
|
|
36
|
-
|
|
37
|
-
`subagentUsage` returns calls, tokens, reservations, charges, releases, cache and transfer metrics. Estimated avoided cache cost uses the original job's calculated cost and is not a measured reduction in the main model's bill.
|
|
38
|
-
|
|
39
|
-
[전체 REST·MCP 가이드 / Full guide](https://apick.app/dev_guide/subagent)
|
|
1
|
+
# 서브에이전트 / Subagent
|
|
2
|
+
|
|
3
|
+
`apick-agent`는 설치형 상품이며 `quoteSkill`·`runSkill` 대신 전용 API를 사용합니다. 설치비·도입비·구독료는 없고, 성공 작업의 확인된 원가에 40%를 가산합니다(2026-11-06부터 분석 원가는 시간대와 관계없이 혼잡 시간대 단가 기준 20%, 자료 선별 원가는 40%)(소수점 올림, 2026-11-06부터 AI 사용 작업 기본 5P). 승인된 동일 결과 캐시는 1P입니다. 충전 잔액 외 상품 사용량 한도는 없습니다.
|
|
4
|
+
|
|
5
|
+
`apick-agent` is an installed-agent product. Use the dedicated API rather than `quoteSkill` or `runSkill`. There is no installation, setup or subscription fee. Successful work is billed at confirmed model cost plus 40% (from 2026-11-06, analysis cost is based on the peak-hour rate regardless of time with 20% added; source-selection cost stays at 40%) (fractions rounded up, 5-point base fee for AI jobs from 2026-11-06); approved identical-result cache reuse costs 1 point. There are no product usage quotas beyond prepaid balance.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { ApickClient } from 'apick-api';
|
|
9
|
+
import { createHash } from 'node:crypto';
|
|
10
|
+
const api = new ApickClient({ apiKey: process.env.APICK_API_KEY });
|
|
11
|
+
const bytes = Buffer.from('검토할 공개 문서입니다.');
|
|
12
|
+
const file = await api.createSubagentFile({
|
|
13
|
+
path: 'docs/sample.txt', bytes: bytes.length,
|
|
14
|
+
sha256: createHash('sha256').update(bytes).digest('hex'), retention: 'seven_days'
|
|
15
|
+
});
|
|
16
|
+
if (file.data.state !== 'ready') {
|
|
17
|
+
for (let offset = 0; offset < bytes.length; offset += file.data.part_bytes) {
|
|
18
|
+
await api.uploadSubagentPart(file.data.file_id, offset / file.data.part_bytes,
|
|
19
|
+
bytes.subarray(offset, offset + file.data.part_bytes).toString('base64'));
|
|
20
|
+
}
|
|
21
|
+
await api.completeSubagentFile(file.data.file_id);
|
|
22
|
+
}
|
|
23
|
+
const job = await api.dispatchSubagent({kind:'summarize', goal:'핵심 내용과 근거를 정리하세요',
|
|
24
|
+
file_ids:[file.data.file_id]}, {idempotencyKey:'sample-summary-20261004-001'});
|
|
25
|
+
const result = await api.collectSubagent(job.data.job_id);
|
|
26
|
+
// 완료 후 evidence_ids를 조회하여 인용·해시를 직접 검토하세요.
|
|
27
|
+
// Once complete, fetch evidence_ids and independently review quotes and hashes.
|
|
28
|
+
console.log(result.data.state);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
접수 응답은 작업 ID를 신속히 반환합니다. 같은 멱등 키와 같은 내용은 기존 작업을 반환하며 내용이 다르면 409입니다. 연결 종료는 취소가 아닙니다. `cancelSubagent`로 명시적으로 취소하세요. `retention:'none'`은 검수 완료 후 삭제하고 임시 보관은 최대 1시간입니다.
|
|
32
|
+
|
|
33
|
+
Submission returns a job ID promptly. Replay the same idempotency key and payload after response loss; a changed payload conflicts with HTTP 409. Disconnecting does not cancel work; use `cancelSubagent`. `retention:'none'` deletes after review, with temporary retention capped at one hour.
|
|
34
|
+
|
|
35
|
+
`subagentUsage`는 호출·토큰·예약·청구·해제·캐시·전송 지표를 반환합니다. 캐시 예상 회피 비용은 동일 작업의 최초 계산 비용 기준이며 주 모델의 실제 청구 절감액이 아닙니다.
|
|
36
|
+
|
|
37
|
+
`subagentUsage` returns calls, tokens, reservations, charges, releases, cache and transfer metrics. Estimated avoided cache cost uses the original job's calculated cost and is not a measured reduction in the main model's bill.
|
|
38
|
+
|
|
39
|
+
[전체 REST·MCP 가이드 / Full guide](https://apick.app/dev_guide/subagent)
|
package/docs/tts.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# Gemini·ChatGPT TTS
|
|
2
|
-
|
|
3
|
-
기존 APICK 목소리와 자동 전환은 종료되었습니다. `createTtsJob`은 Gemini 기본 목소리 `Kore`를 사용합니다. `getTtsQuality`, `retryTtsJob`, `downloadTtsCandidate`의 기존 경로는 HTTP 409를 반환합니다.
|
|
4
|
-
|
|
5
|
-
Legacy APICK voices and automatic fallback have retired. `createTtsJob` now defaults to Gemini voice `Kore`. The legacy quality, retry and candidate endpoints return HTTP 409.
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
const job = await client.createTtsJob('기온은 오 도입니다.', { voiceId: 'Kore', normalizeText: false, idempotencyKey: 'tts-001' });
|
|
9
|
-
const dialogue = await client.createOpenAiTtsJob({
|
|
10
|
-
utterances: [{ speaker: '진행', text: '반갑습니다.' }, { speaker: '손님', text: '안녕하세요.' }],
|
|
11
|
-
speakers: { 진행: { voice_id: 'alloy' }, 손님: { voice_id: 'nova', emotion: 'calm' } },
|
|
12
|
-
multi_speaker: true, normalize_text: false
|
|
13
|
-
}, { idempotencyKey: 'tts-002' });
|
|
14
|
-
const voices = await client.listGeminiTtsVoices();
|
|
15
|
-
const otherVoices = await client.listOpenAiTtsVoices();
|
|
16
|
-
const options = await client.getTtsOptions();
|
|
17
|
-
const quote = await client.quoteTts({ engine: 'gemini', text: '본문', voice_id: 'Kore' });
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
`style`, `emotion`, `tone`, `accent`, `pace`(0.5–2), `pitch`(-12–12), `volume_gain_db`(-12–12)는 최상위·화자·발화에 지정할 수 있습니다. `speakers`는 화자 이름별 설정이고 `multi_speaker: true`는 Gemini 최대 2명, ChatGPT 최대 8명입니다. 엔진에 따라 표현 효과가 달라지며 정확한 속도 배율·반음·dB 적용을 보장하지 않습니다. 특히 ChatGPT는 수치의 방향을 낭독 지시로 전달합니다.
|
|
21
|
-
|
|
22
|
-
Style, emotion, tone, accent, pace, pitch and volume options can be set per request, speaker or utterance. Gemini supports up to two native speakers; ChatGPT supports up to eight speakers across utterances. Numeric acoustic adjustments are not guaranteed: ChatGPT receives directional instructions rather than precise rate, semitone or decibel controls.
|
|
23
|
-
|
|
24
|
-
정규화는 기본 켜짐이며 추가 스킬 요금이 합산됩니다. `normalize_text: false`(SDK 문자열 호출은 `normalizeText: false`)로 끌 수 있습니다. 정규화 입력은 발화 사이 줄바꿈을 포함해 최대 2,000자, 정규화 없이 최대 8,000자입니다. 견적은 `quoteTts`, 현재 목소리는 엔진별 목록, 옵션은 `getTtsOptions`로 조회합니다.
|
|
25
|
-
|
|
26
|
-
Normalization is enabled by default and costs extra. Disable it with `normalize_text: false` (`normalizeText: false` for the string SDK helper). Input limits are 2,000 characters including utterance separators with normalization, or 8,000 without it. Query a quote, engine-specific voices and supported options before submitting.
|
|
27
|
-
|
|
28
|
-
실제 AI 원가 × 고정된 환율 × 1.4에 정규화 요금을 더해 정산합니다. Gemini 프로모션 입력/출력 단가는 2026-12-31까지 백만 토큰당 $0.50/$6.00이며 2027-01-01 00:00 UTC부터 $1.00/$12.00입니다. 약 $0.54/시간은 참고값이며 시간 단위 청구가 아닙니다. 엔진별 요금이 다릅니다.
|
|
29
|
-
|
|
30
|
-
AI usage is charged at verified cost × the pinned exchange rate × 1.4, plus normalization. Gemini promotional input/output rates are $0.50/$6.00 per million tokens through 2026-12-31, then $1.00/$12.00 from 2027-01-01 00:00 UTC. The approximate hourly figure is informational; billing uses actual usage and differs by engine.
|
|
31
|
-
|
|
32
|
-
두 엔진은 같은 작업 조회·취소·MP3·원문 ASS 계약을 사용합니다. `billing`의 예약·해제·확정·환불을 확인하세요. MP3는 24kHz 모노 48kbps, 결과는 완료 후 24시간 보관합니다. MP3와 ASS는 각각 완료된 다운로드 1회만 허용하며 전송 중단은 재시도할 수 있습니다. 접수 응답 유실 시 같은 입력과 멱등 키를 재사용하세요. 서버·공급자 최종 실패는 정규화까지 환불하며, 연결 종료는 작업 취소가 아닙니다. 취소 시 이미 수행된 작업분을 정산합니다.
|
|
33
|
-
|
|
34
|
-
Both engines share job status, cancellation, MP3 and original-text ASS downloads. Check reserved, released, captured and refunded amounts in `billing`. MP3 is 24 kHz mono at 48 kbps. Files are kept for 24 hours; each permits one completed download, and interrupted transfers can be retried. Reuse the same input and idempotency key after a lost response. Final server/provider failures refund synthesis and normalization; disconnecting does not cancel work. Explicit cancellation settles work already performed.
|
|
1
|
+
# Gemini·ChatGPT TTS
|
|
2
|
+
|
|
3
|
+
기존 APICK 목소리와 자동 전환은 종료되었습니다. `createTtsJob`은 Gemini 기본 목소리 `Kore`를 사용합니다. `getTtsQuality`, `retryTtsJob`, `downloadTtsCandidate`의 기존 경로는 HTTP 409를 반환합니다.
|
|
4
|
+
|
|
5
|
+
Legacy APICK voices and automatic fallback have retired. `createTtsJob` now defaults to Gemini voice `Kore`. The legacy quality, retry and candidate endpoints return HTTP 409.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
const job = await client.createTtsJob('기온은 오 도입니다.', { voiceId: 'Kore', normalizeText: false, idempotencyKey: 'tts-001' });
|
|
9
|
+
const dialogue = await client.createOpenAiTtsJob({
|
|
10
|
+
utterances: [{ speaker: '진행', text: '반갑습니다.' }, { speaker: '손님', text: '안녕하세요.' }],
|
|
11
|
+
speakers: { 진행: { voice_id: 'alloy' }, 손님: { voice_id: 'nova', emotion: 'calm' } },
|
|
12
|
+
multi_speaker: true, normalize_text: false
|
|
13
|
+
}, { idempotencyKey: 'tts-002' });
|
|
14
|
+
const voices = await client.listGeminiTtsVoices();
|
|
15
|
+
const otherVoices = await client.listOpenAiTtsVoices();
|
|
16
|
+
const options = await client.getTtsOptions();
|
|
17
|
+
const quote = await client.quoteTts({ engine: 'gemini', text: '본문', voice_id: 'Kore' });
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`style`, `emotion`, `tone`, `accent`, `pace`(0.5–2), `pitch`(-12–12), `volume_gain_db`(-12–12)는 최상위·화자·발화에 지정할 수 있습니다. `speakers`는 화자 이름별 설정이고 `multi_speaker: true`는 Gemini 최대 2명, ChatGPT 최대 8명입니다. 엔진에 따라 표현 효과가 달라지며 정확한 속도 배율·반음·dB 적용을 보장하지 않습니다. 특히 ChatGPT는 수치의 방향을 낭독 지시로 전달합니다.
|
|
21
|
+
|
|
22
|
+
Style, emotion, tone, accent, pace, pitch and volume options can be set per request, speaker or utterance. Gemini supports up to two native speakers; ChatGPT supports up to eight speakers across utterances. Numeric acoustic adjustments are not guaranteed: ChatGPT receives directional instructions rather than precise rate, semitone or decibel controls.
|
|
23
|
+
|
|
24
|
+
정규화는 기본 켜짐이며 추가 스킬 요금이 합산됩니다. `normalize_text: false`(SDK 문자열 호출은 `normalizeText: false`)로 끌 수 있습니다. 정규화 입력은 발화 사이 줄바꿈을 포함해 최대 2,000자, 정규화 없이 최대 8,000자입니다. 견적은 `quoteTts`, 현재 목소리는 엔진별 목록, 옵션은 `getTtsOptions`로 조회합니다.
|
|
25
|
+
|
|
26
|
+
Normalization is enabled by default and costs extra. Disable it with `normalize_text: false` (`normalizeText: false` for the string SDK helper). Input limits are 2,000 characters including utterance separators with normalization, or 8,000 without it. Query a quote, engine-specific voices and supported options before submitting.
|
|
27
|
+
|
|
28
|
+
실제 AI 원가 × 고정된 환율 × 1.4에 정규화 요금을 더해 정산합니다. 소수점은 올림하며, 2026-11-06부터 합성 작업 1건의 기본요금 5P를 최소액으로 받습니다. Gemini 프로모션 입력/출력 단가는 2026-12-31까지 백만 토큰당 $0.50/$6.00이며 2027-01-01 00:00 UTC부터 $1.00/$12.00입니다. 약 $0.54/시간은 참고값이며 시간 단위 청구가 아닙니다. 엔진별 요금이 다릅니다.
|
|
29
|
+
|
|
30
|
+
AI usage is charged at verified cost × the pinned exchange rate × 1.4, plus normalization. Fractions are rounded up, and from 2026-11-06 each synthesis job has a 5-point base fee. Gemini promotional input/output rates are $0.50/$6.00 per million tokens through 2026-12-31, then $1.00/$12.00 from 2027-01-01 00:00 UTC. The approximate hourly figure is informational; billing uses actual usage and differs by engine.
|
|
31
|
+
|
|
32
|
+
두 엔진은 같은 작업 조회·취소·MP3·원문 ASS 계약을 사용합니다. `billing`의 예약·해제·확정·환불을 확인하세요. MP3는 24kHz 모노 48kbps, 결과는 완료 후 24시간 보관합니다. MP3와 ASS는 각각 완료된 다운로드 1회만 허용하며 전송 중단은 재시도할 수 있습니다. 접수 응답 유실 시 같은 입력과 멱등 키를 재사용하세요. 서버·공급자 최종 실패는 정규화까지 환불하며, 연결 종료는 작업 취소가 아닙니다. 취소 시 이미 수행된 작업분을 정산합니다.
|
|
33
|
+
|
|
34
|
+
Both engines share job status, cancellation, MP3 and original-text ASS downloads. Check reserved, released, captured and refunded amounts in `billing`. MP3 is 24 kHz mono at 48 kbps. Files are kept for 24 hours; each permits one completed download, and interrupted transfers can be retried. Reuse the same input and idempotency key after a lost response. Final server/provider failures refund synthesis and normalization; disconnecting does not cancel work. Explicit cancellation settles work already performed.
|
package/examples/basic.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ApickClient } from 'apick-api';
|
|
2
|
-
|
|
3
|
-
const client = new ApickClient(process.env.APICK_API_KEY);
|
|
4
|
-
|
|
5
|
-
const business = await client.businessDetails('439-87-00761');
|
|
6
|
-
console.log(business.data);
|
|
7
|
-
console.log(business.meta);
|
|
8
|
-
|
|
9
|
-
const parcel = await client.trackParcelAuto('123456789012');
|
|
10
|
-
console.log(parcel.data);
|
|
1
|
+
import { ApickClient } from 'apick-api';
|
|
2
|
+
|
|
3
|
+
const client = new ApickClient(process.env.APICK_API_KEY);
|
|
4
|
+
|
|
5
|
+
const business = await client.businessDetails('439-87-00761');
|
|
6
|
+
console.log(business.data);
|
|
7
|
+
console.log(business.meta);
|
|
8
|
+
|
|
9
|
+
const parcel = await client.trackParcelAuto('123456789012');
|
|
10
|
+
console.log(parcel.data);
|
package/examples/commonjs.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const { ApickClient } = require('apick-api');
|
|
2
|
-
|
|
3
|
-
async function main() {
|
|
4
|
-
const client = new ApickClient(process.env.APICK_API_KEY);
|
|
5
|
-
const result = await client.whois('apick.app');
|
|
6
|
-
console.log(result.data);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
main().catch((error) => {
|
|
10
|
-
console.error(error.message);
|
|
11
|
-
process.exitCode = 1;
|
|
12
|
-
});
|
|
1
|
+
const { ApickClient } = require('apick-api');
|
|
2
|
+
|
|
3
|
+
async function main() {
|
|
4
|
+
const client = new ApickClient(process.env.APICK_API_KEY);
|
|
5
|
+
const result = await client.whois('apick.app');
|
|
6
|
+
console.log(result.data);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
main().catch((error) => {
|
|
10
|
+
console.error(error.message);
|
|
11
|
+
process.exitCode = 1;
|
|
12
|
+
});
|
package/examples/files.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ApickClient } from 'apick-api';
|
|
2
|
-
|
|
3
|
-
const client = new ApickClient(process.env.APICK_API_KEY);
|
|
4
|
-
|
|
5
|
-
const ocr = await client.ocr('./receipt.jpg');
|
|
6
|
-
console.log(ocr.data.result.full_text);
|
|
7
|
-
|
|
8
|
-
const pdf = await client.htmlToPdf('<h1>APICK report</h1>', { pagination: true });
|
|
9
|
-
await pdf.save('./report.pdf');
|
|
1
|
+
import { ApickClient } from 'apick-api';
|
|
2
|
+
|
|
3
|
+
const client = new ApickClient(process.env.APICK_API_KEY);
|
|
4
|
+
|
|
5
|
+
const ocr = await client.ocr('./receipt.jpg');
|
|
6
|
+
console.log(ocr.data.result.full_text);
|
|
7
|
+
|
|
8
|
+
const pdf = await client.htmlToPdf('<h1>APICK report</h1>', { pagination: true });
|
|
9
|
+
await pdf.save('./report.pdf');
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "apick-api",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Official zero-dependency Node.js client for APICK data, AI, and image APIs. 에이픽 데이터·AI·이미지 API 공식 Node.js SDK.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./src/index.cjs",
|
|
7
|
-
"module": "./src/index.js",
|
|
8
|
-
"types": "./src/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./src/index.d.ts",
|
|
12
|
-
"import": "./src/index.js",
|
|
13
|
-
"require": "./src/index.cjs"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"src",
|
|
18
|
-
"docs",
|
|
19
|
-
"examples",
|
|
20
|
-
"README.md",
|
|
21
|
-
"CHANGELOG.md",
|
|
22
|
-
"SECURITY.md",
|
|
23
|
-
"LICENSE"
|
|
24
|
-
],
|
|
25
|
-
"sideEffects": false,
|
|
26
|
-
"engines": {
|
|
27
|
-
"node": ">=18"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"test": "node --test && npm run test:types",
|
|
31
|
-
"test:types": "tsc -p tsconfig.json",
|
|
32
|
-
"test:coverage": "node --test --experimental-test-coverage",
|
|
33
|
-
"prepublishOnly": "npm test"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"typescript": "^7.0.2"
|
|
37
|
-
},
|
|
38
|
-
"repository": {
|
|
39
|
-
"type": "git",
|
|
40
|
-
"url": "git+https://github.com/lead788/apick-api.git"
|
|
41
|
-
},
|
|
42
|
-
"bugs": {
|
|
43
|
-
"url": "https://github.com/lead788/apick-api/issues"
|
|
44
|
-
},
|
|
45
|
-
"homepage": "https://apick.app/dev_guide",
|
|
46
|
-
"license": "MIT",
|
|
47
|
-
"author": "APICK",
|
|
48
|
-
"publishConfig": {
|
|
49
|
-
"access": "public",
|
|
50
|
-
"provenance": false
|
|
51
|
-
},
|
|
52
|
-
"keywords": [
|
|
53
|
-
"apick",
|
|
54
|
-
"api",
|
|
55
|
-
"sdk",
|
|
56
|
-
"korea",
|
|
57
|
-
"korean-api",
|
|
58
|
-
"business-registry",
|
|
59
|
-
"parcel-tracking",
|
|
60
|
-
"address",
|
|
61
|
-
"ocr",
|
|
62
|
-
"whois",
|
|
63
|
-
"dns",
|
|
64
|
-
"google-search",
|
|
65
|
-
"pdf",
|
|
66
|
-
"excel",
|
|
67
|
-
"tts-jobs",
|
|
68
|
-
"text-summary",
|
|
69
|
-
"image-generation"
|
|
70
|
-
]
|
|
71
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "apick-api",
|
|
3
|
+
"version": "4.4.0",
|
|
4
|
+
"description": "Official zero-dependency Node.js client for APICK data, AI, and image APIs. 에이픽 데이터·AI·이미지 API 공식 Node.js SDK.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.cjs",
|
|
7
|
+
"module": "./src/index.js",
|
|
8
|
+
"types": "./src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./src/index.d.ts",
|
|
12
|
+
"import": "./src/index.js",
|
|
13
|
+
"require": "./src/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"docs",
|
|
19
|
+
"examples",
|
|
20
|
+
"README.md",
|
|
21
|
+
"CHANGELOG.md",
|
|
22
|
+
"SECURITY.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "node --test && npm run test:types",
|
|
31
|
+
"test:types": "tsc -p tsconfig.json",
|
|
32
|
+
"test:coverage": "node --test --experimental-test-coverage",
|
|
33
|
+
"prepublishOnly": "npm test"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "^7.0.2"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/lead788/apick-api.git"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/lead788/apick-api/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://apick.app/dev_guide",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"author": "APICK",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public",
|
|
50
|
+
"provenance": false
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"apick",
|
|
54
|
+
"api",
|
|
55
|
+
"sdk",
|
|
56
|
+
"korea",
|
|
57
|
+
"korean-api",
|
|
58
|
+
"business-registry",
|
|
59
|
+
"parcel-tracking",
|
|
60
|
+
"address",
|
|
61
|
+
"ocr",
|
|
62
|
+
"whois",
|
|
63
|
+
"dns",
|
|
64
|
+
"google-search",
|
|
65
|
+
"pdf",
|
|
66
|
+
"excel",
|
|
67
|
+
"tts-jobs",
|
|
68
|
+
"text-summary",
|
|
69
|
+
"image-generation"
|
|
70
|
+
]
|
|
71
|
+
}
|
package/src/form.cjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// Client-only multipart serialization. Each value occupies its own form part.
|
|
4
|
-
function createForm(payload, endpoint) {
|
|
5
|
-
const form = new FormData();
|
|
6
|
-
const typed = endpoint === '/rest/json_to_excel';
|
|
7
|
-
const forbidden = new Set(['__proto__', 'prototype', 'constructor']);
|
|
8
|
-
function visit(value, parts) {
|
|
9
|
-
if (parts.some(key => forbidden.has(key) || /[\[\]]/.test(key)) || parts.length > 12) throw new TypeError('Invalid form field path.');
|
|
10
|
-
const name = parts[0] + parts.slice(1).map(key => `[${key}]`).join('');
|
|
11
|
-
const cell = typed && parts[0] === 'data_list';
|
|
12
|
-
if (value === undefined || (value === null && !cell)) return;
|
|
13
|
-
if (value instanceof Blob) { form.append(name, value); return; }
|
|
14
|
-
if (value && typeof value === 'object' && Object.keys(value).length) {
|
|
15
|
-
if (cell) form.append('__apick_type' + parts.map(key => `[${key}]`).join(''), Array.isArray(value) ? 'array' : 'object');
|
|
16
|
-
for (const key of Object.keys(value)) visit(value[key], parts.concat(key));
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (cell && typeof value !== 'string') {
|
|
20
|
-
form.append('__apick_type' + parts.map(key => `[${key}]`).join(''), value === null ? 'null' : Array.isArray(value) ? 'array' : typeof value);
|
|
21
|
-
}
|
|
22
|
-
if (!cell && value && typeof value === 'object') return;
|
|
23
|
-
form.append(name, value === null || typeof value === 'object' ? '' : String(value));
|
|
24
|
-
}
|
|
25
|
-
for (const key of Object.keys(payload || {})) visit(payload[key], [key]);
|
|
26
|
-
return form;
|
|
27
|
-
}
|
|
28
|
-
module.exports = { createForm };
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Client-only multipart serialization. Each value occupies its own form part.
|
|
4
|
+
function createForm(payload, endpoint) {
|
|
5
|
+
const form = new FormData();
|
|
6
|
+
const typed = endpoint === '/rest/json_to_excel';
|
|
7
|
+
const forbidden = new Set(['__proto__', 'prototype', 'constructor']);
|
|
8
|
+
function visit(value, parts) {
|
|
9
|
+
if (parts.some(key => forbidden.has(key) || /[\[\]]/.test(key)) || parts.length > 12) throw new TypeError('Invalid form field path.');
|
|
10
|
+
const name = parts[0] + parts.slice(1).map(key => `[${key}]`).join('');
|
|
11
|
+
const cell = typed && parts[0] === 'data_list';
|
|
12
|
+
if (value === undefined || (value === null && !cell)) return;
|
|
13
|
+
if (value instanceof Blob) { form.append(name, value); return; }
|
|
14
|
+
if (value && typeof value === 'object' && Object.keys(value).length) {
|
|
15
|
+
if (cell) form.append('__apick_type' + parts.map(key => `[${key}]`).join(''), Array.isArray(value) ? 'array' : 'object');
|
|
16
|
+
for (const key of Object.keys(value)) visit(value[key], parts.concat(key));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (cell && typeof value !== 'string') {
|
|
20
|
+
form.append('__apick_type' + parts.map(key => `[${key}]`).join(''), value === null ? 'null' : Array.isArray(value) ? 'array' : typeof value);
|
|
21
|
+
}
|
|
22
|
+
if (!cell && value && typeof value === 'object') return;
|
|
23
|
+
form.append(name, value === null || typeof value === 'object' ? '' : String(value));
|
|
24
|
+
}
|
|
25
|
+
for (const key of Object.keys(payload || {})) visit(payload[key], [key]);
|
|
26
|
+
return form;
|
|
27
|
+
}
|
|
28
|
+
module.exports = { createForm };
|