makea-cli 0.2.35__py3-none-any.whl → 0.2.37__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.35"
1
+ __version__ = "0.2.37"
makea_cli/api_client.py CHANGED
@@ -1432,6 +1432,120 @@ def admin_change_step(product_id: str, supplier_id: str, body: dict[str, Any]) -
1432
1432
  return post_json(f"/admin/products/{product_id}/suppliers/{supplier_id}/change_step", body)
1433
1433
 
1434
1434
 
1435
+ def admin_get_order_flow(product_id: str) -> Any:
1436
+ """GET /admin/products/{id}/order_flow — the order's steps read for makea, the
1437
+ factories' names and the brand's user id."""
1438
+ return get_json(f"/admin/products/{product_id}/order_flow")
1439
+
1440
+
1441
+ def _custom_step_path(product_id: str, step_id: str | None = None) -> str:
1442
+ path = f"/admin/products/{product_id}/order_flow/custom_steps"
1443
+ # A step id carries "#" and "@": encoded whole, as one path segment.
1444
+ return f"{path}/{quote(step_id, safe='')}" if step_id else path
1445
+
1446
+
1447
+ def admin_add_custom_step(product_id: str, body: dict[str, Any]) -> Any:
1448
+ """POST .../order_flow/custom_steps — {label, after, who, completion, due, hold, note,
1449
+ supplier_id?, placement?, joins?}."""
1450
+ return post_json(_custom_step_path(product_id), body)
1451
+
1452
+
1453
+ def admin_update_custom_step(product_id: str, step_id: str, body: dict[str, Any]) -> Any:
1454
+ """PATCH .../order_flow/custom_steps/{step_id} — only the fields given."""
1455
+ return patch_json(_custom_step_path(product_id, step_id), body)
1456
+
1457
+
1458
+ def admin_delete_custom_step(product_id: str, step_id: str) -> Any:
1459
+ """DELETE .../order_flow/custom_steps/{step_id} — only while nothing happened on it."""
1460
+ return delete_json(_custom_step_path(product_id, step_id))
1461
+
1462
+
1463
+ def admin_custom_step_move(product_id: str, step_id: str, move: str, body: dict[str, Any]) -> Any:
1464
+ """POST .../order_flow/custom_steps/{step_id}/{move} — done | upload | submit |
1465
+ approve | send_back | skip, {"as": "makea" | "supplier", files?, note?, comment?,
1466
+ reason?}."""
1467
+ return post_json(f"{_custom_step_path(product_id, step_id)}/{move}", body)
1468
+
1469
+
1470
+ # --- an order's steps from the brand's and the factory's own seats -----------------
1471
+
1472
+
1473
+ def _designer_step_path(product_id: str, step_id: str | None = None) -> str:
1474
+ path = f"/designer/products/{product_id}/order_flow/custom_steps"
1475
+ return f"{path}/{quote(step_id, safe='')}" if step_id else path
1476
+
1477
+
1478
+ def designer_get_order_flow(product_id: str) -> Any:
1479
+ """GET /designer/products/{id}/order_flow — the order's steps as the brand reads them."""
1480
+ return get_json(f"/designer/products/{product_id}/order_flow")
1481
+
1482
+
1483
+ def designer_add_custom_step(product_id: str, body: dict[str, Any]) -> Any:
1484
+ """POST /designer/products/{id}/order_flow/custom_steps — {label, after, who,
1485
+ completion, due, hold, note, placement?, joins?}."""
1486
+ return post_json(_designer_step_path(product_id), body)
1487
+
1488
+
1489
+ def designer_update_custom_step(product_id: str, step_id: str, body: dict[str, Any]) -> Any:
1490
+ """PATCH /designer/products/{id}/order_flow/custom_steps/{step_id} — the fields given."""
1491
+ return patch_json(_designer_step_path(product_id, step_id), body)
1492
+
1493
+
1494
+ def designer_delete_custom_step(product_id: str, step_id: str) -> Any:
1495
+ """DELETE /designer/products/{id}/order_flow/custom_steps/{step_id}."""
1496
+ return delete_json(_designer_step_path(product_id, step_id))
1497
+
1498
+
1499
+ def designer_custom_step_move(
1500
+ product_id: str, step_id: str, move: str, body: dict[str, Any]
1501
+ ) -> Any:
1502
+ """POST /designer/products/{id}/order_flow/custom_steps/{step_id}/{move} — done |
1503
+ upload | approve | send_back | skip."""
1504
+ return post_json(f"{_designer_step_path(product_id, step_id)}/{move}", body)
1505
+
1506
+
1507
+ def supplier_get_order_flow(product_id: str) -> Any:
1508
+ """GET /supplier/products/{id}/order_flow — the factory's own read of the order."""
1509
+ return get_json(f"/supplier/products/{product_id}/order_flow")
1510
+
1511
+
1512
+ def supplier_list_custom_steps(product_id: str) -> Any:
1513
+ """GET /supplier/products/{id}/custom_steps — the added steps the factory does."""
1514
+ return get_json(f"/supplier/products/{product_id}/custom_steps")
1515
+
1516
+
1517
+ def supplier_custom_step_move(
1518
+ product_id: str, step_id: str, move: str, body: dict[str, Any]
1519
+ ) -> Any:
1520
+ """POST /supplier/products/{id}/custom_steps/{step_id}/{move} — done | upload | submit."""
1521
+ return post_json(
1522
+ f"/supplier/products/{product_id}/custom_steps/{quote(step_id, safe='')}/{move}", body
1523
+ )
1524
+
1525
+
1526
+ def supplier_ship_sample(sampling_order_id: str, body: dict[str, Any]) -> Any:
1527
+ """POST /supplier/sampling_orders/{id}/ship — {carrier, tracking_number, tracking_url?}."""
1528
+ return post_json(f"/supplier/sampling_orders/{sampling_order_id}/ship", body)
1529
+
1530
+
1531
+ def supplier_confirm_production_date(production_order_id: str, body: dict[str, Any]) -> Any:
1532
+ """POST /supplier/production_orders/{id}/lead_time — {completion_date, note?}: accept
1533
+ the order with the date bulk will be done."""
1534
+ return post_json(f"/supplier/production_orders/{production_order_id}/lead_time", body)
1535
+
1536
+
1537
+ def supplier_upload_document(
1538
+ file_path: Path, *, product_id: str, doc_type: str = "NOTE_ATTACHMENT"
1539
+ ) -> Any:
1540
+ """POST /supplier/upload_document — multipart ``file`` with ``product_id`` and
1541
+ ``doc_type``; returns the document id."""
1542
+ return post_multipart_with_file(
1543
+ "/supplier/upload_document",
1544
+ file_path=file_path,
1545
+ form_fields={"product_id": product_id, "doc_type": doc_type},
1546
+ )
1547
+
1548
+
1435
1549
  def admin_list_product_notes(product_id: str) -> Any:
1436
1550
  """GET /admin/products/{id}/notes — the product's customer notes."""
1437
1551
  return get_json(f"/admin/products/{product_id}/notes")
@@ -15,6 +15,7 @@ from makea_cli.commands.files.cmd import register as register_files
15
15
  from makea_cli.commands.flags.cmd import register as register_flags
16
16
  from makea_cli.commands.library.cmd import register as register_library
17
17
  from makea_cli.commands.metrics.cmd import register as register_metrics
18
+ from makea_cli.commands.order_flow.cmd import register as register_order_flow
18
19
  from makea_cli.commands.orders.cmd import register as register_orders
19
20
  from makea_cli.commands.playbook.cmd import register as register_playbook
20
21
  from makea_cli.commands.product.cmd import register as register_product
@@ -31,6 +32,7 @@ def register_all(app: typer.Typer) -> None:
31
32
  register_document(app)
32
33
  register_supplier(app)
33
34
  register_orders(app)
35
+ register_order_flow(app)
34
36
  register_product(app)
35
37
  register_production(app)
36
38
  register_shipping(app)
@@ -0,0 +1,3 @@
1
+ from makea_cli.commands.order_flow.cmd import register
2
+
3
+ __all__ = ["register"]
@@ -0,0 +1,723 @@
1
+ """An order's steps (its flow) and the steps added to it, from each seat.
2
+
3
+ admin ``admin get order-flow`` reads every step by stage with whose move it
4
+ is. Added (custom) steps are set up with ``admin create|update|delete
5
+ custom-step`` and completed with ``admin submit custom-step --move``,
6
+ as makea or as the step's factory. A step makea adds is makea's.
7
+ designer The brand's own: ``designer get order-flow`` and ``designer
8
+ create|update|delete|submit custom-step``.
9
+ supplier The factory's own read (``supplier get order-flow``), its added steps
10
+ (``supplier list|submit custom-step``: done, upload, submit a round),
11
+ sending its sample and accepting the order. Factories do not add or
12
+ change steps.
13
+
14
+ Where a step goes (``--placement``): ``inline`` on the line (the next step
15
+ waits for it), ``alongside`` on a line of its own beside the next step, with
16
+ ``--joins`` the step that waits for it (default: the step after that one;
17
+ ``--no-joins`` for none), or ``beside`` a side line's step (``--after`` that
18
+ step): a new line from where that line starts. ``--after`` a side line's step
19
+ with ``inline`` continues that line; the step it joins waits for the whole
20
+ line. Standard steps are moved by their own commands; this group only reads
21
+ them.
22
+ """
23
+
24
+ from __future__ import annotations
25
+
26
+ from pathlib import Path
27
+ from typing import Any
28
+
29
+ import typer
30
+ from rich.console import Console
31
+
32
+ from makea_cli import api_client
33
+ from makea_cli.commands._util import print_json_or_exit
34
+ from makea_cli.registry import command
35
+
36
+ console = Console()
37
+
38
+ WHO = ("BRAND", "SUPPLIER", "MAKEA", "3PL")
39
+ DONE_WHEN = ("check", "upload", "send")
40
+ DUE_KEYS = ("sample_ready", "sample_approved", "bulk_done", "delivery")
41
+ MOVES = ("done", "upload", "submit", "approve", "send-back", "skip")
42
+ AS_SUPPLIER_MOVES = ("done", "upload", "submit")
43
+ BRAND_MOVES = ("done", "upload", "approve", "send-back", "skip")
44
+ FACTORY_MOVES = ("done", "upload", "submit")
45
+ PLACEMENTS = ("inline", "alongside", "beside")
46
+ _PLACEMENT_HELP = (
47
+ "inline (on the line: the next step waits for it), alongside (a line of its own, at "
48
+ "the same time as the next step) or beside (--after a side line's step: a new line "
49
+ "from where that line starts)."
50
+ )
51
+ _JOINS_HELP = (
52
+ "Alongside: id of the step that waits for it (a later step). Default: the step after "
53
+ "the one it runs with."
54
+ )
55
+ _NO_JOINS_HELP = "Alongside: nothing waits for it."
56
+ _HOLD_HELP = (
57
+ "A check inside Pre-production or Bulk production (--after one of them): the step "
58
+ "after it waits for this one."
59
+ )
60
+
61
+ _PRODUCT_HELP = "Product id (the order)."
62
+ _STEP_HELP = (
63
+ "Step id from admin get order-flow, e.g. 'custom.lab-test-1a2b3c@main#1' (quote it: "
64
+ "it has a #)."
65
+ )
66
+
67
+
68
+ def _choice(value: str | None, allowed: tuple[str, ...], flag: str) -> str | None:
69
+ if value is None:
70
+ return None
71
+ v = value.strip()
72
+ v = v.upper() if v.upper() in allowed else v.lower()
73
+ if v not in allowed:
74
+ raise typer.BadParameter(f"{flag} must be one of {', '.join(allowed)}")
75
+ return v
76
+
77
+
78
+ def _due(
79
+ due_date: str | None, due_days: int | None, due_before: str | None, no_due: bool
80
+ ) -> dict[str, Any] | None | bool:
81
+ """The due rule, None for no date, False when nothing was said."""
82
+ if no_due:
83
+ if due_date or due_days is not None or due_before:
84
+ raise typer.BadParameter("--no-due cannot be combined with a due date")
85
+ return None
86
+ if due_date and (due_days is not None or due_before):
87
+ raise typer.BadParameter("pass --due-date, or --due-days with --due-before, not both")
88
+ if due_date:
89
+ return {"mode": "date", "date": due_date}
90
+ if due_days is not None or due_before:
91
+ if due_days is None or not due_before:
92
+ raise typer.BadParameter("--due-days and --due-before go together")
93
+ return {
94
+ "mode": "before",
95
+ "days": due_days,
96
+ "key": _choice(due_before, DUE_KEYS, "--due-before"),
97
+ }
98
+ return False
99
+
100
+
101
+ def _step_body(
102
+ *,
103
+ label: str | None,
104
+ after: str | None,
105
+ who: str | None,
106
+ supplier: str | None,
107
+ done_when: str | None,
108
+ due: dict[str, Any] | None | bool,
109
+ hold: bool | None,
110
+ note: str | None,
111
+ placement: str | None = None,
112
+ joins: str | None = None,
113
+ no_joins: bool = False,
114
+ ) -> dict[str, Any]:
115
+ body: dict[str, Any] = {}
116
+ if joins and no_joins:
117
+ raise typer.BadParameter("pass --joins or --no-joins, not both")
118
+ if placement is not None:
119
+ body["placement"] = _choice(placement, PLACEMENTS, "--placement")
120
+ if joins:
121
+ body["joins"] = joins
122
+ elif no_joins:
123
+ body["joins"] = None
124
+ for key, value in (
125
+ ("label", label),
126
+ ("after", after),
127
+ ("who", _choice(who, WHO, "--who")),
128
+ ("supplier_id", supplier),
129
+ ("completion", _choice(done_when, DONE_WHEN, "--done-when")),
130
+ ("hold", hold),
131
+ ("note", note),
132
+ ):
133
+ if value is not None:
134
+ body[key] = value
135
+ if due is not False:
136
+ body["due"] = due
137
+ return body
138
+
139
+
140
+ def _files(product_id: str, paths: list[Path] | None, document_ids: list[str] | None) -> list[dict]:
141
+ """Upload local files under the brand, and add documents already on the platform."""
142
+ files: list[dict[str, Any]] = [{"document_id": d} for d in document_ids or []]
143
+ if not paths:
144
+ return files
145
+ flow = api_client.admin_get_order_flow(product_id)
146
+ owner = (flow or {}).get("owner_user_id")
147
+ if not owner:
148
+ raise typer.BadParameter("could not tell whose order this is to file the upload under")
149
+ for p in paths:
150
+ res = api_client.upload_admin_document_to_product(
151
+ user_id=owner, product_id=product_id, file_path=p, doc_type="NOTE_ATTACHMENT"
152
+ )
153
+ doc = (res or {}).get("result") or res or {}
154
+ doc = doc.get("document") if isinstance(doc.get("document"), dict) else doc
155
+ doc_id = doc.get("document_id")
156
+ if not doc_id:
157
+ raise typer.BadParameter(f"upload of {p.name} returned no document id")
158
+ files.append({"document_id": doc_id, "name": p.name})
159
+ return files
160
+
161
+
162
+ def register(app: typer.Typer) -> None:
163
+ @command(
164
+ app,
165
+ "admin",
166
+ "get",
167
+ "order-flow",
168
+ api="GET /admin/products/{product_id}/order_flow",
169
+ help=(
170
+ "An order's steps: stages, sample lanes, every step with its state (pending, "
171
+ "active, done, skipped, stopped), whose move it is (owner) and when, the key "
172
+ "dates, and the factories' names. Added steps carry `custom` (who does it, how "
173
+ "it is done, due, hold, rounds, files). Use a step's `id` as --after or STEP_ID."
174
+ ),
175
+ )
176
+ def get_order_flow(product_id: str = typer.Argument(..., help=_PRODUCT_HELP)) -> None:
177
+ """Show an order's steps."""
178
+ print_json_or_exit(console, lambda: api_client.admin_get_order_flow(product_id))
179
+
180
+ _WHO_HELP = "Who does it: BRAND, SUPPLIER (the factory), MAKEA or 3PL (the warehouse)."
181
+ _DONE_WHEN_HELP = (
182
+ "How it is done: check (ticked off), upload (a file is uploaded) or send (the doer "
183
+ "sends it, the brand approves or sends it back; not for BRAND)."
184
+ )
185
+ _DUE_KEYS_HELP = f"Key date it is due before: {', '.join(DUE_KEYS)}."
186
+
187
+ @command(
188
+ app,
189
+ "admin",
190
+ "create",
191
+ "custom-step",
192
+ api="POST /admin/products/{product_id}/order_flow/custom_steps",
193
+ side_effects=[
194
+ "the step shows on the brand's order page (and the factory's, when it does it)",
195
+ "once the step before it has started, whoever does it gets an action card",
196
+ "in line, the next step waits for it; alongside, the step it --joins does",
197
+ ],
198
+ approval="ask",
199
+ help=(
200
+ "Add a step to one order, as makea (recorded as makea whoever does it): a name, "
201
+ "the step it comes after, where it goes (--placement inline, alongside with "
202
+ "--joins, or beside a side line's step), who does it and how it is done, with "
203
+ "an optional due date and note. A factory step goes to the factory of the step "
204
+ "it follows unless --supplier says."
205
+ ),
206
+ )
207
+ def create_custom_step(
208
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
209
+ label: str = typer.Option(..., "--label", help="The step's name, e.g. Lab test report."),
210
+ after: str = typer.Option(..., "--after", help="Id of the step it comes after."),
211
+ who: str = typer.Option("SUPPLIER", "--who", help=_WHO_HELP),
212
+ done_when: str = typer.Option("check", "--done-when", help=_DONE_WHEN_HELP),
213
+ supplier: str | None = typer.Option(
214
+ None, "--supplier", help="With --who SUPPLIER: the factory, when not the step's own."
215
+ ),
216
+ due_date: str | None = typer.Option(None, "--due-date", help="Due on YYYY-MM-DD."),
217
+ due_days: int | None = typer.Option(
218
+ None, "--due-days", help="Due this many days before --due-before.", min=0, max=365
219
+ ),
220
+ due_before: str | None = typer.Option(None, "--due-before", help=_DUE_KEYS_HELP),
221
+ placement: str = typer.Option("inline", "--placement", help=_PLACEMENT_HELP),
222
+ joins: str | None = typer.Option(None, "--joins", help=_JOINS_HELP),
223
+ no_joins: bool = typer.Option(False, "--no-joins", help=_NO_JOINS_HELP),
224
+ hold: bool = typer.Option(False, "--hold", help=_HOLD_HELP),
225
+ note: str | None = typer.Option(None, "--note", help="For whoever does it."),
226
+ ) -> None:
227
+ """Add a step to an order."""
228
+ body = _step_body(
229
+ label=label,
230
+ after=after,
231
+ who=who,
232
+ supplier=supplier,
233
+ done_when=done_when,
234
+ due=_due(due_date, due_days, due_before, False),
235
+ hold=hold,
236
+ note=note,
237
+ placement=placement,
238
+ joins=joins,
239
+ no_joins=no_joins,
240
+ )
241
+ print_json_or_exit(console, lambda: api_client.admin_add_custom_step(product_id, body))
242
+
243
+ @command(
244
+ app,
245
+ "admin",
246
+ "update",
247
+ "custom-step",
248
+ api="PATCH /admin/products/{product_id}/order_flow/custom_steps/{step_id}",
249
+ side_effects=["the brand's and the factory's order pages show the change"],
250
+ approval="ask",
251
+ reversible=True,
252
+ help=(
253
+ "Change an added step that is not done or skipped: only the options given, "
254
+ "including where it goes (--after, --placement, --joins / --no-joins). Once "
255
+ "something was sent or uploaded on it, who does it and how it is done stay."
256
+ ),
257
+ )
258
+ def update_custom_step(
259
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
260
+ step_id: str = typer.Argument(..., help=_STEP_HELP),
261
+ label: str | None = typer.Option(None, "--label"),
262
+ after: str | None = typer.Option(None, "--after", help="Move it after another step."),
263
+ who: str | None = typer.Option(None, "--who", help=_WHO_HELP),
264
+ done_when: str | None = typer.Option(None, "--done-when", help=_DONE_WHEN_HELP),
265
+ supplier: str | None = typer.Option(None, "--supplier"),
266
+ due_date: str | None = typer.Option(None, "--due-date", help="Due on YYYY-MM-DD."),
267
+ due_days: int | None = typer.Option(None, "--due-days", min=0, max=365),
268
+ due_before: str | None = typer.Option(None, "--due-before", help=_DUE_KEYS_HELP),
269
+ no_due: bool = typer.Option(False, "--no-due", help="Take the due date off."),
270
+ placement: str | None = typer.Option(None, "--placement", help=_PLACEMENT_HELP),
271
+ joins: str | None = typer.Option(None, "--joins", help=_JOINS_HELP),
272
+ no_joins: bool = typer.Option(False, "--no-joins", help=_NO_JOINS_HELP),
273
+ hold: bool | None = typer.Option(None, "--hold/--no-hold", help=_HOLD_HELP),
274
+ note: str | None = typer.Option(None, "--note"),
275
+ ) -> None:
276
+ """Change an added step."""
277
+ body = _step_body(
278
+ label=label,
279
+ after=after,
280
+ who=who,
281
+ supplier=supplier,
282
+ done_when=done_when,
283
+ due=_due(due_date, due_days, due_before, no_due),
284
+ hold=hold,
285
+ note=note,
286
+ placement=placement,
287
+ joins=joins,
288
+ no_joins=no_joins,
289
+ )
290
+ if not body:
291
+ raise typer.BadParameter("nothing to change")
292
+ print_json_or_exit(
293
+ console, lambda: api_client.admin_update_custom_step(product_id, step_id, body)
294
+ )
295
+
296
+ @command(
297
+ app,
298
+ "admin",
299
+ "delete",
300
+ "custom-step",
301
+ api="DELETE /admin/products/{product_id}/order_flow/custom_steps/{step_id}",
302
+ side_effects=["the step and its action card leave the order"],
303
+ approval="ask",
304
+ help=(
305
+ "Remove an added step as if it was never added: only while nothing was sent or "
306
+ "uploaded on it; the steps added after it follow the step it followed (a side "
307
+ "line's next step takes over its fork and join). Otherwise skip it (admin "
308
+ "submit custom-step --move skip), which also stops it holding a step."
309
+ ),
310
+ )
311
+ def delete_custom_step(
312
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
313
+ step_id: str = typer.Argument(..., help=_STEP_HELP),
314
+ ) -> None:
315
+ """Remove an added step."""
316
+ print_json_or_exit(
317
+ console, lambda: api_client.admin_delete_custom_step(product_id, step_id)
318
+ )
319
+
320
+ @command(
321
+ app,
322
+ "admin",
323
+ "submit",
324
+ "custom-step",
325
+ api="POST /admin/products/{product_id}/order_flow/custom_steps/{step_id}/{move}",
326
+ side_effects=[
327
+ "the step moves on the brand's and the factory's order pages",
328
+ "the action card moves to whoever's turn it is next, or closes",
329
+ "--as supplier records the move as the step's factory",
330
+ ],
331
+ approval="ask",
332
+ help=(
333
+ "Make an added step's move: done (tick off), upload (--file / --document), "
334
+ "submit (send a round: files and/or --note), approve or send-back (--comment "
335
+ "needed), skip (--reason). --as supplier makes done, upload or submit for the "
336
+ "step's own factory; makea may make every move."
337
+ ),
338
+ )
339
+ def submit_custom_step(
340
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
341
+ step_id: str = typer.Argument(..., help=_STEP_HELP),
342
+ move: str = typer.Option(..., "--move", help=f"One of {', '.join(MOVES)}."),
343
+ as_who: str = typer.Option(
344
+ "makea", "--as", help="makea, or supplier (the step's factory)."
345
+ ),
346
+ file: list[Path] | None = typer.Option(
347
+ None,
348
+ "--file",
349
+ "-f",
350
+ exists=True,
351
+ dir_okay=False,
352
+ readable=True,
353
+ help="Local file to upload with upload or submit; repeat.",
354
+ ),
355
+ document: list[str] | None = typer.Option(
356
+ None, "--document", help="Document id already on the platform; repeat."
357
+ ),
358
+ note: str | None = typer.Option(None, "--note", help="With upload or submit."),
359
+ comment: str | None = typer.Option(
360
+ None, "--comment", help="With approve or send-back: what to change."
361
+ ),
362
+ reason: str | None = typer.Option(None, "--reason", help="With skip: why."),
363
+ ) -> None:
364
+ """Make an added step's move as makea or the factory."""
365
+ m = _choice(move, MOVES, "--move")
366
+ actor = (as_who or "").strip().lower()
367
+ if actor not in ("makea", "supplier"):
368
+ raise typer.BadParameter("--as must be makea or supplier")
369
+ if actor == "supplier" and m not in AS_SUPPLIER_MOVES:
370
+ raise typer.BadParameter(f"--as supplier makes {', '.join(AS_SUPPLIER_MOVES)} only")
371
+ if m == "send-back" and not (comment and comment.strip()):
372
+ raise typer.BadParameter("--comment says what to change")
373
+
374
+ def run() -> Any:
375
+ body: dict[str, Any] = {"as": actor}
376
+ if m in ("upload", "submit"):
377
+ files = _files(product_id, file, document)
378
+ if files:
379
+ body["files"] = files
380
+ for key, value in (("note", note), ("comment", comment), ("reason", reason)):
381
+ if value and value.strip():
382
+ body[key] = value.strip()
383
+ return api_client.admin_custom_step_move(
384
+ product_id, step_id, str(m).replace("-", "_"), body
385
+ )
386
+
387
+ print_json_or_exit(console, run)
388
+
389
+ _register_designer(app)
390
+ _register_supplier(app)
391
+
392
+
393
+ def _brand_files(
394
+ product_id: str, paths: list[Path] | None, document_ids: list[str] | None
395
+ ) -> list[dict]:
396
+ """Upload local files to the brand's product, and add documents already there."""
397
+ files: list[dict[str, Any]] = [{"document_id": d} for d in document_ids or []]
398
+ for p in paths or []:
399
+ res = api_client.designer_upload_document(product_id=product_id, file_path=p)
400
+ files.append({"document_id": _doc_id(res, p), "name": p.name})
401
+ return files
402
+
403
+
404
+ def _factory_files(
405
+ product_id: str, paths: list[Path] | None, document_ids: list[str] | None
406
+ ) -> list[dict]:
407
+ files: list[dict[str, Any]] = [{"document_id": d} for d in document_ids or []]
408
+ for p in paths or []:
409
+ res = api_client.supplier_upload_document(p, product_id=product_id)
410
+ files.append({"document_id": _doc_id(res, p), "name": p.name})
411
+ return files
412
+
413
+
414
+ def _doc_id(res: Any, path: Path) -> str:
415
+ doc = (res or {}).get("result") or res or {}
416
+ for key in ("document", "data"):
417
+ if isinstance(doc.get(key), dict):
418
+ doc = doc[key]
419
+ doc_id = doc.get("document_id") or doc.get("id")
420
+ if not doc_id:
421
+ raise typer.BadParameter(f"upload of {path.name} returned no document id")
422
+ return str(doc_id)
423
+
424
+
425
+ _FILE_OPT = dict(exists=True, dir_okay=False, readable=True, help="Local file to upload; repeat.")
426
+
427
+
428
+ def _register_designer(app: typer.Typer) -> None:
429
+ @command(
430
+ app,
431
+ "designer",
432
+ "get",
433
+ "order-flow",
434
+ api="GET /designer/products/{product_id}/order_flow",
435
+ help=(
436
+ "Your order's steps: stages, every step with its state and whose move it is, "
437
+ "the moves between them (a line added alongside branches off with kind "
438
+ "'branch' and rejoins with 'join'), the key dates, and on each step "
439
+ "`waits_for`: the added steps it waits for."
440
+ ),
441
+ )
442
+ def designer_get_order_flow(product_id: str = typer.Argument(..., help=_PRODUCT_HELP)) -> None:
443
+ """Show your order's steps."""
444
+ print_json_or_exit(console, lambda: api_client.designer_get_order_flow(product_id))
445
+
446
+ @command(
447
+ app,
448
+ "designer",
449
+ "create",
450
+ "custom-step",
451
+ api="POST /designer/products/{product_id}/order_flow/custom_steps",
452
+ side_effects=[
453
+ "the step shows on your order page, and the factory's when it does it",
454
+ "whoever does it gets an action card once it opens",
455
+ "in line, the next step waits for it; alongside, the step it --joins does",
456
+ ],
457
+ approval="ask",
458
+ help=(
459
+ "Add a step to your order: a name, the step it comes after, where it goes "
460
+ "(--placement inline, alongside with --joins, or beside a side line's step), "
461
+ "who does it (BRAND, SUPPLIER, MAKEA, 3PL) and how it is done."
462
+ ),
463
+ )
464
+ def designer_create_custom_step(
465
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
466
+ label: str = typer.Option(..., "--label", help="The step's name."),
467
+ after: str = typer.Option(..., "--after", help="Id of the step it comes after."),
468
+ placement: str = typer.Option("alongside", "--placement", help=_PLACEMENT_HELP),
469
+ joins: str | None = typer.Option(None, "--joins", help=_JOINS_HELP),
470
+ no_joins: bool = typer.Option(False, "--no-joins", help=_NO_JOINS_HELP),
471
+ who: str = typer.Option("SUPPLIER", "--who", help="BRAND, SUPPLIER, MAKEA or 3PL."),
472
+ done_when: str = typer.Option("check", "--done-when", help="check, upload or send."),
473
+ due_date: str | None = typer.Option(None, "--due-date", help="Due on YYYY-MM-DD."),
474
+ due_days: int | None = typer.Option(None, "--due-days", min=0, max=365),
475
+ due_before: str | None = typer.Option(None, "--due-before", help=", ".join(DUE_KEYS)),
476
+ hold: bool = typer.Option(False, "--hold", help=_HOLD_HELP),
477
+ note: str | None = typer.Option(None, "--note", help="For whoever does it."),
478
+ ) -> None:
479
+ """Add a step to your order."""
480
+ body = _step_body(
481
+ label=label,
482
+ after=after,
483
+ who=who,
484
+ supplier=None,
485
+ done_when=done_when,
486
+ due=_due(due_date, due_days, due_before, False),
487
+ hold=hold,
488
+ note=note,
489
+ placement=placement,
490
+ joins=joins,
491
+ no_joins=no_joins,
492
+ )
493
+ print_json_or_exit(console, lambda: api_client.designer_add_custom_step(product_id, body))
494
+
495
+ @command(
496
+ app,
497
+ "designer",
498
+ "update",
499
+ "custom-step",
500
+ api="PATCH /designer/products/{product_id}/order_flow/custom_steps/{step_id}",
501
+ side_effects=["your order page and the factory's show the change"],
502
+ approval="ask",
503
+ reversible=True,
504
+ help="Change a step you added that is not done or skipped: only the options given.",
505
+ )
506
+ def designer_update_custom_step(
507
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
508
+ step_id: str = typer.Argument(..., help=_STEP_HELP),
509
+ label: str | None = typer.Option(None, "--label"),
510
+ after: str | None = typer.Option(None, "--after"),
511
+ placement: str | None = typer.Option(None, "--placement", help=_PLACEMENT_HELP),
512
+ joins: str | None = typer.Option(None, "--joins", help=_JOINS_HELP),
513
+ no_joins: bool = typer.Option(False, "--no-joins", help=_NO_JOINS_HELP),
514
+ who: str | None = typer.Option(None, "--who"),
515
+ done_when: str | None = typer.Option(None, "--done-when"),
516
+ due_date: str | None = typer.Option(None, "--due-date"),
517
+ due_days: int | None = typer.Option(None, "--due-days", min=0, max=365),
518
+ due_before: str | None = typer.Option(None, "--due-before"),
519
+ no_due: bool = typer.Option(False, "--no-due"),
520
+ hold: bool | None = typer.Option(None, "--hold/--no-hold", help=_HOLD_HELP),
521
+ note: str | None = typer.Option(None, "--note"),
522
+ ) -> None:
523
+ """Change a step you added."""
524
+ body = _step_body(
525
+ label=label,
526
+ after=after,
527
+ who=who,
528
+ supplier=None,
529
+ done_when=done_when,
530
+ due=_due(due_date, due_days, due_before, no_due),
531
+ hold=hold,
532
+ note=note,
533
+ placement=placement,
534
+ joins=joins,
535
+ no_joins=no_joins,
536
+ )
537
+ if not body:
538
+ raise typer.BadParameter("nothing to change")
539
+ print_json_or_exit(
540
+ console, lambda: api_client.designer_update_custom_step(product_id, step_id, body)
541
+ )
542
+
543
+ @command(
544
+ app,
545
+ "designer",
546
+ "delete",
547
+ "custom-step",
548
+ api="DELETE /designer/products/{product_id}/order_flow/custom_steps/{step_id}",
549
+ side_effects=["the step and its action card leave the order"],
550
+ approval="ask",
551
+ help=(
552
+ "Remove a step you added, only while nothing was sent or uploaded on it. "
553
+ "Otherwise skip it (designer submit custom-step --move skip)."
554
+ ),
555
+ )
556
+ def designer_delete_custom_step(
557
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
558
+ step_id: str = typer.Argument(..., help=_STEP_HELP),
559
+ ) -> None:
560
+ """Remove a step you added."""
561
+ print_json_or_exit(
562
+ console, lambda: api_client.designer_delete_custom_step(product_id, step_id)
563
+ )
564
+
565
+ @command(
566
+ app,
567
+ "designer",
568
+ "submit",
569
+ "custom-step",
570
+ api="POST /designer/products/{product_id}/order_flow/custom_steps/{step_id}/{move}",
571
+ side_effects=["the step moves on your order page and the factory's"],
572
+ approval="ask",
573
+ help=(
574
+ "Make your move on an added step: done, upload (--file / --document), approve "
575
+ "or send-back a round the factory sent (--comment needed to send back), or "
576
+ "skip (--reason; it stops holding the step that waited for it)."
577
+ ),
578
+ )
579
+ def designer_submit_custom_step(
580
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
581
+ step_id: str = typer.Argument(..., help=_STEP_HELP),
582
+ move: str = typer.Option(..., "--move", help=", ".join(BRAND_MOVES)),
583
+ file: list[Path] | None = typer.Option(None, "--file", "-f", **_FILE_OPT),
584
+ document: list[str] | None = typer.Option(None, "--document"),
585
+ comment: str | None = typer.Option(None, "--comment"),
586
+ reason: str | None = typer.Option(None, "--reason"),
587
+ ) -> None:
588
+ """Make your move on an added step."""
589
+ m = _choice(move, BRAND_MOVES, "--move")
590
+ if m == "send-back" and not (comment and comment.strip()):
591
+ raise typer.BadParameter("--comment says what to change")
592
+
593
+ def run() -> Any:
594
+ body: dict[str, Any] = {}
595
+ if m == "upload":
596
+ body["files"] = _brand_files(product_id, file, document)
597
+ for key, value in (("comment", comment), ("reason", reason)):
598
+ if value and value.strip():
599
+ body[key] = value.strip()
600
+ return api_client.designer_custom_step_move(
601
+ product_id, step_id, str(m).replace("-", "_"), body
602
+ )
603
+
604
+ print_json_or_exit(console, run)
605
+
606
+
607
+ def _register_supplier(app: typer.Typer) -> None:
608
+ @command(
609
+ app,
610
+ "supplier",
611
+ "get",
612
+ "order-flow",
613
+ api="GET /supplier/products/{product_id}/order_flow",
614
+ help=(
615
+ "Your read of an order: the request, one row per quote you sent, the sample "
616
+ "and bulk steps that are yours, the brand's steps you wait on, and the steps "
617
+ "the brand added for you. A step that `waits_for` added steps is on hold."
618
+ ),
619
+ )
620
+ def supplier_get_order_flow(product_id: str = typer.Argument(..., help=_PRODUCT_HELP)) -> None:
621
+ """Show your read of an order."""
622
+ print_json_or_exit(console, lambda: api_client.supplier_get_order_flow(product_id))
623
+
624
+ @command(
625
+ app,
626
+ "supplier",
627
+ "list",
628
+ "custom-step",
629
+ api="GET /supplier/products/{product_id}/custom_steps",
630
+ help="The steps the brand added that you do, with whose turn it is and what they hold.",
631
+ )
632
+ def supplier_list_custom_steps(
633
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
634
+ ) -> None:
635
+ """List the added steps you do."""
636
+ print_json_or_exit(console, lambda: api_client.supplier_list_custom_steps(product_id))
637
+
638
+ @command(
639
+ app,
640
+ "supplier",
641
+ "submit",
642
+ "custom-step",
643
+ api="POST /supplier/products/{product_id}/custom_steps/{step_id}/{move}",
644
+ side_effects=["the brand sees the step move; a sent round waits for its approval"],
645
+ approval="ask",
646
+ help=(
647
+ "Your move on a step the brand added: done (tick off), upload (--file / "
648
+ "--document), or submit a round for the brand to approve (files and/or --note). "
649
+ "Adding, changing or skipping steps is the brand's."
650
+ ),
651
+ )
652
+ def supplier_submit_custom_step(
653
+ product_id: str = typer.Argument(..., help=_PRODUCT_HELP),
654
+ step_id: str = typer.Argument(..., help=_STEP_HELP),
655
+ move: str = typer.Option(..., "--move", help=", ".join(FACTORY_MOVES)),
656
+ file: list[Path] | None = typer.Option(None, "--file", "-f", **_FILE_OPT),
657
+ document: list[str] | None = typer.Option(None, "--document"),
658
+ note: str | None = typer.Option(None, "--note"),
659
+ ) -> None:
660
+ """Make your move on an added step."""
661
+ m = _choice(move, FACTORY_MOVES, "--move")
662
+
663
+ def run() -> Any:
664
+ body: dict[str, Any] = {}
665
+ if m in ("upload", "submit"):
666
+ files = _factory_files(product_id, file, document)
667
+ if files:
668
+ body["files"] = files
669
+ if note and note.strip():
670
+ body["note"] = note.strip()
671
+ return api_client.supplier_custom_step_move(product_id, step_id, str(m), body)
672
+
673
+ print_json_or_exit(console, run)
674
+
675
+ @command(
676
+ app,
677
+ "supplier",
678
+ "submit",
679
+ "sample-shipment",
680
+ api="POST /supplier/sampling_orders/{sampling_order_id}/ship",
681
+ side_effects=["the sample shows as sent and the brand gets the shipped email"],
682
+ approval="ask",
683
+ help="Send the sample: the courier and its tracking number (and link).",
684
+ )
685
+ def supplier_ship_sample(
686
+ sampling_order_id: str = typer.Argument(..., help="The sample order."),
687
+ carrier: str = typer.Option(..., "--carrier", help="Courier, e.g. DHL Express."),
688
+ tracking_number: str = typer.Option(..., "--tracking-number"),
689
+ tracking_url: str | None = typer.Option(None, "--tracking-url"),
690
+ ) -> None:
691
+ """Send the sample."""
692
+ body: dict[str, Any] = {"carrier": carrier, "tracking_number": tracking_number}
693
+ if tracking_url:
694
+ body["tracking_url"] = tracking_url
695
+ print_json_or_exit(
696
+ console, lambda: api_client.supplier_ship_sample(sampling_order_id, body)
697
+ )
698
+
699
+ @command(
700
+ app,
701
+ "supplier",
702
+ "submit",
703
+ "order-acceptance",
704
+ api="POST /supplier/production_orders/{production_order_id}/lead_time",
705
+ side_effects=[
706
+ "the order is accepted with the date bulk will be done",
707
+ "the production milestones are set up",
708
+ ],
709
+ approval="ask",
710
+ help="Accept the order after the deposit: the date bulk production will be done.",
711
+ )
712
+ def supplier_accept_order(
713
+ production_order_id: str = typer.Argument(..., help="The production order."),
714
+ completion_date: str = typer.Option(..., "--completion-date", help="YYYY-MM-DD."),
715
+ note: str | None = typer.Option(None, "--note"),
716
+ ) -> None:
717
+ """Accept the order with its production date."""
718
+ body: dict[str, Any] = {"completion_date": completion_date}
719
+ if note:
720
+ body["note"] = note
721
+ print_json_or_exit(
722
+ console, lambda: api_client.supplier_confirm_production_date(production_order_id, body)
723
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.35
3
+ Version: 0.2.37
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
@@ -95,6 +95,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
95
95
  |---|---|---|---|---|
96
96
  | `makea-cli admin backfill supplier-id` | write(never) | `POST /admin/supplier/backfill_supplier_id_with_quote_requests` | Migrate supplier_id from a wrong UUID to the Cognito user sub (user_id): profile + Cognito supplierReferenceId, optio… | `backfill-supplier-id` |
97
97
  | `makea-cli admin create consignment` | write(ask) | `POST /admin/{production_orders\|shipping_orders}/{id}/consignments` | add one lot leaving the factory with its own tracking number, pieces, cartons, kg and ship date. The lot that brings the pieces up to the order is marked last unless `--last/--not-last` says. | — |
98
+ | `makea-cli admin create custom-step` | write(ask) | `POST /admin/products/{product_id}/order_flow/custom_steps` | add a step to one order as makea: `--label`, `--after` (a step id), `--placement inline\|alongside\|beside`, `--joins` / `--no-joins`, `--who`, `--done-when check\|upload\|send`, due (`--due-date` or `--due-days` + `--due-before`), `--hold` (checks in a production step), `--note`. | — |
98
99
  | `makea-cli admin create feature-flag` | write(ask) | `POST /admin/feature-flags` | add a flag (off unless --enabled). An existing key is refused. | — |
99
100
  | `makea-cli admin create library-element` | write(auto) | `POST /admin/designer/{user_id}/library_components` | save a reusable component under a designer. Provide --section and --values (see admin get library-schema). | `library-create` |
100
101
  | `makea-cli admin create product-note` | write(ask) | `POST /admin/products/{product_id}/notes` | write a note on a product. Without --internal it goes to the brand. | — |
@@ -110,6 +111,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
110
111
  | `makea-cli admin create user` | write(never) | `POST /admin/users/create` | register a user and confirm the Cognito account in one step (no verification email). Allowed --user-type values: "Fas… | `create-user` |
111
112
  | `makea-cli admin delete about` | write(ask) | `DELETE /admin/about/{target}/{key}` | remove one About you line (`--user` / `--supplier`); it is not guessed again. --reason required. | — |
112
113
  | `makea-cli admin delete consignment` | write(ask) | `DELETE /admin/{production_orders\|shipping_orders}/{id}/consignments/{consignment_id}` | remove a lot entered by mistake. A delivered lot cannot be removed. | — |
114
+ | `makea-cli admin delete custom-step` | write(ask) | `DELETE /admin/products/{product_id}/order_flow/custom_steps/{step_id}` | remove an added step while nothing was sent or uploaded on it; otherwise skip it. | — |
113
115
  | `makea-cli admin delete ship-log` | write(ask) | `DELETE /admin/ship-log/deploys/{deploy_id}` | remove a Ship log entry recorded by mistake, with its recordings. | — |
114
116
  | `makea-cli admin delete feature-flag` | write(ask) | `DELETE /admin/feature-flags/{key}` | remove a flag. Every check of it then reads false, so delete it only once the code that reads it is gone. | — |
115
117
  | `makea-cli admin delete library-element` | write(never) | `DELETE /admin/designer/{user_id}/library_components/{component_id}` | remove a component from the designer's org library. | `library-delete` |
@@ -134,6 +136,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
134
136
  | `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. | — |
135
137
  | `makea-cli admin get product-status` | read | `GET /admin/products/{product_id}/status` | where the product is: stage · step · owner for each supplier on it (the shared status model), plus the step catalog. | — |
136
138
  | `makea-cli admin get product-step` | read | `GET /admin/products/{product_id}/suppliers/{supplier_id}/change_step` | the step one factory is at on a product and the steps admin update product-step can move it to (options; money steps are listed but never selectable). | — |
139
+ | `makea-cli admin get order-flow` | read | `GET /admin/products/{product_id}/order_flow` | an order's steps by stage: state, whose move it is, dates, key dates, factory names; added steps carry `custom`. | — |
137
140
  | `makea-cli admin get production-order` | read | `GET /admin/production_orders/{production_order_id}/details` | one production (or restock) order in full: items, status, progress steps, tracking, notes, documents and linked suppliers. For only its pricing use admin get production-pricing. | — |
138
141
  | `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` |
139
142
  | `makea-cli admin get quote-request` | read | `GET /admin/quote_requests/{quote_request_id}` | one quote request in full. | — |
@@ -172,6 +175,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
172
175
  | `makea-cli admin set production-variants` | write(ask) | `POST /admin/production_orders/{id}/details/update` | Set a production order's available sizes and colours (the grid the buyer's cart and every pricing group's cart keys a… | `production-variants-set` |
173
176
  | `makea-cli admin set sampling-order-tracking` | write(ask) | `PUT /admin/sampling_orders/{sampling_order_id}/tracking` | the sample's parcel: tracking number, URL, shipping method, carrier. Only what you pass is changed; an empty string clears a field. | — |
174
177
  | `makea-cli admin submit quote` | write(ask) | `POST /admin/quote_requests/{quote_request_id}/submit_quote` | admin submits a new quote (link) to a quote request. Pricing groups cannot be sent here (the submit endpoint ignores … | `submit-supplier-quote` |
178
+ | `makea-cli admin submit custom-step` | write(ask) | `POST /admin/products/{product_id}/order_flow/custom_steps/{step_id}/{move}` | make an added step's move (`--move done\|upload\|submit\|approve\|send-back\|skip`) as makea, or `--as supplier` for the step's factory (done, upload, submit); `--file` uploads under the brand. | — |
175
179
  | `makea-cli admin update about` | write(ask) | `PATCH /admin/about/{target}/{key}` | add or reword one About you line (stands as the account's own words); `--restore` brings a removed one back. --reason required. | — |
176
180
  | `makea-cli admin update about-pause` | write(ask) | `POST /admin/about/{target}/pause` | stop (or `--resume`) Beeboo using an account's About you. --reason required. | — |
177
181
  | `makea-cli admin update feature-flag` | write(ask) | `PATCH /admin/feature-flags/{key}` | flip the global switch, edit the description or default value, or add / remove one account on the allow-list (by user id; find it with admin list user). | — |
@@ -188,6 +192,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
188
192
  | `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` |
189
193
  | `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. | — |
190
194
  | `makea-cli admin update consignment` | write(ask) | `PUT /admin/{production_orders\|shipping_orders}/{id}/consignments/{consignment_id}` | edit one lot; `--delivered` marks it delivered through the tracking sweep path (a middle lot tells the brand in-app and on WhatsApp, the last one delivers the order); `--silent` tells nobody. | — |
195
+ | `makea-cli admin update custom-step` | write(ask) | `PATCH /admin/products/{product_id}/order_flow/custom_steps/{step_id}` | change an added step that is not done or skipped; only the options given, including `--placement` and `--joins`. | — |
191
196
  | `makea-cli admin update ship-log` | write(ask) | `PATCH /admin/ship-log/deploys/{deploy_id}` | fix a Ship log entry's title, summary or watch note; `--media` attaches more recordings. | — |
192
197
  | `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
193
198
  | `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). | — |
@@ -207,6 +212,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
207
212
  |---|---|---|---|---|
208
213
  | `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… | — |
209
214
  | `makea-cli designer create collection` | write(auto) | `POST /designer/collections/create` | create or update a designer collection. | `designer-create-collection` |
215
+ | `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`. | — |
210
216
  | `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. | — |
211
217
  | `makea-cli designer create note` | write(ask) | `POST /designer/products/{product_id}/notes` | post a message into a product's conversation. | — |
212
218
  | `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. | — |
@@ -249,6 +255,10 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
249
255
  | `makea-cli designer update product` | write(auto) | `POST /designer/product/update_basic_info` | patch fields on a product. --cover-image / --back-image take a document id and are what the assistant's set_product_i… | — |
250
256
  | `makea-cli designer update production-order` | write(ask) | `POST /designer/production_orders/{production_order_id}/complete` | POST /designer/production_orders/{id}/complete, or PUT the order to re-pick which supplier links it covers (--links-f… | — |
251
257
  | `makea-cli designer create proposal` | write(auto) | `POST /designer/products/{product_id}/tech_spec/proposals` | propose a tech-pack change as a card on the field it changes; the user applies it. Name section/field as `get tech-pack --readable` shows them; --item / --entry pick a row, --was a line. | — |
258
+ | `makea-cli designer delete custom-step` | write(ask) | `DELETE /designer/products/{product_id}/order_flow/custom_steps/{step_id}` | remove a step you added while nothing was sent on it; the steps after it close up. | — |
259
+ | `makea-cli designer get order-flow` | read | `GET /designer/products/{product_id}/order_flow` | your order's steps, the branch/join moves of lines added alongside, and what each step `waits_for`. | — |
260
+ | `makea-cli designer submit custom-step` | write(ask) | `POST /designer/products/{product_id}/order_flow/custom_steps/{step_id}/{move}` | your move on an added step: done, upload, approve, send-back (`--comment`), skip (`--reason`). | — |
261
+ | `makea-cli designer update custom-step` | write(ask) | `PATCH /designer/products/{product_id}/order_flow/custom_steps/{step_id}` | change a step you added, including where it goes (`--after`, `--placement`, `--joins`). | — |
252
262
  | `makea-cli designer update proposal` | write(ask) | `POST /designer/beeboo_proposals/approve` | apply one spec change the assistant proposed. This edits the pack, so read the proposal first. | — |
253
263
  | `makea-cli designer update sampling-order` | write(never) | `POST /designer/sampling_orders/{sampling_order_id}/cancel` | cancel a sample order. Graded `never`: an agent must not do this on its own, a person runs it. | — |
254
264
  | `makea-cli designer update shipping-order` | write(ask) | `POST /designer/shipping_orders/{shipping_order_id}/confirm_receive` | say the goods arrived. The backend accepts this only while the shipment is IN_TRANSIT. | — |
@@ -263,18 +273,23 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
263
273
  | `makea-cli supplier create note` | write(ask) | `POST /supplier/products/{id}/channels/{key}/notes` | post a message into a product channel you are part of. | — |
264
274
  | `makea-cli supplier download document` | read | `GET /supplier/document/download` | save a document you are allowed to read. | — |
265
275
  | `makea-cli supplier 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. | — |
276
+ | `makea-cli supplier get order-flow` | read | `GET /supplier/products/{product_id}/order_flow` | your read of an order: request, one row per quote, your sample and bulk steps, holds (`waits_for`). | — |
266
277
  | `makea-cli supplier get pack` | read | `GET /supplier/quote_requests/{id}/technical-specifications` | the tech pack for an RFQ, as the factory is allowed to see it (`--readable`: labels, values and blank essentials only). | — |
267
278
  | `makea-cli supplier get pack-changes` | read | `GET /supplier/products/{product_id}/specification-change-history` | what changed in the pack since you quoted, field by field. | — |
268
279
  | `makea-cli supplier get profile` | read | `GET /supplier/profile` | your own supplier profile. | — |
269
280
  | `makea-cli supplier get rfq` | read | `GET /supplier/quote_requests` | one RFQ in full. | — |
270
281
  | `makea-cli supplier list action` | read | `GET /supplier/actions` | what the platform is waiting on you for (pending actions). | — |
271
282
  | `makea-cli supplier list channel` | read | `GET /supplier/products/{product_id}/channels` | the channels you are part of on a product. | — |
283
+ | `makea-cli supplier list custom-step` | read | `GET /supplier/products/{product_id}/custom_steps` | the steps the brand added that you do. | — |
272
284
  | `makea-cli supplier list note` | read | `GET /supplier/products/{product_id}/channels/{channel_key}/notes` | the conversation in one channel. | — |
273
285
  | `makea-cli supplier list production-order` | read | `GET /supplier/production_orders` | your production orders, optionally for one RFQ. | — |
274
286
  | `makea-cli supplier list quote-edit-request` | read | `GET /supplier/quote_requests/{quote_request_id}/quote_edit_requests` | changes the brand has asked you to make to a quote you already sent. | — |
275
287
  | `makea-cli supplier list rfq` | read | `GET /supplier/quote_requests` | the RFQs (quote requests) sent to you. | — |
276
288
  | `makea-cli supplier list task` | read | `GET /supplier/tasks` | your onboarding and per-order to-dos. | — |
289
+ | `makea-cli supplier submit custom-step` | write(ask) | `POST /supplier/products/{product_id}/custom_steps/{step_id}/{move}` | your move on an added step: done, upload, or submit a round (`--file`, `--note`). Adding or changing steps is the brand's. | — |
290
+ | `makea-cli supplier submit order-acceptance` | write(ask) | `POST /supplier/production_orders/{production_order_id}/lead_time` | accept the order after the deposit with the date bulk will be done (`--completion-date`). | — |
277
291
  | `makea-cli supplier submit quote` | write(ask) | `POST /supplier/quote_requests/{id}/submit_quote` | submit your quote for an RFQ. --file is the supplier link payload as JSON (same shape the web form posts); run with -… | — |
292
+ | `makea-cli supplier submit sample-shipment` | write(ask) | `POST /supplier/sampling_orders/{sampling_order_id}/ship` | send the sample: `--carrier`, `--tracking-number`, `--tracking-url`. | — |
278
293
  | `makea-cli supplier update action` | write(auto) | `POST /supplier/actions/{action_id}/{acknowledge\|snooze}` | respond to a pending action. Acknowledging says you have seen it; the action still closes on the fact it asks for. | — |
279
294
  | `makea-cli supplier update quote` | write(ask) | `POST /supplier/quote_requests/{quote_request_id}/links/{link_id}/edit` | revise a quote you already sent. --file is the same payload shape as submit; --dry-run first. | — |
280
295
  | `makea-cli supplier update rfq` | write(ask) | `POST /supplier/quote_requests/{quote_request_id}/{status\|archive\|accept_terms}` | answer an RFQ. --status accepts or declines the invitation; --archive takes it off your board; --accept-terms accepts… | — |
@@ -1,6 +1,6 @@
1
- makea_cli/__init__.py,sha256=5ZoGMhOu85BCUht7p7mDjOUD0Ek7HaoVyA0NOs5A-L0,23
1
+ makea_cli/__init__.py,sha256=5cBA1BOigyaIjTZkiKDnt-MqIStCt3LXAj1D5m_PUbg,23
2
2
  makea_cli/__main__.py,sha256=AkQjxWfKE3w9iD1d6I-2Zqvv2t9cct0oYyFF0UiA-Z0,144
3
- makea_cli/api_client.py,sha256=HBxrRDHzWe7VCHKgr3gPQirYRHlfLvMHns4vXKGv9h0,85257
3
+ makea_cli/api_client.py,sha256=5HmLZuY1ljqbSDd-BpGFyWLFZt2iCCYENAjBX11EwGU,90271
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
@@ -12,7 +12,7 @@ makea_cli/main.py,sha256=oU7cMXiZwCnT8gZS1vvuZYgtpDnyqTtb0dlkKIULZzo,9445
12
12
  makea_cli/output.py,sha256=6xOJFjoIBphc10nz53xKCyQiz06an7oGtFJ0bap1G-Y,6739
13
13
  makea_cli/posthog_client.py,sha256=k0cy9Hq7bhdLlPvC1ZW_esJ70xHDdQzPQUlx-GpVskk,1921
14
14
  makea_cli/registry.py,sha256=GYJK_idhwIh1X2ictwFjn8PEMaXT56hFVkoLEVYrVqw,13722
15
- makea_cli/commands/__init__.py,sha256=jLmxRxUat3CmdFpztpPsdD4aTb94XtZoclu9D2njXQg,2142
15
+ makea_cli/commands/__init__.py,sha256=JezGFTj6bCClcpdWudh9rfzbrWxHomFwu7HeGhCk69w,2249
16
16
  makea_cli/commands/_util.py,sha256=zSFwWaWpncARlKxgq4WuJlJvNv7XdZ39HfHrNOELHuw,980
17
17
  makea_cli/commands/about/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  makea_cli/commands/about/cmd.py,sha256=smvn0WWfRfyL6h1ZB7vXSmJY67t7qhTHdRqxTk4jqeI,9665
@@ -40,6 +40,8 @@ makea_cli/commands/library/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
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
42
  makea_cli/commands/metrics/cmd.py,sha256=gAYNztkhvdK8miP3ayDu0JgYzxLr42-ToeiXBCrAQeA,8656
43
+ makea_cli/commands/order_flow/__init__.py,sha256=SmD-TaDbNZLeu8q1nkPi2H6gJaKCrNAyW3Ejj6-UBog,79
44
+ makea_cli/commands/order_flow/cmd.py,sha256=3kUelbdFDDaxxLp0GMjtSG__CbV_aQQDhswxeJCR4aY,30960
43
45
  makea_cli/commands/orders/__init__.py,sha256=6WKPqX02e0RRPmItPIBJ0TA4_yDI2PVvBDkAiMQu9rU,75
44
46
  makea_cli/commands/orders/cmd.py,sha256=LgYPmC-eXEIvKhDYLKxo03DsJ2529-yKPKFPixnMBu0,23072
45
47
  makea_cli/commands/playbook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -57,7 +59,7 @@ makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNL
57
59
  makea_cli/commands/supplier/cmd.py,sha256=12YzQIz8478ksOUbuI7pSwSAwQAqLTvXu-AKjyrwLgA,64039
58
60
  makea_cli/commands/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
61
  makea_cli/commands/tasks/cmd.py,sha256=72MrVigmjjQCpDVF2a3aJn_gclw2iBbJdFmyd87mXec,8549
60
- makea_cli-0.2.35.dist-info/METADATA,sha256=0LiiWfvFcceLTx3P1YIMpia-NyzTPzMVTKZGw5JvScI,47396
61
- makea_cli-0.2.35.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
62
- makea_cli-0.2.35.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
63
- makea_cli-0.2.35.dist-info/RECORD,,
62
+ makea_cli-0.2.37.dist-info/METADATA,sha256=ls1R_knOZuxyOxXZnERi-rPst9gUhmTpxBg629G4z7Q,51096
63
+ makea_cli-0.2.37.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
64
+ makea_cli-0.2.37.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
65
+ makea_cli-0.2.37.dist-info/RECORD,,