taiwan-logistics-skill 1.4.10 → 1.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -142
- package/assets/taiwan-logistics/CLAUDE.md +150 -150
- package/assets/taiwan-logistics/EXAMPLES.md +2627 -2627
- package/assets/taiwan-logistics/README.md +142 -142
- package/assets/taiwan-logistics/SKILL.md +145 -711
- package/assets/taiwan-logistics/data/field-mappings.csv +23 -23
- package/assets/taiwan-logistics/data/logistics-types.csv +57 -57
- package/assets/taiwan-logistics/data/operations.csv +51 -51
- package/assets/taiwan-logistics/data/pending.csv +6 -0
- package/assets/taiwan-logistics/data/providers.csv +21 -21
- package/assets/taiwan-logistics/data/status-codes.csv +964 -964
- package/assets/taiwan-logistics/evals/RESULTS.md +32 -0
- package/assets/taiwan-logistics/evals/cases.json +159 -0
- package/assets/taiwan-logistics/evals/grade.py +121 -0
- package/assets/taiwan-logistics/examples/ecpay-logistics-cvs-example.py +221 -221
- package/assets/taiwan-logistics/examples/ezship-logistics-example.py +395 -395
- package/assets/taiwan-logistics/examples/hct-logistics-example.py +285 -285
- package/assets/taiwan-logistics/examples/newebpay-logistics-cvs-example.py +538 -538
- package/assets/taiwan-logistics/examples/paynow-logistics-cvs-example.py +243 -243
- package/assets/taiwan-logistics/examples/payuni-logistics-cvs-example.py +251 -251
- package/assets/taiwan-logistics/examples/pchomepay-logistics-cvs-example.py +254 -254
- package/assets/taiwan-logistics/examples/smilepay-logistics-cvs-example.py +297 -297
- package/assets/taiwan-logistics/examples/store-map-integration-example.html +573 -573
- package/assets/taiwan-logistics/references/NEWEBPAY_LOGISTICS_REFERENCE.md +771 -771
- package/assets/taiwan-logistics/references/carrier-direct-access.md +133 -133
- package/assets/taiwan-logistics/references/ecpay-logistics-api.md +567 -567
- package/assets/taiwan-logistics/references/ezship-logistics-api.md +387 -387
- package/assets/taiwan-logistics/references/hct-logistics-api.md +1099 -1099
- package/assets/taiwan-logistics/references/implementation-guide.md +667 -0
- package/assets/taiwan-logistics/references/lalamove-logistics-api.md +140 -140
- package/assets/taiwan-logistics/references/ondemand-delivery.md +183 -183
- package/assets/taiwan-logistics/references/paynow-logistics-api.md +1672 -1672
- package/assets/taiwan-logistics/references/payuni-logistics-api.md +296 -296
- package/assets/taiwan-logistics/references/pchomepay-logistics-api.md +1151 -1151
- package/assets/taiwan-logistics/references/smilepay-logistics-api.md +1370 -1370
- package/assets/taiwan-logistics/requirements.txt +4 -0
- package/assets/taiwan-logistics/scripts/check_numbers.py +166 -0
- package/assets/taiwan-logistics/scripts/core.py +295 -278
- package/assets/taiwan-logistics/scripts/generate-logistics-service.py +87 -87
- package/assets/taiwan-logistics/scripts/recommend.py +370 -370
- package/assets/taiwan-logistics/scripts/search.py +142 -127
- package/assets/taiwan-logistics/scripts/test_logistics.py +154 -146
- package/assets/taiwan-logistics/scripts/test_skill.py +202 -0
- package/assets/templates/base/quick-reference.md +82 -82
- package/assets/templates/base/skill-content.md +141 -707
- package/assets/templates/platforms/agent.json +26 -26
- package/assets/templates/platforms/claude.json +26 -26
- package/assets/templates/platforms/cline.json +26 -26
- package/assets/templates/platforms/codebuddy.json +25 -25
- package/assets/templates/platforms/codex.json +26 -26
- package/assets/templates/platforms/continue.json +25 -25
- package/assets/templates/platforms/copilot.json +25 -25
- package/assets/templates/platforms/cursor.json +26 -26
- package/assets/templates/platforms/gemini.json +25 -25
- package/assets/templates/platforms/kiro.json +25 -25
- package/assets/templates/platforms/opencode.json +25 -25
- package/assets/templates/platforms/qoder.json +25 -25
- package/assets/templates/platforms/trae.json +25 -25
- package/assets/templates/platforms/windsurf.json +25 -25
- package/dist/index.js +10 -1
- package/package.json +65 -65
package/README.md
CHANGED
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
<h1 align="center">taiwan-logistics-skill</h1>
|
|
2
|
-
|
|
3
|
-
<h3 align="center">台灣物流 AI 開發技能包</h3>
|
|
4
|
-
|
|
5
|
-
<p align="center">
|
|
6
|
-
<strong>7 家物流 aggregator + HCT 新竹物流直連 + 2 家即時配送</strong>
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
<p align="center">
|
|
10
|
-
ECPay · NewebPay · PAYUNi · SmilePay · PChomePay · PayNow · ezShip · HCT 直連 · Lalamove · pandago
|
|
11
|
-
</p>
|
|
12
|
-
|
|
13
|
-
<p align="center">
|
|
14
|
-
<a href="https://www.npmjs.com/package/taiwan-logistics-skill"><img src="https://img.shields.io/npm/v/taiwan-logistics-skill?style=flat-square&logo=npm" alt="npm version"></a>
|
|
15
|
-
<a href="https://www.npmjs.com/package/taiwan-logistics-skill"><img src="https://img.shields.io/npm/dm/taiwan-logistics-skill?style=flat-square&label=downloads" alt="npm downloads"></a>
|
|
16
|
-
<img src="https://img.shields.io/badge/providers-10-success?style=flat-square" alt="10 Providers">
|
|
17
|
-
<img src="https://img.shields.io/badge/AI%20platforms-14-blue?style=flat-square" alt="14 AI Platforms">
|
|
18
|
-
<a href="https://github.com/Moksa1123/taiwan-ecommerce-toolkit/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Moksa1123/taiwan-ecommerce-toolkit?style=flat-square" alt="License"></a>
|
|
19
|
-
</p>
|
|
20
|
-
|
|
21
|
-
<p align="center">
|
|
22
|
-
<a href="https://paypal.me/cccsubcom"><img src="https://img.shields.io/badge/PayPal-支持開發-00457C?style=for-the-badge&logo=paypal&logoColor=white" alt="PayPal"></a>
|
|
23
|
-
</p>
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## 安裝
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm install -g taiwan-logistics-skill
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## 快速開始
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
cd /path/to/your/project
|
|
37
|
-
|
|
38
|
-
taiwan-logistics init # 互動式
|
|
39
|
-
taiwan-logistics init --ai claude # Claude Code
|
|
40
|
-
taiwan-logistics init --ai all # 全部安裝
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
安裝完後,在 AI 助手用自然語言:
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
查詢台北市信義區的 7-11 取貨點,整合 ECPay 物流
|
|
47
|
-
建立 SmilePay 黑貓宅急便冷凍 C2C 訂單,COD 1000 元
|
|
48
|
-
PChomePay 7-11 取貨付款,金額 1500 元,notify URL 設好
|
|
49
|
-
PayNow 7-11 大宗寄倉,使用 3DES 加密
|
|
50
|
-
HCT 直連 API 傳入託運資料,逆物流單獨處理
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## 物流服務商
|
|
56
|
-
|
|
57
|
-
| 服務商 | 類型 | 加密 / 認證 | 特色 |
|
|
58
|
-
|---|---|---|---|
|
|
59
|
-
| **ECPay 綠界** | aggregator | MD5 CheckMacValue | B2C 7-11(含冷凍)/全家/萊爾富;C2C 四大超商;宅配黑貓/中華郵政 |
|
|
60
|
-
| **NewebPay 藍新** | aggregator | AES-256-CBC + SHA256 | B2C 僅 7-11;C2C 四大超商;無宅配 |
|
|
61
|
-
| **PAYUNi 統一** | aggregator | AES-256-GCM + SHA256 | 7-11 常溫/冷凍 + T-Cat 常溫/冷藏/冷凍(溫控配送最完整) |
|
|
62
|
-
| **SmilePay 速買配** | aggregator | Verify_key + 加權檢核碼 | Pay_zg 矩陣 51/52/55/56/81/82/83,含逆物流 |
|
|
63
|
-
| **PChomePay 拍錢包** | aggregator | HTTP Basic Auth → token | 金物流二合一、7-11/全家/萊爾富取貨付款 |
|
|
64
|
-
| **PayNow 立吉富** | aggregator | **3DES/ECB/Zero-Padding** | 11 條產品線(含海外配送);不同於金流端 AES |
|
|
65
|
-
| **ezShip 台灣便利配** | aggregator | 無簽章(`su_id` 帳號綁定) | 全家/萊爾富/OK、宅配、店港澳;不含 7-11 |
|
|
66
|
-
| **HCT 新竹物流** | **direct carrier API** | 申請後提供金鑰 | 收錄的聚合商都沒有新竹物流選項,只能直連 |
|
|
67
|
-
| **Lalamove** | 即時配送 | HMAC-SHA256 自簽 | 先報價後下單(報價 5 分鐘效期) |
|
|
68
|
-
| **pandago** | 即時配送 | OAuth 2.0 + RSA 簽 JWT assertion | 同城即時配送 |
|
|
69
|
-
|
|
70
|
-
## 技能包內容
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
taiwan-logistics/
|
|
74
|
-
├── SKILL.md # AI 技能主文檔
|
|
75
|
-
├── EXAMPLES.md # 實戰範例集
|
|
76
|
-
├── references/ # 各服務商 API 規格
|
|
77
|
-
│ ├── ecpay-logistics-api.md
|
|
78
|
-
│ ├── NEWEBPAY_LOGISTICS_REFERENCE.md
|
|
79
|
-
│ ├── payuni-logistics-api.md
|
|
80
|
-
│ ├── smilepay-logistics-api.md # Pay_zg 矩陣
|
|
81
|
-
│ ├── pchomepay-logistics-api.md # NDJSON 對帳 parser
|
|
82
|
-
│ ├── paynow-logistics-api.md # Logistic_service 產品線
|
|
83
|
-
│ ├── ezship-logistics-api.md
|
|
84
|
-
│ ├── hct-logistics-api.md # 直連 HCT
|
|
85
|
-
│ ├── lalamove-logistics-api.md
|
|
86
|
-
│ ├── ondemand-delivery.md # Lalamove / pandago
|
|
87
|
-
│ └── carrier-direct-access.md # 無公開 API 的物流業者與替代路徑
|
|
88
|
-
├── examples/ # Python 範例
|
|
89
|
-
└── data/ # search / recommend 使用的 CSV
|
|
90
|
-
├── providers.csv # 可串接 + 僅供查詢
|
|
91
|
-
├── operations.csv
|
|
92
|
-
├── logistics-types.csv # 各家實際參數值(子類型/溫層/代收上限)
|
|
93
|
-
├── status-codes.csv # 跨服務商狀態碼
|
|
94
|
-
└── field-mappings.csv # 欄位對照
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## CLI 指令
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
taiwan-logistics list # 列出 AI 平台
|
|
101
|
-
taiwan-logistics info # 技能資訊
|
|
102
|
-
taiwan-logistics update # 檢查更新
|
|
103
|
-
taiwan-logistics init --force # 覆蓋安裝
|
|
104
|
-
taiwan-logistics init --global # 全域安裝
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## 14 個 AI 平台支援
|
|
108
|
-
|
|
109
|
-
Claude Code · Cursor · Windsurf · Antigravity · GitHub Copilot · Kiro · Codex · Qoder · Cline · Gemini · Trae · OpenCode · Continue · CodeBuddy
|
|
110
|
-
|
|
111
|
-
## 物流類型支援矩陣
|
|
112
|
-
|
|
113
|
-
依各家官方規格整理,實際參數值見 `data/logistics-types.csv`。
|
|
114
|
-
|
|
115
|
-
| 服務商 | 7-11 | 全家 | 萊爾富 | OK | 黑貓 | 其他 |
|
|
116
|
-
|---|---|---|---|---|---|---|
|
|
117
|
-
| ECPay | B2C(含冷凍)+ C2C | B2C + C2C | B2C + C2C | C2C | 常溫/冷藏/冷凍 | 中華郵政 |
|
|
118
|
-
| NewebPay | B2C + C2C | C2C | C2C | C2C | — | — |
|
|
119
|
-
| PAYUNi | B2C + C2C(常溫/冷凍) | — | — | — | 常溫/冷凍/冷藏 | — |
|
|
120
|
-
| SmilePay | B2C + C2C | C2C | — | — | 含逆物流 | — |
|
|
121
|
-
| PChomePay | 取貨付款 | 取貨付款 | 取貨付款 | — | — | — |
|
|
122
|
-
| PayNow | B2C + C2C(含冷凍) | B2C + C2C(含冷凍) | C2C | C2C | 宅配、到店 | 7-11 海外 |
|
|
123
|
-
| ezShip | — | C2C | C2C | C2C | — | 宅配、店港澳 |
|
|
124
|
-
| HCT 直連 | — | — | — | — | — | 新竹物流 |
|
|
125
|
-
|
|
126
|
-
## 相關套件
|
|
127
|
-
|
|
128
|
-
本套件是 **[Taiwan E-Commerce Toolkit](https://github.com/Moksa1123/taiwan-ecommerce-toolkit)** 的一部分:
|
|
129
|
-
|
|
130
|
-
- [taiwan-invoice-skill](https://www.npmjs.com/package/taiwan-invoice-skill) — 7 家電子發票加值中心 + 財政部大平台查詢
|
|
131
|
-
- [taiwan-payment-skill](https://www.npmjs.com/package/taiwan-payment-skill) — 14 家金流
|
|
132
|
-
|
|
133
|
-
## 授權
|
|
134
|
-
|
|
135
|
-
[MIT License](https://github.com/Moksa1123/taiwan-ecommerce-toolkit/blob/main/LICENSE)
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
<p align="center">
|
|
140
|
-
<sub>Made by <strong>Moksa</strong></sub><br>
|
|
141
|
-
<sub>service@moksaweb.com</sub>
|
|
142
|
-
</p>
|
|
1
|
+
<h1 align="center">taiwan-logistics-skill</h1>
|
|
2
|
+
|
|
3
|
+
<h3 align="center">台灣物流 AI 開發技能包</h3>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>7 家物流 aggregator + HCT 新竹物流直連 + 2 家即時配送</strong>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
ECPay · NewebPay · PAYUNi · SmilePay · PChomePay · PayNow · ezShip · HCT 直連 · Lalamove · pandago
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://www.npmjs.com/package/taiwan-logistics-skill"><img src="https://img.shields.io/npm/v/taiwan-logistics-skill?style=flat-square&logo=npm" alt="npm version"></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/taiwan-logistics-skill"><img src="https://img.shields.io/npm/dm/taiwan-logistics-skill?style=flat-square&label=downloads" alt="npm downloads"></a>
|
|
16
|
+
<img src="https://img.shields.io/badge/providers-10-success?style=flat-square" alt="10 Providers">
|
|
17
|
+
<img src="https://img.shields.io/badge/AI%20platforms-14-blue?style=flat-square" alt="14 AI Platforms">
|
|
18
|
+
<a href="https://github.com/Moksa1123/taiwan-ecommerce-toolkit/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Moksa1123/taiwan-ecommerce-toolkit?style=flat-square" alt="License"></a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<a href="https://paypal.me/cccsubcom"><img src="https://img.shields.io/badge/PayPal-支持開發-00457C?style=for-the-badge&logo=paypal&logoColor=white" alt="PayPal"></a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 安裝
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g taiwan-logistics-skill
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 快速開始
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd /path/to/your/project
|
|
37
|
+
|
|
38
|
+
taiwan-logistics init # 互動式
|
|
39
|
+
taiwan-logistics init --ai claude # Claude Code
|
|
40
|
+
taiwan-logistics init --ai all # 全部安裝
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
安裝完後,在 AI 助手用自然語言:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
查詢台北市信義區的 7-11 取貨點,整合 ECPay 物流
|
|
47
|
+
建立 SmilePay 黑貓宅急便冷凍 C2C 訂單,COD 1000 元
|
|
48
|
+
PChomePay 7-11 取貨付款,金額 1500 元,notify URL 設好
|
|
49
|
+
PayNow 7-11 大宗寄倉,使用 3DES 加密
|
|
50
|
+
HCT 直連 API 傳入託運資料,逆物流單獨處理
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 物流服務商
|
|
56
|
+
|
|
57
|
+
| 服務商 | 類型 | 加密 / 認證 | 特色 |
|
|
58
|
+
|---|---|---|---|
|
|
59
|
+
| **ECPay 綠界** | aggregator | MD5 CheckMacValue | B2C 7-11(含冷凍)/全家/萊爾富;C2C 四大超商;宅配黑貓/中華郵政 |
|
|
60
|
+
| **NewebPay 藍新** | aggregator | AES-256-CBC + SHA256 | B2C 僅 7-11;C2C 四大超商;無宅配 |
|
|
61
|
+
| **PAYUNi 統一** | aggregator | AES-256-GCM + SHA256 | 7-11 常溫/冷凍 + T-Cat 常溫/冷藏/冷凍(溫控配送最完整) |
|
|
62
|
+
| **SmilePay 速買配** | aggregator | Verify_key + 加權檢核碼 | Pay_zg 矩陣 51/52/55/56/81/82/83,含逆物流 |
|
|
63
|
+
| **PChomePay 拍錢包** | aggregator | HTTP Basic Auth → token | 金物流二合一、7-11/全家/萊爾富取貨付款 |
|
|
64
|
+
| **PayNow 立吉富** | aggregator | **3DES/ECB/Zero-Padding** | 11 條產品線(含海外配送);不同於金流端 AES |
|
|
65
|
+
| **ezShip 台灣便利配** | aggregator | 無簽章(`su_id` 帳號綁定) | 全家/萊爾富/OK、宅配、店港澳;不含 7-11 |
|
|
66
|
+
| **HCT 新竹物流** | **direct carrier API** | 申請後提供金鑰 | 收錄的聚合商都沒有新竹物流選項,只能直連 |
|
|
67
|
+
| **Lalamove** | 即時配送 | HMAC-SHA256 自簽 | 先報價後下單(報價 5 分鐘效期) |
|
|
68
|
+
| **pandago** | 即時配送 | OAuth 2.0 + RSA 簽 JWT assertion | 同城即時配送 |
|
|
69
|
+
|
|
70
|
+
## 技能包內容
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
taiwan-logistics/
|
|
74
|
+
├── SKILL.md # AI 技能主文檔
|
|
75
|
+
├── EXAMPLES.md # 實戰範例集
|
|
76
|
+
├── references/ # 各服務商 API 規格
|
|
77
|
+
│ ├── ecpay-logistics-api.md
|
|
78
|
+
│ ├── NEWEBPAY_LOGISTICS_REFERENCE.md
|
|
79
|
+
│ ├── payuni-logistics-api.md
|
|
80
|
+
│ ├── smilepay-logistics-api.md # Pay_zg 矩陣
|
|
81
|
+
│ ├── pchomepay-logistics-api.md # NDJSON 對帳 parser
|
|
82
|
+
│ ├── paynow-logistics-api.md # Logistic_service 產品線
|
|
83
|
+
│ ├── ezship-logistics-api.md
|
|
84
|
+
│ ├── hct-logistics-api.md # 直連 HCT
|
|
85
|
+
│ ├── lalamove-logistics-api.md
|
|
86
|
+
│ ├── ondemand-delivery.md # Lalamove / pandago
|
|
87
|
+
│ └── carrier-direct-access.md # 無公開 API 的物流業者與替代路徑
|
|
88
|
+
├── examples/ # Python 範例
|
|
89
|
+
└── data/ # search / recommend 使用的 CSV
|
|
90
|
+
├── providers.csv # 可串接 + 僅供查詢
|
|
91
|
+
├── operations.csv
|
|
92
|
+
├── logistics-types.csv # 各家實際參數值(子類型/溫層/代收上限)
|
|
93
|
+
├── status-codes.csv # 跨服務商狀態碼
|
|
94
|
+
└── field-mappings.csv # 欄位對照
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## CLI 指令
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
taiwan-logistics list # 列出 AI 平台
|
|
101
|
+
taiwan-logistics info # 技能資訊
|
|
102
|
+
taiwan-logistics update # 檢查更新
|
|
103
|
+
taiwan-logistics init --force # 覆蓋安裝
|
|
104
|
+
taiwan-logistics init --global # 全域安裝
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## 14 個 AI 平台支援
|
|
108
|
+
|
|
109
|
+
Claude Code · Cursor · Windsurf · Antigravity · GitHub Copilot · Kiro · Codex · Qoder · Cline · Gemini · Trae · OpenCode · Continue · CodeBuddy
|
|
110
|
+
|
|
111
|
+
## 物流類型支援矩陣
|
|
112
|
+
|
|
113
|
+
依各家官方規格整理,實際參數值見 `data/logistics-types.csv`。
|
|
114
|
+
|
|
115
|
+
| 服務商 | 7-11 | 全家 | 萊爾富 | OK | 黑貓 | 其他 |
|
|
116
|
+
|---|---|---|---|---|---|---|
|
|
117
|
+
| ECPay | B2C(含冷凍)+ C2C | B2C + C2C | B2C + C2C | C2C | 常溫/冷藏/冷凍 | 中華郵政 |
|
|
118
|
+
| NewebPay | B2C + C2C | C2C | C2C | C2C | — | — |
|
|
119
|
+
| PAYUNi | B2C + C2C(常溫/冷凍) | — | — | — | 常溫/冷凍/冷藏 | — |
|
|
120
|
+
| SmilePay | B2C + C2C | C2C | — | — | 含逆物流 | — |
|
|
121
|
+
| PChomePay | 取貨付款 | 取貨付款 | 取貨付款 | — | — | — |
|
|
122
|
+
| PayNow | B2C + C2C(含冷凍) | B2C + C2C(含冷凍) | C2C | C2C | 宅配、到店 | 7-11 海外 |
|
|
123
|
+
| ezShip | — | C2C | C2C | C2C | — | 宅配、店港澳 |
|
|
124
|
+
| HCT 直連 | — | — | — | — | — | 新竹物流 |
|
|
125
|
+
|
|
126
|
+
## 相關套件
|
|
127
|
+
|
|
128
|
+
本套件是 **[Taiwan E-Commerce Toolkit](https://github.com/Moksa1123/taiwan-ecommerce-toolkit)** 的一部分:
|
|
129
|
+
|
|
130
|
+
- [taiwan-invoice-skill](https://www.npmjs.com/package/taiwan-invoice-skill) — 7 家電子發票加值中心 + 財政部大平台查詢
|
|
131
|
+
- [taiwan-payment-skill](https://www.npmjs.com/package/taiwan-payment-skill) — 14 家金流
|
|
132
|
+
|
|
133
|
+
## 授權
|
|
134
|
+
|
|
135
|
+
[MIT License](https://github.com/Moksa1123/taiwan-ecommerce-toolkit/blob/main/LICENSE)
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
<p align="center">
|
|
140
|
+
<sub>Made by <strong>Moksa</strong></sub><br>
|
|
141
|
+
<sub>service@moksaweb.com</sub>
|
|
142
|
+
</p>
|
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
Taiwan Logistics Skill is an AI-powered toolkit for Taiwan logistics integration, providing API documentation, code examples, and scripts for major logistics platforms. It works as a skill/workflow for AI coding assistants (Claude Code, Windsurf, Cursor, etc.).
|
|
8
|
-
|
|
9
|
-
**Supported Providers:** `ecpay`, `newebpay`, `payuni`, `smilepay`, `pchomepay`, `paynow`, `ezship`, `lalamove`, `pandago`, `hct_direct`
|
|
10
|
-
|
|
11
|
-
**即時/同城配送(`ondemand`):** `lalamove`、`pandago` 兩家。此分類與批次物流(超取/宅配)的資料模型不同——報價有效期短、以「趟」為單位、司機有即時座標。見 `references/ondemand-delivery.md`。
|
|
12
|
-
|
|
13
|
-
**No public API(僅列於 providers.csv 供查詢,`api_available=false`):** 黑貓 t-cat、嘉里大榮、宅配通、中華郵政、7-11 交貨便/賣貨便、全家好賣+、萊爾富、OK、蝦皮店到店。原因與替代路徑見 `references/carrier-direct-access.md`。
|
|
14
|
-
|
|
15
|
-
## Available Scripts
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Search API documentation (BM25)
|
|
19
|
-
python3 taiwan-logistics/scripts/search.py "<query>" [--domain <domain>]
|
|
20
|
-
|
|
21
|
-
# Recommend logistics provider
|
|
22
|
-
python3 taiwan-logistics/scripts/recommend.py "<requirements>"
|
|
23
|
-
|
|
24
|
-
# 簽章已知答案 + 測試環境連線(ecpay 另可 --create / --query)
|
|
25
|
-
python3 taiwan-logistics/scripts/test_logistics.py [ecpay|newebpay|payuni]
|
|
26
|
-
|
|
27
|
-
# 輸出已驗證的服務實作(py:examples/;ts:EXAMPLES.md 的 verify 片段)
|
|
28
|
-
python3 taiwan-logistics/scripts/generate-logistics-service.py <Provider> --output <ts|py>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Architecture
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
taiwan-logistics/ # Source of Truth
|
|
35
|
-
├── SKILL.md # Main skill documentation
|
|
36
|
-
├── EXAMPLES.md # Code examples and patterns
|
|
37
|
-
├── references/ # API documentation
|
|
38
|
-
│ ├── ecpay-logistics-api.md
|
|
39
|
-
│ ├── NEWEBPAY_LOGISTICS_REFERENCE.md
|
|
40
|
-
│ ├── payuni-logistics-api.md
|
|
41
|
-
│ ├── smilepay-logistics-api.md # Pay_zg matrix
|
|
42
|
-
│ ├── pchomepay-logistics-api.md # 金物流二合一
|
|
43
|
-
│ ├── paynow-logistics-api.md # Logistic_service 產品線, 3DES/ECB
|
|
44
|
-
│ ├── ezship-logistics-api.md
|
|
45
|
-
│ ├── hct-logistics-api.md # HCT 直連 carrier API
|
|
46
|
-
│ ├── lalamove-logistics-api.md
|
|
47
|
-
│ ├── ondemand-delivery.md
|
|
48
|
-
│ └── carrier-direct-access.md # 無公開 API 的物流業者
|
|
49
|
-
├── examples/ # 可執行範例(CI 以官方測試向量驗證)
|
|
50
|
-
└── data/ # Data-driven CSVs
|
|
51
|
-
├── providers.csv # 10 可串接 + 10 僅供查詢(含 doc_access 分級)
|
|
52
|
-
├── operations.csv # cross-provider API operations
|
|
53
|
-
├── logistics-types.csv # 各家實際參數值(子類型/溫層/代收上限)
|
|
54
|
-
├── status-codes.csv # vendor-specific status codes
|
|
55
|
-
└── field-mappings.csv # 跨 provider 欄位對照(含即時配送)
|
|
56
|
-
|
|
57
|
-
logistics-cli/ # CLI installer (taiwan-logistics-skill on npm)
|
|
58
|
-
├── src/
|
|
59
|
-
│ ├── commands/init.ts # Install command with template generation
|
|
60
|
-
│ └── utils/template.ts # Template rendering engine
|
|
61
|
-
└── assets/ # Bundled assets
|
|
62
|
-
├── taiwan-logistics/ # Copy of taiwan-logistics/
|
|
63
|
-
└── templates/
|
|
64
|
-
├── base/ # Base templates (skill-content.md, quick-reference.md)
|
|
65
|
-
└── platforms/ # Platform configs (14 platforms)
|
|
66
|
-
|
|
67
|
-
.claude/skills/taiwan-logistics/ # Claude Code skill (generated by CLI)
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Sync Rules
|
|
71
|
-
|
|
72
|
-
**Source of Truth:** `taiwan-logistics/`
|
|
73
|
-
|
|
74
|
-
When modifying files:
|
|
75
|
-
|
|
76
|
-
1. **Skill Content** - Edit in `taiwan-logistics/`:
|
|
77
|
-
- `SKILL.md` - Main documentation
|
|
78
|
-
- `EXAMPLES.md` - Code examples
|
|
79
|
-
- `references/*.md` - API documentation
|
|
80
|
-
- `scripts/*.py` - Utility scripts
|
|
81
|
-
- `data/*.csv` - Data files
|
|
82
|
-
|
|
83
|
-
2. **Templates** - Edit in `logistics-cli/assets/templates/`:
|
|
84
|
-
- `base/skill-content.md` - Common skill content
|
|
85
|
-
- `base/quick-reference.md` - Quick reference (Claude only)
|
|
86
|
-
- `platforms/*.json` - Platform-specific configs (14 platforms)
|
|
87
|
-
|
|
88
|
-
3. **CLI Assets** - 自動同步,無需手動複製:
|
|
89
|
-
- `<cli>/scripts/build.js` 會在打包前呼叫 `scripts/sync-assets.mjs`,
|
|
90
|
-
因此 `npm run build` 與 `npm publish`(透過 prepublishOnly)都會自動帶到最新內容
|
|
91
|
-
- 發布流程另以 `node scripts/sync-assets.mjs --check` 驗證,落差會擋下發布
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
node scripts/sync-assets.mjs # 手動同步全部
|
|
95
|
-
node scripts/sync-assets.mjs --check # 只檢查,有落差 exit 1
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
> assets 會隨 npm publish 一起發布(package.json 的 `files` 含 `assets`),
|
|
99
|
-
> 過去忘記同步會靜默發出過期的 skill 內容,因此改為自動化。
|
|
100
|
-
|
|
101
|
-
## Supported AI Platforms
|
|
102
|
-
|
|
103
|
-
| Platform | Folder | Install Type |
|
|
104
|
-
|-------------|-------------|--------------|
|
|
105
|
-
| Claude Code | `.claude` | full |
|
|
106
|
-
| Cursor | `.cursor` | full |
|
|
107
|
-
| Windsurf | `.windsurf` | full |
|
|
108
|
-
| Antigravity | `.agents` | full |
|
|
109
|
-
| Copilot | `.github` | full |
|
|
110
|
-
| Kiro | `.kiro` | full |
|
|
111
|
-
| Codex | `.agents` | full |
|
|
112
|
-
| Qoder | `.qoder` | full |
|
|
113
|
-
| Cline | `.cline` | full |
|
|
114
|
-
| Gemini | `.gemini` | full |
|
|
115
|
-
| Trae | `.trae` | full |
|
|
116
|
-
| OpenCode | `.opencode` | full |
|
|
117
|
-
| Continue | `.continue` | full |
|
|
118
|
-
| CodeBuddy | `.codebuddy`| full |
|
|
119
|
-
|
|
120
|
-
## Prerequisites
|
|
121
|
-
|
|
122
|
-
- Node.js 18+ (for CLI)
|
|
123
|
-
- Python 3.x (for scripts, no external dependencies)
|
|
124
|
-
|
|
125
|
-
## Encryption Methods
|
|
126
|
-
|
|
127
|
-
| Provider | Encryption | Notes |
|
|
128
|
-
|---|---|---|
|
|
129
|
-
| ECPay 綠界 | MD5 CheckMacValue | Sort params + HashKey/HashIV |
|
|
130
|
-
| NewebPay 藍新 | AES-256-CBC + SHA256 | HashData = SHA256(`HashKey=..&EncryptData&HashIV=..`);送出欄位帶 `_`,回應不帶 |
|
|
131
|
-
| PAYUNi 統一 | AES-256-GCM + SHA256 | EncryptInfo = hex(base64(密文) + `:::` + base64(tag));HashInfo = SHA256(HashKey + EncryptInfo + HashIV) |
|
|
132
|
-
| SmilePay 速買配 | Verify_key + Mid_smilepay 加權檢核碼 | No AES; shared secret |
|
|
133
|
-
| PChomePay 拍錢包 | HTTP Basic Auth → 8h pcpay-token | Same as payment side |
|
|
134
|
-
| PayNow 立吉富 | **3DES (TripleDES) / ECB / Zero-Padding → Base64** | Key = `1234567890` + Password + `123456`(24 bytes);ECB 不使用 IV;PassCode = SHA1;**不同於金流端的動態 AES-256** |
|
|
135
|
-
| HCT 直連 | 自訂加密(金鑰申請後提供) | C# sample code only |
|
|
136
|
-
|
|
137
|
-
## Git Workflow
|
|
138
|
-
|
|
139
|
-
Never push directly to `main`. Always:
|
|
140
|
-
|
|
141
|
-
1. Create a new branch: `git checkout -b feat/...` or `fix/...`
|
|
142
|
-
2. Commit changes
|
|
143
|
-
3. Push branch: `git push -u origin <branch>`
|
|
144
|
-
4. Create PR: `gh pr create`
|
|
145
|
-
|
|
146
|
-
## Related Projects
|
|
147
|
-
|
|
148
|
-
- **Taiwan Invoice Skill** - E-Invoice integration (ECPay, SmilePay, Amego, ezPay, PayNow, O'Pay, SunPay)
|
|
149
|
-
- **Taiwan Payment Skill** - Payment integration (14 providers: ECPay, NewebPay, PAYUNi, SmilePay, PChomePay, ezPay, PayNow, Shopline, LINE Pay, TapPay, O'Pay, JKOPAY, SunPay, GoMyPay)
|
|
150
|
-
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Taiwan Logistics Skill is an AI-powered toolkit for Taiwan logistics integration, providing API documentation, code examples, and scripts for major logistics platforms. It works as a skill/workflow for AI coding assistants (Claude Code, Windsurf, Cursor, etc.).
|
|
8
|
+
|
|
9
|
+
**Supported Providers:** `ecpay`, `newebpay`, `payuni`, `smilepay`, `pchomepay`, `paynow`, `ezship`, `lalamove`, `pandago`, `hct_direct`
|
|
10
|
+
|
|
11
|
+
**即時/同城配送(`ondemand`):** `lalamove`、`pandago` 兩家。此分類與批次物流(超取/宅配)的資料模型不同——報價有效期短、以「趟」為單位、司機有即時座標。見 `references/ondemand-delivery.md`。
|
|
12
|
+
|
|
13
|
+
**No public API(僅列於 providers.csv 供查詢,`api_available=false`):** 黑貓 t-cat、嘉里大榮、宅配通、中華郵政、7-11 交貨便/賣貨便、全家好賣+、萊爾富、OK、蝦皮店到店。原因與替代路徑見 `references/carrier-direct-access.md`。
|
|
14
|
+
|
|
15
|
+
## Available Scripts
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Search API documentation (BM25)
|
|
19
|
+
python3 taiwan-logistics/scripts/search.py "<query>" [--domain <domain>]
|
|
20
|
+
|
|
21
|
+
# Recommend logistics provider
|
|
22
|
+
python3 taiwan-logistics/scripts/recommend.py "<requirements>"
|
|
23
|
+
|
|
24
|
+
# 簽章已知答案 + 測試環境連線(ecpay 另可 --create / --query)
|
|
25
|
+
python3 taiwan-logistics/scripts/test_logistics.py [ecpay|newebpay|payuni]
|
|
26
|
+
|
|
27
|
+
# 輸出已驗證的服務實作(py:examples/;ts:EXAMPLES.md 的 verify 片段)
|
|
28
|
+
python3 taiwan-logistics/scripts/generate-logistics-service.py <Provider> --output <ts|py>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Architecture
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
taiwan-logistics/ # Source of Truth
|
|
35
|
+
├── SKILL.md # Main skill documentation
|
|
36
|
+
├── EXAMPLES.md # Code examples and patterns
|
|
37
|
+
├── references/ # API documentation
|
|
38
|
+
│ ├── ecpay-logistics-api.md
|
|
39
|
+
│ ├── NEWEBPAY_LOGISTICS_REFERENCE.md
|
|
40
|
+
│ ├── payuni-logistics-api.md
|
|
41
|
+
│ ├── smilepay-logistics-api.md # Pay_zg matrix
|
|
42
|
+
│ ├── pchomepay-logistics-api.md # 金物流二合一
|
|
43
|
+
│ ├── paynow-logistics-api.md # Logistic_service 產品線, 3DES/ECB
|
|
44
|
+
│ ├── ezship-logistics-api.md
|
|
45
|
+
│ ├── hct-logistics-api.md # HCT 直連 carrier API
|
|
46
|
+
│ ├── lalamove-logistics-api.md
|
|
47
|
+
│ ├── ondemand-delivery.md
|
|
48
|
+
│ └── carrier-direct-access.md # 無公開 API 的物流業者
|
|
49
|
+
├── examples/ # 可執行範例(CI 以官方測試向量驗證)
|
|
50
|
+
└── data/ # Data-driven CSVs
|
|
51
|
+
├── providers.csv # 10 可串接 + 10 僅供查詢(含 doc_access 分級)
|
|
52
|
+
├── operations.csv # cross-provider API operations
|
|
53
|
+
├── logistics-types.csv # 各家實際參數值(子類型/溫層/代收上限)
|
|
54
|
+
├── status-codes.csv # vendor-specific status codes
|
|
55
|
+
└── field-mappings.csv # 跨 provider 欄位對照(含即時配送)
|
|
56
|
+
|
|
57
|
+
logistics-cli/ # CLI installer (taiwan-logistics-skill on npm)
|
|
58
|
+
├── src/
|
|
59
|
+
│ ├── commands/init.ts # Install command with template generation
|
|
60
|
+
│ └── utils/template.ts # Template rendering engine
|
|
61
|
+
└── assets/ # Bundled assets
|
|
62
|
+
├── taiwan-logistics/ # Copy of taiwan-logistics/
|
|
63
|
+
└── templates/
|
|
64
|
+
├── base/ # Base templates (skill-content.md, quick-reference.md)
|
|
65
|
+
└── platforms/ # Platform configs (14 platforms)
|
|
66
|
+
|
|
67
|
+
.claude/skills/taiwan-logistics/ # Claude Code skill (generated by CLI)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Sync Rules
|
|
71
|
+
|
|
72
|
+
**Source of Truth:** `taiwan-logistics/`
|
|
73
|
+
|
|
74
|
+
When modifying files:
|
|
75
|
+
|
|
76
|
+
1. **Skill Content** - Edit in `taiwan-logistics/`:
|
|
77
|
+
- `SKILL.md` - Main documentation
|
|
78
|
+
- `EXAMPLES.md` - Code examples
|
|
79
|
+
- `references/*.md` - API documentation
|
|
80
|
+
- `scripts/*.py` - Utility scripts
|
|
81
|
+
- `data/*.csv` - Data files
|
|
82
|
+
|
|
83
|
+
2. **Templates** - Edit in `logistics-cli/assets/templates/`:
|
|
84
|
+
- `base/skill-content.md` - Common skill content
|
|
85
|
+
- `base/quick-reference.md` - Quick reference (Claude only)
|
|
86
|
+
- `platforms/*.json` - Platform-specific configs (14 platforms)
|
|
87
|
+
|
|
88
|
+
3. **CLI Assets** - 自動同步,無需手動複製:
|
|
89
|
+
- `<cli>/scripts/build.js` 會在打包前呼叫 `scripts/sync-assets.mjs`,
|
|
90
|
+
因此 `npm run build` 與 `npm publish`(透過 prepublishOnly)都會自動帶到最新內容
|
|
91
|
+
- 發布流程另以 `node scripts/sync-assets.mjs --check` 驗證,落差會擋下發布
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
node scripts/sync-assets.mjs # 手動同步全部
|
|
95
|
+
node scripts/sync-assets.mjs --check # 只檢查,有落差 exit 1
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
> assets 會隨 npm publish 一起發布(package.json 的 `files` 含 `assets`),
|
|
99
|
+
> 過去忘記同步會靜默發出過期的 skill 內容,因此改為自動化。
|
|
100
|
+
|
|
101
|
+
## Supported AI Platforms
|
|
102
|
+
|
|
103
|
+
| Platform | Folder | Install Type |
|
|
104
|
+
|-------------|-------------|--------------|
|
|
105
|
+
| Claude Code | `.claude` | full |
|
|
106
|
+
| Cursor | `.cursor` | full |
|
|
107
|
+
| Windsurf | `.windsurf` | full |
|
|
108
|
+
| Antigravity | `.agents` | full |
|
|
109
|
+
| Copilot | `.github` | full |
|
|
110
|
+
| Kiro | `.kiro` | full |
|
|
111
|
+
| Codex | `.agents` | full |
|
|
112
|
+
| Qoder | `.qoder` | full |
|
|
113
|
+
| Cline | `.cline` | full |
|
|
114
|
+
| Gemini | `.gemini` | full |
|
|
115
|
+
| Trae | `.trae` | full |
|
|
116
|
+
| OpenCode | `.opencode` | full |
|
|
117
|
+
| Continue | `.continue` | full |
|
|
118
|
+
| CodeBuddy | `.codebuddy`| full |
|
|
119
|
+
|
|
120
|
+
## Prerequisites
|
|
121
|
+
|
|
122
|
+
- Node.js 18+ (for CLI)
|
|
123
|
+
- Python 3.x (for scripts, no external dependencies)
|
|
124
|
+
|
|
125
|
+
## Encryption Methods
|
|
126
|
+
|
|
127
|
+
| Provider | Encryption | Notes |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| ECPay 綠界 | MD5 CheckMacValue | Sort params + HashKey/HashIV |
|
|
130
|
+
| NewebPay 藍新 | AES-256-CBC + SHA256 | HashData = SHA256(`HashKey=..&EncryptData&HashIV=..`);送出欄位帶 `_`,回應不帶 |
|
|
131
|
+
| PAYUNi 統一 | AES-256-GCM + SHA256 | EncryptInfo = hex(base64(密文) + `:::` + base64(tag));HashInfo = SHA256(HashKey + EncryptInfo + HashIV) |
|
|
132
|
+
| SmilePay 速買配 | Verify_key + Mid_smilepay 加權檢核碼 | No AES; shared secret |
|
|
133
|
+
| PChomePay 拍錢包 | HTTP Basic Auth → 8h pcpay-token | Same as payment side |
|
|
134
|
+
| PayNow 立吉富 | **3DES (TripleDES) / ECB / Zero-Padding → Base64** | Key = `1234567890` + Password + `123456`(24 bytes);ECB 不使用 IV;PassCode = SHA1;**不同於金流端的動態 AES-256** |
|
|
135
|
+
| HCT 直連 | 自訂加密(金鑰申請後提供) | C# sample code only |
|
|
136
|
+
|
|
137
|
+
## Git Workflow
|
|
138
|
+
|
|
139
|
+
Never push directly to `main`. Always:
|
|
140
|
+
|
|
141
|
+
1. Create a new branch: `git checkout -b feat/...` or `fix/...`
|
|
142
|
+
2. Commit changes
|
|
143
|
+
3. Push branch: `git push -u origin <branch>`
|
|
144
|
+
4. Create PR: `gh pr create`
|
|
145
|
+
|
|
146
|
+
## Related Projects
|
|
147
|
+
|
|
148
|
+
- **Taiwan Invoice Skill** - E-Invoice integration (ECPay, SmilePay, Amego, ezPay, PayNow, O'Pay, SunPay)
|
|
149
|
+
- **Taiwan Payment Skill** - Payment integration (14 providers: ECPay, NewebPay, PAYUNi, SmilePay, PChomePay, ezPay, PayNow, Shopline, LINE Pay, TapPay, O'Pay, JKOPAY, SunPay, GoMyPay)
|
|
150
|
+
|