makea-cli 0.2.37__tar.gz → 0.2.39__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 (89) hide show
  1. {makea_cli-0.2.37 → makea_cli-0.2.39}/CHANGELOG.md +23 -0
  2. {makea_cli-0.2.37 → makea_cli-0.2.39}/PKG-INFO +4 -1
  3. {makea_cli-0.2.37 → makea_cli-0.2.39}/README.md +3 -0
  4. makea_cli-0.2.39/makea_cli/__init__.py +1 -0
  5. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/api_client.py +20 -0
  6. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/metrics/cmd.py +47 -0
  7. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/order_flow/cmd.py +61 -0
  8. {makea_cli-0.2.37 → makea_cli-0.2.39}/pyproject.toml +1 -1
  9. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/golden_manifest.json +147 -0
  10. {makea_cli-0.2.37 → makea_cli-0.2.39}/uv.lock +1 -1
  11. makea_cli-0.2.37/makea_cli/__init__.py +0 -1
  12. {makea_cli-0.2.37 → makea_cli-0.2.39}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
  13. {makea_cli-0.2.37 → makea_cli-0.2.39}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
  14. {makea_cli-0.2.37 → makea_cli-0.2.39}/.claude/skills/link-supplier-user/SKILL.md +0 -0
  15. {makea_cli-0.2.37 → makea_cli-0.2.39}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
  16. {makea_cli-0.2.37 → makea_cli-0.2.39}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
  17. {makea_cli-0.2.37 → makea_cli-0.2.39}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
  18. {makea_cli-0.2.37 → makea_cli-0.2.39}/.gitignore +0 -0
  19. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea-collection-upload/SKILL.md +0 -0
  20. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea-collection-upload/scripts/create_products.py +0 -0
  21. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/__main__.py +0 -0
  22. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/auth_pkce.py +0 -0
  23. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/broker.py +0 -0
  24. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/__init__.py +0 -0
  25. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/_util.py +0 -0
  26. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/about/__init__.py +0 -0
  27. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/about/cmd.py +0 -0
  28. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/analytics/__init__.py +0 -0
  29. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/analytics/cmd.py +0 -0
  30. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/auth/__init__.py +0 -0
  31. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/auth/cmd.py +0 -0
  32. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/brand/__init__.py +0 -0
  33. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/brand/cmd.py +0 -0
  34. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/designer/__init__.py +0 -0
  35. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/designer/cmd.py +0 -0
  36. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/directory/__init__.py +0 -0
  37. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/directory/cmd.py +0 -0
  38. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/document/__init__.py +0 -0
  39. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/document/cmd.py +0 -0
  40. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/email/__init__.py +0 -0
  41. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/email/cmd.py +0 -0
  42. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/factory/__init__.py +0 -0
  43. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/factory/cmd.py +0 -0
  44. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/files/__init__.py +0 -0
  45. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/files/cmd.py +0 -0
  46. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/flags/__init__.py +0 -0
  47. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/flags/cmd.py +0 -0
  48. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/library/__init__.py +0 -0
  49. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/library/cmd.py +0 -0
  50. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/metrics/__init__.py +0 -0
  51. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/order_flow/__init__.py +0 -0
  52. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/orders/__init__.py +0 -0
  53. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/orders/cmd.py +0 -0
  54. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/playbook/__init__.py +0 -0
  55. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/playbook/cmd.py +0 -0
  56. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/product/__init__.py +0 -0
  57. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/product/cmd.py +0 -0
  58. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/production/__init__.py +0 -0
  59. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/production/cmd.py +0 -0
  60. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/production/pricing_spec.py +0 -0
  61. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/shiplog/__init__.py +0 -0
  62. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/shiplog/cmd.py +0 -0
  63. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/shipping/__init__.py +0 -0
  64. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/shipping/cmd.py +0 -0
  65. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/supplier/__init__.py +0 -0
  66. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/supplier/cmd.py +0 -0
  67. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/tasks/__init__.py +0 -0
  68. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/commands/tasks/cmd.py +0 -0
  69. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/companion.py +0 -0
  70. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/config.py +0 -0
  71. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/errors.py +0 -0
  72. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/file_reader.py +0 -0
  73. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/identity.py +0 -0
  74. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/main.py +0 -0
  75. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/output.py +0 -0
  76. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/posthog_client.py +0 -0
  77. {makea_cli-0.2.37 → makea_cli-0.2.39}/makea_cli/registry.py +0 -0
  78. {makea_cli-0.2.37 → makea_cli-0.2.39}/npm/makea-cli/README.md +0 -0
  79. {makea_cli-0.2.37 → makea_cli-0.2.39}/npm/makea-cli/makea-cli.mjs +0 -0
  80. {makea_cli-0.2.37 → makea_cli-0.2.39}/npm/makea-cli/package.json +0 -0
  81. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_broker.py +0 -0
  82. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_companion.py +0 -0
  83. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_currency_conversion.py +0 -0
  84. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_file_reader.py +0 -0
  85. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_output_contract.py +0 -0
  86. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_persona_commands.py +0 -0
  87. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_pm_reads.py +0 -0
  88. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_registry.py +0 -0
  89. {makea_cli-0.2.37 → makea_cli-0.2.39}/tests/test_supplier_scorecard.py +0 -0
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.39
4
+
5
+ Engagement numbers for sales. Needs the backend with `/admin/engagement-stats`.
6
+
7
+ - `admin get engagement-stats`: per customer (a team counts once) and per
8
+ product, the messages the brand, the factory and makea wrote in factory
9
+ threads, Beeboo's nudges (reminders to the brand, the morning emails that
10
+ carried them, chases to the factory) and its other actions. `--start/--end`
11
+ bound the days, `--customer` filters by name, `--view` keeps one part. Every
12
+ counter comes with a one-line definition fit for a slide.
13
+
14
+ ## 0.2.38
15
+
16
+ Set an order up like the last ones. Needs the backend with the step library.
17
+
18
+ - `designer list step-library <product>`: the steps the brand used on its
19
+ other orders (most used first, with the kind of step each came after), its
20
+ rules that add a step to every order, and this order's steps a new one can
21
+ follow.
22
+ - `designer create custom-steps <product> --file steps.json`: several steps at
23
+ once; each item names `after` (a step id) or `anchor_type` (from the
24
+ library). Graded ask: Beeboo proposes one "Add steps" button for all of them.
25
+
3
26
  ## 0.2.37
4
27
 
5
28
  Steps added alongside, and an order's steps from the brand's and the factory's
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.37
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` |
@@ -213,6 +214,8 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
213
214
  | `makea-cli designer create checkout` | write(ask) | `POST /designer/payments/basket/create-session` | a Stripe checkout link for one or more charges. --key repeats: sampling:<sampling_order_id>, production:<production_o… | — |
214
215
  | `makea-cli designer create collection` | write(auto) | `POST /designer/collections/create` | create or update a designer collection. | `designer-create-collection` |
215
216
  | `makea-cli designer create custom-step` | write(ask) | `POST /designer/products/{product_id}/order_flow/custom_steps` | add a step to your order: `--after`, `--placement inline\|alongside\|beside` (default alongside), `--joins` / `--no-joins`, `--who`, `--done-when`, due, `--note`. | — |
217
+ | `makea-cli designer create custom-steps` | write(ask) | `POST /designer/products/{product_id}/order_flow/custom_steps/batch` | add several steps at once from `--file` (a JSON list; each item names `after` or `anchor_type`). | — |
218
+ | `makea-cli designer list step-library` | read | `GET /designer/products/{product_id}/order_flow/step_library` | steps used on your other orders, your step rules, and this order's steps a new one can follow. | — |
216
219
  | `makea-cli designer create library-element` | write(auto) | `POST /designer/library_components` | add a fabric, trim or other part to the brand's library; --document attaches a photo or data sheet, --draft when required fields are unknown. | — |
217
220
  | `makea-cli designer create note` | write(ask) | `POST /designer/products/{product_id}/notes` | post a message into a product's conversation. | — |
218
221
  | `makea-cli designer create pack-file` | write(auto) | `POST /designer/products/{product_id}/tech_spec/files` | put an uploaded file on a tech pack section; a pattern file (DXF, RUL, PLT) goes on Patterns when no section is named. | — |
@@ -114,6 +114,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
114
114
  | `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` |
115
115
  | `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. | — |
116
116
  | `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` |
117
+ | `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`. | — |
117
118
  | `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` |
118
119
  | `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, …). | — |
119
120
  | `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` |
@@ -197,6 +198,8 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
197
198
  | `makea-cli designer create checkout` | write(ask) | `POST /designer/payments/basket/create-session` | a Stripe checkout link for one or more charges. --key repeats: sampling:<sampling_order_id>, production:<production_o… | — |
198
199
  | `makea-cli designer create collection` | write(auto) | `POST /designer/collections/create` | create or update a designer collection. | `designer-create-collection` |
199
200
  | `makea-cli designer create custom-step` | write(ask) | `POST /designer/products/{product_id}/order_flow/custom_steps` | add a step to your order: `--after`, `--placement inline\|alongside\|beside` (default alongside), `--joins` / `--no-joins`, `--who`, `--done-when`, due, `--note`. | — |
201
+ | `makea-cli designer create custom-steps` | write(ask) | `POST /designer/products/{product_id}/order_flow/custom_steps/batch` | add several steps at once from `--file` (a JSON list; each item names `after` or `anchor_type`). | — |
202
+ | `makea-cli designer list step-library` | read | `GET /designer/products/{product_id}/order_flow/step_library` | steps used on your other orders, your step rules, and this order's steps a new one can follow. | — |
200
203
  | `makea-cli designer create library-element` | write(auto) | `POST /designer/library_components` | add a fabric, trim or other part to the brand's library; --document attaches a photo or data sheet, --draft when required fields are unknown. | — |
201
204
  | `makea-cli designer create note` | write(ask) | `POST /designer/products/{product_id}/notes` | post a message into a product's conversation. | — |
202
205
  | `makea-cli designer create pack-file` | write(auto) | `POST /designer/products/{product_id}/tech_spec/files` | put an uploaded file on a tech pack section; a pattern file (DXF, RUL, PLT) goes on Patterns when no section is named. | — |
@@ -0,0 +1 @@
1
+ __version__ = "0.2.39"
@@ -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
 
@@ -1480,6 +1487,19 @@ def designer_get_order_flow(product_id: str) -> Any:
1480
1487
  return get_json(f"/designer/products/{product_id}/order_flow")
1481
1488
 
1482
1489
 
1490
+ def designer_step_library(product_id: str) -> Any:
1491
+ """GET /designer/products/{id}/order_flow/step_library — the steps the brand
1492
+ used on its other orders, its step rules, and this order's steps a new one
1493
+ may follow."""
1494
+ return get_json(f"/designer/products/{product_id}/order_flow/step_library")
1495
+
1496
+
1497
+ def designer_add_custom_steps(product_id: str, steps: list[dict[str, Any]]) -> Any:
1498
+ """POST /designer/products/{id}/order_flow/custom_steps/batch — several
1499
+ steps at once; each names ``after`` or ``anchor_type``."""
1500
+ return post_json(f"{_designer_step_path(product_id)}/batch", {"steps": steps})
1501
+
1502
+
1483
1503
  def designer_add_custom_step(product_id: str, body: dict[str, Any]) -> Any:
1484
1504
  """POST /designer/products/{id}/order_flow/custom_steps — {label, after, who,
1485
1505
  completion, due, hold, note, placement?, joins?}."""
@@ -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",
@@ -23,6 +23,7 @@ them.
23
23
 
24
24
  from __future__ import annotations
25
25
 
26
+ import json
26
27
  from pathlib import Path
27
28
  from typing import Any
28
29
 
@@ -492,6 +493,66 @@ def _register_designer(app: typer.Typer) -> None:
492
493
  )
493
494
  print_json_or_exit(console, lambda: api_client.designer_add_custom_step(product_id, body))
494
495
 
496
+ @command(
497
+ app,
498
+ "designer",
499
+ "list",
500
+ "step-library",
501
+ api="GET /designer/products/{product_id}/order_flow/step_library",
502
+ help=(
503
+ "Steps you used on your other orders (most used first: name, who does "
504
+ "it, how it is done, the kind of step it came after as anchor_type, how "
505
+ "many orders and which), your rules that add a step to every order, and "
506
+ "this order's steps a new one can follow. Read it before setting an "
507
+ "order up like your last ones."
508
+ ),
509
+ )
510
+ def designer_list_step_library(
511
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
512
+ ) -> None:
513
+ """Steps you used on other orders, to set this one up."""
514
+ print_json_or_exit(console, lambda: api_client.designer_step_library(product_id))
515
+
516
+ @command(
517
+ app,
518
+ "designer",
519
+ "create",
520
+ "custom-steps",
521
+ api="POST /designer/products/{product_id}/order_flow/custom_steps/batch",
522
+ side_effects=[
523
+ "every step shows on your order page, and the factory's when it does it",
524
+ "whoever does a step gets an action card once it opens",
525
+ ],
526
+ approval="ask",
527
+ help=(
528
+ "Add several steps to your order at once, from a JSON list in --file. "
529
+ "Each item: label, who (BRAND, SUPPLIER, MAKEA), completion (check, "
530
+ "upload, send), and either after (a step id) or anchor_type (the kind "
531
+ "of step it follows, as step-library gives it); optional placement "
532
+ "(inline, alongside), hold, note, due ({mode: before, key, days} or "
533
+ "{mode: date, date})."
534
+ ),
535
+ )
536
+ def designer_create_custom_steps(
537
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
538
+ file: Path = typer.Option(
539
+ ...,
540
+ "--file",
541
+ "-f",
542
+ exists=True,
543
+ dir_okay=False,
544
+ help="JSON list of steps.",
545
+ ),
546
+ ) -> None:
547
+ """Add several steps to your order at once."""
548
+ try:
549
+ steps = json.loads(file.read_text(encoding="utf-8"))
550
+ except ValueError as e:
551
+ raise typer.BadParameter(f"--file is not valid JSON: {e}") from e
552
+ if not isinstance(steps, list) or not steps:
553
+ raise typer.BadParameter("--file must hold a JSON list of steps")
554
+ print_json_or_exit(console, lambda: api_client.designer_add_custom_steps(product_id, steps))
555
+
495
556
  @command(
496
557
  app,
497
558
  "designer",
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "makea-cli"
7
- version = "0.2.37"
7
+ version = "0.2.39"
8
8
  description = "Makea admin CLI (browser login + Makea admin HTTP API)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -3122,6 +3122,75 @@
3122
3122
  }
3123
3123
  ]
3124
3124
  },
3125
+ {
3126
+ "name": "admin get engagement-stats",
3127
+ "persona": "admin",
3128
+ "verb": "get",
3129
+ "noun": "engagement-stats",
3130
+ "access": "read",
3131
+ "api": "GET /admin/engagement-stats",
3132
+ "external": null,
3133
+ "side_effects": [],
3134
+ "approval": "auto",
3135
+ "reversible": null,
3136
+ "idempotent": null,
3137
+ "limit": null,
3138
+ "legacy": [],
3139
+ "help": "GET /admin/engagement-stats — per customer and per product: messages brand to factory, factory to brand and makea to factory, Beeboo's nudges (reminders to the brand, morning emails that carried them, chases to the factory) and every other action Beeboo took.",
3140
+ "function": "makea_cli.commands.metrics.cmd.register.<locals>.get_engagement_stats",
3141
+ "flags": [
3142
+ {
3143
+ "name": "start",
3144
+ "kind": "option",
3145
+ "opts": [
3146
+ "--start"
3147
+ ],
3148
+ "type": "text",
3149
+ "required": false,
3150
+ "multiple": false,
3151
+ "default": null,
3152
+ "help": "First day, YYYY-MM-DD (inclusive)."
3153
+ },
3154
+ {
3155
+ "name": "end",
3156
+ "kind": "option",
3157
+ "opts": [
3158
+ "--end"
3159
+ ],
3160
+ "type": "text",
3161
+ "required": false,
3162
+ "multiple": false,
3163
+ "default": null,
3164
+ "help": "Last day, YYYY-MM-DD (inclusive)."
3165
+ },
3166
+ {
3167
+ "name": "customer",
3168
+ "kind": "option",
3169
+ "opts": [
3170
+ "--customer",
3171
+ "-c"
3172
+ ],
3173
+ "type": "text",
3174
+ "required": false,
3175
+ "multiple": false,
3176
+ "default": null,
3177
+ "help": "Only customers whose name contains this."
3178
+ },
3179
+ {
3180
+ "name": "view",
3181
+ "kind": "option",
3182
+ "opts": [
3183
+ "--view",
3184
+ "-v"
3185
+ ],
3186
+ "type": "text",
3187
+ "required": false,
3188
+ "multiple": false,
3189
+ "default": "all",
3190
+ "help": "all | customers | products | totals | definitions."
3191
+ }
3192
+ ]
3193
+ },
3125
3194
  {
3126
3195
  "name": "admin get feature-usage",
3127
3196
  "persona": "admin",
@@ -9956,6 +10025,53 @@
9956
10025
  }
9957
10026
  ]
9958
10027
  },
10028
+ {
10029
+ "name": "designer create custom-steps",
10030
+ "persona": "designer",
10031
+ "verb": "create",
10032
+ "noun": "custom-steps",
10033
+ "access": "write",
10034
+ "api": "POST /designer/products/{product_id}/order_flow/custom_steps/batch",
10035
+ "external": null,
10036
+ "side_effects": [
10037
+ "every step shows on your order page, and the factory's when it does it",
10038
+ "whoever does a step gets an action card once it opens"
10039
+ ],
10040
+ "approval": "ask",
10041
+ "reversible": null,
10042
+ "idempotent": null,
10043
+ "limit": null,
10044
+ "legacy": [],
10045
+ "help": "Add several steps to your order at once, from a JSON list in --file. Each item: label, who (BRAND, SUPPLIER, MAKEA), completion (check, upload, send), and either after (a step id) or anchor_type (the kind of step it follows, as step-library gives it); optional placement (inline, alongside), hold, note, due ({mode: before, key, days} or {mode: date, date}).",
10046
+ "function": "makea_cli.commands.order_flow.cmd._register_designer.<locals>.designer_create_custom_steps",
10047
+ "flags": [
10048
+ {
10049
+ "name": "product_id",
10050
+ "kind": "argument",
10051
+ "opts": [
10052
+ "product_id"
10053
+ ],
10054
+ "type": "text",
10055
+ "required": true,
10056
+ "multiple": false,
10057
+ "default": null,
10058
+ "help": "Product id (the order)."
10059
+ },
10060
+ {
10061
+ "name": "file",
10062
+ "kind": "option",
10063
+ "opts": [
10064
+ "--file",
10065
+ "-f"
10066
+ ],
10067
+ "type": "file",
10068
+ "required": true,
10069
+ "multiple": false,
10070
+ "default": null,
10071
+ "help": "JSON list of steps."
10072
+ }
10073
+ ]
10074
+ },
9959
10075
  {
9960
10076
  "name": "designer create library-element",
9961
10077
  "persona": "designer",
@@ -11725,6 +11841,37 @@
11725
11841
  "function": "makea_cli.commands.brand.cmd.register.<locals>.list_shipping_orders",
11726
11842
  "flags": []
11727
11843
  },
11844
+ {
11845
+ "name": "designer list step-library",
11846
+ "persona": "designer",
11847
+ "verb": "list",
11848
+ "noun": "step-library",
11849
+ "access": "read",
11850
+ "api": "GET /designer/products/{product_id}/order_flow/step_library",
11851
+ "external": null,
11852
+ "side_effects": [],
11853
+ "approval": "auto",
11854
+ "reversible": null,
11855
+ "idempotent": null,
11856
+ "limit": "client",
11857
+ "legacy": [],
11858
+ "help": "Steps you used on your other orders (most used first: name, who does it, how it is done, the kind of step it came after as anchor_type, how many orders and which), your rules that add a step to every order, and this order's steps a new one can follow. Read it before setting an order up like your last ones.",
11859
+ "function": "makea_cli.commands.order_flow.cmd._register_designer.<locals>.designer_list_step_library",
11860
+ "flags": [
11861
+ {
11862
+ "name": "product_id",
11863
+ "kind": "argument",
11864
+ "opts": [
11865
+ "product_id"
11866
+ ],
11867
+ "type": "text",
11868
+ "required": true,
11869
+ "multiple": false,
11870
+ "default": null,
11871
+ "help": "Product id (the order)."
11872
+ }
11873
+ ]
11874
+ },
11728
11875
  {
11729
11876
  "name": "designer list supplier-link",
11730
11877
  "persona": "designer",
@@ -119,7 +119,7 @@ wheels = [
119
119
 
120
120
  [[package]]
121
121
  name = "makea-cli"
122
- version = "0.2.32"
122
+ version = "0.2.39"
123
123
  source = { editable = "." }
124
124
  dependencies = [
125
125
  { name = "click" },
@@ -1 +0,0 @@
1
- __version__ = "0.2.37"
File without changes
File without changes