@bolta-io/cli 0.0.18 → 0.2.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/CLAUDE.md +43 -24
  3. package/README.md +54 -22
  4. package/dist/bin/bolta.js +29 -30
  5. package/dist/bin/bolta.js.map +1 -1
  6. package/dist/src/client/bolta-client.d.ts +26 -19
  7. package/dist/src/client/bolta-client.d.ts.map +1 -1
  8. package/dist/src/client/bolta-client.js +71 -48
  9. package/dist/src/client/bolta-client.js.map +1 -1
  10. package/dist/src/commands/cash-receipt/cancel.d.ts +5 -0
  11. package/dist/src/commands/cash-receipt/cancel.d.ts.map +1 -0
  12. package/dist/src/commands/cash-receipt/cancel.js +27 -0
  13. package/dist/src/commands/cash-receipt/cancel.js.map +1 -0
  14. package/dist/src/commands/cash-receipt/index.d.ts +3 -0
  15. package/dist/src/commands/cash-receipt/index.d.ts.map +1 -0
  16. package/dist/src/commands/cash-receipt/index.js +63 -0
  17. package/dist/src/commands/cash-receipt/index.js.map +1 -0
  18. package/dist/src/commands/cash-receipt/issue.d.ts +8 -0
  19. package/dist/src/commands/cash-receipt/issue.d.ts.map +1 -0
  20. package/dist/src/commands/cash-receipt/issue.js +29 -0
  21. package/dist/src/commands/cash-receipt/issue.js.map +1 -0
  22. package/dist/src/commands/cash-receipt/status.d.ts +5 -0
  23. package/dist/src/commands/cash-receipt/status.d.ts.map +1 -0
  24. package/dist/src/commands/cash-receipt/status.js +17 -0
  25. package/dist/src/commands/cash-receipt/status.js.map +1 -0
  26. package/dist/src/commands/certificate/index.d.ts.map +1 -1
  27. package/dist/src/commands/certificate/index.js +19 -42
  28. package/dist/src/commands/certificate/index.js.map +1 -1
  29. package/dist/src/commands/config/index.d.ts.map +1 -1
  30. package/dist/src/commands/config/index.js +17 -54
  31. package/dist/src/commands/config/index.js.map +1 -1
  32. package/dist/src/commands/examples/index.d.ts.map +1 -1
  33. package/dist/src/commands/examples/index.js +73 -9
  34. package/dist/src/commands/examples/index.js.map +1 -1
  35. package/dist/src/commands/guide/index.d.ts.map +1 -1
  36. package/dist/src/commands/guide/index.js +71 -27
  37. package/dist/src/commands/guide/index.js.map +1 -1
  38. package/dist/src/commands/invoice/amend.d.ts.map +1 -1
  39. package/dist/src/commands/invoice/amend.js +9 -30
  40. package/dist/src/commands/invoice/amend.js.map +1 -1
  41. package/dist/src/commands/invoice/get.d.ts.map +1 -1
  42. package/dist/src/commands/invoice/get.js +2 -7
  43. package/dist/src/commands/invoice/get.js.map +1 -1
  44. package/dist/src/commands/invoice/index.js +1 -1
  45. package/dist/src/commands/invoice/issue-request.d.ts.map +1 -1
  46. package/dist/src/commands/invoice/issue-request.js +3 -15
  47. package/dist/src/commands/invoice/issue-request.js.map +1 -1
  48. package/dist/src/commands/invoice/issue.d.ts.map +1 -1
  49. package/dist/src/commands/invoice/issue.js +3 -15
  50. package/dist/src/commands/invoice/issue.js.map +1 -1
  51. package/dist/src/commands/invoice/status.d.ts.map +1 -1
  52. package/dist/src/commands/invoice/status.js +2 -7
  53. package/dist/src/commands/invoice/status.js.map +1 -1
  54. package/dist/src/commands/issuer/create.d.ts +4 -0
  55. package/dist/src/commands/issuer/create.d.ts.map +1 -0
  56. package/dist/src/commands/issuer/create.js +24 -0
  57. package/dist/src/commands/issuer/create.js.map +1 -0
  58. package/dist/src/commands/issuer/get.d.ts +3 -0
  59. package/dist/src/commands/issuer/get.d.ts.map +1 -0
  60. package/dist/src/commands/issuer/get.js +14 -0
  61. package/dist/src/commands/issuer/get.js.map +1 -0
  62. package/dist/src/commands/issuer/index.d.ts +3 -0
  63. package/dist/src/commands/issuer/index.d.ts.map +1 -0
  64. package/dist/src/commands/issuer/index.js +31 -0
  65. package/dist/src/commands/issuer/index.js.map +1 -0
  66. package/dist/src/commands/schema/index.d.ts.map +1 -1
  67. package/dist/src/commands/schema/index.js +4 -4
  68. package/dist/src/commands/schema/index.js.map +1 -1
  69. package/dist/src/commands/supplier/legacy.d.ts +3 -0
  70. package/dist/src/commands/supplier/legacy.d.ts.map +1 -0
  71. package/dist/src/commands/supplier/legacy.js +75 -0
  72. package/dist/src/commands/supplier/legacy.js.map +1 -0
  73. package/dist/src/config/config-manager.d.ts +7 -9
  74. package/dist/src/config/config-manager.d.ts.map +1 -1
  75. package/dist/src/config/config-manager.js +28 -48
  76. package/dist/src/config/config-manager.js.map +1 -1
  77. package/dist/src/types/api.d.ts +86 -7
  78. package/dist/src/types/api.d.ts.map +1 -1
  79. package/dist/src/utils/client.d.ts +10 -7
  80. package/dist/src/utils/client.d.ts.map +1 -1
  81. package/dist/src/utils/client.js +26 -10
  82. package/dist/src/utils/client.js.map +1 -1
  83. package/dist/src/utils/errors.d.ts +2 -2
  84. package/dist/src/utils/errors.d.ts.map +1 -1
  85. package/dist/src/utils/errors.js +4 -4
  86. package/dist/src/utils/errors.js.map +1 -1
  87. package/dist/src/utils/legacy-issuer.d.ts +28 -0
  88. package/dist/src/utils/legacy-issuer.d.ts.map +1 -0
  89. package/dist/src/utils/legacy-issuer.js +45 -0
  90. package/dist/src/utils/legacy-issuer.js.map +1 -0
  91. package/dist/src/utils/output.d.ts +7 -3
  92. package/dist/src/utils/output.d.ts.map +1 -1
  93. package/dist/src/utils/output.js +14 -4
  94. package/dist/src/utils/output.js.map +1 -1
  95. package/dist/src/validators/parse.d.ts +3 -0
  96. package/dist/src/validators/parse.d.ts.map +1 -0
  97. package/dist/src/validators/parse.js +15 -0
  98. package/dist/src/validators/parse.js.map +1 -0
  99. package/dist/src/validators/schemas.d.ts +182 -1
  100. package/dist/src/validators/schemas.d.ts.map +1 -1
  101. package/dist/src/validators/schemas.js +230 -7
  102. package/dist/src/validators/schemas.js.map +1 -1
  103. package/llms.txt +47 -34
  104. package/package.json +4 -2
  105. package/dist/src/commands/supplier/create.d.ts +0 -4
  106. package/dist/src/commands/supplier/create.d.ts.map +0 -1
  107. package/dist/src/commands/supplier/create.js +0 -40
  108. package/dist/src/commands/supplier/create.js.map +0 -1
  109. package/dist/src/commands/supplier/get.d.ts +0 -3
  110. package/dist/src/commands/supplier/get.d.ts.map +0 -1
  111. package/dist/src/commands/supplier/get.js +0 -19
  112. package/dist/src/commands/supplier/get.js.map +0 -1
  113. package/dist/src/commands/supplier/index.d.ts +0 -3
  114. package/dist/src/commands/supplier/index.d.ts.map +0 -1
  115. package/dist/src/commands/supplier/index.js +0 -56
  116. package/dist/src/commands/supplier/index.js.map +0 -1
  117. package/dist/src/commands/supplier/legacy-customer.d.ts +0 -5
  118. package/dist/src/commands/supplier/legacy-customer.d.ts.map +0 -1
  119. package/dist/src/commands/supplier/legacy-customer.js +0 -56
  120. package/dist/src/commands/supplier/legacy-customer.js.map +0 -1
package/llms.txt CHANGED
@@ -1,31 +1,27 @@
1
1
  # Bolta CLI
2
2
 
3
- > Bolta API CLI for Korean electronic tax invoices (전자세금계산서)
3
+ > Bolta API CLI for Korean electronic tax invoices and cash receipts (전자세금계산서·현금영수증)
4
4
 
5
- Bolta CLI는 한국 전자세금계산서 API를 위한 커맨드라인 도구입니다.
6
- AI 에이전트(Claude Code 등)가 세금계산서 업무를 자동화할 때 사용합니다.
5
+ Bolta CLI는 한국 전자세금계산서와 현금영수증 API를 위한 커맨드라인 도구입니다.
6
+ AI 에이전트(Claude Code 등)가 세금계산서와 현금영수증 업무를 자동화할 때 사용합니다.
7
7
 
8
8
  ## Authentication
9
9
 
10
10
  환경변수로 설정:
11
11
  - BOLTA_API_KEY: API 키 (test_ 접두사: 샌드박스, live_ 접두사: 프로덕션)
12
- - BOLTA_SUPPLIER_KEY: 공급자 키 (세금계산서 발행 시 필요)
13
12
 
14
13
  또는 CLI로 설정:
15
14
  - bolta config set api-key <value>
16
- - bolta config set supplier-key <value>
17
15
 
18
16
  ## 핵심 개념
19
17
 
20
- ### Supplier Key
21
- supplierKey는 세금계산서를 발행하는 공급자 본인을 식별하는 키입니다.
22
- - 형식: SupplierKey_ 접두사 문자열 (예: SupplierKey_bf8paz)
23
- - 획득: 공급자의 사업자 정보로 bolta supplier create 호출 → 응답의 supplierKey
24
- - 설정: BOLTA_SUPPLIER_KEY 환경변수, --supplier-key 플래그, 또는 bolta config set supplier-key
25
- - API 키(test_/live_) 단위로 독립 관리. 상호 호환 안 됨
26
- 주의: Supplier-Key는 공급자(발행자) 본인의 키입니다. 세금계산서를 받는 거래처(공급받는자)의 정보는 Supplier-Key 헤더가 아니라 요청 본문의 supplied 필드에 포함합니다.
27
-
28
- 참고: 구 명칭(customer)은 deprecated이며 당분간 동작합니다. `bolta customer ...`, `--customer-key`, `BOLTA_CUSTOMER_KEY`, `config set customer-key` 사용 시 경고가 출력됩니다.
18
+ ### 발급자
19
+ 발급자는 세금계산서나 현금영수증 발행에 사용하는 인증서의 소유자입니다.
20
+ - 등록: bolta issuer create 호출 → 응답의 issuerId
21
+ - 관리: issuerId는 발급자 조회와 인증서 등록·조회·해제에만 사용
22
+ - 발행: API 키와 요청 본문의 사업자등록번호 사용
23
+ - 일반 정발행·역발행: supplier.identificationNumber
24
+ - 현금영수증: issuer.businessRegistrationNumber
29
25
 
30
26
  ### 요금
31
27
  Bolta API는 사전 충전 포인트 차감 방식 유료 서비스입니다.
@@ -35,34 +31,32 @@ Bolta API는 사전 충전 포인트 차감 방식 유료 서비스입니다.
35
31
  - 포인트 충전: https://developers.bolta.io 개발자센터
36
32
 
37
33
  ### 개념 안내 커맨드
38
- bolta guide 주요 개념 안내 (supplier-key, payment, workflow, glossary)
34
+ bolta guide 주요 개념 안내 (issuer, payment, workflow, cash-receipt, glossary)
39
35
 
40
36
  ## Commands
41
37
 
42
- ### Supplier Management
38
+ ### Issuer Management
43
39
 
44
- bolta supplier create --data '<json>'
45
- 공급자 생성. 필수: identificationNumber(10자리), organizationName, representativeName
40
+ bolta issuer create --data '<json>'
41
+ 발급자 등록. 필수: identificationNumber(10자리), organizationName, representativeName
46
42
 
47
- bolta supplier get <supplierKey>
48
- 공급자 조회.
43
+ bolta issuer get <issuerId>
44
+ 발급자 조회.
49
45
 
50
46
  ### Certificate Management
51
47
 
52
- bolta certificate url <supplierKey>
48
+ bolta certificate url <issuerId>
53
49
  공동인증서 등록 URL 조회.
54
50
 
55
- bolta certificate status <supplierKey>
51
+ bolta certificate status <issuerId>
56
52
  인증서 등록 내역 조회.
57
53
 
58
- bolta certificate deregister <supplierKey>
54
+ bolta certificate deregister <issuerId>
59
55
  인증서 등록 해제.
60
56
 
61
- deprecated CustomerKey_ 키도 인증서 명령에서 당분간 사용할 수 있습니다.
62
-
63
57
  ### Tax Invoice
64
58
 
65
- bolta invoice issue --data '<json>' [--reference-id <id>] [--supplier-key <key>]
59
+ bolta invoice issue --data '<json>' [--reference-id <id>]
66
60
  세금계산서 정발행. 필수 필드:
67
61
  - date (YYYY-MM-DD)
68
62
  - purpose (CLAIM | RECEIPT)
@@ -78,7 +72,7 @@ bolta invoice issue --data '<json>' [--reference-id <id>] [--supplier-key <key>]
78
72
  taxType별 tax 규칙: TAXABLE은 tax가 null/누락이면 안 됨, ZERO_RATE은 모든 tax가 0, TAX_FREE는 모든 tax가 null.
79
73
  외국인등록번호 공급받는자는 정발행만 지원. 이 경우 supplied.taxRegistrationId와 최상위 description은 null/미입력이어야 함. 여권번호는 미지원.
80
74
 
81
- bolta invoice issue-request --data '<json>' [--reference-id <id>] [--supplier-key <key>]
75
+ bolta invoice issue-request --data '<json>' [--reference-id <id>]
82
76
  세금계산서 역발행 요청. supplied.identificationNumber는 사업자등록번호 10자리만 허용.
83
77
 
84
78
  bolta invoice get <issuanceKey>
@@ -87,16 +81,36 @@ bolta invoice get <issuanceKey>
87
81
  bolta invoice status --reference-id <id>
88
82
  Client-Reference-Id로 세금계산서 상태 조회.
89
83
 
90
- bolta invoice amend termination <issuanceKey> --date <YYYY-MM-DD> [--supplier-key <key>]
84
+ bolta invoice amend termination <issuanceKey> --date <YYYY-MM-DD>
91
85
  수정발행: 계약 해제.
92
86
 
93
- bolta invoice amend change-supply-cost <issuanceKey> --data '<json>' [--supplier-key <key>]
87
+ bolta invoice amend change-supply-cost <issuanceKey> --data '<json>'
94
88
  수정발행: 공급가액 변동. JSON: {date, taxType, items: [{date, name, supplyCost, tax}]}
95
89
 
90
+ ### Cash Receipt
91
+
92
+ bolta cash-receipt issue --data '<json>' --reference-id <id>
93
+ 현금영수증 발행 요청. 필수 필드:
94
+ - itemName (1~20자)
95
+ - issuer: {businessRegistrationNumber, organizationName, representativeName, telephone}
96
+ - recipient:
97
+ - {type: "SELF"}
98
+ - {type: "PHONE", value: "010-1234-5678"}
99
+ - {type: "BUSINESS_REGISTRATION_NUMBER", value: "1234567891"}
100
+ - amount: {supplyAmount, vatAmount, taxFreeAmount?}
101
+ 각 금액과 합계는 9,999,999,999 이하이고 합계는 0보다 커야 함.
102
+
103
+ bolta cash-receipt status --reference-id <id>
104
+ 발행 또는 취소 처리 상태를 한 번 조회.
105
+ PENDING과 REQUEST_SUCCESS는 처리 중이며 ISSUED 또는 CANCELED가 성공 상태.
106
+
107
+ bolta cash-receipt cancel <issuanceKey> --reference-id <새 id>
108
+ 발행 완료 건을 전액 취소. 발행 요청과 다른 reference-id를 사용하며 부분 취소는 지원하지 않음.
109
+
96
110
  ### Configuration
97
111
 
98
112
  bolta config set <key> <value>
99
- 설정 저장. key: api-key, supplier-key, base-url
113
+ 설정 저장. key: api-key, base-url
100
114
 
101
115
  bolta config show
102
116
  현재 설정 확인.
@@ -108,7 +122,7 @@ bolta config test
108
122
 
109
123
  bolta examples [command]
110
124
  샘플 JSON 출력. command 없이 실행하면 목록 표시.
111
- 사용 가능: supplier-create, invoice-issue, invoice-issue-foreign-supplied, invoice-issue-request, amend-termination, amend-change-supply-cost
125
+ 사용 가능: issuer-create, invoice-issue, invoice-issue-foreign-supplied, invoice-issue-request, cash-receipt-issue, cash-receipt-issue-business, cash-receipt-issue-self, amend-termination, amend-change-supply-cost
112
126
 
113
127
  bolta schema [command]
114
128
  입력 JSON 스키마 출력. command 없이 실행하면 목록 표시.
@@ -116,7 +130,6 @@ bolta schema [command]
116
130
  ## Global Options
117
131
 
118
132
  --api-key <key> API 키 오버라이드
119
- --supplier-key <key> Supplier Key 오버라이드
120
133
  --verbose 상세 로그 (stderr)
121
134
  --dry-run API 호출 없이 요청 데이터만 출력
122
135
 
@@ -133,7 +146,7 @@ bolta schema [command]
133
146
 
134
147
  ## Common Workflow
135
148
 
136
- 1. bolta supplier create --data '{"identificationNumber":"1234567890","organizationName":"회사명","representativeName":"대표자"}'
137
- 2. bolta certificate status <supplierKey>
149
+ 1. bolta issuer create --data '{"identificationNumber":"1234567890","organizationName":"회사명","representativeName":"대표자"}'
150
+ 2. bolta certificate status <issuerId>
138
151
  3. bolta invoice issue --data '<세금계산서 JSON>'
139
152
  4. bolta invoice get <issuanceKey>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bolta-io/cli",
3
- "version": "0.0.18",
4
- "description": "Bolta API CLI for Korean electronic tax invoices (전자세금계산서)",
3
+ "version": "0.2.0",
4
+ "description": "Bolta API CLI for Korean electronic tax invoices and cash receipts (전자세금계산서·현금영수증)",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "bolta": "./dist/bin/bolta.js"
@@ -36,6 +36,8 @@
36
36
  "korean-tax",
37
37
  "전자세금계산서",
38
38
  "세금계산서",
39
+ "cash-receipt",
40
+ "현금영수증",
39
41
  "cli",
40
42
  "ai-tools"
41
43
  ],
@@ -1,4 +0,0 @@
1
- import { Command } from 'commander';
2
- import type { DataInputOptions } from '../../types/api.js';
3
- export declare function createSupplierAction(options: DataInputOptions, command: Command): Promise<void>;
4
- //# sourceMappingURL=create.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/commands/supplier/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCrG"}
@@ -1,40 +0,0 @@
1
- import { resolveApiKey, resolveBaseUrl } from '../../config/config-manager.js';
2
- import { BoltaClient } from '../../client/bolta-client.js';
3
- import { resolveInput } from '../../utils/input.js';
4
- import { outputSuccess, outputError, verbose } from '../../utils/output.js';
5
- import { createSupplierSchema } from '../../validators/schemas.js';
6
- import { BoltaValidationError, BoltaAuthError } from '../../utils/errors.js';
7
- import { ZodError } from 'zod';
8
- export async function createSupplierAction(options, command) {
9
- try {
10
- const globalOpts = command.optsWithGlobals();
11
- const apiKey = resolveApiKey(globalOpts.apiKey);
12
- if (!apiKey)
13
- throw new BoltaAuthError('API 키가 설정되지 않았습니다.');
14
- const client = new BoltaClient({ apiKey, baseUrl: resolveBaseUrl() });
15
- const raw = await resolveInput(options);
16
- // Validate
17
- let validated;
18
- try {
19
- validated = createSupplierSchema.parse(raw);
20
- }
21
- catch (err) {
22
- if (err instanceof ZodError) {
23
- const details = Object.fromEntries(err.errors.map((e) => [e.path.join('.'), e.message]));
24
- throw new BoltaValidationError('입력 데이터가 유효하지 않습니다.', details);
25
- }
26
- throw err;
27
- }
28
- if (globalOpts.dryRun) {
29
- outputSuccess({ dryRun: true, requestBody: validated, endpoint: 'POST /v1/suppliers' });
30
- return;
31
- }
32
- verbose('공급자 생성 요청', { identificationNumber: validated.identificationNumber });
33
- const result = await client.createSupplier(validated);
34
- outputSuccess(result);
35
- }
36
- catch (err) {
37
- outputError(err);
38
- }
39
- }
40
- //# sourceMappingURL=create.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/supplier/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,O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MAAM,GAAG,CAAC;QACZ,CAAC;QAED,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CAAC,CAAC;YACxF,OAAO;QACT,CAAC;QAED,OAAO,CAAC,WAAW,EAAE,EAAE,oBAAoB,EAAE,SAAS,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAC/E,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACtD,aAAa,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,WAAW,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function getSupplierAction(supplierKey: string, options: Record<string, unknown>, command: Command): Promise<void>;
3
- //# sourceMappingURL=get.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/commands/supplier/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAY9H"}
@@ -1,19 +0,0 @@
1
- import { resolveApiKey, resolveBaseUrl } from '../../config/config-manager.js';
2
- import { BoltaClient } from '../../client/bolta-client.js';
3
- import { outputSuccess, outputError } from '../../utils/output.js';
4
- import { BoltaAuthError } from '../../utils/errors.js';
5
- export async function getSupplierAction(supplierKey, options, command) {
6
- try {
7
- const globalOpts = command.optsWithGlobals();
8
- const apiKey = resolveApiKey(globalOpts.apiKey);
9
- if (!apiKey)
10
- throw new BoltaAuthError('API 키가 설정되지 않았습니다.');
11
- const client = new BoltaClient({ apiKey, baseUrl: resolveBaseUrl() });
12
- const result = await client.getSupplier(supplierKey);
13
- outputSuccess(result);
14
- }
15
- catch (err) {
16
- outputError(err);
17
- }
18
- }
19
- //# sourceMappingURL=get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/supplier/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAmB,EAAE,OAAgC,EAAE,OAAgB;IAC7G,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,cAAc,CAAC,oBAAoB,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;QAEtE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QACrD,aAAa,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,WAAW,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function registerSupplierCommands(program: Command): void;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/supplier/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwD/D"}
@@ -1,56 +0,0 @@
1
- import { createSupplierAction } from './create.js';
2
- import { getSupplierAction } from './get.js';
3
- import { createLegacyCustomerAction, getLegacyCustomerAction } from './legacy-customer.js';
4
- export function registerSupplierCommands(program) {
5
- const supplier = program
6
- .command('supplier')
7
- .description('공급자(Supplier) 관리');
8
- supplier
9
- .command('create')
10
- .description('공급자 생성 (POST /v1/suppliers)')
11
- .option('--data <json>', '인라인 JSON 데이터')
12
- .option('--file <path>', 'JSON 파일 경로')
13
- .option('--stdin', '표준 입력에서 읽기')
14
- .addHelpText('after', `
15
- Example:
16
- bolta supplier create --data '{
17
- "identificationNumber": "1234567890",
18
- "organizationName": "주식회사 테스트",
19
- "representativeName": "홍길동"
20
- }'
21
-
22
- bolta supplier create --file supplier.json`)
23
- .action(createSupplierAction);
24
- supplier
25
- .command('get <supplierKey>')
26
- .description('공급자 조회 (GET /v1/suppliers/{supplierKey})')
27
- .addHelpText('after', `
28
- Example:
29
- bolta supplier get SupplierKey_bf8paz`)
30
- .action(getSupplierAction);
31
- const customer = program
32
- .command('customer', { hidden: true })
33
- .description('(deprecated) 공급자 관리. supplier 명령어를 사용하세요.');
34
- customer
35
- .command('create')
36
- .description('(deprecated) 공급자 생성 (POST /v1/customers)')
37
- .option('--data <json>', '인라인 JSON 데이터')
38
- .option('--file <path>', 'JSON 파일 경로')
39
- .option('--stdin', '표준 입력에서 읽기')
40
- .addHelpText('after', `
41
- Example:
42
- bolta customer create --data '{
43
- "identificationNumber": "1234567890",
44
- "organizationName": "주식회사 테스트",
45
- "representativeName": "홍길동"
46
- }'`)
47
- .action(createLegacyCustomerAction);
48
- customer
49
- .command('get <customerKey>')
50
- .description('(deprecated) 공급자 조회 (GET /v1/customers/{customerKey})')
51
- .addHelpText('after', `
52
- Example:
53
- bolta customer get CustomerKey_bf8paz`)
54
- .action(getLegacyCustomerAction);
55
- }
56
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/supplier/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE3F,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,QAAQ,GAAG,OAAO;SACrB,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAEnC,QAAQ;SACL,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,6BAA6B,CAAC;SAC1C,MAAM,CAAC,eAAe,EAAE,cAAc,CAAC;SACvC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC;SACrC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC;SAC/B,WAAW,CAAC,OAAO,EAAE;;;;;;;;6CAQmB,CAAC;SACzC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAEhC,QAAQ;SACL,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,0CAA0C,CAAC;SACvD,WAAW,CAAC,OAAO,EAAE;;wCAEc,CAAC;SACpC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAE7B,MAAM,QAAQ,GAAG,OAAO;SACrB,OAAO,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SACrC,WAAW,CAAC,2CAA2C,CAAC,CAAC;IAE5D,QAAQ;SACL,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CAAC,eAAe,EAAE,cAAc,CAAC;SACvC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC;SACrC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC;SAC/B,WAAW,CAAC,OAAO,EAAE;;;;;;KAMrB,CAAC;SACD,MAAM,CAAC,0BAA0B,CAAC,CAAC;IAEtC,QAAQ;SACL,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,uDAAuD,CAAC;SACpE,WAAW,CAAC,OAAO,EAAE;;wCAEc,CAAC;SACpC,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACrC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { Command } from 'commander';
2
- import type { DataInputOptions } from '../../types/api.js';
3
- export declare function createLegacyCustomerAction(options: DataInputOptions, command: Command): Promise<void>;
4
- export declare function getLegacyCustomerAction(customerKey: string, options: Record<string, unknown>, command: Command): Promise<void>;
5
- //# sourceMappingURL=legacy-customer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legacy-customer.d.ts","sourceRoot":"","sources":["../../../../src/commands/supplier/legacy-customer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC3G;AAED,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -1,56 +0,0 @@
1
- import { resolveApiKey, resolveBaseUrl } from '../../config/config-manager.js';
2
- import { BoltaClient } from '../../client/bolta-client.js';
3
- import { resolveInput } from '../../utils/input.js';
4
- import { deprecationWarning, outputError, outputSuccess, verbose } from '../../utils/output.js';
5
- import { createSupplierSchema } from '../../validators/schemas.js';
6
- import { BoltaAuthError, BoltaValidationError } from '../../utils/errors.js';
7
- import { ZodError } from 'zod';
8
- const LEGACY_CUSTOMER_COMMAND_WARNING = "'customer' 명령어는 'supplier'로 변경되었습니다. 'bolta supplier ...'를 사용하세요.";
9
- export async function createLegacyCustomerAction(options, command) {
10
- try {
11
- deprecationWarning(LEGACY_CUSTOMER_COMMAND_WARNING);
12
- const globalOpts = command.optsWithGlobals();
13
- const apiKey = resolveApiKey(globalOpts.apiKey);
14
- if (!apiKey)
15
- throw new BoltaAuthError('API 키가 설정되지 않았습니다.');
16
- const client = new BoltaClient({ apiKey, baseUrl: resolveBaseUrl() });
17
- const raw = await resolveInput(options);
18
- let validated;
19
- try {
20
- validated = createSupplierSchema.parse(raw);
21
- }
22
- catch (err) {
23
- if (err instanceof ZodError) {
24
- const details = Object.fromEntries(err.errors.map((e) => [e.path.join('.'), e.message]));
25
- throw new BoltaValidationError('입력 데이터가 유효하지 않습니다.', details);
26
- }
27
- throw err;
28
- }
29
- if (globalOpts.dryRun) {
30
- outputSuccess({ dryRun: true, requestBody: validated, endpoint: 'POST /v1/customers' });
31
- return;
32
- }
33
- verbose('공급자 생성 요청 (legacy customer)', { identificationNumber: validated.identificationNumber });
34
- const result = await client.createCustomer(validated);
35
- outputSuccess(result);
36
- }
37
- catch (err) {
38
- outputError(err);
39
- }
40
- }
41
- export async function getLegacyCustomerAction(customerKey, options, command) {
42
- try {
43
- deprecationWarning(LEGACY_CUSTOMER_COMMAND_WARNING);
44
- const globalOpts = command.optsWithGlobals();
45
- const apiKey = resolveApiKey(globalOpts.apiKey);
46
- if (!apiKey)
47
- throw new BoltaAuthError('API 키가 설정되지 않았습니다.');
48
- const client = new BoltaClient({ apiKey, baseUrl: resolveBaseUrl() });
49
- const result = await client.getCustomer(customerKey);
50
- outputSuccess(result);
51
- }
52
- catch (err) {
53
- outputError(err);
54
- }
55
- }
56
- //# sourceMappingURL=legacy-customer.js.map
@@ -1 +0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