shinten-ship 0.2.0 → 0.2.2
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.ja.md +35 -16
- package/README.md +21 -0
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# shinten-ship
|
|
2
2
|
|
|
3
|
-
**shinten
|
|
3
|
+
**shinten の出荷デスク。暗号化された住所を、送り状を作る場所でだけ復号する。**
|
|
4
4
|
|
|
5
|
-
[shinten](https://github.com/eucassoc/shinten)
|
|
6
|
-
|
|
7
|
-
shinten-ship
|
|
8
|
-
|
|
5
|
+
[shinten](https://github.com/eucassoc/shinten) で配送先を暗号化している店舗は、
|
|
6
|
+
注文ごとに郵便番号と暗号文しか持ちません。それでも誰かが送り状を印字します。
|
|
7
|
+
shinten-ship はその誰かの道具です。出荷担当の端末で動き、各注文の暗号文を
|
|
8
|
+
その端末の秘密鍵で復号し、配送業者の送り状ソフトがそのまま受け付ける取込ファイルを
|
|
9
9
|
書きます。住所が平文で存在するのはその端末の上、取込ファイルがある間だけで、
|
|
10
10
|
その後は消えます。
|
|
11
11
|
|
|
12
12
|
[English](README.md)
|
|
13
13
|
|
|
14
|
-
- 注文のエクスポート(注文ID
|
|
14
|
+
- 注文のエクスポート(注文ID、郵便番号、暗号文、送り状に要る平文項目: 品名、個数、
|
|
15
15
|
日付、時間帯、保冷)を JSON、JSON Lines、CSV で読みます。
|
|
16
16
|
- ヤマト運輸 B2クラウド(基本レイアウト、97項目、位置固定)と日本郵便
|
|
17
17
|
ゆうパックプリントR(項目名付きの列。フィルタで一対一に対応付け)の取込 CSV を
|
|
@@ -21,15 +21,15 @@ shinten-ship はその誰かの道具です。出荷担当の端末で動き、
|
|
|
21
21
|
記録します。証跡ログに後から載せられる形です。
|
|
22
22
|
- デスク用の CLI と、デスクを動かすエージェント向けの MCP サーバー。
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
デスクの秘密鍵は端末から出ません。デスクが複数ある店舗や外部の倉庫は、暗号化の
|
|
25
25
|
宛先が増えるだけです。バックアップ鍵をオフラインに置いてください。失った鍵
|
|
26
|
-
|
|
26
|
+
だけで暗号化した内容は、誰にも復号できません。
|
|
27
27
|
|
|
28
28
|
## 準備
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
31
|
npm install -g shinten-ship
|
|
32
|
-
shinten keygen -o desk.json # shinten
|
|
32
|
+
shinten keygen -o desk.json # shinten の鍵。公開鍵を店舗のフォームの暗号化の宛先として公開する
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
`ship.json` に差出人と業者のアカウントを書きます。
|
|
@@ -43,8 +43,8 @@ shinten keygen -o desk.json # shinten の鍵。公開側を店舗のフ
|
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
`recipients`
|
|
47
|
-
|
|
46
|
+
`recipients` は、店舗のフォームが暗号化に使うはずの公開鍵を、この発送窓口が承認したものです。
|
|
47
|
+
他の鍵でも暗号化された注文や、これらの鍵が欠けた注文は、店舗のサイトの鍵一覧が
|
|
48
48
|
差し替えられたことを意味します。ラベルは一つも作られず、`labels` は STOP で終わります。
|
|
49
49
|
同じ鍵で `shinten watch -r` を定期的に店舗の鍵一覧に向けて実行すれば、注文が来る前に
|
|
50
50
|
差し替えを見つけられます。
|
|
@@ -55,11 +55,11 @@ shinten keygen -o desk.json # shinten の鍵。公開側を店舗のフ
|
|
|
55
55
|
|
|
56
56
|
## 注文
|
|
57
57
|
|
|
58
|
-
注文のエクスポートは、店舗が既に持っているもの(
|
|
58
|
+
注文のエクスポートは、店舗が既に持っているもの(平文項目と暗号文)に、送り状に
|
|
59
59
|
書く内容を加えたものです。次のどの形でも読めます。
|
|
60
60
|
|
|
61
61
|
```json
|
|
62
|
-
[{ "id": "A-1", "postalCode": "150-0001", "envelope": { "...": "保存されている shinten
|
|
62
|
+
[{ "id": "A-1", "postalCode": "150-0001", "envelope": { "...": "保存されている shinten の暗号文" },
|
|
63
63
|
"item": "雑貨", "count": 1, "deliveryDate": "2026-04-03", "timeSlot": "14-16", "cool": "chilled" }]
|
|
64
64
|
```
|
|
65
65
|
|
|
@@ -79,12 +79,12 @@ shinten-ship labels --carrier yamato-b2 -k desk.json -c ship.json -o labels.csv
|
|
|
79
79
|
shinten-ship purge labels.csv
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
このデスクの鍵で復号できない暗号文や、業者の項目に収まらない注文(ヤマトで住所が64バイト
|
|
83
83
|
超、業者にない時間帯)は除外して報告し、残りを書き出します。ファイルは業者の
|
|
84
84
|
ソフトが読む CP932、CRLF です。
|
|
85
85
|
|
|
86
86
|
記録は `~/.shinten-ship/records.jsonl`(または `SHINTEN_SHIP_RECORDS`)に
|
|
87
|
-
追記されます。各ファイルのダイジェスト、含まれる注文の ID
|
|
87
|
+
追記されます。各ファイルのダイジェスト、含まれる注文の ID と暗号文のダイジェスト、
|
|
88
88
|
消去の事実です。住所が記録に入ることはありません。
|
|
89
89
|
|
|
90
90
|
## MCP
|
|
@@ -97,7 +97,7 @@ shinten-ship purge labels.csv
|
|
|
97
97
|
| ツール | 内容 |
|
|
98
98
|
|---|---|
|
|
99
99
|
| `carriers` | このデスクが書ける形式と、各業者のソフトでの読み込み方 |
|
|
100
|
-
| `make_labels` |
|
|
100
|
+
| `make_labels` | 注文の暗号文を復号し、送り状ファイルを指定パスに書く |
|
|
101
101
|
| `purge` | アップロード後に送り状ファイルを消し、ダイジェストを記録する |
|
|
102
102
|
|
|
103
103
|
## 業者の形式
|
|
@@ -109,6 +109,25 @@ shinten-ship purge labels.csv
|
|
|
109
109
|
|
|
110
110
|
業者の形式は業者の都合で変わります。形式は `src/carriers/` の1ファイルです。
|
|
111
111
|
|
|
112
|
+
## 例
|
|
113
|
+
|
|
114
|
+
[shinten の web-shop の例](https://github.com/eucassoc/shinten/tree/main/examples/web-shop)
|
|
115
|
+
で、架空のネットショップの出荷担当の端末を動かせます。暗号化された注文からヤマト運輸
|
|
116
|
+
B2クラウドの取込ファイルを作り、印刷後に削除し、サイトが承認していない鍵を配っていた
|
|
117
|
+
ときには止まります。流れは[約2分の動画](https://github.com/eucassoc/shinten/blob/main/examples/web-shop/demo.mp4)で見られます。
|
|
118
|
+
|
|
119
|
+
受付から復号、削除までの各手順は [deedlog](https://github.com/eucassoc/deedlog) で記録し、
|
|
120
|
+
二つの連署サーバーが連署します。そのため、例を動かすには `dlog` コマンドが必要です
|
|
121
|
+
(Go が必要です)。
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
go install github.com/eucassoc/deedlog/cmd/dlog@latest
|
|
125
|
+
|
|
126
|
+
git clone https://github.com/eucassoc/shinten && cd shinten/examples/web-shop
|
|
127
|
+
npm install
|
|
128
|
+
npm start # http://127.0.0.1:8800/
|
|
129
|
+
```
|
|
130
|
+
|
|
112
131
|
## 開発
|
|
113
132
|
|
|
114
133
|
```sh
|
package/README.md
CHANGED
|
@@ -115,6 +115,27 @@ and each purge. No address is ever in a record.
|
|
|
115
115
|
Carrier formats change on the carriers' schedule; a format is one file
|
|
116
116
|
under `src/carriers/`.
|
|
117
117
|
|
|
118
|
+
## Example
|
|
119
|
+
|
|
120
|
+
[shinten's web-shop example](https://github.com/eucassoc/shinten/tree/main/examples/web-shop)
|
|
121
|
+
runs the desk on a fictional shop: Yamato B2 Cloud labels from encrypted
|
|
122
|
+
orders, the file deleted after printing, and the stop when the site has
|
|
123
|
+
served a key the desk never approved.
|
|
124
|
+
[A two-minute video](https://github.com/eucassoc/shinten/blob/main/examples/web-shop/demo.mp4)
|
|
125
|
+
walks through it.
|
|
126
|
+
|
|
127
|
+
Each step, from receipt to decryption and deletion, is also recorded with
|
|
128
|
+
[deedlog](https://github.com/eucassoc/deedlog) and cosigned by two witnesses,
|
|
129
|
+
so running the example needs its `dlog` command (Go required):
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
go install github.com/eucassoc/deedlog/cmd/dlog@latest
|
|
133
|
+
|
|
134
|
+
git clone https://github.com/eucassoc/shinten && cd shinten/examples/web-shop
|
|
135
|
+
npm install
|
|
136
|
+
npm start # http://127.0.0.1:8800/
|
|
137
|
+
```
|
|
138
|
+
|
|
118
139
|
## Development
|
|
119
140
|
|
|
120
141
|
```sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinten-ship",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "The shipping desk for shinten: opens sealed delivery addresses on the desk's own device and writes the carrier's label-import CSV, so the store never holds an address in the clear.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "github:eucassoc/shinten-ship",
|