makea-cli 0.2.23__py3-none-any.whl → 0.2.24__py3-none-any.whl

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/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.2.23"
1
+ __version__ = "0.2.24"
makea_cli/api_client.py CHANGED
@@ -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")
@@ -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",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.23
3
+ Version: 0.2.24
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. | — |
@@ -1,6 +1,6 @@
1
- makea_cli/__init__.py,sha256=drfF0qMRjoB2RacyqP-NkNmDOIBrys6RWHvqSTpZLuc,23
1
+ makea_cli/__init__.py,sha256=n5ZPZHIaXZ7sqt8tjkjGM573cZdtdmlQuM7yyyEcMe0,23
2
2
  makea_cli/__main__.py,sha256=AkQjxWfKE3w9iD1d6I-2Zqvv2t9cct0oYyFF0UiA-Z0,144
3
- makea_cli/api_client.py,sha256=SQWPYQzIrm9BqWrraHkhAQeFZjljLHZm_ioSnlcz9ss,75766
3
+ makea_cli/api_client.py,sha256=1Qy2iG0JYu0IRLIi3fDOcCkG2w1IAo8Z61OE0wCLYXw,74891
4
4
  makea_cli/auth_pkce.py,sha256=iXSyJ7DM3qVuj-3FwPiqM25CxXz9ebFs9FNthZdw3ws,7315
5
5
  makea_cli/broker.py,sha256=5O650nAdRuF-u9E1MuVM2jVv796iBdxJGIaJasxHij0,3019
6
6
  makea_cli/config.py,sha256=hz8MnJSkhxcIEZkcpHR005JrDceo1Xmi8qwIUq50cMU,3003
@@ -33,7 +33,7 @@ makea_cli/commands/factory/cmd.py,sha256=k_UGkqpzxxZhN9WjKt1rb95KOTGHMpMJRpfNHTG
33
33
  makea_cli/commands/library/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  makea_cli/commands/library/cmd.py,sha256=eXZa6iLyPaoEWtRd-UmhRT6Ox-zlfs89gJqGn-IPuSU,11187
35
35
  makea_cli/commands/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- makea_cli/commands/metrics/cmd.py,sha256=GvJe83vQu8XSCEulsfDvA60eKnvpIA5ItyMbvxjHQss,12069
36
+ makea_cli/commands/metrics/cmd.py,sha256=gAYNztkhvdK8miP3ayDu0JgYzxLr42-ToeiXBCrAQeA,8656
37
37
  makea_cli/commands/orders/__init__.py,sha256=6WKPqX02e0RRPmItPIBJ0TA4_yDI2PVvBDkAiMQu9rU,75
38
38
  makea_cli/commands/orders/cmd.py,sha256=Nh5lGv5k4SIwsr_hg-ndah8eTorZCYIMpTAz4CCi6oY,13352
39
39
  makea_cli/commands/playbook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -49,7 +49,7 @@ makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNL
49
49
  makea_cli/commands/supplier/cmd.py,sha256=crRCy9WfhkryHMIL3iufoiT90_SG3-mKChAtdhd06uc,58076
50
50
  makea_cli/commands/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  makea_cli/commands/tasks/cmd.py,sha256=SRvv4Ovtcf5-me-8AdKcZ_z_gSrdgC0pbswYbMz7oY4,6539
52
- makea_cli-0.2.23.dist-info/METADATA,sha256=R8vXTZWjsjKrw0eGacTTpI3gCFT3xv8uV41cJ5wqau4,38087
53
- makea_cli-0.2.23.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
54
- makea_cli-0.2.23.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
55
- makea_cli-0.2.23.dist-info/RECORD,,
52
+ makea_cli-0.2.24.dist-info/METADATA,sha256=ea4MmXWcoW3i6Uiav-OLFvlAvm00HTd7zIK6OtjcpSc,37804
53
+ makea_cli-0.2.24.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
54
+ makea_cli-0.2.24.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
55
+ makea_cli-0.2.24.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.32.4
2
+ Generator: hatchling 1.33.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any