makea-cli 0.2.26__py3-none-any.whl → 0.2.27__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.26"
1
+ __version__ = "0.2.27"
makea_cli/api_client.py CHANGED
@@ -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?, recurs?}."""
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. Only notes the team handles
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(kind=kind, type_=type_, user=user, product=product),
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 it is "
114
- "handled (notes the team handles off the platform only), --dismiss when it "
115
- "will not be done. --note required. On a held lesson, --reason records why "
116
- "it happened for Beeboo's next reading."
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
- note: str = typer.Option(..., "--note", "-n", help="What was done, or why not (required)."),
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 dismiss it."""
140
- if done == dismiss:
141
- raise typer.BadParameter("pass exactly one of --done, --dismiss")
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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.26
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` |
@@ -1,6 +1,6 @@
1
- makea_cli/__init__.py,sha256=d4vvnQjTf3nZeJvMOie0EHTHbjNFC-xqHs5rOv3P7oQ,23
1
+ makea_cli/__init__.py,sha256=gCfzMhLTA5cL7eXcOlChBuYFkjCn8H1SjU3SRPiSnV8,23
2
2
  makea_cli/__main__.py,sha256=AkQjxWfKE3w9iD1d6I-2Zqvv2t9cct0oYyFF0UiA-Z0,144
3
- makea_cli/api_client.py,sha256=euAX9wPJ48G37-ePVeGuYkKtgudMY36o2mJuYD8h__Q,80760
3
+ makea_cli/api_client.py,sha256=jQX6ogn9kt5rHXSmWst0J-1esLb0BYXzDTpPEboEN7Q,80996
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
@@ -51,8 +51,8 @@ makea_cli/commands/shipping/cmd.py,sha256=ozt73pj3onlOv0NhEwiJlslyG9WOycE0QN4tmz
51
51
  makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNLu3ipsZ7dfs,77
52
52
  makea_cli/commands/supplier/cmd.py,sha256=3M7OYhBd-uQk5naoM2I87vJ6IA_P-gdrsbIX2vbyDns,63763
53
53
  makea_cli/commands/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
- makea_cli/commands/tasks/cmd.py,sha256=SRvv4Ovtcf5-me-8AdKcZ_z_gSrdgC0pbswYbMz7oY4,6539
55
- makea_cli-0.2.26.dist-info/METADATA,sha256=By9qSEjT7gaz6vC6fMiBYjpR5HCuiluusVOyC4a9Uuw,43460
56
- makea_cli-0.2.26.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
57
- makea_cli-0.2.26.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
58
- makea_cli-0.2.26.dist-info/RECORD,,
54
+ makea_cli/commands/tasks/cmd.py,sha256=72MrVigmjjQCpDVF2a3aJn_gclw2iBbJdFmyd87mXec,8549
55
+ makea_cli-0.2.27.dist-info/METADATA,sha256=rHJVe63ME9Vhmo2IFEL3LKnf28NXfSmtjmHKppocfgg,43632
56
+ makea_cli-0.2.27.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
57
+ makea_cli-0.2.27.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
58
+ makea_cli-0.2.27.dist-info/RECORD,,