makea-cli 0.2.23__tar.gz → 0.2.25__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 (77) hide show
  1. {makea_cli-0.2.23 → makea_cli-0.2.25}/CHANGELOG.md +20 -0
  2. {makea_cli-0.2.23 → makea_cli-0.2.25}/PKG-INFO +2 -2
  3. {makea_cli-0.2.23 → makea_cli-0.2.25}/README.md +1 -1
  4. makea_cli-0.2.25/makea_cli/__init__.py +1 -0
  5. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/api_client.py +7 -26
  6. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/brand/cmd.py +84 -0
  7. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/metrics/cmd.py +0 -88
  8. {makea_cli-0.2.23 → makea_cli-0.2.25}/pyproject.toml +1 -1
  9. {makea_cli-0.2.23 → makea_cli-0.2.25}/tests/golden_manifest.json +179 -84
  10. {makea_cli-0.2.23 → makea_cli-0.2.25}/uv.lock +1 -1
  11. makea_cli-0.2.23/makea_cli/__init__.py +0 -1
  12. {makea_cli-0.2.23 → makea_cli-0.2.25}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
  13. {makea_cli-0.2.23 → makea_cli-0.2.25}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
  14. {makea_cli-0.2.23 → makea_cli-0.2.25}/.claude/skills/link-supplier-user/SKILL.md +0 -0
  15. {makea_cli-0.2.23 → makea_cli-0.2.25}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
  16. {makea_cli-0.2.23 → makea_cli-0.2.25}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
  17. {makea_cli-0.2.23 → makea_cli-0.2.25}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
  18. {makea_cli-0.2.23 → makea_cli-0.2.25}/.gitignore +0 -0
  19. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea-collection-upload/SKILL.md +0 -0
  20. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea-collection-upload/scripts/create_products.py +0 -0
  21. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/__main__.py +0 -0
  22. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/auth_pkce.py +0 -0
  23. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/broker.py +0 -0
  24. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/__init__.py +0 -0
  25. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/_util.py +0 -0
  26. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/about/__init__.py +0 -0
  27. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/about/cmd.py +0 -0
  28. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/analytics/__init__.py +0 -0
  29. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/analytics/cmd.py +0 -0
  30. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/auth/__init__.py +0 -0
  31. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/auth/cmd.py +0 -0
  32. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/brand/__init__.py +0 -0
  33. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/designer/__init__.py +0 -0
  34. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/designer/cmd.py +0 -0
  35. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/directory/__init__.py +0 -0
  36. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/directory/cmd.py +0 -0
  37. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/document/__init__.py +0 -0
  38. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/document/cmd.py +0 -0
  39. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/email/__init__.py +0 -0
  40. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/email/cmd.py +0 -0
  41. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/factory/__init__.py +0 -0
  42. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/factory/cmd.py +0 -0
  43. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/library/__init__.py +0 -0
  44. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/library/cmd.py +0 -0
  45. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/metrics/__init__.py +0 -0
  46. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/orders/__init__.py +0 -0
  47. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/orders/cmd.py +0 -0
  48. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/playbook/__init__.py +0 -0
  49. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/playbook/cmd.py +0 -0
  50. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/product/__init__.py +0 -0
  51. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/product/cmd.py +0 -0
  52. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/production/__init__.py +0 -0
  53. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/production/cmd.py +0 -0
  54. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/production/pricing_spec.py +0 -0
  55. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/shipping/__init__.py +0 -0
  56. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/shipping/cmd.py +0 -0
  57. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/supplier/__init__.py +0 -0
  58. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/supplier/cmd.py +0 -0
  59. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/tasks/__init__.py +0 -0
  60. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/commands/tasks/cmd.py +0 -0
  61. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/config.py +0 -0
  62. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/errors.py +0 -0
  63. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/identity.py +0 -0
  64. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/main.py +0 -0
  65. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/output.py +0 -0
  66. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/posthog_client.py +0 -0
  67. {makea_cli-0.2.23 → makea_cli-0.2.25}/makea_cli/registry.py +0 -0
  68. {makea_cli-0.2.23 → makea_cli-0.2.25}/npm/makea-cli/README.md +0 -0
  69. {makea_cli-0.2.23 → makea_cli-0.2.25}/npm/makea-cli/makea-cli.mjs +0 -0
  70. {makea_cli-0.2.23 → makea_cli-0.2.25}/npm/makea-cli/package.json +0 -0
  71. {makea_cli-0.2.23 → makea_cli-0.2.25}/tests/test_broker.py +0 -0
  72. {makea_cli-0.2.23 → makea_cli-0.2.25}/tests/test_currency_conversion.py +0 -0
  73. {makea_cli-0.2.23 → makea_cli-0.2.25}/tests/test_output_contract.py +0 -0
  74. {makea_cli-0.2.23 → makea_cli-0.2.25}/tests/test_persona_commands.py +0 -0
  75. {makea_cli-0.2.23 → makea_cli-0.2.25}/tests/test_pm_reads.py +0 -0
  76. {makea_cli-0.2.23 → makea_cli-0.2.25}/tests/test_registry.py +0 -0
  77. {makea_cli-0.2.23 → makea_cli-0.2.25}/tests/test_supplier_scorecard.py +0 -0
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.25
4
+
5
+ New: `designer create proposal`, a tech-pack change as a card on the field it
6
+ changes. Needs the backend from the same day
7
+ (`/designer/products/{id}/tech_spec/proposals`).
8
+
9
+ - Name the section and field as `designer get tech-pack --readable` shows them
10
+ (label or key). Pick a row with `--item "<a value it holds>"` or `--entry N`,
11
+ a line with `--was "<its text>"`; `--action add|delete` for a new row or a
12
+ cleared field. `--file` takes a JSON list for several changes at once.
13
+ - It writes nothing into the pack: the user presses Apply on the card. A
14
+ refusal lists the sections, fields, rows or lines that exist.
15
+ - Graded `auto`, so Beeboo runs it without a confirm button.
16
+
17
+ ## 0.2.24
18
+
19
+ Removed: `admin get revenue-metrics` (legacy `get-cumulative-payment-and-platform-revenue`).
20
+ The backend endpoint is gone; it was never the reconciled figure. Use
21
+ `admin get growth-snapshot` for platform money.
22
+
3
23
  ## 0.2.23
4
24
 
5
25
  New: Growth Analysis snapshots, the numbers on admin Metrics. Needs the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.23
3
+ Version: 0.2.25
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
@@ -119,7 +119,6 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
119
119
  | `makea-cli admin get playbook-preview` | read | `GET /admin/playbook/preview` | the playbook block one AI surface would get for a person or factory, and every rule left out with its reason; --product previews a conversation about one product, --rule answers for one rule. | — |
120
120
  | `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` |
121
121
  | `makea-cli admin get quote-request` | read | `GET /admin/quote_requests/{quote_request_id}` | one quote request in full. | — |
122
- | `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` |
123
122
  | `makea-cli admin get rule` | read | `GET /admin/playbook/{target}/rules/{rule_id}` | one rule in full (`--user` / `--supplier` / `--global`), with its evidence: where it came from, who changed it and why. | — |
124
123
  | `makea-cli admin get rule-history` | read | `GET /admin/playbook/rules/{rule_id}/history` | every revision of one rule: its words, who changed it and why, and the rule that replaced it. | — |
125
124
  | `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. | — |
@@ -211,6 +210,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
211
210
  | `makea-cli designer update note` | write(ask) | `POST /designer/products/{product_id}/notes/{note_id}/{accept\|reject}` | decide on a task the assistant proposed on a product. | — |
212
211
  | `makea-cli designer update product` | write(auto) | `POST /designer/product/update_basic_info` | patch fields on a product. --cover-image / --back-image take a document id and are what the assistant's set_product_i… | — |
213
212
  | `makea-cli designer update production-order` | write(ask) | `POST /designer/production_orders/{production_order_id}/complete` | POST /designer/production_orders/{id}/complete, or PUT the order to re-pick which supplier links it covers (--links-f… | — |
213
+ | `makea-cli designer create proposal` | write(auto) | `POST /designer/products/{product_id}/tech_spec/proposals` | propose a tech-pack change as a card on the field it changes; the user applies it. Name section/field as `get tech-pack --readable` shows them; --item / --entry pick a row, --was a line. | — |
214
214
  | `makea-cli designer update proposal` | write(ask) | `POST /designer/beeboo_proposals/approve` | apply one spec change the assistant proposed. This edits the pack, so read the proposal first. | — |
215
215
  | `makea-cli designer update sampling-order` | write(never) | `POST /designer/sampling_orders/{sampling_order_id}/cancel` | cancel a sample order. Graded `never`: an agent must not do this on its own, a person runs it. | — |
216
216
  | `makea-cli designer update shipping-order` | write(ask) | `POST /designer/shipping_orders/{shipping_order_id}/confirm_receive` | say the goods arrived. The backend accepts this only while the shipment is IN_TRANSIT. | — |
@@ -107,7 +107,6 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
107
107
  | `makea-cli admin get playbook-preview` | read | `GET /admin/playbook/preview` | the playbook block one AI surface would get for a person or factory, and every rule left out with its reason; --product previews a conversation about one product, --rule answers for one rule. | — |
108
108
  | `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` |
109
109
  | `makea-cli admin get quote-request` | read | `GET /admin/quote_requests/{quote_request_id}` | one quote request in full. | — |
110
- | `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` |
111
110
  | `makea-cli admin get rule` | read | `GET /admin/playbook/{target}/rules/{rule_id}` | one rule in full (`--user` / `--supplier` / `--global`), with its evidence: where it came from, who changed it and why. | — |
112
111
  | `makea-cli admin get rule-history` | read | `GET /admin/playbook/rules/{rule_id}/history` | every revision of one rule: its words, who changed it and why, and the rule that replaced it. | — |
113
112
  | `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. | — |
@@ -199,6 +198,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
199
198
  | `makea-cli designer update note` | write(ask) | `POST /designer/products/{product_id}/notes/{note_id}/{accept\|reject}` | decide on a task the assistant proposed on a product. | — |
200
199
  | `makea-cli designer update product` | write(auto) | `POST /designer/product/update_basic_info` | patch fields on a product. --cover-image / --back-image take a document id and are what the assistant's set_product_i… | — |
201
200
  | `makea-cli designer update production-order` | write(ask) | `POST /designer/production_orders/{production_order_id}/complete` | POST /designer/production_orders/{id}/complete, or PUT the order to re-pick which supplier links it covers (--links-f… | — |
201
+ | `makea-cli designer create proposal` | write(auto) | `POST /designer/products/{product_id}/tech_spec/proposals` | propose a tech-pack change as a card on the field it changes; the user applies it. Name section/field as `get tech-pack --readable` shows them; --item / --entry pick a row, --was a line. | — |
202
202
  | `makea-cli designer update proposal` | write(ask) | `POST /designer/beeboo_proposals/approve` | apply one spec change the assistant proposed. This edits the pack, so read the proposal first. | — |
203
203
  | `makea-cli designer update sampling-order` | write(never) | `POST /designer/sampling_orders/{sampling_order_id}/cancel` | cancel a sample order. Graded `never`: an agent must not do this on its own, a person runs it. | — |
204
204
  | `makea-cli designer update shipping-order` | write(ask) | `POST /designer/shipping_orders/{shipping_order_id}/confirm_receive` | say the goods arrived. The backend accepts this only while the shipment is IN_TRANSIT. | — |
@@ -0,0 +1 @@
1
+ __version__ = "0.2.25"
@@ -907,32 +907,6 @@ def update_production_order_details(
907
907
  )
908
908
 
909
909
 
910
- def get_cumulative_payment_and_platform_revenue(
911
- *,
912
- start_date: str,
913
- end_date: str,
914
- granularity: str | None = None,
915
- currency: str | None = None,
916
- order_type: str | None = None,
917
- ) -> Any:
918
- """
919
- GET /admin/business-metrics/cumulative-payment-and-platform-revenue —
920
- platform-wide cumulative payment received and platform revenue (service fee +
921
- transaction fee) within a date range, bucketed by day/week/month.
922
- """
923
- params: dict[str, Any] = {"start_date": start_date, "end_date": end_date}
924
- if granularity is not None:
925
- params["granularity"] = granularity
926
- if currency is not None:
927
- params["currency"] = currency
928
- if order_type is not None:
929
- params["order_type"] = order_type
930
- return get_json(
931
- "/admin/business-metrics/cumulative-payment-and-platform-revenue",
932
- params=params,
933
- )
934
-
935
-
936
910
  def list_growth_snapshots() -> Any:
937
911
  """GET /admin/growth/snapshots — published Growth Analysis snapshots, newest first."""
938
912
  return get_json("/admin/growth/snapshots")
@@ -1760,6 +1734,13 @@ def designer_approve_proposal(note_id: str, proposal_id: str) -> Any:
1760
1734
  )
1761
1735
 
1762
1736
 
1737
+ def designer_create_proposals(product_id: str, proposals: list[dict[str, Any]]) -> Any:
1738
+ """POST /designer/products/{id}/tech_spec/proposals — change cards on the tech pack."""
1739
+ return post_json(
1740
+ f"/designer/products/{product_id}/tech_spec/proposals", {"proposals": proposals}
1741
+ )
1742
+
1743
+
1763
1744
  def designer_bulk_accept_actions(channel_id: str, actions: list[dict[str, str]]) -> Any:
1764
1745
  """POST /designer/channels/{id}/suggested_actions/bulk_accept — accept several at once."""
1765
1746
  return post_json(
@@ -666,6 +666,90 @@ def register(app: typer.Typer) -> None:
666
666
  """Approve one assistant proposal."""
667
667
  print_json_or_exit(console, lambda: api_client.designer_approve_proposal(note, proposal_id))
668
668
 
669
+ @command(
670
+ app,
671
+ "designer",
672
+ "create",
673
+ "proposal",
674
+ api="POST /designer/products/{product_id}/tech_spec/proposals",
675
+ side_effects=[
676
+ "puts a change card on the tech pack; the pack changes only when the user applies it"
677
+ ],
678
+ approval="auto",
679
+ help=(
680
+ "POST /designer/products/{id}/tech_spec/proposals — propose a tech-pack change as a "
681
+ "card on the field it changes. Name the section and field as `get tech-pack "
682
+ "--readable` shows them; pick a row with --item (a value it holds) or --entry, a line "
683
+ "with --was. A refusal lists the sections, fields, rows or lines that exist. "
684
+ "--file takes a JSON list of the same keys for several changes at once."
685
+ ),
686
+ )
687
+ def create_proposal(
688
+ product: str = typer.Option(..., "--product", "-p", help="Product id."),
689
+ section: str | None = typer.Option(
690
+ None, "--section", help='Section, by label or key (e.g. "Trims & hardware").'
691
+ ),
692
+ field: str | None = typer.Option(
693
+ None, "--field", help="Field, by label or key (field-based packs)."
694
+ ),
695
+ value: str | None = typer.Option(None, "--value", help="The new value or line."),
696
+ reason: str | None = typer.Option(
697
+ None, "--reason", help="One line the user reads on the card."
698
+ ),
699
+ action: str = typer.Option(
700
+ "update", "--action", help="update (default), add (a new row or line) or delete."
701
+ ),
702
+ entry: int | None = typer.Option(
703
+ None, "--entry", help="Row number in a repeating section, 0 = first."
704
+ ),
705
+ item: str | None = typer.Option(
706
+ None, "--item", help='Pick the row that holds this value now (e.g. "cord lock").'
707
+ ),
708
+ was: str | None = typer.Option(
709
+ None, "--was", help="Current text of the line to change (line-based packs)."
710
+ ),
711
+ kind: str | None = typer.Option(
712
+ None, "--kind", help="For a new line: spec (default) or note."
713
+ ),
714
+ replaces: list[str] = typer.Option(
715
+ [], "--replaces", help="line_id a new line replaces (repeat)."
716
+ ),
717
+ document: list[str] = typer.Option(
718
+ [], "--document", help="document_id the change comes from (repeat)."
719
+ ),
720
+ file: Path | None = typer.Option(
721
+ None,
722
+ "--file",
723
+ "-f",
724
+ exists=True,
725
+ dir_okay=False,
726
+ help="JSON list of proposals with the keys above, instead of the flags.",
727
+ ),
728
+ ) -> None:
729
+ """Propose tech-pack changes."""
730
+ if file is not None:
731
+ items = json.loads(file.read_text(encoding="utf-8"))
732
+ if not isinstance(items, list):
733
+ raise typer.BadParameter("--file must hold a JSON list of proposals")
734
+ else:
735
+ if not section or not reason:
736
+ raise typer.BadParameter("--section and --reason are required (or --file)")
737
+ one: dict[str, Any] = {
738
+ "section": section,
739
+ "field": field,
740
+ "value": value,
741
+ "reason": reason,
742
+ "action": action,
743
+ "entry": entry,
744
+ "item": item,
745
+ "was": was,
746
+ "kind": kind,
747
+ "replaces": replaces or None,
748
+ "documents": document or None,
749
+ }
750
+ items = [{k: v for k, v in one.items() if v is not None}]
751
+ print_json_or_exit(console, lambda: api_client.designer_create_proposals(product, items))
752
+
669
753
  @command(
670
754
  app,
671
755
  "designer",
@@ -14,96 +14,8 @@ from makea_cli.commands._util import print_json_or_exit
14
14
 
15
15
  console = Console()
16
16
 
17
- _GRANULARITIES = ("day", "week", "month")
18
- _ORDER_TYPES = ("all", "sampling", "production")
19
-
20
17
 
21
18
  def register(app: typer.Typer) -> None:
22
- @command(
23
- app,
24
- "admin",
25
- "get",
26
- "revenue-metrics",
27
- legacy="get-cumulative-payment-and-platform-revenue",
28
- api="GET /admin/business-metrics/cumulative-payment-and-platform-revenue",
29
- help=(
30
- "GET /admin/business-metrics/cumulative-payment-and-platform-revenue — "
31
- "platform-wide payment received and platform revenue (service fee + "
32
- "transaction fee) bucketed over a date range."
33
- ),
34
- )
35
- def get_cumulative_payment_and_platform_revenue(
36
- start_date: str = typer.Option(
37
- ...,
38
- "--start-date",
39
- help="Start date (inclusive), ISO format YYYY-MM-DD.",
40
- ),
41
- end_date: str = typer.Option(
42
- ...,
43
- "--end-date",
44
- help="End date (inclusive), ISO format YYYY-MM-DD.",
45
- ),
46
- granularity: str = typer.Option(
47
- "day",
48
- "--granularity",
49
- "-g",
50
- help="Time bucket: day, week, or month. Default: day.",
51
- ),
52
- currency: str = typer.Option(
53
- "GBP",
54
- "--currency",
55
- "-c",
56
- help="Target currency for conversion. Default: GBP.",
57
- ),
58
- order_type: str = typer.Option(
59
- "all",
60
- "--order-type",
61
- "-t",
62
- help="Filter: all, sampling, or production. Default: all.",
63
- ),
64
- ) -> None:
65
- """
66
- Platform-wide cumulative payment received and platform revenue over a date range.
67
-
68
- Calls GET /admin/business-metrics/cumulative-payment-and-platform-revenue.
69
-
70
- Platform revenue = service fee + transaction fee (the 2.8% transaction fee is
71
- applied by the server). The response contains two siblings under ``result``:
72
-
73
- - ``payment_received``: cumulative/period amounts per bucket, plus a
74
- ``payment_breakdown`` (sampling / production_deposit / production_final).
75
- - ``platform_revenue``: cumulative/period amounts per bucket.
76
-
77
- Input: required --start-date and --end-date (YYYY-MM-DD); optional
78
- --granularity (day|week|month), --currency, --order-type (all|sampling|production).
79
-
80
- Output: raw JSON body from the admin business-metrics endpoint.
81
-
82
- This endpoint is **platform-wide only** and does not support filtering by
83
- user_id, product, or category. For per-user / per-product drill-downs, use
84
- admin list product-order / admin list sampling-order --product /
85
- admin list production-order --product and aggregate client-side.
86
- """
87
- g = granularity.strip().lower()
88
- if g not in _GRANULARITIES:
89
- console.print(f"[red]--granularity must be one of: {', '.join(_GRANULARITIES)}.[/red]")
90
- raise typer.Exit(1)
91
- ot = order_type.strip().lower()
92
- if ot not in _ORDER_TYPES:
93
- console.print(f"[red]--order-type must be one of: {', '.join(_ORDER_TYPES)}.[/red]")
94
- raise typer.Exit(1)
95
-
96
- print_json_or_exit(
97
- console,
98
- lambda: api_client.get_cumulative_payment_and_platform_revenue(
99
- start_date=start_date,
100
- end_date=end_date,
101
- granularity=g,
102
- currency=currency,
103
- order_type=ot,
104
- ),
105
- )
106
-
107
19
  @command(
108
20
  app,
109
21
  "admin",
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "makea-cli"
7
- version = "0.2.23"
7
+ version = "0.2.25"
8
8
  description = "Makea admin CLI (browser login + Makea admin HTTP API)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -2342,90 +2342,6 @@
2342
2342
  }
2343
2343
  ]
2344
2344
  },
2345
- {
2346
- "name": "admin get revenue-metrics",
2347
- "persona": "admin",
2348
- "verb": "get",
2349
- "noun": "revenue-metrics",
2350
- "access": "read",
2351
- "api": "GET /admin/business-metrics/cumulative-payment-and-platform-revenue",
2352
- "external": null,
2353
- "side_effects": [],
2354
- "approval": "auto",
2355
- "reversible": null,
2356
- "idempotent": null,
2357
- "limit": null,
2358
- "legacy": [
2359
- "get-cumulative-payment-and-platform-revenue"
2360
- ],
2361
- "help": "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.",
2362
- "function": "makea_cli.commands.metrics.cmd.register.<locals>.get_cumulative_payment_and_platform_revenue",
2363
- "flags": [
2364
- {
2365
- "name": "start_date",
2366
- "kind": "option",
2367
- "opts": [
2368
- "--start-date"
2369
- ],
2370
- "type": "text",
2371
- "required": true,
2372
- "multiple": false,
2373
- "default": null,
2374
- "help": "Start date (inclusive), ISO format YYYY-MM-DD."
2375
- },
2376
- {
2377
- "name": "end_date",
2378
- "kind": "option",
2379
- "opts": [
2380
- "--end-date"
2381
- ],
2382
- "type": "text",
2383
- "required": true,
2384
- "multiple": false,
2385
- "default": null,
2386
- "help": "End date (inclusive), ISO format YYYY-MM-DD."
2387
- },
2388
- {
2389
- "name": "granularity",
2390
- "kind": "option",
2391
- "opts": [
2392
- "--granularity",
2393
- "-g"
2394
- ],
2395
- "type": "text",
2396
- "required": false,
2397
- "multiple": false,
2398
- "default": "day",
2399
- "help": "Time bucket: day, week, or month. Default: day."
2400
- },
2401
- {
2402
- "name": "currency",
2403
- "kind": "option",
2404
- "opts": [
2405
- "--currency",
2406
- "-c"
2407
- ],
2408
- "type": "text",
2409
- "required": false,
2410
- "multiple": false,
2411
- "default": "GBP",
2412
- "help": "Target currency for conversion. Default: GBP."
2413
- },
2414
- {
2415
- "name": "order_type",
2416
- "kind": "option",
2417
- "opts": [
2418
- "--order-type",
2419
- "-t"
2420
- ],
2421
- "type": "text",
2422
- "required": false,
2423
- "multiple": false,
2424
- "default": "all",
2425
- "help": "Filter: all, sampling, or production. Default: all."
2426
- }
2427
- ]
2428
- },
2429
2345
  {
2430
2346
  "name": "admin get rule",
2431
2347
  "persona": "admin",
@@ -7163,6 +7079,185 @@
7163
7079
  }
7164
7080
  ]
7165
7081
  },
7082
+ {
7083
+ "name": "designer create proposal",
7084
+ "persona": "designer",
7085
+ "verb": "create",
7086
+ "noun": "proposal",
7087
+ "access": "write",
7088
+ "api": "POST /designer/products/{product_id}/tech_spec/proposals",
7089
+ "external": null,
7090
+ "side_effects": [
7091
+ "puts a change card on the tech pack; the pack changes only when the user applies it"
7092
+ ],
7093
+ "approval": "auto",
7094
+ "reversible": null,
7095
+ "idempotent": null,
7096
+ "limit": null,
7097
+ "legacy": [],
7098
+ "help": "POST /designer/products/{id}/tech_spec/proposals — propose a tech-pack change as a card on the field it changes. Name the section and field as `get tech-pack --readable` shows them; pick a row with --item (a value it holds) or --entry, a line with --was. A refusal lists the sections, fields, rows or lines that exist. --file takes a JSON list of the same keys for several changes at once.",
7099
+ "function": "makea_cli.commands.brand.cmd.register.<locals>.create_proposal",
7100
+ "flags": [
7101
+ {
7102
+ "name": "product",
7103
+ "kind": "option",
7104
+ "opts": [
7105
+ "--product",
7106
+ "-p"
7107
+ ],
7108
+ "type": "text",
7109
+ "required": true,
7110
+ "multiple": false,
7111
+ "default": null,
7112
+ "help": "Product id."
7113
+ },
7114
+ {
7115
+ "name": "section",
7116
+ "kind": "option",
7117
+ "opts": [
7118
+ "--section"
7119
+ ],
7120
+ "type": "text",
7121
+ "required": false,
7122
+ "multiple": false,
7123
+ "default": null,
7124
+ "help": "Section, by label or key (e.g. \"Trims & hardware\")."
7125
+ },
7126
+ {
7127
+ "name": "field",
7128
+ "kind": "option",
7129
+ "opts": [
7130
+ "--field"
7131
+ ],
7132
+ "type": "text",
7133
+ "required": false,
7134
+ "multiple": false,
7135
+ "default": null,
7136
+ "help": "Field, by label or key (field-based packs)."
7137
+ },
7138
+ {
7139
+ "name": "value",
7140
+ "kind": "option",
7141
+ "opts": [
7142
+ "--value"
7143
+ ],
7144
+ "type": "text",
7145
+ "required": false,
7146
+ "multiple": false,
7147
+ "default": null,
7148
+ "help": "The new value or line."
7149
+ },
7150
+ {
7151
+ "name": "reason",
7152
+ "kind": "option",
7153
+ "opts": [
7154
+ "--reason"
7155
+ ],
7156
+ "type": "text",
7157
+ "required": false,
7158
+ "multiple": false,
7159
+ "default": null,
7160
+ "help": "One line the user reads on the card."
7161
+ },
7162
+ {
7163
+ "name": "action",
7164
+ "kind": "option",
7165
+ "opts": [
7166
+ "--action"
7167
+ ],
7168
+ "type": "text",
7169
+ "required": false,
7170
+ "multiple": false,
7171
+ "default": "update",
7172
+ "help": "update (default), add (a new row or line) or delete."
7173
+ },
7174
+ {
7175
+ "name": "entry",
7176
+ "kind": "option",
7177
+ "opts": [
7178
+ "--entry"
7179
+ ],
7180
+ "type": "integer",
7181
+ "required": false,
7182
+ "multiple": false,
7183
+ "default": null,
7184
+ "help": "Row number in a repeating section, 0 = first."
7185
+ },
7186
+ {
7187
+ "name": "item",
7188
+ "kind": "option",
7189
+ "opts": [
7190
+ "--item"
7191
+ ],
7192
+ "type": "text",
7193
+ "required": false,
7194
+ "multiple": false,
7195
+ "default": null,
7196
+ "help": "Pick the row that holds this value now (e.g. \"cord lock\")."
7197
+ },
7198
+ {
7199
+ "name": "was",
7200
+ "kind": "option",
7201
+ "opts": [
7202
+ "--was"
7203
+ ],
7204
+ "type": "text",
7205
+ "required": false,
7206
+ "multiple": false,
7207
+ "default": null,
7208
+ "help": "Current text of the line to change (line-based packs)."
7209
+ },
7210
+ {
7211
+ "name": "kind",
7212
+ "kind": "option",
7213
+ "opts": [
7214
+ "--kind"
7215
+ ],
7216
+ "type": "text",
7217
+ "required": false,
7218
+ "multiple": false,
7219
+ "default": null,
7220
+ "help": "For a new line: spec (default) or note."
7221
+ },
7222
+ {
7223
+ "name": "replaces",
7224
+ "kind": "option",
7225
+ "opts": [
7226
+ "--replaces"
7227
+ ],
7228
+ "type": "text",
7229
+ "required": false,
7230
+ "multiple": true,
7231
+ "default": [],
7232
+ "help": "line_id a new line replaces (repeat)."
7233
+ },
7234
+ {
7235
+ "name": "document",
7236
+ "kind": "option",
7237
+ "opts": [
7238
+ "--document"
7239
+ ],
7240
+ "type": "text",
7241
+ "required": false,
7242
+ "multiple": true,
7243
+ "default": [],
7244
+ "help": "document_id the change comes from (repeat)."
7245
+ },
7246
+ {
7247
+ "name": "file",
7248
+ "kind": "option",
7249
+ "opts": [
7250
+ "--file",
7251
+ "-f"
7252
+ ],
7253
+ "type": "file",
7254
+ "required": false,
7255
+ "multiple": false,
7256
+ "default": null,
7257
+ "help": "JSON list of proposals with the keys above, instead of the flags."
7258
+ }
7259
+ ]
7260
+ },
7166
7261
  {
7167
7262
  "name": "designer create quote-award",
7168
7263
  "persona": "designer",
@@ -115,7 +115,7 @@ wheels = [
115
115
 
116
116
  [[package]]
117
117
  name = "makea-cli"
118
- version = "0.2.21"
118
+ version = "0.2.24"
119
119
  source = { editable = "." }
120
120
  dependencies = [
121
121
  { name = "click" },
@@ -1 +0,0 @@
1
- __version__ = "0.2.23"
File without changes
File without changes