makea-cli 0.2.26__tar.gz → 0.2.27__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.
- {makea_cli-0.2.26 → makea_cli-0.2.27}/CHANGELOG.md +13 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/PKG-INFO +3 -3
- {makea_cli-0.2.26 → makea_cli-0.2.27}/README.md +2 -2
- makea_cli-0.2.27/makea_cli/__init__.py +1 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/api_client.py +7 -2
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/tasks/cmd.py +53 -15
- {makea_cli-0.2.26 → makea_cli-0.2.27}/pyproject.toml +1 -1
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/golden_manifest.json +32 -6
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/test_persona_commands.py +20 -1
- makea_cli-0.2.26/makea_cli/__init__.py +0 -1
- {makea_cli-0.2.26 → makea_cli-0.2.27}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/.claude/skills/link-supplier-user/SKILL.md +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/.gitignore +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea-collection-upload/SKILL.md +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea-collection-upload/scripts/create_products.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/__main__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/auth_pkce.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/broker.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/_util.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/about/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/about/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/analytics/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/analytics/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/auth/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/auth/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/brand/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/brand/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/designer/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/designer/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/directory/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/directory/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/document/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/document/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/email/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/email/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/factory/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/factory/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/flags/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/flags/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/library/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/library/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/metrics/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/metrics/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/orders/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/orders/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/playbook/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/playbook/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/product/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/product/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/production/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/production/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/production/pricing_spec.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/shipping/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/shipping/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/supplier/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/supplier/cmd.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/commands/tasks/__init__.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/companion.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/config.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/errors.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/identity.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/main.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/output.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/posthog_client.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/makea_cli/registry.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/npm/makea-cli/README.md +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/npm/makea-cli/makea-cli.mjs +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/npm/makea-cli/package.json +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/test_broker.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/test_companion.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/test_currency_conversion.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/test_output_contract.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/test_pm_reads.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/test_registry.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/tests/test_supplier_scorecard.py +0 -0
- {makea_cli-0.2.26 → makea_cli-0.2.27}/uv.lock +0 -0
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.27
|
|
4
|
+
|
|
5
|
+
Notes and misfires on the Makea task queue.
|
|
6
|
+
|
|
7
|
+
- `admin update task <id> --note "…"` alone adds a note (who was asked, what
|
|
8
|
+
the team is waiting on) and leaves the task open.
|
|
9
|
+
- `admin update task <id> --dismiss --wrong --note "…"`: the task should never
|
|
10
|
+
have been raised, and the note says why. On a lesson Beeboo held, its next
|
|
11
|
+
reading of the chats is told and raises nothing on the same message again.
|
|
12
|
+
- `admin list task --wrong`: every task marked wrong, newest first, with why.
|
|
13
|
+
|
|
14
|
+
The same queue is on the admin page under Makea tasks.
|
|
15
|
+
|
|
3
16
|
## 0.2.26
|
|
4
17
|
|
|
5
18
|
The admin page is now the CLI's companion. Every `makea-cli admin …` result
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: makea-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.27
|
|
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
|
|
@@ -152,7 +152,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
152
152
|
| `makea-cli admin list shipping-order` | read | `GET /admin/shipping_orders` | paginated list of all shipping orders (admin). | `list-all-shipping-orders` |
|
|
153
153
|
| `makea-cli admin list supplier` | read | `GET /admin/supplier/get_all_suppliers` | list all suppliers (admin). | `list-suppliers` |
|
|
154
154
|
| `makea-cli admin list supplier-link` | read | `GET /admin/product/linked_suppliers/by_supplier/{supplier_id}` | direct backend query. | `get-supplier-links-by-supplier-id` |
|
|
155
|
-
| `makea-cli admin list task` | read | `GET /admin/tasks` | the Makea team's open tasks (Beeboo's notes, held lessons, sample price flags, PP samples, brand asks) by kind; `--user` adds that account's own `account.*` cards. | — |
|
|
155
|
+
| `makea-cli admin list task` | read | `GET /admin/tasks` | the Makea team's open tasks (Beeboo's notes, held lessons, sample price flags, PP samples, brand asks) by kind, with notes; `--user` adds that account's own `account.*` cards; `--wrong` lists the tasks marked wrong instead. | — |
|
|
156
156
|
| `makea-cli admin list user` | read | `GET /admin/users` | list registered users (admin, optional pagination). | `list-users` |
|
|
157
157
|
| `makea-cli admin send email` | write(ask) | `POST /admin/email/send` | queue an HTML email (To required, Cc optional). From must be @makea.co; HTML from --html-file or stdin ('-'). Require… | `send-email` |
|
|
158
158
|
| `makea-cli admin set pricing-groups` | write(ask) | `POST /admin/production_orders/{id}/details/update` | Set a production order's pricing groups from a JSON file, copy them from the order's quote, or clear them (--clear) t… | `production-groups-set` |
|
|
@@ -175,7 +175,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
175
175
|
| `makea-cli admin update sampling-order` | write(ask) | `PUT /admin/sampling_orders/{sampling_order_id}/status` | move a sampling order to another status (DRAFT, IN_PROGRESS, SAMPLING_COMPLETED, APPROVAL, SHIPPED, DELIVERED, CANCELLED). PAID is recorded by the payment and is refused here. Prefer admin update product-step, which moves the same statuses through the step model. | — |
|
|
176
176
|
| `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… | — |
|
|
177
177
|
| `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` |
|
|
178
|
-
| `makea-cli admin update task` | write(ask) | `POST /admin/tasks/{task_id}/{done\|dismiss}` | close a Makea task with a note: `--done` once handled (a held lesson's `--reason` goes to Beeboo's next reading), or `--dismiss
|
|
178
|
+
| `makea-cli admin update task` | write(ask) | `POST /admin/tasks/{task_id}/{done\|dismiss\|note}` | close a Makea task with a note: `--done` once handled (a held lesson's `--reason` goes to Beeboo's next reading), `--dismiss`, or `--dismiss --wrong` when it should never have been raised; `--note` alone adds a note and leaves it open. | — |
|
|
179
179
|
| `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
|
|
180
180
|
| `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). | — |
|
|
181
181
|
| `makea-cli admin update user` | write(ask) | `PUT /admin/user-profiles/{user_id}/update` | admin updates DynamoDB user profile fields and/or Cognito custom:userType. Allowed --user-type values: "Fashion brand… | `update-user-profile` |
|
|
@@ -140,7 +140,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
140
140
|
| `makea-cli admin list shipping-order` | read | `GET /admin/shipping_orders` | paginated list of all shipping orders (admin). | `list-all-shipping-orders` |
|
|
141
141
|
| `makea-cli admin list supplier` | read | `GET /admin/supplier/get_all_suppliers` | list all suppliers (admin). | `list-suppliers` |
|
|
142
142
|
| `makea-cli admin list supplier-link` | read | `GET /admin/product/linked_suppliers/by_supplier/{supplier_id}` | direct backend query. | `get-supplier-links-by-supplier-id` |
|
|
143
|
-
| `makea-cli admin list task` | read | `GET /admin/tasks` | the Makea team's open tasks (Beeboo's notes, held lessons, sample price flags, PP samples, brand asks) by kind; `--user` adds that account's own `account.*` cards. | — |
|
|
143
|
+
| `makea-cli admin list task` | read | `GET /admin/tasks` | the Makea team's open tasks (Beeboo's notes, held lessons, sample price flags, PP samples, brand asks) by kind, with notes; `--user` adds that account's own `account.*` cards; `--wrong` lists the tasks marked wrong instead. | — |
|
|
144
144
|
| `makea-cli admin list user` | read | `GET /admin/users` | list registered users (admin, optional pagination). | `list-users` |
|
|
145
145
|
| `makea-cli admin send email` | write(ask) | `POST /admin/email/send` | queue an HTML email (To required, Cc optional). From must be @makea.co; HTML from --html-file or stdin ('-'). Require… | `send-email` |
|
|
146
146
|
| `makea-cli admin set pricing-groups` | write(ask) | `POST /admin/production_orders/{id}/details/update` | Set a production order's pricing groups from a JSON file, copy them from the order's quote, or clear them (--clear) t… | `production-groups-set` |
|
|
@@ -163,7 +163,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
163
163
|
| `makea-cli admin update sampling-order` | write(ask) | `PUT /admin/sampling_orders/{sampling_order_id}/status` | move a sampling order to another status (DRAFT, IN_PROGRESS, SAMPLING_COMPLETED, APPROVAL, SHIPPED, DELIVERED, CANCELLED). PAID is recorded by the payment and is refused here. Prefer admin update product-step, which moves the same statuses through the step model. | — |
|
|
164
164
|
| `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… | — |
|
|
165
165
|
| `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` |
|
|
166
|
-
| `makea-cli admin update task` | write(ask) | `POST /admin/tasks/{task_id}/{done\|dismiss}` | close a Makea task with a note: `--done` once handled (a held lesson's `--reason` goes to Beeboo's next reading), or `--dismiss
|
|
166
|
+
| `makea-cli admin update task` | write(ask) | `POST /admin/tasks/{task_id}/{done\|dismiss\|note}` | close a Makea task with a note: `--done` once handled (a held lesson's `--reason` goes to Beeboo's next reading), `--dismiss`, or `--dismiss --wrong` when it should never have been raised; `--note` alone adds a note and leaves it open. | — |
|
|
167
167
|
| `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
|
|
168
168
|
| `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). | — |
|
|
169
169
|
| `makea-cli admin update user` | write(ask) | `PUT /admin/user-profiles/{user_id}/update` | admin updates DynamoDB user profile fields and/or Cognito custom:userType. Allowed --user-type values: "Fashion brand… | `update-user-profile` |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.27"
|
|
@@ -1195,8 +1195,12 @@ def admin_list_tasks(
|
|
|
1195
1195
|
type_: str | None = None,
|
|
1196
1196
|
user: str | None = None,
|
|
1197
1197
|
product: str | None = None,
|
|
1198
|
+
wrong: bool = False,
|
|
1198
1199
|
) -> Any:
|
|
1199
|
-
"""GET /admin/tasks — the team's open tasks; filters are comma-separated.
|
|
1200
|
+
"""GET /admin/tasks — the team's open tasks; filters are comma-separated.
|
|
1201
|
+
``wrong``: the tasks the team marked wrong instead, newest first."""
|
|
1202
|
+
if wrong:
|
|
1203
|
+
return get_json("/admin/tasks", params={"wrong": "1"})
|
|
1200
1204
|
params = {
|
|
1201
1205
|
k: v
|
|
1202
1206
|
for k, v in (("kind", kind), ("type", type_), ("user", user), ("product", product))
|
|
@@ -1211,7 +1215,8 @@ def admin_get_task(task_id: str) -> Any:
|
|
|
1211
1215
|
|
|
1212
1216
|
|
|
1213
1217
|
def admin_close_task(task_id: str, verb: str, body: dict[str, Any]) -> Any:
|
|
1214
|
-
"""POST /admin/tasks/{task_id}/{done|dismiss} — {note, reason?, caused_by?,
|
|
1218
|
+
"""POST /admin/tasks/{task_id}/{done|dismiss|note} — {note, reason?, caused_by?,
|
|
1219
|
+
recurs?, wrong?}. ``note`` adds a note and leaves the task open."""
|
|
1215
1220
|
return post_json(f"/admin/tasks/{quote(task_id, safe='')}/{verb}", body)
|
|
1216
1221
|
|
|
1217
1222
|
|
|
@@ -12,7 +12,10 @@ read as one order's problem), ``note`` (a slip of Makea's or the platform's),
|
|
|
12
12
|
|
|
13
13
|
The change a task asks for is made with the command that owns it (``admin
|
|
14
14
|
create rule``, ``admin update user``, ``admin update about`` …); ``update
|
|
15
|
-
task --done`` then records that it was handled.
|
|
15
|
+
task --done`` then records that it was handled. ``update task --note`` alone
|
|
16
|
+
adds a note and leaves the task open; ``--dismiss --wrong`` says the task
|
|
17
|
+
should never have been raised (Beeboo's next reading is told, and ``list
|
|
18
|
+
task --wrong`` lists every such task). Only notes the team handles
|
|
16
19
|
off the platform can be marked done; the others close by themselves when the
|
|
17
20
|
fact behind them lands, and ``get task`` says which fact.
|
|
18
21
|
"""
|
|
@@ -44,6 +47,10 @@ Examples
|
|
|
44
47
|
makea-cli admin update task <task_id> --done --note "Asked the brand on WhatsApp" \\
|
|
45
48
|
--reason "The brand changed the cuff after approval" --caused-by brand --once
|
|
46
49
|
makea-cli admin update task <task_id> --dismiss --note "Brand keeps GBP"
|
|
50
|
+
makea-cli admin update task <task_id> --note "Asked the brand, waiting"
|
|
51
|
+
makea-cli admin update task <task_id> --dismiss --wrong \
|
|
52
|
+
--note "The factory was confirming the file, not reporting a mistake"
|
|
53
|
+
makea-cli admin list task --wrong
|
|
47
54
|
""".strip()
|
|
48
55
|
|
|
49
56
|
|
|
@@ -56,8 +63,9 @@ def register(app: typer.Typer) -> None:
|
|
|
56
63
|
api="GET /admin/tasks",
|
|
57
64
|
help=(
|
|
58
65
|
"GET /admin/tasks — the Makea team's open tasks: task_id, type, kind, title, "
|
|
59
|
-
"owner (the account), product, due date, can_mark_done; counts by kind. "
|
|
60
|
-
"--user adds that account's own cards the team may settle (account.*)."
|
|
66
|
+
"owner (the account), product, due date, can_mark_done, notes; counts by kind. "
|
|
67
|
+
"--user adds that account's own cards the team may settle (account.*). "
|
|
68
|
+
"--wrong lists the tasks the team marked wrong instead, newest first."
|
|
61
69
|
),
|
|
62
70
|
epilog=_TASKS_EPILOG,
|
|
63
71
|
)
|
|
@@ -72,11 +80,18 @@ def register(app: typer.Typer) -> None:
|
|
|
72
80
|
None, "--user", "-u", help="One account: user_id or email."
|
|
73
81
|
),
|
|
74
82
|
product: str | None = typer.Option(None, "--product", "-p", help="One product id."),
|
|
83
|
+
wrong: bool = typer.Option(
|
|
84
|
+
False, "--wrong", help="The tasks marked wrong (closed), with why, newest first."
|
|
85
|
+
),
|
|
75
86
|
) -> None:
|
|
76
|
-
"""List the Makea team's open tasks."""
|
|
87
|
+
"""List the Makea team's open tasks, or the ones marked wrong."""
|
|
88
|
+
if wrong and (kind or type_ or user or product):
|
|
89
|
+
raise typer.BadParameter("--wrong takes no filters")
|
|
77
90
|
print_json_or_exit(
|
|
78
91
|
console,
|
|
79
|
-
lambda: api_client.admin_list_tasks(
|
|
92
|
+
lambda: api_client.admin_list_tasks(
|
|
93
|
+
kind=kind, type_=type_, user=user, product=product, wrong=wrong
|
|
94
|
+
),
|
|
80
95
|
)
|
|
81
96
|
|
|
82
97
|
@command(
|
|
@@ -101,19 +116,23 @@ def register(app: typer.Typer) -> None:
|
|
|
101
116
|
"admin",
|
|
102
117
|
"update",
|
|
103
118
|
"task",
|
|
104
|
-
api="POST /admin/tasks/{task_id}/{done|dismiss}",
|
|
119
|
+
api="POST /admin/tasks/{task_id}/{done|dismiss|note}",
|
|
105
120
|
side_effects=[
|
|
106
|
-
"closes the task for the whole Makea team",
|
|
121
|
+
"with --done or --dismiss, closes the task for the whole Makea team",
|
|
122
|
+
"with --note alone, adds a note the team sees; the task stays open",
|
|
107
123
|
"with --reason, Beeboo's next reading of the chats uses that reason",
|
|
124
|
+
"with --wrong, Beeboo's next reading is told the finding was wrong",
|
|
108
125
|
],
|
|
109
126
|
approval="ask",
|
|
110
127
|
reversible=False,
|
|
111
128
|
idempotent=False,
|
|
112
129
|
help=(
|
|
113
|
-
"POST /admin/tasks/{task_id}/{done|dismiss} — close a task: --done once
|
|
114
|
-
"handled (notes the team handles off the platform only), --dismiss when
|
|
115
|
-
"will not be done
|
|
116
|
-
"
|
|
130
|
+
"POST /admin/tasks/{task_id}/{done|dismiss|note} — close a task: --done once "
|
|
131
|
+
"it is handled (notes the team handles off the platform only), --dismiss when "
|
|
132
|
+
"it will not be done, --dismiss --wrong when it should never have been raised "
|
|
133
|
+
"(the note says why). --note required; --note alone adds a note and leaves the "
|
|
134
|
+
"task open. On a held lesson, --reason records why it happened for Beeboo's "
|
|
135
|
+
"next reading."
|
|
117
136
|
),
|
|
118
137
|
epilog=_TASKS_EPILOG,
|
|
119
138
|
)
|
|
@@ -121,7 +140,17 @@ def register(app: typer.Typer) -> None:
|
|
|
121
140
|
task_id: str = typer.Argument(..., help="Task id (from list task)."),
|
|
122
141
|
done: bool = typer.Option(False, "--done", help="It was handled."),
|
|
123
142
|
dismiss: bool = typer.Option(False, "--dismiss", help="It will not be done."),
|
|
124
|
-
|
|
143
|
+
wrong: bool = typer.Option(
|
|
144
|
+
False,
|
|
145
|
+
"--wrong",
|
|
146
|
+
help="With --dismiss: it should never have been raised; --note says why.",
|
|
147
|
+
),
|
|
148
|
+
note: str = typer.Option(
|
|
149
|
+
...,
|
|
150
|
+
"--note",
|
|
151
|
+
"-n",
|
|
152
|
+
help="What was done, or why not (required). Alone: a note; the task stays open.",
|
|
153
|
+
),
|
|
125
154
|
reason: str | None = typer.Option(
|
|
126
155
|
None,
|
|
127
156
|
"--reason",
|
|
@@ -136,13 +165,22 @@ def register(app: typer.Typer) -> None:
|
|
|
136
165
|
help="With --reason: it will happen again, or it was this order only.",
|
|
137
166
|
),
|
|
138
167
|
) -> None:
|
|
139
|
-
"""Mark a task done, or
|
|
140
|
-
if done
|
|
141
|
-
raise typer.BadParameter("pass
|
|
168
|
+
"""Mark a task done, dismiss it, or add a note."""
|
|
169
|
+
if done and dismiss:
|
|
170
|
+
raise typer.BadParameter("pass at most one of --done, --dismiss")
|
|
171
|
+
if wrong and not dismiss:
|
|
172
|
+
raise typer.BadParameter("--wrong goes with --dismiss")
|
|
142
173
|
clean_note = " ".join(note.split())
|
|
143
174
|
if not clean_note:
|
|
144
175
|
raise typer.BadParameter("--note must not be empty")
|
|
145
176
|
body: dict[str, Any] = {"note": clean_note}
|
|
177
|
+
if not (done or dismiss):
|
|
178
|
+
if reason is not None or caused_by is not None or recurs is not None:
|
|
179
|
+
raise typer.BadParameter("--reason, --caused-by, --recurs/--once go with --done")
|
|
180
|
+
print_json_or_exit(console, lambda: api_client.admin_close_task(task_id, "note", body))
|
|
181
|
+
return
|
|
182
|
+
if wrong:
|
|
183
|
+
body["wrong"] = True
|
|
146
184
|
if reason is not None:
|
|
147
185
|
if not done:
|
|
148
186
|
raise typer.BadParameter("--reason goes with --done")
|
|
@@ -3874,7 +3874,7 @@
|
|
|
3874
3874
|
"idempotent": null,
|
|
3875
3875
|
"limit": "client",
|
|
3876
3876
|
"legacy": [],
|
|
3877
|
-
"help": "GET /admin/tasks — the Makea team's open tasks: task_id, type, kind, title, owner (the account), product, due date, can_mark_done; counts by kind. --user adds that account's own cards the team may settle (account.*).",
|
|
3877
|
+
"help": "GET /admin/tasks — the Makea team's open tasks: task_id, type, kind, title, owner (the account), product, due date, can_mark_done, notes; counts by kind. --user adds that account's own cards the team may settle (account.*). --wrong lists the tasks the team marked wrong instead, newest first.",
|
|
3878
3878
|
"function": "makea_cli.commands.tasks.cmd.register.<locals>.list_tasks",
|
|
3879
3879
|
"flags": [
|
|
3880
3880
|
{
|
|
@@ -3927,6 +3927,18 @@
|
|
|
3927
3927
|
"multiple": false,
|
|
3928
3928
|
"default": null,
|
|
3929
3929
|
"help": "One product id."
|
|
3930
|
+
},
|
|
3931
|
+
{
|
|
3932
|
+
"name": "wrong",
|
|
3933
|
+
"kind": "option",
|
|
3934
|
+
"opts": [
|
|
3935
|
+
"--wrong"
|
|
3936
|
+
],
|
|
3937
|
+
"type": "flag",
|
|
3938
|
+
"required": false,
|
|
3939
|
+
"multiple": false,
|
|
3940
|
+
"default": false,
|
|
3941
|
+
"help": "The tasks marked wrong (closed), with why, newest first."
|
|
3930
3942
|
}
|
|
3931
3943
|
]
|
|
3932
3944
|
},
|
|
@@ -6692,18 +6704,20 @@
|
|
|
6692
6704
|
"verb": "update",
|
|
6693
6705
|
"noun": "task",
|
|
6694
6706
|
"access": "write",
|
|
6695
|
-
"api": "POST /admin/tasks/{task_id}/{done|dismiss}",
|
|
6707
|
+
"api": "POST /admin/tasks/{task_id}/{done|dismiss|note}",
|
|
6696
6708
|
"external": null,
|
|
6697
6709
|
"side_effects": [
|
|
6698
|
-
"closes the task for the whole Makea team",
|
|
6699
|
-
"with --
|
|
6710
|
+
"with --done or --dismiss, closes the task for the whole Makea team",
|
|
6711
|
+
"with --note alone, adds a note the team sees; the task stays open",
|
|
6712
|
+
"with --reason, Beeboo's next reading of the chats uses that reason",
|
|
6713
|
+
"with --wrong, Beeboo's next reading is told the finding was wrong"
|
|
6700
6714
|
],
|
|
6701
6715
|
"approval": "ask",
|
|
6702
6716
|
"reversible": false,
|
|
6703
6717
|
"idempotent": false,
|
|
6704
6718
|
"limit": null,
|
|
6705
6719
|
"legacy": [],
|
|
6706
|
-
"help": "POST /admin/tasks/{task_id}/{done|dismiss} — close a task: --done once it is handled (notes the team handles off the platform only), --dismiss when it will not be done. --note required. On a held lesson, --reason records why it happened for Beeboo's next reading.",
|
|
6720
|
+
"help": "POST /admin/tasks/{task_id}/{done|dismiss|note} — close a task: --done once it is handled (notes the team handles off the platform only), --dismiss when it will not be done, --dismiss --wrong when it should never have been raised (the note says why). --note required; --note alone adds a note and leaves the task open. On a held lesson, --reason records why it happened for Beeboo's next reading.",
|
|
6707
6721
|
"function": "makea_cli.commands.tasks.cmd.register.<locals>.update_task",
|
|
6708
6722
|
"flags": [
|
|
6709
6723
|
{
|
|
@@ -6742,6 +6756,18 @@
|
|
|
6742
6756
|
"default": false,
|
|
6743
6757
|
"help": "It will not be done."
|
|
6744
6758
|
},
|
|
6759
|
+
{
|
|
6760
|
+
"name": "wrong",
|
|
6761
|
+
"kind": "option",
|
|
6762
|
+
"opts": [
|
|
6763
|
+
"--wrong"
|
|
6764
|
+
],
|
|
6765
|
+
"type": "flag",
|
|
6766
|
+
"required": false,
|
|
6767
|
+
"multiple": false,
|
|
6768
|
+
"default": false,
|
|
6769
|
+
"help": "With --dismiss: it should never have been raised; --note says why."
|
|
6770
|
+
},
|
|
6745
6771
|
{
|
|
6746
6772
|
"name": "note",
|
|
6747
6773
|
"kind": "option",
|
|
@@ -6753,7 +6779,7 @@
|
|
|
6753
6779
|
"required": true,
|
|
6754
6780
|
"multiple": false,
|
|
6755
6781
|
"default": null,
|
|
6756
|
-
"help": "What was done, or why not (required)."
|
|
6782
|
+
"help": "What was done, or why not (required). Alone: a note; the task stays open."
|
|
6757
6783
|
},
|
|
6758
6784
|
{
|
|
6759
6785
|
"name": "reason",
|
|
@@ -677,8 +677,27 @@ class TaskCommandTests(_PersonaCase):
|
|
|
677
677
|
self.run_cli("admin", "update", "task", "t1", "--dismiss", "--note", "keeps GBP")
|
|
678
678
|
self.assertEqual(self.rec.last["path"], "/admin/tasks/t1/dismiss")
|
|
679
679
|
|
|
680
|
+
def test_a_note_alone_leaves_the_task_open(self):
|
|
681
|
+
self.run_cli("admin", "update", "task", "t1", "--note", " asked, waiting ")
|
|
682
|
+
self.assertEqual(
|
|
683
|
+
(self.rec.last["path"], self.rec.last["body"]),
|
|
684
|
+
("/admin/tasks/t1/note", {"note": "asked, waiting"}),
|
|
685
|
+
)
|
|
686
|
+
|
|
687
|
+
def test_wrong_dismisses_with_why_and_lists(self):
|
|
688
|
+
self.run_cli("admin", "update", "task", "t1", "--dismiss", "--wrong", "-n", "misread")
|
|
689
|
+
self.assertEqual(
|
|
690
|
+
(self.rec.last["path"], self.rec.last["body"]),
|
|
691
|
+
("/admin/tasks/t1/dismiss", {"note": "misread", "wrong": True}),
|
|
692
|
+
)
|
|
693
|
+
self.run_cli("admin", "list", "task", "--wrong")
|
|
694
|
+
self.assertEqual(self.rec.last["params"], {"wrong": "1"})
|
|
695
|
+
|
|
680
696
|
def test_refused_before_the_backend(self):
|
|
681
|
-
self.run_cli("admin", "update", "task", "t1", "--
|
|
697
|
+
self.run_cli("admin", "update", "task", "t1", "--wrong", "-n", "x", expect=2)
|
|
698
|
+
self.run_cli("admin", "update", "task", "t1", "--done", "--wrong", "-n", "x", expect=2)
|
|
699
|
+
self.run_cli("admin", "update", "task", "t1", "-n", "x", "--reason", "r", expect=2)
|
|
700
|
+
self.run_cli("admin", "list", "task", "--wrong", "--kind", "once", expect=2)
|
|
682
701
|
self.run_cli("admin", "update", "task", "t1", "--done", "--dismiss", "-n", "x", expect=2)
|
|
683
702
|
self.run_cli("admin", "update", "task", "t1", "--done", expect=2)
|
|
684
703
|
self.run_cli(
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.26"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|