makea-cli 0.2.15__tar.gz → 0.2.17__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.
Files changed (73) hide show
  1. {makea_cli-0.2.15 → makea_cli-0.2.17}/CHANGELOG.md +45 -0
  2. {makea_cli-0.2.15 → makea_cli-0.2.17}/PKG-INFO +15 -1
  3. {makea_cli-0.2.15 → makea_cli-0.2.17}/README.md +14 -0
  4. makea_cli-0.2.17/makea_cli/__init__.py +1 -0
  5. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/api_client.py +137 -3
  6. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/__init__.py +4 -0
  7. makea_cli-0.2.17/makea_cli/commands/playbook/__init__.py +0 -0
  8. makea_cli-0.2.17/makea_cli/commands/playbook/cmd.py +329 -0
  9. makea_cli-0.2.17/makea_cli/commands/shipping/__init__.py +0 -0
  10. makea_cli-0.2.17/makea_cli/commands/shipping/cmd.py +422 -0
  11. {makea_cli-0.2.15 → makea_cli-0.2.17}/pyproject.toml +1 -1
  12. {makea_cli-0.2.15 → makea_cli-0.2.17}/tests/golden_manifest.json +1140 -3
  13. {makea_cli-0.2.15 → makea_cli-0.2.17}/tests/test_persona_commands.py +78 -0
  14. {makea_cli-0.2.15 → makea_cli-0.2.17}/uv.lock +1 -1
  15. makea_cli-0.2.15/makea_cli/__init__.py +0 -1
  16. {makea_cli-0.2.15 → makea_cli-0.2.17}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
  17. {makea_cli-0.2.15 → makea_cli-0.2.17}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
  18. {makea_cli-0.2.15 → makea_cli-0.2.17}/.claude/skills/link-supplier-user/SKILL.md +0 -0
  19. {makea_cli-0.2.15 → makea_cli-0.2.17}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
  20. {makea_cli-0.2.15 → makea_cli-0.2.17}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
  21. {makea_cli-0.2.15 → makea_cli-0.2.17}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
  22. {makea_cli-0.2.15 → makea_cli-0.2.17}/.gitignore +0 -0
  23. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea-collection-upload/SKILL.md +0 -0
  24. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea-collection-upload/scripts/create_products.py +0 -0
  25. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/__main__.py +0 -0
  26. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/auth_pkce.py +0 -0
  27. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/broker.py +0 -0
  28. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/_util.py +0 -0
  29. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/analytics/__init__.py +0 -0
  30. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/analytics/cmd.py +0 -0
  31. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/auth/__init__.py +0 -0
  32. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/auth/cmd.py +0 -0
  33. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/brand/__init__.py +0 -0
  34. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/brand/cmd.py +0 -0
  35. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/designer/__init__.py +0 -0
  36. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/designer/cmd.py +0 -0
  37. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/directory/__init__.py +0 -0
  38. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/directory/cmd.py +0 -0
  39. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/document/__init__.py +0 -0
  40. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/document/cmd.py +0 -0
  41. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/email/__init__.py +0 -0
  42. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/email/cmd.py +0 -0
  43. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/factory/__init__.py +0 -0
  44. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/factory/cmd.py +0 -0
  45. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/library/__init__.py +0 -0
  46. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/library/cmd.py +0 -0
  47. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/metrics/__init__.py +0 -0
  48. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/metrics/cmd.py +0 -0
  49. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/orders/__init__.py +0 -0
  50. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/orders/cmd.py +0 -0
  51. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/product/__init__.py +0 -0
  52. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/product/cmd.py +0 -0
  53. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/production/__init__.py +0 -0
  54. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/production/cmd.py +0 -0
  55. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/production/pricing_spec.py +0 -0
  56. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/supplier/__init__.py +0 -0
  57. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/commands/supplier/cmd.py +0 -0
  58. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/config.py +0 -0
  59. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/errors.py +0 -0
  60. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/identity.py +0 -0
  61. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/main.py +0 -0
  62. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/output.py +0 -0
  63. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/posthog_client.py +0 -0
  64. {makea_cli-0.2.15 → makea_cli-0.2.17}/makea_cli/registry.py +0 -0
  65. {makea_cli-0.2.15 → makea_cli-0.2.17}/npm/makea-cli/README.md +0 -0
  66. {makea_cli-0.2.15 → makea_cli-0.2.17}/npm/makea-cli/makea-cli.mjs +0 -0
  67. {makea_cli-0.2.15 → makea_cli-0.2.17}/npm/makea-cli/package.json +0 -0
  68. {makea_cli-0.2.15 → makea_cli-0.2.17}/tests/test_broker.py +0 -0
  69. {makea_cli-0.2.15 → makea_cli-0.2.17}/tests/test_currency_conversion.py +0 -0
  70. {makea_cli-0.2.15 → makea_cli-0.2.17}/tests/test_output_contract.py +0 -0
  71. {makea_cli-0.2.15 → makea_cli-0.2.17}/tests/test_pm_reads.py +0 -0
  72. {makea_cli-0.2.15 → makea_cli-0.2.17}/tests/test_registry.py +0 -0
  73. {makea_cli-0.2.15 → makea_cli-0.2.17}/tests/test_supplier_scorecard.py +0 -0
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.17
4
+
5
+ New: an admin can make and run shipping orders from the CLI. `create
6
+ shipping-order` needs the backend's new `POST /admin/shipping_orders/create`;
7
+ the other commands use endpoints the admin web page already calls.
8
+
9
+ - `admin create shipping-order -p <production_order_id> [-s <sampling_order_id>] …`:
10
+ a shipment owned by the orders' brand (it shows on their Ship page, and the
11
+ fulfilment fee follows their plan); you are recorded as created_by.
12
+ Optional `--mode`, `--status` (default SUBMITTED), `--address`. Orders
13
+ already on a live shipment are refused, and one shipment carries one
14
+ supplier's goods.
15
+ - `admin get shipping-order <id>`: the shipment with its orders, quotes, fees,
16
+ tracking and address.
17
+ - `admin update shipping-order <id>`: any of `--status`, tracking
18
+ (`--tracking-number`, `--tracking-url`, `--shipping-method`, `--carrier-id`),
19
+ `--address`, `--cartons` / `--gross-weight-kg`.
20
+ - `admin create|delete shipping-option`: add or withdraw a freight quote.
21
+ - `admin create|delete shipping-fee`: add or remove a fee on the shipment.
22
+ - `admin delete shipping-order-item <id> -p|-s <order_id>`: take one order off
23
+ a shipment (an emptied shipment is deleted).
24
+ - `admin delete shipping-order <id>`: delete the shipment and free its orders.
25
+
26
+ ## 0.2.16
27
+
28
+ New: an admin can read, add, edit and remove the AI playbook rules of one
29
+ person (backend 2026-10-18, deploy e408a077 or later).
30
+
31
+ - `admin list rule --user <user_id|email> [--status …] [--all]`: every rule
32
+ that holds for the person, from their team, their own account and, for a
33
+ factory, its company. Archived rules only with `--all`.
34
+ - `admin get rule <rule_id> --user …`: one rule with its evidence.
35
+ - `admin create rule --user … --text … --reason …`: admin-authored, active
36
+ unless `--status`. Goes to the team when there is one (`--scope` to pick).
37
+ A repeat or a conflict is refused unless `--force`.
38
+ - `admin update rule <rule_id> --user … --reason …`: text, status,
39
+ applies_to, which products (`--when`) or mode.
40
+ - `admin delete rule <rule_id> --user … --reason …`: archives the rule, the
41
+ way the brand's own dismiss does. It leaves the brand's Rules page and every
42
+ prompt, and Beeboo will not propose the same words again. `update rule
43
+ --status active` brings it back.
44
+
45
+ Every write needs `--reason`; the rule records who changed it, why and what
46
+ it was before. An email on two accounts is refused with both user ids.
47
+
3
48
  ## 0.2.15
4
49
 
5
50
  **Behaviour change: `admin get currency-conversion` returns different
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.15
3
+ Version: 0.2.17
4
4
  Summary: Makea admin CLI (browser login + Makea admin HTTP API)
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: click<9,>=8.1
@@ -92,9 +92,18 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
92
92
  | `makea-cli admin backfill supplier-id` | write(never) | `POST /admin/supplier/backfill_supplier_id_with_quote_requests` | Migrate supplier_id from a wrong UUID to the Cognito user sub (user_id): profile + Cognito supplierReferenceId, optio… | `backfill-supplier-id` |
93
93
  | `makea-cli admin create library-element` | write(auto) | `POST /admin/designer/{user_id}/library_components` | save a reusable component under a designer. Provide --section and --values (see admin get library-schema). | `library-create` |
94
94
  | `makea-cli admin create quote-request` | write(ask) | `POST /admin/supplier/create_quote_request` | create/send a quote request to a supplier for a product (admin). | `create-quote-request` |
95
+ | `makea-cli admin create rule` | write(ask) | `POST /admin/playbook/users/{user}/rules` | add a rule to one person's AI playbook (user_id or email); admin-authored, active unless --status. Refuses a repeat or a conflict unless --force. --reason required. | — |
96
+ | `makea-cli admin create shipping-fee` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/fees/add` | add a fee (fixed amount or percentage) on top of the freight. | — |
97
+ | `makea-cli admin create shipping-option` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/shipping-options` | add one freight quote (provider, speed, price, currency). | — |
98
+ | `makea-cli admin create shipping-order` | write(ask) | `POST /admin/shipping_orders/create` | make a shipment for a brand's production and/or sampling orders. The shipment belongs to the orders' owner; you are r… | — |
95
99
  | `makea-cli admin create supplier` | write(ask) | `POST /admin/supplier/add_supplier` | create supplier from JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the field taxonomy (… | `add-supplier` |
96
100
  | `makea-cli admin create user` | write(never) | `POST /admin/users/create` | register a user and confirm the Cognito account in one step (no verification email). Allowed --user-type values: "Fas… | `create-user` |
97
101
  | `makea-cli admin delete library-element` | write(never) | `DELETE /admin/designer/{user_id}/library_components/{component_id}` | remove a component from the designer's org library. | `library-delete` |
102
+ | `makea-cli admin delete rule` | write(ask) | `DELETE /admin/playbook/users/{user}/rules/{rule_id}` | remove a rule: archived, with who and why kept on it (`update rule --status active` restores it). --reason required. | — |
103
+ | `makea-cli admin delete shipping-fee` | write(ask) | `DELETE /admin/shipping_orders/{shipping_order_id}/fees/{fee_id}/remove` | remove one fee. | — |
104
+ | `makea-cli admin delete shipping-option` | write(ask) | `DELETE /admin/shipping_orders/{shipping_order_id}/shipping-options/{shipping_option_id}/remove` | withdraw one freight quote. | — |
105
+ | `makea-cli admin delete shipping-order` | write(never) | `DELETE /admin/shipping_orders/{shipping_order_id}/delete` | remove a shipment and free its orders. Graded `never`: the backend does not check status, so it removes a paid or in-transit shipment too. | — |
106
+ | `makea-cli admin delete shipping-order-item` | write(ask) | `POST /admin/production_orders/{id}/unlink_from_shipping_order/{shipping_order_id}` | take one production or sampling order off a shipment. A shipment left empty is deleted. | — |
98
107
  | `makea-cli admin download document` | read | `GET /admin/document/download` | save a document file (document id + designer user_id). | `download-document` |
99
108
  | `makea-cli admin download product-document` | read | `GET /admin/document/download` | Resolve product via admin list product-order payload, then GET /admin/document/download. | `download-product-document` |
100
109
  | `makea-cli admin generate pricing-groups` | write(ask) | `POST /admin/production_orders/{id}/details/update` | Lay a production order's variants into pricing groups along one axis (--by style \| colour \| variant \| all) with th… | `production-groups-generate` |
@@ -106,6 +115,8 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
106
115
  | `makea-cli admin get production-pricing` | read | `GET /admin/production_orders/{id}/details` | show a production order's price tiers, MOQ, sizes/colours, pricing groups and cart coverage. | `production-pricing-show` |
107
116
  | `makea-cli admin get quote-request` | read | `GET /admin/quote_requests/{quote_request_id}` | one quote request in full. | — |
108
117
  | `makea-cli admin get revenue-metrics` | read | `GET /admin/business-metrics/cumulative-payment-and-platform-revenue` | platform-wide payment received and platform revenue (service fee + transaction fee) bucketed over a date range. | `get-cumulative-payment-and-platform-revenue` |
118
+ | `makea-cli admin get rule` | read | `GET /admin/playbook/users/{user}/rules/{rule_id}` | one rule in full, with its evidence: where it came from, who changed it and why. | — |
119
+ | `makea-cli admin get shipping-order` | read | `GET /admin/shipping_orders/{shipping_order_id}/details` | one shipment with its production and sampling orders, freight quotes, fees, tracking and address. | — |
109
120
  | `makea-cli admin get supplier-profile-schema` | read | `GET /admin/supplier/profile/schema` | supplier profile v2 schema (section/field taxonomy: sections, fields, options, required rules). | `get-supplier-profile-schema` |
110
121
  | `makea-cli admin get tech-spec-extraction` | read | `GET /admin/products/{id}/extract-tech-specifications` | AI-generate specs (not saved). | `extract-ai-tech-spec` |
111
122
  | `makea-cli admin get top-clicks` | read | `POST /admin/analytics/query` | which buttons/elements get clicked most. | `analytics-top-clicks` |
@@ -116,6 +127,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
116
127
  | `makea-cli admin list production-order` | read | `GET /admin/production_orders?type=PRODUCTION` | 大货 (production) orders only. For restock use admin list restock-order; for shipping use admin list shipping-order. | `list-all-production-orders` |
117
128
  | `makea-cli admin list quote-request` | read | `GET /admin/quote_requests` | quote requests, optionally for one product (--product) or one supplier (--supplier, GET /admin/quote_requests/supplie… | — |
118
129
  | `makea-cli admin list restock-order` | read | `GET /admin/production_orders?type=RESTOCK` | restock orders only. Restock shares the production_orders table; this filters to type=RESTOCK. | `list-all-restock-orders` |
130
+ | `makea-cli admin list rule` | read | `GET /admin/playbook/users/{user}/rules` | every AI playbook rule that holds for one person (team, own account, factory): status, scope, text, which products, effect, source. Archived ones only with --all. | — |
119
131
  | `makea-cli admin list sampling-order` | read | `GET /admin/sampling_orders/get_all` | paginated list of all sampling orders (admin). | `list-all-sampling-orders` |
120
132
  | `makea-cli admin list shipping-order` | read | `GET /admin/shipping_orders` | paginated list of all shipping orders (admin). | `list-all-shipping-orders` |
121
133
  | `makea-cli admin list supplier` | read | `GET /admin/supplier/get_all_suppliers` | list all suppliers (admin). | `list-suppliers` |
@@ -129,6 +141,8 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
129
141
  | `makea-cli admin update library-element` | write(auto) | `PATCH /admin/designer/{user_id}/library_components/{component_id}` | update a component's name and/or values (empty value clears a field). | `library-update` |
130
142
  | `makea-cli admin update quote` | write(ask) | `POST /admin/product/edit_supplier_link_override_info` | admin updates an existing quote (supplier link) in place. Only the options you pass are sent, and the backend leaves … | `update-supplier-quote` |
131
143
  | `makea-cli admin update quote-request` | write(ask) | `PATCH /admin/quote_requests/{quote_request_id}/update` | set a quote request's stage, status and/or due date. Only what you pass is changed. This is the door that unblocks a … | `update-quote-request` |
144
+ | `makea-cli admin update rule` | write(ask) | `PATCH /admin/playbook/users/{user}/rules/{rule_id}` | change a rule's text, status, applies_to, when or mode. --reason required; the rule keeps what it was before. | — |
145
+ | `makea-cli admin update shipping-order` | write(ask) | `PUT /admin/shipping_orders/{shipping_order_id}/status` | Change a shipment: --status (PUT .../status), tracking flags (POST .../tracking), --address (PUT .../shipping-address… | — |
132
146
  | `makea-cli admin update supplier` | write(ask) | `PUT /admin/supplier/update_supplier` | update an existing supplier from a JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the fi… | `update-supplier` |
133
147
  | `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
134
148
  | `makea-cli admin update tracking-status` | write(ask) | `POST /admin/tracking/carrier_status` | apply a carrier status looked up by hand (tracking-sweep skill) to one order: status, fan-out, delivered emails (--silent: state only). | — |
@@ -80,9 +80,18 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
80
80
  | `makea-cli admin backfill supplier-id` | write(never) | `POST /admin/supplier/backfill_supplier_id_with_quote_requests` | Migrate supplier_id from a wrong UUID to the Cognito user sub (user_id): profile + Cognito supplierReferenceId, optio… | `backfill-supplier-id` |
81
81
  | `makea-cli admin create library-element` | write(auto) | `POST /admin/designer/{user_id}/library_components` | save a reusable component under a designer. Provide --section and --values (see admin get library-schema). | `library-create` |
82
82
  | `makea-cli admin create quote-request` | write(ask) | `POST /admin/supplier/create_quote_request` | create/send a quote request to a supplier for a product (admin). | `create-quote-request` |
83
+ | `makea-cli admin create rule` | write(ask) | `POST /admin/playbook/users/{user}/rules` | add a rule to one person's AI playbook (user_id or email); admin-authored, active unless --status. Refuses a repeat or a conflict unless --force. --reason required. | — |
84
+ | `makea-cli admin create shipping-fee` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/fees/add` | add a fee (fixed amount or percentage) on top of the freight. | — |
85
+ | `makea-cli admin create shipping-option` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/shipping-options` | add one freight quote (provider, speed, price, currency). | — |
86
+ | `makea-cli admin create shipping-order` | write(ask) | `POST /admin/shipping_orders/create` | make a shipment for a brand's production and/or sampling orders. The shipment belongs to the orders' owner; you are r… | — |
83
87
  | `makea-cli admin create supplier` | write(ask) | `POST /admin/supplier/add_supplier` | create supplier from JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the field taxonomy (… | `add-supplier` |
84
88
  | `makea-cli admin create user` | write(never) | `POST /admin/users/create` | register a user and confirm the Cognito account in one step (no verification email). Allowed --user-type values: "Fas… | `create-user` |
85
89
  | `makea-cli admin delete library-element` | write(never) | `DELETE /admin/designer/{user_id}/library_components/{component_id}` | remove a component from the designer's org library. | `library-delete` |
90
+ | `makea-cli admin delete rule` | write(ask) | `DELETE /admin/playbook/users/{user}/rules/{rule_id}` | remove a rule: archived, with who and why kept on it (`update rule --status active` restores it). --reason required. | — |
91
+ | `makea-cli admin delete shipping-fee` | write(ask) | `DELETE /admin/shipping_orders/{shipping_order_id}/fees/{fee_id}/remove` | remove one fee. | — |
92
+ | `makea-cli admin delete shipping-option` | write(ask) | `DELETE /admin/shipping_orders/{shipping_order_id}/shipping-options/{shipping_option_id}/remove` | withdraw one freight quote. | — |
93
+ | `makea-cli admin delete shipping-order` | write(never) | `DELETE /admin/shipping_orders/{shipping_order_id}/delete` | remove a shipment and free its orders. Graded `never`: the backend does not check status, so it removes a paid or in-transit shipment too. | — |
94
+ | `makea-cli admin delete shipping-order-item` | write(ask) | `POST /admin/production_orders/{id}/unlink_from_shipping_order/{shipping_order_id}` | take one production or sampling order off a shipment. A shipment left empty is deleted. | — |
86
95
  | `makea-cli admin download document` | read | `GET /admin/document/download` | save a document file (document id + designer user_id). | `download-document` |
87
96
  | `makea-cli admin download product-document` | read | `GET /admin/document/download` | Resolve product via admin list product-order payload, then GET /admin/document/download. | `download-product-document` |
88
97
  | `makea-cli admin generate pricing-groups` | write(ask) | `POST /admin/production_orders/{id}/details/update` | Lay a production order's variants into pricing groups along one axis (--by style \| colour \| variant \| all) with th… | `production-groups-generate` |
@@ -94,6 +103,8 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
94
103
  | `makea-cli admin get production-pricing` | read | `GET /admin/production_orders/{id}/details` | show a production order's price tiers, MOQ, sizes/colours, pricing groups and cart coverage. | `production-pricing-show` |
95
104
  | `makea-cli admin get quote-request` | read | `GET /admin/quote_requests/{quote_request_id}` | one quote request in full. | — |
96
105
  | `makea-cli admin get revenue-metrics` | read | `GET /admin/business-metrics/cumulative-payment-and-platform-revenue` | platform-wide payment received and platform revenue (service fee + transaction fee) bucketed over a date range. | `get-cumulative-payment-and-platform-revenue` |
106
+ | `makea-cli admin get rule` | read | `GET /admin/playbook/users/{user}/rules/{rule_id}` | one rule in full, with its evidence: where it came from, who changed it and why. | — |
107
+ | `makea-cli admin get shipping-order` | read | `GET /admin/shipping_orders/{shipping_order_id}/details` | one shipment with its production and sampling orders, freight quotes, fees, tracking and address. | — |
97
108
  | `makea-cli admin get supplier-profile-schema` | read | `GET /admin/supplier/profile/schema` | supplier profile v2 schema (section/field taxonomy: sections, fields, options, required rules). | `get-supplier-profile-schema` |
98
109
  | `makea-cli admin get tech-spec-extraction` | read | `GET /admin/products/{id}/extract-tech-specifications` | AI-generate specs (not saved). | `extract-ai-tech-spec` |
99
110
  | `makea-cli admin get top-clicks` | read | `POST /admin/analytics/query` | which buttons/elements get clicked most. | `analytics-top-clicks` |
@@ -104,6 +115,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
104
115
  | `makea-cli admin list production-order` | read | `GET /admin/production_orders?type=PRODUCTION` | 大货 (production) orders only. For restock use admin list restock-order; for shipping use admin list shipping-order. | `list-all-production-orders` |
105
116
  | `makea-cli admin list quote-request` | read | `GET /admin/quote_requests` | quote requests, optionally for one product (--product) or one supplier (--supplier, GET /admin/quote_requests/supplie… | — |
106
117
  | `makea-cli admin list restock-order` | read | `GET /admin/production_orders?type=RESTOCK` | restock orders only. Restock shares the production_orders table; this filters to type=RESTOCK. | `list-all-restock-orders` |
118
+ | `makea-cli admin list rule` | read | `GET /admin/playbook/users/{user}/rules` | every AI playbook rule that holds for one person (team, own account, factory): status, scope, text, which products, effect, source. Archived ones only with --all. | — |
107
119
  | `makea-cli admin list sampling-order` | read | `GET /admin/sampling_orders/get_all` | paginated list of all sampling orders (admin). | `list-all-sampling-orders` |
108
120
  | `makea-cli admin list shipping-order` | read | `GET /admin/shipping_orders` | paginated list of all shipping orders (admin). | `list-all-shipping-orders` |
109
121
  | `makea-cli admin list supplier` | read | `GET /admin/supplier/get_all_suppliers` | list all suppliers (admin). | `list-suppliers` |
@@ -117,6 +129,8 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
117
129
  | `makea-cli admin update library-element` | write(auto) | `PATCH /admin/designer/{user_id}/library_components/{component_id}` | update a component's name and/or values (empty value clears a field). | `library-update` |
118
130
  | `makea-cli admin update quote` | write(ask) | `POST /admin/product/edit_supplier_link_override_info` | admin updates an existing quote (supplier link) in place. Only the options you pass are sent, and the backend leaves … | `update-supplier-quote` |
119
131
  | `makea-cli admin update quote-request` | write(ask) | `PATCH /admin/quote_requests/{quote_request_id}/update` | set a quote request's stage, status and/or due date. Only what you pass is changed. This is the door that unblocks a … | `update-quote-request` |
132
+ | `makea-cli admin update rule` | write(ask) | `PATCH /admin/playbook/users/{user}/rules/{rule_id}` | change a rule's text, status, applies_to, when or mode. --reason required; the rule keeps what it was before. | — |
133
+ | `makea-cli admin update shipping-order` | write(ask) | `PUT /admin/shipping_orders/{shipping_order_id}/status` | Change a shipment: --status (PUT .../status), tracking flags (POST .../tracking), --address (PUT .../shipping-address… | — |
120
134
  | `makea-cli admin update supplier` | write(ask) | `PUT /admin/supplier/update_supplier` | update an existing supplier from a JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the fi… | `update-supplier` |
121
135
  | `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
122
136
  | `makea-cli admin update tracking-status` | write(ask) | `POST /admin/tracking/carrier_status` | apply a carrier status looked up by hand (tracking-sweep skill) to one order: status, fan-out, delivered emails (--silent: state only). | — |
@@ -0,0 +1 @@
1
+ __version__ = "0.2.17"
@@ -5,7 +5,7 @@ import mimetypes
5
5
  from pathlib import Path
6
6
  from pathlib import PurePosixPath
7
7
  from typing import Any
8
- from urllib.parse import unquote
8
+ from urllib.parse import quote, unquote
9
9
 
10
10
  import httpx
11
11
 
@@ -197,8 +197,14 @@ def patch_json(path: str, body: Any, *, timeout: float = 60.0) -> Any:
197
197
  return _request("PATCH", path, json_body=body, timeout=timeout)
198
198
 
199
199
 
200
- def delete_json(path: str, *, params: dict[str, Any] | None = None, timeout: float = 60.0) -> Any:
201
- return _request("DELETE", path, params=params, timeout=timeout)
200
+ def delete_json(
201
+ path: str,
202
+ *,
203
+ params: dict[str, Any] | None = None,
204
+ body: Any = None,
205
+ timeout: float = 60.0,
206
+ ) -> Any:
207
+ return _request("DELETE", path, params=params, json_body=body, timeout=timeout)
202
208
 
203
209
 
204
210
  def send_admin_raw_email(body: dict[str, Any]) -> Any:
@@ -760,6 +766,89 @@ def get_all_shipping_orders(
760
766
  return get_json("/admin/shipping_orders", params=params)
761
767
 
762
768
 
769
+ def admin_create_shipping_order(body: dict[str, Any]) -> Any:
770
+ """POST /admin/shipping_orders/create — a shipment for a brand's production/sampling orders."""
771
+ return post_json("/admin/shipping_orders/create", body)
772
+
773
+
774
+ def admin_get_shipping_order(shipping_order_id: str) -> Any:
775
+ """GET /admin/shipping_orders/{id}/details — the shipment with its orders filled in."""
776
+ return get_json(f"/admin/shipping_orders/{shipping_order_id}/details")
777
+
778
+
779
+ def admin_update_shipping_order_status(shipping_order_id: str, status: str) -> Any:
780
+ """PUT /admin/shipping_orders/{id}/status"""
781
+ return put_json(f"/admin/shipping_orders/{shipping_order_id}/status", {"status": status})
782
+
783
+
784
+ def admin_update_shipping_order_tracking(
785
+ shipping_order_id: str, tracking_info: dict[str, Any]
786
+ ) -> Any:
787
+ """POST /admin/shipping_orders/{id}/tracking"""
788
+ return post_json(
789
+ f"/admin/shipping_orders/{shipping_order_id}/tracking", {"tracking_info": tracking_info}
790
+ )
791
+
792
+
793
+ def admin_update_shipping_order_address(
794
+ shipping_order_id: str, shipping_address: dict[str, Any]
795
+ ) -> Any:
796
+ """PUT /admin/shipping_orders/{id}/shipping-address"""
797
+ return put_json(
798
+ f"/admin/shipping_orders/{shipping_order_id}/shipping-address",
799
+ {"shipping_address": shipping_address},
800
+ )
801
+
802
+
803
+ def admin_update_shipping_order_cargo(shipping_order_id: str, cargo: dict[str, Any]) -> Any:
804
+ """PUT /admin/shipping_orders/{id}/cargo — cartons and/or gross_weight_kg."""
805
+ return put_json(f"/admin/shipping_orders/{shipping_order_id}/cargo", cargo)
806
+
807
+
808
+ def admin_delete_shipping_order(shipping_order_id: str) -> Any:
809
+ """DELETE /admin/shipping_orders/{id}/delete — soft delete; unlinks its orders."""
810
+ return delete_json(f"/admin/shipping_orders/{shipping_order_id}/delete")
811
+
812
+
813
+ def admin_add_shipping_option(shipping_order_id: str, option: dict[str, Any]) -> Any:
814
+ """POST /admin/shipping_orders/{id}/shipping-options — one freight quote."""
815
+ return post_json(
816
+ f"/admin/shipping_orders/{shipping_order_id}/shipping-options",
817
+ {"shipping_option": option},
818
+ )
819
+
820
+
821
+ def admin_remove_shipping_option(shipping_order_id: str, shipping_option_id: str) -> Any:
822
+ """DELETE /admin/shipping_orders/{id}/shipping-options/{option_id}/remove"""
823
+ return delete_json(
824
+ f"/admin/shipping_orders/{shipping_order_id}/shipping-options/{shipping_option_id}/remove"
825
+ )
826
+
827
+
828
+ def admin_add_shipping_order_fee(shipping_order_id: str, fee: dict[str, Any]) -> Any:
829
+ """POST /admin/shipping_orders/{id}/fees/add"""
830
+ return post_json(f"/admin/shipping_orders/{shipping_order_id}/fees/add", fee)
831
+
832
+
833
+ def admin_remove_shipping_order_fee(shipping_order_id: str, fee_id: str) -> Any:
834
+ """DELETE /admin/shipping_orders/{id}/fees/{fee_id}/remove"""
835
+ return delete_json(f"/admin/shipping_orders/{shipping_order_id}/fees/{fee_id}/remove")
836
+
837
+
838
+ def admin_unlink_from_shipping_order(
839
+ shipping_order_id: str,
840
+ *,
841
+ production_order_id: str | None = None,
842
+ sampling_order_id: str | None = None,
843
+ ) -> Any:
844
+ """POST /admin/{production|sampling}_orders/{id}/unlink_from_shipping_order/{shipping_order_id}"""
845
+ if production_order_id:
846
+ path = f"/admin/production_orders/{production_order_id}"
847
+ else:
848
+ path = f"/admin/sampling_orders/{sampling_order_id}"
849
+ return post_json(f"{path}/unlink_from_shipping_order/{shipping_order_id}", {})
850
+
851
+
763
852
  def get_misc_payments_by_product(product_id: str) -> Any:
764
853
  """GET /admin/products/{product_id}/misc-payments — misc payments for one product."""
765
854
  return get_json(f"/admin/products/{product_id}/misc-payments")
@@ -1047,6 +1136,51 @@ def admin_delete_library_component(
1047
1136
  )
1048
1137
 
1049
1138
 
1139
+ # --- admin: one person's AI playbook rules ---------------------------------------
1140
+ # Addressed by user_id or email; the backend resolves every scope the person's
1141
+ # rules live in (team, own account, factory) and refuses an email that is on
1142
+ # more than one account. Every write carries a reason the rule keeps.
1143
+
1144
+
1145
+ def _user_rules_path(user: str, rule_id: str | None = None) -> str:
1146
+ path = f"/admin/playbook/users/{quote(user.strip(), safe='@')}/rules"
1147
+ return f"{path}/{quote(rule_id, safe='')}" if rule_id else path
1148
+
1149
+
1150
+ def admin_list_user_rules(
1151
+ user: str, *, status: str | None = None, include_archived: bool = False
1152
+ ) -> Any:
1153
+ """GET /admin/playbook/users/{user}/rules — every rule that holds for one person."""
1154
+ params: dict[str, Any] = {}
1155
+ if status:
1156
+ params["status"] = status
1157
+ if include_archived:
1158
+ params["include_archived"] = "1"
1159
+ return get_json(_user_rules_path(user), params=params or None)
1160
+
1161
+
1162
+ def admin_get_user_rule(user: str, rule_id: str) -> Any:
1163
+ """GET /admin/playbook/users/{user}/rules/{rule_id} — one rule, evidence included."""
1164
+ return get_json(_user_rules_path(user, rule_id))
1165
+
1166
+
1167
+ def admin_create_user_rule(user: str, body: dict[str, Any]) -> Any:
1168
+ """POST /admin/playbook/users/{user}/rules — {text, reason, scope?, applies_to?,
1169
+ when?, mode?, category?, polarity?, status?, force?}."""
1170
+ return post_json(_user_rules_path(user), body)
1171
+
1172
+
1173
+ def admin_update_user_rule(user: str, rule_id: str, body: dict[str, Any]) -> Any:
1174
+ """PATCH /admin/playbook/users/{user}/rules/{rule_id} — {text?, status?,
1175
+ applies_to?, when?, mode?, reason}."""
1176
+ return patch_json(_user_rules_path(user, rule_id), body)
1177
+
1178
+
1179
+ def admin_delete_user_rule(user: str, rule_id: str, reason: str) -> Any:
1180
+ """DELETE /admin/playbook/users/{user}/rules/{rule_id} — archives it, with the reason."""
1181
+ return delete_json(_user_rules_path(user, rule_id), body={"reason": reason})
1182
+
1183
+
1050
1184
  # --- supplier persona: a factory acting on its own RFQs, quotes and orders --------
1051
1185
 
1052
1186
 
@@ -13,8 +13,10 @@ from makea_cli.commands.factory.cmd import register as register_factory
13
13
  from makea_cli.commands.library.cmd import register as register_library
14
14
  from makea_cli.commands.metrics.cmd import register as register_metrics
15
15
  from makea_cli.commands.orders.cmd import register as register_orders
16
+ from makea_cli.commands.playbook.cmd import register as register_playbook
16
17
  from makea_cli.commands.product.cmd import register as register_product
17
18
  from makea_cli.commands.production.cmd import register as register_production
19
+ from makea_cli.commands.shipping.cmd import register as register_shipping
18
20
  from makea_cli.commands.supplier.cmd import register as register_supplier
19
21
 
20
22
 
@@ -26,6 +28,7 @@ def register_all(app: typer.Typer) -> None:
26
28
  register_orders(app)
27
29
  register_product(app)
28
30
  register_production(app)
31
+ register_shipping(app)
29
32
  register_designer(app)
30
33
  register_metrics(app)
31
34
  register_analytics(app)
@@ -33,3 +36,4 @@ def register_all(app: typer.Typer) -> None:
33
36
  register_library(app)
34
37
  register_factory(app)
35
38
  register_brand(app)
39
+ register_playbook(app)