makea-cli 0.2.38__py3-none-any.whl → 0.2.39__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.38"
1
+ __version__ = "0.2.39"
makea_cli/api_client.py CHANGED
@@ -973,6 +973,13 @@ def get_growth_snapshot(snapshot_id: str = "latest") -> Any:
973
973
  return get_json(f"/admin/growth/snapshots/{quote(snapshot_id, safe='')}", timeout=120.0)
974
974
 
975
975
 
976
+ def get_engagement_stats(start: str = "", end: str = "", customer: str = "") -> Any:
977
+ """GET /admin/engagement-stats?start=&end=&customer= — brand/factory messages
978
+ and Beeboo's actions per customer and per product. Scans the table: slow-ish."""
979
+ params = {k: v for k, v in (("start", start), ("end", end), ("customer", customer)) if v}
980
+ return get_json("/admin/engagement-stats", params=params, timeout=120.0)
981
+
982
+
976
983
  def import_growth_snapshot(sources_path: Path, *, check_only: bool = False) -> Any:
977
984
  """POST /admin/growth/snapshots — gate and publish one reconciled snapshot.
978
985
 
@@ -133,6 +133,53 @@ def register(app: typer.Typer) -> None:
133
133
 
134
134
  print_json_or_exit(console, _do)
135
135
 
136
+ @command(
137
+ app,
138
+ "admin",
139
+ "get",
140
+ "engagement-stats",
141
+ api="GET /admin/engagement-stats",
142
+ help=(
143
+ "GET /admin/engagement-stats — per customer and per product: messages "
144
+ "brand to factory, factory to brand and makea to factory, Beeboo's "
145
+ "nudges (reminders to the brand, morning emails that carried them, "
146
+ "chases to the factory) and every other action Beeboo took."
147
+ ),
148
+ )
149
+ def get_engagement_stats(
150
+ start: str = typer.Option(None, "--start", help="First day, YYYY-MM-DD (inclusive)."),
151
+ end: str = typer.Option(None, "--end", help="Last day, YYYY-MM-DD (inclusive)."),
152
+ customer: str = typer.Option(
153
+ None, "--customer", "-c", help="Only customers whose name contains this."
154
+ ),
155
+ view: str = typer.Option(
156
+ "all",
157
+ "--view",
158
+ "-v",
159
+ help="all | customers | products | totals | definitions.",
160
+ ),
161
+ ) -> None:
162
+ """A customer is a team (named after its owner's brand) or a lone account.
163
+ Counts come from the threads and Beeboo's day log; nothing is estimated.
164
+
165
+ Output JSON: {"period", "definitions", "totals", "customers", "products"};
166
+ every row has the same counters plus "messages" (the three message
167
+ counts) and "beeboo_actions" (every Beeboo counter). "definitions" says
168
+ what each counter means, in words fit for a slide. --view keeps one part.
169
+ """
170
+ views = ("all", "customers", "products", "totals", "definitions")
171
+ if view not in views:
172
+ console.print(f"[red]--view must be one of {', '.join(views)}.[/red]")
173
+ raise typer.Exit(1)
174
+
175
+ def _do():
176
+ result = (
177
+ api_client.get_engagement_stats(start or "", end or "", customer or "") or {}
178
+ ).get("result") or {}
179
+ return result if view == "all" else result.get(view)
180
+
181
+ print_json_or_exit(console, _do)
182
+
136
183
  @command(
137
184
  app,
138
185
  "admin",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.38
3
+ Version: 0.2.39
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
@@ -130,6 +130,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
130
130
  | `makea-cli admin get analytics-query` | read | `POST /admin/analytics/query` | Run an arbitrary HogQL query (escape hatch). Example: analytics-query "SELECT count() FROM events" | `analytics-query` |
131
131
  | `makea-cli admin get file` | read | local (makea_cli.file_reader) | read a pattern (DXF/RUL/PLT), artwork (AI/EPS/PSD/SVG), embroidery (PES/DST/EMB), ZIP or AVIF/TIFF file on this machine; saves PNG pictures of what it draws next to it. No API call. | — |
132
132
  | `makea-cli admin get currency-conversion` | read | `GET /admin/fx/rates` | the platform's own exchange rates and rounding (rate table for several --from; one --from with --amount converts it). | `convert-currency` |
133
+ | `makea-cli admin get engagement-stats` | read | `GET /admin/engagement-stats` | per customer and per product: messages brand↔factory and makea→factory, Beeboo's nudges (reminders to the brand, the morning emails that carried them, chases to the factory) and its other actions; `--start/--end`, `--customer`, `--view`. | — |
133
134
  | `makea-cli admin get feature-usage` | read | `POST /admin/analytics/query` | How many distinct users used a feature recently, plus event volume. Matches $pageview path and feature_time_spent eve… | `analytics-feature-usage` |
134
135
  | `makea-cli admin get growth-snapshot` | read | `GET /admin/growth/snapshots/{id}` | one reconciled Growth Analysis snapshot (default `latest`); `--block` prints one block (headline, gates, review_items, …). | — |
135
136
  | `makea-cli admin get library-schema` | read | `GET /admin/library_components/schema` | the tech-pack library taxonomy: sections and their library-role field keys (run this before create/update). | `library-schema` |
@@ -1,6 +1,6 @@
1
- makea_cli/__init__.py,sha256=GFASnxYQos3wXWEnb0SyWm8AN1_G5QGZbYyzzpVOW0E,23
1
+ makea_cli/__init__.py,sha256=OLeSZoOE5KDS2bHV78zl4JEvBz59oQbMDw2kbLLG_BU,23
2
2
  makea_cli/__main__.py,sha256=AkQjxWfKE3w9iD1d6I-2Zqvv2t9cct0oYyFF0UiA-Z0,144
3
- makea_cli/api_client.py,sha256=gKRzN9m53_VTcsdAhtGR6UxP70sUeCTKioFU7_TwbHk,90895
3
+ makea_cli/api_client.py,sha256=-tZjD5oh5qbaVf1Rcrrr7qO3zd_gFkZa8QJn-v4L8eE,91322
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/companion.py,sha256=lEEMRDbS-5-CWPawlkPDeCij08pAYW8MsXLVSG3_8V0,10116
@@ -39,7 +39,7 @@ makea_cli/commands/flags/cmd.py,sha256=BC9Vu2h9HKid5S2SNNUqtgQaqTWRx2Ne529gzGmqr
39
39
  makea_cli/commands/library/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  makea_cli/commands/library/cmd.py,sha256=eXZa6iLyPaoEWtRd-UmhRT6Ox-zlfs89gJqGn-IPuSU,11187
41
41
  makea_cli/commands/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
- makea_cli/commands/metrics/cmd.py,sha256=gAYNztkhvdK8miP3ayDu0JgYzxLr42-ToeiXBCrAQeA,8656
42
+ makea_cli/commands/metrics/cmd.py,sha256=juK9vWaQrZCAiDpaGBHlZfKEk7ant0vm-2Ak94Zzz1o,10674
43
43
  makea_cli/commands/order_flow/__init__.py,sha256=SmD-TaDbNZLeu8q1nkPi2H6gJaKCrNAyW3Ejj6-UBog,79
44
44
  makea_cli/commands/order_flow/cmd.py,sha256=epZ7E8vsVzy8bGLQ0e4MmqwvBqp2da1kpFVsXUjwiLg,33479
45
45
  makea_cli/commands/orders/__init__.py,sha256=6WKPqX02e0RRPmItPIBJ0TA4_yDI2PVvBDkAiMQu9rU,75
@@ -59,7 +59,7 @@ makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNL
59
59
  makea_cli/commands/supplier/cmd.py,sha256=12YzQIz8478ksOUbuI7pSwSAwQAqLTvXu-AKjyrwLgA,64039
60
60
  makea_cli/commands/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
61
  makea_cli/commands/tasks/cmd.py,sha256=72MrVigmjjQCpDVF2a3aJn_gclw2iBbJdFmyd87mXec,8549
62
- makea_cli-0.2.38.dist-info/METADATA,sha256=CX23ythdy0eJLfeCUG9mYlcjMdqCnVmh7hfEkZQjtco,51551
63
- makea_cli-0.2.38.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
64
- makea_cli-0.2.38.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
65
- makea_cli-0.2.38.dist-info/RECORD,,
62
+ makea_cli-0.2.39.dist-info/METADATA,sha256=HCO1jPpuIcs6XMGevS9BjW3ygAbv3N8ObVreorn-S5s,51883
63
+ makea_cli-0.2.39.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
64
+ makea_cli-0.2.39.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
65
+ makea_cli-0.2.39.dist-info/RECORD,,