makea-cli 0.1.19__tar.gz → 0.1.21__tar.gz
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.
- {makea_cli-0.1.19 → makea_cli-0.1.21}/PKG-INFO +47 -1
- {makea_cli-0.1.19 → makea_cli-0.1.21}/README.md +46 -0
- makea_cli-0.1.21/makea_cli/__init__.py +1 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/api_client.py +34 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/__init__.py +2 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/directory/cmd.py +6 -2
- makea_cli-0.1.21/makea_cli/commands/production/__init__.py +3 -0
- makea_cli-0.1.21/makea_cli/commands/production/cmd.py +887 -0
- makea_cli-0.1.21/makea_cli/commands/production/pricing_spec.py +726 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/pyproject.toml +1 -1
- makea_cli-0.1.19/makea_cli/__init__.py +0 -1
- {makea_cli-0.1.19 → makea_cli-0.1.21}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/.claude/skills/link-supplier-user/SKILL.md +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/.gitignore +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea-collection-upload/SKILL.md +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea-collection-upload/scripts/create_products.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/__main__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/auth_pkce.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/_util.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/analytics/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/analytics/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/auth/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/auth/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/designer/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/designer/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/directory/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/document/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/document/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/email/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/email/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/library/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/library/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/metrics/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/metrics/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/orders/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/orders/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/product/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/product/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/supplier/__init__.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/commands/supplier/cmd.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/config.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/main.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/makea_cli/posthog_client.py +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/npm/makea-cli/README.md +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/npm/makea-cli/makea-cli.mjs +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/npm/makea-cli/package.json +0 -0
- {makea_cli-0.1.19 → makea_cli-0.1.21}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: makea-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.21
|
|
4
4
|
Summary: Makea admin CLI (browser login + Makea admin HTTP API)
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: httpx>=0.27
|
|
@@ -86,6 +86,11 @@ makea-cli auth --logout
|
|
|
86
86
|
- `makea-cli list-product-orders` — 列出所有设计师产品订单(GET `/admin/designer/get_all_product_orders`)
|
|
87
87
|
- `makea-cli list-sampling-orders-by-product <id>` — 按产品 reference id 列打样单
|
|
88
88
|
- `makea-cli list-production-orders-by-product <id>` — 按产品 reference id 列大货单
|
|
89
|
+
- `makea-cli production-pricing-show <production_order_id>` — 看一张大货单的定价现状:币种、MOQ、阶梯价、尺码/颜色、pricing groups、购物车覆盖情况(加 `--json` 出原始字段)
|
|
90
|
+
- `makea-cli production-variants-set <production_order_id> --sizes S,M,L --color "Black:#000000"` — 改这张单的可选尺码和颜色(cart key 就是由它们拼出来的)
|
|
91
|
+
- `makea-cli production-tiers-set <production_order_id> --tier 100-199:7.50 --tier 500+:7.20 --moq 100` — 改整单口径的阶梯价 / MOQ / incoterm / 币种
|
|
92
|
+
- `makea-cli production-groups-generate <production_order_id> --by style|colour|variant|all` — 按某个轴生成 pricing groups,连带每组的阶梯价和 MOQ
|
|
93
|
+
- `makea-cli production-groups-set <production_order_id> --file groups.json | --from-quote | --clear` — 整体写入 pricing groups:文件回放、从供应商报价拷贝、或清空回退到整单阶梯价
|
|
89
94
|
- `makea-cli download-document <document_id> -u <user_id>` — 下载单个文件(GET `/admin/document/download`)
|
|
90
95
|
- `makea-cli download-product-document <product_reference_id> <document_id> -d <designer_user_id>` — 按产品行 + 文档 id 下载(内部用订单列表 JSON,不额外查 metadata)
|
|
91
96
|
- `makea-cli upload-product-document -u <designer_user_id> -p <product_id> -f <path>` — 通用产品文档上传(不限 quote 流程):上传到 AWS S3 并挂到产品(POST `/admin/designer/upload_document`),返回 document domain 元数据供其它命令使用
|
|
@@ -100,6 +105,47 @@ makea-cli auth --logout
|
|
|
100
105
|
|
|
101
106
|
---
|
|
102
107
|
|
|
108
|
+
## 大货定价(price tier / 颜色尺码 / pricing group)
|
|
109
|
+
|
|
110
|
+
一张 production order 的价格由三部分组成:
|
|
111
|
+
|
|
112
|
+
1. `available_sizes` / `available_colors` — 买家购物车的网格。cart key 是 `"{尺码},{颜色}"`,颜色段有 hex 就用 `hex_code`,没有才退回 `color_name`。所以颜色尽量都给 hex。
|
|
113
|
+
2. `production_price_tiers` + `moq` — 整单一套阶梯价。**只在这张单没有 pricing group 时生效**。
|
|
114
|
+
3. `pricing_groups` — 若干个各自计价的 cart key 分组。分组回答"谁共用一套价目表",`tier_basis` / `moq_basis` 回答"按什么量去查这套表"(VARIANT 每个 cart key 各算各的,GROUP 按组内合计,ORDER 按全单合计)。
|
|
115
|
+
|
|
116
|
+
MOQ 的几种配法就是这两个旋钮的组合:
|
|
117
|
+
|
|
118
|
+
| 想要的效果 | 命令 |
|
|
119
|
+
|---|---|
|
|
120
|
+
| 每个 style 自己的阶梯价 + 自己的 MOQ | `--by style --moq-basis group` |
|
|
121
|
+
| 每个颜色一个 MOQ,跨所有 style 累计 | `--by colour --moq-basis group` |
|
|
122
|
+
| 每个颜色 × 尺码单独计价 | `--by variant --moq-basis group` |
|
|
123
|
+
| 全单一套价,MOQ 看全单总量 | `--by all --moq-basis order` |
|
|
124
|
+
|
|
125
|
+
阶梯写法:`--tier 100-199:7.50 --tier 200-499:7.40 --tier 500+:7.20`。结尾的 `+`(或只写下限)表示不封顶,存成 `max_qty=0`;后端从低到高选,最后一个够 `min_qty` 的档位胜出。
|
|
126
|
+
|
|
127
|
+
单组覆盖:`--tier-for 'S=100-199:22.45'`、`--moq-for 'S=100'`,等号左边可以写组名、尺码、颜色名或 hex。
|
|
128
|
+
|
|
129
|
+
例(参考 Lacati 毯子那张报价的形态:三个尺寸各一套价,MOQ 100/组):
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
makea-cli production-variants-set <po_id> --sizes S,M,L --customized-color
|
|
133
|
+
makea-cli production-groups-generate <po_id> --by style \
|
|
134
|
+
--tier-for 'S=100-199:7.50' --tier-for 'S=300+:7.20' \
|
|
135
|
+
--tier-for 'M=100-199:22.45' --tier-for 'M=300+:21.85' \
|
|
136
|
+
--tier-for 'L=100-199:33.05' --tier-for 'L=300+:32.25' \
|
|
137
|
+
--moq 100 --moq-basis group --tier-basis VARIANT --dry-run
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
几条要记住的:
|
|
141
|
+
|
|
142
|
+
- 写命令都先打印 plan 再问一次;`--dry-run` 只看不发,`--yes` 跳过确认。默认打的是**生产环境**。
|
|
143
|
+
- 购物车里有、却没被任何组认领的 cart key,付款时会整单失败(不是按 0 计价)。plan 和保存结果都会把这些 key 列出来。
|
|
144
|
+
- 重跑 `production-groups-generate` 会保留同名/同变体旧组的 `group_id` 和这次没指定的字段,所以"只改 MOQ"是安全的。
|
|
145
|
+
- 已经付过款的单,改这里不会动已经收的钱(发票读冻结值),只影响之后的扣款。
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
103
149
|
## Claude / Cursor skills(可选)
|
|
104
150
|
|
|
105
151
|
仓库内 `.claude/skills/` 下放有面向 agent 的操作说明,例如:
|
|
@@ -75,6 +75,11 @@ makea-cli auth --logout
|
|
|
75
75
|
- `makea-cli list-product-orders` — 列出所有设计师产品订单(GET `/admin/designer/get_all_product_orders`)
|
|
76
76
|
- `makea-cli list-sampling-orders-by-product <id>` — 按产品 reference id 列打样单
|
|
77
77
|
- `makea-cli list-production-orders-by-product <id>` — 按产品 reference id 列大货单
|
|
78
|
+
- `makea-cli production-pricing-show <production_order_id>` — 看一张大货单的定价现状:币种、MOQ、阶梯价、尺码/颜色、pricing groups、购物车覆盖情况(加 `--json` 出原始字段)
|
|
79
|
+
- `makea-cli production-variants-set <production_order_id> --sizes S,M,L --color "Black:#000000"` — 改这张单的可选尺码和颜色(cart key 就是由它们拼出来的)
|
|
80
|
+
- `makea-cli production-tiers-set <production_order_id> --tier 100-199:7.50 --tier 500+:7.20 --moq 100` — 改整单口径的阶梯价 / MOQ / incoterm / 币种
|
|
81
|
+
- `makea-cli production-groups-generate <production_order_id> --by style|colour|variant|all` — 按某个轴生成 pricing groups,连带每组的阶梯价和 MOQ
|
|
82
|
+
- `makea-cli production-groups-set <production_order_id> --file groups.json | --from-quote | --clear` — 整体写入 pricing groups:文件回放、从供应商报价拷贝、或清空回退到整单阶梯价
|
|
78
83
|
- `makea-cli download-document <document_id> -u <user_id>` — 下载单个文件(GET `/admin/document/download`)
|
|
79
84
|
- `makea-cli download-product-document <product_reference_id> <document_id> -d <designer_user_id>` — 按产品行 + 文档 id 下载(内部用订单列表 JSON,不额外查 metadata)
|
|
80
85
|
- `makea-cli upload-product-document -u <designer_user_id> -p <product_id> -f <path>` — 通用产品文档上传(不限 quote 流程):上传到 AWS S3 并挂到产品(POST `/admin/designer/upload_document`),返回 document domain 元数据供其它命令使用
|
|
@@ -89,6 +94,47 @@ makea-cli auth --logout
|
|
|
89
94
|
|
|
90
95
|
---
|
|
91
96
|
|
|
97
|
+
## 大货定价(price tier / 颜色尺码 / pricing group)
|
|
98
|
+
|
|
99
|
+
一张 production order 的价格由三部分组成:
|
|
100
|
+
|
|
101
|
+
1. `available_sizes` / `available_colors` — 买家购物车的网格。cart key 是 `"{尺码},{颜色}"`,颜色段有 hex 就用 `hex_code`,没有才退回 `color_name`。所以颜色尽量都给 hex。
|
|
102
|
+
2. `production_price_tiers` + `moq` — 整单一套阶梯价。**只在这张单没有 pricing group 时生效**。
|
|
103
|
+
3. `pricing_groups` — 若干个各自计价的 cart key 分组。分组回答"谁共用一套价目表",`tier_basis` / `moq_basis` 回答"按什么量去查这套表"(VARIANT 每个 cart key 各算各的,GROUP 按组内合计,ORDER 按全单合计)。
|
|
104
|
+
|
|
105
|
+
MOQ 的几种配法就是这两个旋钮的组合:
|
|
106
|
+
|
|
107
|
+
| 想要的效果 | 命令 |
|
|
108
|
+
|---|---|
|
|
109
|
+
| 每个 style 自己的阶梯价 + 自己的 MOQ | `--by style --moq-basis group` |
|
|
110
|
+
| 每个颜色一个 MOQ,跨所有 style 累计 | `--by colour --moq-basis group` |
|
|
111
|
+
| 每个颜色 × 尺码单独计价 | `--by variant --moq-basis group` |
|
|
112
|
+
| 全单一套价,MOQ 看全单总量 | `--by all --moq-basis order` |
|
|
113
|
+
|
|
114
|
+
阶梯写法:`--tier 100-199:7.50 --tier 200-499:7.40 --tier 500+:7.20`。结尾的 `+`(或只写下限)表示不封顶,存成 `max_qty=0`;后端从低到高选,最后一个够 `min_qty` 的档位胜出。
|
|
115
|
+
|
|
116
|
+
单组覆盖:`--tier-for 'S=100-199:22.45'`、`--moq-for 'S=100'`,等号左边可以写组名、尺码、颜色名或 hex。
|
|
117
|
+
|
|
118
|
+
例(参考 Lacati 毯子那张报价的形态:三个尺寸各一套价,MOQ 100/组):
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
makea-cli production-variants-set <po_id> --sizes S,M,L --customized-color
|
|
122
|
+
makea-cli production-groups-generate <po_id> --by style \
|
|
123
|
+
--tier-for 'S=100-199:7.50' --tier-for 'S=300+:7.20' \
|
|
124
|
+
--tier-for 'M=100-199:22.45' --tier-for 'M=300+:21.85' \
|
|
125
|
+
--tier-for 'L=100-199:33.05' --tier-for 'L=300+:32.25' \
|
|
126
|
+
--moq 100 --moq-basis group --tier-basis VARIANT --dry-run
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
几条要记住的:
|
|
130
|
+
|
|
131
|
+
- 写命令都先打印 plan 再问一次;`--dry-run` 只看不发,`--yes` 跳过确认。默认打的是**生产环境**。
|
|
132
|
+
- 购物车里有、却没被任何组认领的 cart key,付款时会整单失败(不是按 0 计价)。plan 和保存结果都会把这些 key 列出来。
|
|
133
|
+
- 重跑 `production-groups-generate` 会保留同名/同变体旧组的 `group_id` 和这次没指定的字段,所以"只改 MOQ"是安全的。
|
|
134
|
+
- 已经付过款的单,改这里不会动已经收的钱(发票读冻结值),只影响之后的扣款。
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
92
138
|
## Claude / Cursor skills(可选)
|
|
93
139
|
|
|
94
140
|
仓库内 `.claude/skills/` 下放有面向 agent 的操作说明,例如:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.21"
|
|
@@ -652,6 +652,40 @@ def get_production_orders_by_product(
|
|
|
652
652
|
)
|
|
653
653
|
|
|
654
654
|
|
|
655
|
+
def get_production_order_details(production_order_id: str, *, timeout: float = 60.0) -> Any:
|
|
656
|
+
"""
|
|
657
|
+
GET /admin/production_orders/{id}/details — one production (or restock) order in full.
|
|
658
|
+
|
|
659
|
+
Carries the pricing configuration the pricing commands read and write back:
|
|
660
|
+
currency, moq, production_price_tiers, pricing_groups, available_sizes,
|
|
661
|
+
available_colors, cart_items.
|
|
662
|
+
"""
|
|
663
|
+
return get_json(f"/admin/production_orders/{production_order_id}/details", timeout=timeout)
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
def update_production_order_details(
|
|
667
|
+
production_order_id: str,
|
|
668
|
+
body: dict[str, Any],
|
|
669
|
+
*,
|
|
670
|
+
timeout: float = 60.0,
|
|
671
|
+
) -> Any:
|
|
672
|
+
"""
|
|
673
|
+
POST /admin/production_orders/{id}/details/update — patch-style admin update.
|
|
674
|
+
|
|
675
|
+
Only the keys present in ``body`` are touched (moq, production_price_tiers,
|
|
676
|
+
pricing_groups, production_price_incoterm, production_price_valid_until,
|
|
677
|
+
available_sizes, available_colors, currency, lead_time, payment_term,
|
|
678
|
+
one_time_production_fees, sizechart, component_specifications). The response
|
|
679
|
+
may carry a ``warning`` plus ``uncovered_cart_keys`` when the saved pricing
|
|
680
|
+
groups do not price the whole cart.
|
|
681
|
+
"""
|
|
682
|
+
return post_json(
|
|
683
|
+
f"/admin/production_orders/{production_order_id}/details/update",
|
|
684
|
+
body,
|
|
685
|
+
timeout=timeout,
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
|
|
655
689
|
def get_cumulative_payment_and_platform_revenue(
|
|
656
690
|
*,
|
|
657
691
|
start_date: str,
|
|
@@ -12,6 +12,7 @@ from makea_cli.commands.library.cmd import register as register_library
|
|
|
12
12
|
from makea_cli.commands.metrics.cmd import register as register_metrics
|
|
13
13
|
from makea_cli.commands.orders.cmd import register as register_orders
|
|
14
14
|
from makea_cli.commands.product.cmd import register as register_product
|
|
15
|
+
from makea_cli.commands.production.cmd import register as register_production
|
|
15
16
|
from makea_cli.commands.supplier.cmd import register as register_supplier
|
|
16
17
|
|
|
17
18
|
|
|
@@ -22,6 +23,7 @@ def register_all(app: typer.Typer) -> None:
|
|
|
22
23
|
register_supplier(app)
|
|
23
24
|
register_orders(app)
|
|
24
25
|
register_product(app)
|
|
26
|
+
register_production(app)
|
|
25
27
|
register_designer(app)
|
|
26
28
|
register_metrics(app)
|
|
27
29
|
register_analytics(app)
|
|
@@ -59,7 +59,7 @@ def register(app: typer.Typer) -> None:
|
|
|
59
59
|
def create_user(
|
|
60
60
|
email: str = typer.Argument(
|
|
61
61
|
...,
|
|
62
|
-
help="Email address
|
|
62
|
+
help="Email address the new account signs in with.",
|
|
63
63
|
),
|
|
64
64
|
user_type: str = typer.Option(
|
|
65
65
|
...,
|
|
@@ -94,7 +94,11 @@ def register(app: typer.Typer) -> None:
|
|
|
94
94
|
username: str | None = typer.Option(
|
|
95
95
|
None,
|
|
96
96
|
"--username",
|
|
97
|
-
help=
|
|
97
|
+
help=(
|
|
98
|
+
"Optional Cognito pool username. Defaults to the email local part "
|
|
99
|
+
"(the pool has email as an alias, so the username itself cannot be "
|
|
100
|
+
"an email address). Sign-in uses the email either way."
|
|
101
|
+
),
|
|
98
102
|
),
|
|
99
103
|
) -> None:
|
|
100
104
|
"""
|