makea-cli 0.2.20__py3-none-any.whl → 0.2.22__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 +1 -1
- makea_cli/api_client.py +29 -0
- makea_cli/commands/__init__.py +2 -0
- makea_cli/commands/directory/cmd.py +13 -0
- makea_cli/commands/playbook/cmd.py +82 -4
- makea_cli/commands/tasks/__init__.py +0 -0
- makea_cli/commands/tasks/cmd.py +159 -0
- {makea_cli-0.2.20.dist-info → makea_cli-0.2.22.dist-info}/METADATA +7 -4
- {makea_cli-0.2.20.dist-info → makea_cli-0.2.22.dist-info}/RECORD +11 -9
- {makea_cli-0.2.20.dist-info → makea_cli-0.2.22.dist-info}/WHEEL +0 -0
- {makea_cli-0.2.20.dist-info → makea_cli-0.2.22.dist-info}/entry_points.txt +0 -0
makea_cli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.22"
|
makea_cli/api_client.py
CHANGED
|
@@ -1191,6 +1191,35 @@ def admin_delete_rule(base: str, rule_id: str, reason: str) -> Any:
|
|
|
1191
1191
|
return delete_json(_rule_path(base, rule_id), body={"reason": reason})
|
|
1192
1192
|
|
|
1193
1193
|
|
|
1194
|
+
# --- admin: the Makea team's task queue -------------------------------------------
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
def admin_list_tasks(
|
|
1198
|
+
*,
|
|
1199
|
+
kind: str | None = None,
|
|
1200
|
+
type_: str | None = None,
|
|
1201
|
+
user: str | None = None,
|
|
1202
|
+
product: str | None = None,
|
|
1203
|
+
) -> Any:
|
|
1204
|
+
"""GET /admin/tasks — the team's open tasks; filters are comma-separated."""
|
|
1205
|
+
params = {
|
|
1206
|
+
k: v
|
|
1207
|
+
for k, v in (("kind", kind), ("type", type_), ("user", user), ("product", product))
|
|
1208
|
+
if v
|
|
1209
|
+
}
|
|
1210
|
+
return get_json("/admin/tasks", params=params or None)
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
def admin_get_task(task_id: str) -> Any:
|
|
1214
|
+
"""GET /admin/tasks/{task_id} — one task, with Beeboo's finding behind it."""
|
|
1215
|
+
return get_json(f"/admin/tasks/{quote(task_id, safe='')}")
|
|
1216
|
+
|
|
1217
|
+
|
|
1218
|
+
def admin_close_task(task_id: str, verb: str, body: dict[str, Any]) -> Any:
|
|
1219
|
+
"""POST /admin/tasks/{task_id}/{done|dismiss} — {note, reason?, caused_by?, recurs?}."""
|
|
1220
|
+
return post_json(f"/admin/tasks/{quote(task_id, safe='')}/{verb}", body)
|
|
1221
|
+
|
|
1222
|
+
|
|
1194
1223
|
# --- admin: one account's Knowledge > About you -----------------------------------
|
|
1195
1224
|
# A person (user_id or email; a supplier account's person is their factory's page)
|
|
1196
1225
|
# or one factory by supplier id. Every write but refresh carries a reason.
|
makea_cli/commands/__init__.py
CHANGED
|
@@ -19,6 +19,7 @@ from makea_cli.commands.product.cmd import register as register_product
|
|
|
19
19
|
from makea_cli.commands.production.cmd import register as register_production
|
|
20
20
|
from makea_cli.commands.shipping.cmd import register as register_shipping
|
|
21
21
|
from makea_cli.commands.supplier.cmd import register as register_supplier
|
|
22
|
+
from makea_cli.commands.tasks.cmd import register as register_tasks
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
def register_all(app: typer.Typer) -> None:
|
|
@@ -39,3 +40,4 @@ def register_all(app: typer.Typer) -> None:
|
|
|
39
40
|
register_brand(app)
|
|
40
41
|
register_playbook(app)
|
|
41
42
|
register_about(app)
|
|
43
|
+
register_tasks(app)
|
|
@@ -232,6 +232,15 @@ def register(app: typer.Typer) -> None:
|
|
|
232
232
|
"--company-certificate-document-id",
|
|
233
233
|
help="Optional company-certificate document ID already stored under the user.",
|
|
234
234
|
),
|
|
235
|
+
billing_currency: str | None = typer.Option(
|
|
236
|
+
None,
|
|
237
|
+
"--billing-currency",
|
|
238
|
+
help=(
|
|
239
|
+
"Optional ISO code (GBP, USD, EUR…) the account bills in. Every product "
|
|
240
|
+
"nothing is paid on yet follows, and a 'Set your billing currency' card "
|
|
241
|
+
"closes."
|
|
242
|
+
),
|
|
243
|
+
),
|
|
235
244
|
) -> None:
|
|
236
245
|
"""
|
|
237
246
|
Admin: update a user's DDB profile fields and/or Cognito custom:userType.
|
|
@@ -262,6 +271,10 @@ def register(app: typer.Typer) -> None:
|
|
|
262
271
|
("referral_type", referral_type),
|
|
263
272
|
("referral_detail", referral_detail),
|
|
264
273
|
("company_certificate_document_id", company_certificate_document_id),
|
|
274
|
+
(
|
|
275
|
+
"billing_currency",
|
|
276
|
+
billing_currency.strip().upper() if billing_currency is not None else None,
|
|
277
|
+
),
|
|
265
278
|
]
|
|
266
279
|
for key, value in scalar_options:
|
|
267
280
|
if value is not None:
|
|
@@ -15,6 +15,8 @@ one of three targets:
|
|
|
15
15
|
Every write needs ``--reason``. The rule keeps it as an evidence entry
|
|
16
16
|
(``admin_add`` / ``admin_edit`` / ``admin_delete`` with who, why, when and,
|
|
17
17
|
for edits and deletes, what the rule was before), and the audit log records it.
|
|
18
|
+
``--reason`` is the change log and the brand never reads it; ``--why`` and
|
|
19
|
+
``--proof`` are what the brand reads under the rule on Knowledge > Rules.
|
|
18
20
|
``delete`` archives: the rule leaves the brand's Rules page and every prompt,
|
|
19
21
|
the row stays as the record, and ``update --status active`` brings it back.
|
|
20
22
|
"""
|
|
@@ -55,6 +57,15 @@ when there is no team); --scope overrides.
|
|
|
55
57
|
style, collection, supplier, element (e.g. supplier:sup_123:Ningbo Knit).
|
|
56
58
|
"all" (update only) widens it back to the whole account.
|
|
57
59
|
|
|
60
|
+
--why is the reason the brand reads under the rule; --proof (repeatable) is
|
|
61
|
+
one message behind it, WHO|YYYY-MM-DD|TEXT or WHO|TEXT, WHO being Brand,
|
|
62
|
+
Factory, record or a name. Both are kept apart from --reason, which only
|
|
63
|
+
admins see. A later --why/--proof replaces the earlier pair.
|
|
64
|
+
|
|
65
|
+
--title is the rule's card name on the brand's Rules page ("Restate every
|
|
66
|
+
comment"). Beeboo names every rule by itself; a --title given here holds
|
|
67
|
+
until the rule's words change. update --title "" hands naming back to Beeboo.
|
|
68
|
+
|
|
58
69
|
--when is which products it is for, as JSON:
|
|
59
70
|
'{"categories": ["knitwear"], "service_modes": ["cmt"]}'
|
|
60
71
|
Order conditions the rule already has (units, destination) are kept; {} means
|
|
@@ -64,7 +75,9 @@ Examples
|
|
|
64
75
|
makea-cli admin list rule --user brand@example.com
|
|
65
76
|
makea-cli admin get rule rul_0123456789ab --user brand@example.com
|
|
66
77
|
makea-cli admin create rule --user brand@example.com \\
|
|
67
|
-
--text "Always book DHL Express for samples" --reason "Agreed on the 14 Oct call"
|
|
78
|
+
--text "Always book DHL Express for samples" --reason "Agreed on the 14 Oct call" \\
|
|
79
|
+
--why "Two sample parcels were lost with the economy courier" \\
|
|
80
|
+
--proof "Brand|2026-10-14|Please only use DHL Express for samples from now on"
|
|
68
81
|
makea-cli admin update rule rul_0123456789ab --user brand@example.com \\
|
|
69
82
|
--status muted --reason "Brand asked to pause it by email"
|
|
70
83
|
makea-cli admin delete rule rul_0123456789ab --user brand@example.com \\
|
|
@@ -114,6 +127,58 @@ def _reason(raw: str) -> str:
|
|
|
114
127
|
return reason
|
|
115
128
|
|
|
116
129
|
|
|
130
|
+
def _why_option() -> Any:
|
|
131
|
+
return typer.Option(
|
|
132
|
+
None, "--why", help="Why the rule exists, as the brand reads it (max 300 chars)."
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def _title_option() -> Any:
|
|
137
|
+
return typer.Option(
|
|
138
|
+
None,
|
|
139
|
+
"--title",
|
|
140
|
+
help="The card name on the brand's Rules page, 2-4 words (Beeboo names it "
|
|
141
|
+
'when left out; "" on update hands it back to Beeboo).',
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def _proof_option() -> Any:
|
|
146
|
+
return typer.Option(
|
|
147
|
+
None,
|
|
148
|
+
"--proof",
|
|
149
|
+
help="A message behind the rule, WHO|YYYY-MM-DD|TEXT or WHO|TEXT (repeatable, max 5).",
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def _proof(raw: list[str]) -> list[dict[str, str]]:
|
|
154
|
+
out = []
|
|
155
|
+
for item in raw:
|
|
156
|
+
parts = [p.strip() for p in item.split("|", 2)]
|
|
157
|
+
if len(parts) == 3:
|
|
158
|
+
who, at, text = parts
|
|
159
|
+
try:
|
|
160
|
+
at = date.fromisoformat(at).isoformat()
|
|
161
|
+
except ValueError as e:
|
|
162
|
+
raise typer.BadParameter(f"--proof date must be YYYY-MM-DD: {item}") from e
|
|
163
|
+
elif len(parts) == 2:
|
|
164
|
+
(who, text), at = parts, ""
|
|
165
|
+
else:
|
|
166
|
+
raise typer.BadParameter(f"--proof must be WHO|YYYY-MM-DD|TEXT: {item}")
|
|
167
|
+
if not who or not text:
|
|
168
|
+
raise typer.BadParameter(f"--proof needs who and text: {item}")
|
|
169
|
+
out.append({"who": who, "at": at, "text": text})
|
|
170
|
+
if len(out) > 5:
|
|
171
|
+
raise typer.BadParameter("--proof at most 5 times")
|
|
172
|
+
return out
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def _basis(body: dict[str, Any], why: str | None, proof: list[str] | None) -> None:
|
|
176
|
+
if why is not None and why.strip():
|
|
177
|
+
body["why"] = " ".join(why.split())
|
|
178
|
+
if proof:
|
|
179
|
+
body["proof"] = _proof(proof)
|
|
180
|
+
|
|
181
|
+
|
|
117
182
|
def _applies_to(raw: str) -> dict[str, str]:
|
|
118
183
|
if raw.strip().lower() == "all":
|
|
119
184
|
return {"kind": "all"}
|
|
@@ -348,6 +413,9 @@ def register(app: typer.Typer) -> None:
|
|
|
348
413
|
"--valid-until",
|
|
349
414
|
help="YYYY-MM-DD the rule ends on (a closure, a temporary arrangement).",
|
|
350
415
|
),
|
|
416
|
+
why: str | None = _why_option(),
|
|
417
|
+
proof: list[str] | None = _proof_option(),
|
|
418
|
+
title: str | None = _title_option(),
|
|
351
419
|
) -> None:
|
|
352
420
|
"""Add a playbook rule for a person, a factory or everyone."""
|
|
353
421
|
base = _target(user, supplier, is_global)
|
|
@@ -374,6 +442,9 @@ def register(app: typer.Typer) -> None:
|
|
|
374
442
|
body["force"] = True
|
|
375
443
|
if valid_until is not None:
|
|
376
444
|
body["valid_until"] = _date(valid_until)
|
|
445
|
+
_basis(body, why, proof)
|
|
446
|
+
if title is not None and title.strip():
|
|
447
|
+
body["title"] = " ".join(title.split())
|
|
377
448
|
print_json_or_exit(console, lambda: api_client.admin_create_rule(base, body))
|
|
378
449
|
|
|
379
450
|
@command(
|
|
@@ -391,7 +462,8 @@ def register(app: typer.Typer) -> None:
|
|
|
391
462
|
idempotent=True,
|
|
392
463
|
help=(
|
|
393
464
|
"PATCH /admin/playbook/{target}/rules/{rule_id} — change a rule's text, "
|
|
394
|
-
"status, applies_to, when
|
|
465
|
+
"status, applies_to, when, mode, the --why/--proof the brand reads, or its card "
|
|
466
|
+
"--title. --reason required; the rule keeps what it was before."
|
|
395
467
|
),
|
|
396
468
|
epilog=_RULES_EPILOG,
|
|
397
469
|
)
|
|
@@ -415,6 +487,9 @@ def register(app: typer.Typer) -> None:
|
|
|
415
487
|
"--valid-until",
|
|
416
488
|
help='YYYY-MM-DD the rule ends on; "none" removes the end date.',
|
|
417
489
|
),
|
|
490
|
+
why: str | None = _why_option(),
|
|
491
|
+
proof: list[str] | None = _proof_option(),
|
|
492
|
+
title: str | None = _title_option(),
|
|
418
493
|
) -> None:
|
|
419
494
|
"""Edit a playbook rule."""
|
|
420
495
|
base = _target(user, supplier, is_global)
|
|
@@ -433,10 +508,13 @@ def register(app: typer.Typer) -> None:
|
|
|
433
508
|
body["valid_until"] = (
|
|
434
509
|
"" if valid_until.strip().lower() == "none" else _date(valid_until)
|
|
435
510
|
)
|
|
511
|
+
_basis(body, why, proof)
|
|
512
|
+
if title is not None:
|
|
513
|
+
body["title"] = " ".join(title.split())
|
|
436
514
|
if not body:
|
|
437
515
|
raise typer.BadParameter(
|
|
438
|
-
"nothing to change: pass --text, --status, --applies-to, --when, --mode "
|
|
439
|
-
"
|
|
516
|
+
"nothing to change: pass --text, --status, --applies-to, --when, --mode, "
|
|
517
|
+
"--valid-until, --why, --proof or --title"
|
|
440
518
|
)
|
|
441
519
|
body["reason"] = _reason(reason)
|
|
442
520
|
print_json_or_exit(console, lambda: api_client.admin_update_rule(base, rule_id, body))
|
|
File without changes
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"""Admin commands for the Makea team's task queue.
|
|
2
|
+
|
|
3
|
+
A *task* is a card the Makea team owns: Beeboo's notes from reading the chats
|
|
4
|
+
(a lesson it held back from the brand's rules, or a slip of the platform's),
|
|
5
|
+
a sample priced far above bulk, a PP sample to see through, a brand's ask in
|
|
6
|
+
the concierge thread. With ``--user``, an account's own cards the team may
|
|
7
|
+
settle for it (``account.*``, such as its billing currency) are listed too.
|
|
8
|
+
|
|
9
|
+
Kinds: ``unknown`` (a lesson nobody said the reason for), ``once`` (a lesson
|
|
10
|
+
read as one order's problem), ``note`` (a slip of Makea's or the platform's),
|
|
11
|
+
``sample_price``, ``pp_sample``, ``brand_ask``, ``setting``.
|
|
12
|
+
|
|
13
|
+
The change a task asks for is made with the command that owns it (``admin
|
|
14
|
+
create rule``, ``admin update user``, ``admin update about`` …); ``update
|
|
15
|
+
task --done`` then records that it was handled. Only notes the team handles
|
|
16
|
+
off the platform can be marked done; the others close by themselves when the
|
|
17
|
+
fact behind them lands, and ``get task`` says which fact.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
from typing import Any
|
|
23
|
+
|
|
24
|
+
import typer
|
|
25
|
+
from rich.console import Console
|
|
26
|
+
|
|
27
|
+
from makea_cli import api_client
|
|
28
|
+
from makea_cli.commands._util import print_json_or_exit
|
|
29
|
+
from makea_cli.registry import command
|
|
30
|
+
|
|
31
|
+
console = Console()
|
|
32
|
+
|
|
33
|
+
_CAUSES = ("factory", "brand", "makea", "outside")
|
|
34
|
+
|
|
35
|
+
_TASKS_EPILOG = """
|
|
36
|
+
Kinds: unknown (a lesson nobody said why), once (one order's problem),
|
|
37
|
+
note (a slip of Makea's or the platform's), sample_price, pp_sample,
|
|
38
|
+
brand_ask, setting.
|
|
39
|
+
|
|
40
|
+
Examples
|
|
41
|
+
makea-cli admin list task --kind unknown,once
|
|
42
|
+
makea-cli admin list task --user brand@example.com
|
|
43
|
+
makea-cli admin get task 4d85c843-3888-500e-adb2-207f0f07110d
|
|
44
|
+
makea-cli admin update task <task_id> --done --note "Asked the brand on WhatsApp" \\
|
|
45
|
+
--reason "The brand changed the cuff after approval" --caused-by brand --once
|
|
46
|
+
makea-cli admin update task <task_id> --dismiss --note "Brand keeps GBP"
|
|
47
|
+
""".strip()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def register(app: typer.Typer) -> None:
|
|
51
|
+
@command(
|
|
52
|
+
app,
|
|
53
|
+
"admin",
|
|
54
|
+
"list",
|
|
55
|
+
"task",
|
|
56
|
+
api="GET /admin/tasks",
|
|
57
|
+
help=(
|
|
58
|
+
"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.*)."
|
|
61
|
+
),
|
|
62
|
+
epilog=_TASKS_EPILOG,
|
|
63
|
+
)
|
|
64
|
+
def list_tasks(
|
|
65
|
+
kind: str | None = typer.Option(
|
|
66
|
+
None, "--kind", "-k", help="Only these kinds, comma-separated."
|
|
67
|
+
),
|
|
68
|
+
type_: str | None = typer.Option(
|
|
69
|
+
None, "--type", help="Only these action types, e.g. makea.beeboo_note."
|
|
70
|
+
),
|
|
71
|
+
user: str | None = typer.Option(
|
|
72
|
+
None, "--user", "-u", help="One account: user_id or email."
|
|
73
|
+
),
|
|
74
|
+
product: str | None = typer.Option(None, "--product", "-p", help="One product id."),
|
|
75
|
+
) -> None:
|
|
76
|
+
"""List the Makea team's open tasks."""
|
|
77
|
+
print_json_or_exit(
|
|
78
|
+
console,
|
|
79
|
+
lambda: api_client.admin_list_tasks(kind=kind, type_=type_, user=user, product=product),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
@command(
|
|
83
|
+
app,
|
|
84
|
+
"admin",
|
|
85
|
+
"get",
|
|
86
|
+
"task",
|
|
87
|
+
api="GET /admin/tasks/{task_id}",
|
|
88
|
+
help=(
|
|
89
|
+
"GET /admin/tasks/{task_id} — one task in full: body, context, admin_url, "
|
|
90
|
+
"next (what settles it), and for a held lesson the finding Beeboo kept "
|
|
91
|
+
"(problem, factory, product, reason so far)."
|
|
92
|
+
),
|
|
93
|
+
epilog=_TASKS_EPILOG,
|
|
94
|
+
)
|
|
95
|
+
def get_task(task_id: str = typer.Argument(..., help="Task id (from list task).")) -> None:
|
|
96
|
+
"""Show one task and what settles it."""
|
|
97
|
+
print_json_or_exit(console, lambda: api_client.admin_get_task(task_id))
|
|
98
|
+
|
|
99
|
+
@command(
|
|
100
|
+
app,
|
|
101
|
+
"admin",
|
|
102
|
+
"update",
|
|
103
|
+
"task",
|
|
104
|
+
api="POST /admin/tasks/{task_id}/{done|dismiss}",
|
|
105
|
+
side_effects=[
|
|
106
|
+
"closes the task for the whole Makea team",
|
|
107
|
+
"with --reason, Beeboo's next reading of the chats uses that reason",
|
|
108
|
+
],
|
|
109
|
+
approval="ask",
|
|
110
|
+
reversible=False,
|
|
111
|
+
idempotent=False,
|
|
112
|
+
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."
|
|
117
|
+
),
|
|
118
|
+
epilog=_TASKS_EPILOG,
|
|
119
|
+
)
|
|
120
|
+
def update_task(
|
|
121
|
+
task_id: str = typer.Argument(..., help="Task id (from list task)."),
|
|
122
|
+
done: bool = typer.Option(False, "--done", help="It was handled."),
|
|
123
|
+
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)."),
|
|
125
|
+
reason: str | None = typer.Option(
|
|
126
|
+
None,
|
|
127
|
+
"--reason",
|
|
128
|
+
help="With --done on a held lesson: why it happened, as the team found out.",
|
|
129
|
+
),
|
|
130
|
+
caused_by: str | None = typer.Option(
|
|
131
|
+
None, "--caused-by", help=f"With --reason: {', '.join(_CAUSES)}."
|
|
132
|
+
),
|
|
133
|
+
recurs: bool | None = typer.Option(
|
|
134
|
+
None,
|
|
135
|
+
"--recurs/--once",
|
|
136
|
+
help="With --reason: it will happen again, or it was this order only.",
|
|
137
|
+
),
|
|
138
|
+
) -> None:
|
|
139
|
+
"""Mark a task done, or dismiss it."""
|
|
140
|
+
if done == dismiss:
|
|
141
|
+
raise typer.BadParameter("pass exactly one of --done, --dismiss")
|
|
142
|
+
clean_note = " ".join(note.split())
|
|
143
|
+
if not clean_note:
|
|
144
|
+
raise typer.BadParameter("--note must not be empty")
|
|
145
|
+
body: dict[str, Any] = {"note": clean_note}
|
|
146
|
+
if reason is not None:
|
|
147
|
+
if not done:
|
|
148
|
+
raise typer.BadParameter("--reason goes with --done")
|
|
149
|
+
body["reason"] = " ".join(reason.split())
|
|
150
|
+
if caused_by is not None:
|
|
151
|
+
if caused_by not in _CAUSES:
|
|
152
|
+
raise typer.BadParameter(f"--caused-by: one of {', '.join(_CAUSES)}")
|
|
153
|
+
body["caused_by"] = caused_by
|
|
154
|
+
if recurs is not None:
|
|
155
|
+
body["recurs"] = recurs
|
|
156
|
+
elif caused_by is not None or recurs is not None:
|
|
157
|
+
raise typer.BadParameter("--caused-by and --recurs/--once go with --reason")
|
|
158
|
+
verb = "done" if done else "dismiss"
|
|
159
|
+
print_json_or_exit(console, lambda: api_client.admin_close_task(task_id, verb, body))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: makea-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.22
|
|
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
|
|
@@ -92,7 +92,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
92
92
|
| `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` |
|
|
93
93
|
| `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` |
|
|
94
94
|
| `makea-cli admin create quote-request` | write(ask) | `POST /admin/supplier/create_quote_request` | create/send a quote request to a supplier for a product (admin). | `create-quote-request` |
|
|
95
|
-
| `makea-cli admin create rule` | write(ask) | `POST /admin/playbook/{target}/rules` | add a rule to a person's (`--user`, user_id or email), a factory's (`--supplier`) or the platform-wide (`--global`, max 30 live) AI playbook; admin-authored, active unless --status. Refuses a repeat or a conflict unless --force. --reason required. | — |
|
|
95
|
+
| `makea-cli admin create rule` | write(ask) | `POST /admin/playbook/{target}/rules` | add a rule to a person's (`--user`, user_id or email), a factory's (`--supplier`) or the platform-wide (`--global`, max 30 live) AI playbook; admin-authored, active unless --status. Refuses a repeat or a conflict unless --force. --reason required; --why / --proof are what the brand reads under it, --title its card name. | — |
|
|
96
96
|
| `makea-cli admin create shipping-fee` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/fees/add` | add a fee (fixed amount or percentage) on top of the freight. | — |
|
|
97
97
|
| `makea-cli admin create shipping-option` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/shipping-options` | add one freight quote (provider, speed, price, currency). | — |
|
|
98
98
|
| `makea-cli admin create shipping-order` | write(ask) | `POST /admin/shipping_orders/create` | make a shipment for a brand's production and/or sampling orders. The shipment belongs to the orders' owner; you are r… | — |
|
|
@@ -123,6 +123,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
123
123
|
| `makea-cli admin get rule-history` | read | `GET /admin/playbook/rules/{rule_id}/history` | every revision of one rule: its words, who changed it and why, and the rule that replaced it. | — |
|
|
124
124
|
| `makea-cli admin get shipping-order` | read | `GET /admin/shipping_orders/{shipping_order_id}/details` | one shipment with its production and sampling orders, freight quotes, fees, tracking and address. | — |
|
|
125
125
|
| `makea-cli admin get supplier-profile-schema` | read | `GET /admin/supplier/profile/schema` | supplier profile v2 schema (section/field taxonomy: sections, fields, options, required rules). | `get-supplier-profile-schema` |
|
|
126
|
+
| `makea-cli admin get task` | read | `GET /admin/tasks/{task_id}` | one Makea task in full: body, admin link, what settles it, and for a held lesson the finding Beeboo kept. | — |
|
|
126
127
|
| `makea-cli admin get tech-spec-extraction` | read | `GET /admin/products/{id}/extract-tech-specifications` | AI-generate specs (not saved). | `extract-ai-tech-spec` |
|
|
127
128
|
| `makea-cli admin get top-clicks` | read | `POST /admin/analytics/query` | which buttons/elements get clicked most. | `analytics-top-clicks` |
|
|
128
129
|
| `makea-cli admin get top-features` | read | `POST /admin/analytics/query` | a quick map of which features get used most. | `analytics-top-features` |
|
|
@@ -132,11 +133,12 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
132
133
|
| `makea-cli admin list production-order` | read | `GET /admin/production_orders?type=PRODUCTION` | 大货 (production) orders only. For restock use admin list restock-order; for shipping use admin list shipping-order. | `list-all-production-orders` |
|
|
133
134
|
| `makea-cli admin list quote-request` | read | `GET /admin/quote_requests` | quote requests, optionally for one product (--product) or one supplier (--supplier, GET /admin/quote_requests/supplie… | — |
|
|
134
135
|
| `makea-cli admin list restock-order` | read | `GET /admin/production_orders?type=RESTOCK` | restock orders only. Restock shares the production_orders table; this filters to type=RESTOCK. | `list-all-restock-orders` |
|
|
135
|
-
| `makea-cli admin list rule` | read | `GET /admin/playbook/{target}/rules` | every AI playbook rule for one person (team, own account, factory), one factory (`--supplier`) or the platform (`--global`): status, scope, text, which products, effect, source. Archived ones only with --all. | — |
|
|
136
|
+
| `makea-cli admin list rule` | read | `GET /admin/playbook/{target}/rules` | every AI playbook rule for one person (team, own account, factory), one factory (`--supplier`) or the platform (`--global`): status, scope, title, text, which products, effect, source. Archived ones only with --all. | — |
|
|
136
137
|
| `makea-cli admin list sampling-order` | read | `GET /admin/sampling_orders/get_all` | paginated list of all sampling orders (admin). | `list-all-sampling-orders` |
|
|
137
138
|
| `makea-cli admin list shipping-order` | read | `GET /admin/shipping_orders` | paginated list of all shipping orders (admin). | `list-all-shipping-orders` |
|
|
138
139
|
| `makea-cli admin list supplier` | read | `GET /admin/supplier/get_all_suppliers` | list all suppliers (admin). | `list-suppliers` |
|
|
139
140
|
| `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` |
|
|
141
|
+
| `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. | — |
|
|
140
142
|
| `makea-cli admin list user` | read | `GET /admin/users` | list registered users (admin, optional pagination). | `list-users` |
|
|
141
143
|
| `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` |
|
|
142
144
|
| `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` |
|
|
@@ -148,9 +150,10 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
148
150
|
| `makea-cli admin update library-element` | write(auto) | `PATCH /admin/designer/{user_id}/library_components/{component_id}` | update a component's name and/or values (empty value clears a field). | `library-update` |
|
|
149
151
|
| `makea-cli admin update quote` | write(ask) | `POST /admin/product/edit_supplier_link_override_info` | admin updates an existing quote (supplier link) in place. Only the options you pass are sent, and the backend leaves … | `update-supplier-quote` |
|
|
150
152
|
| `makea-cli admin update quote-request` | write(ask) | `PATCH /admin/quote_requests/{quote_request_id}/update` | set a quote request's stage, status and/or due date. Only what you pass is changed. This is the door that unblocks a … | `update-quote-request` |
|
|
151
|
-
| `makea-cli admin update rule` | write(ask) | `PATCH /admin/playbook/{target}/rules/{rule_id}` | change a rule's text, status, applies_to, when, mode or end date (--valid-until), on `--user` / `--supplier` / `--global`. --reason required; the rule keeps what it was before. | — |
|
|
153
|
+
| `makea-cli admin update rule` | write(ask) | `PATCH /admin/playbook/{target}/rules/{rule_id}` | change a rule's text, status, applies_to, when, mode or end date (--valid-until), the --why / --proof the brand reads, or its card --title, on `--user` / `--supplier` / `--global`. --reason required; the rule keeps what it was before. | — |
|
|
152
154
|
| `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… | — |
|
|
153
155
|
| `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` |
|
|
156
|
+
| `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`. | — |
|
|
154
157
|
| `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
|
|
155
158
|
| `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). | — |
|
|
156
159
|
| `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=
|
|
1
|
+
makea_cli/__init__.py,sha256=ByX4mXI7ZzGpflAj9VCqX2NLBK8uAil5WOrao7y2YZM,23
|
|
2
2
|
makea_cli/__main__.py,sha256=AkQjxWfKE3w9iD1d6I-2Zqvv2t9cct0oYyFF0UiA-Z0,144
|
|
3
|
-
makea_cli/api_client.py,sha256=
|
|
3
|
+
makea_cli/api_client.py,sha256=SJu96FAB2jjbXtbg6rz9dbJfAdR-xodP_7bwsQnLn2c,74802
|
|
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/config.py,sha256=hz8MnJSkhxcIEZkcpHR005JrDceo1Xmi8qwIUq50cMU,3003
|
|
@@ -10,7 +10,7 @@ makea_cli/main.py,sha256=nuTQ8_P8OSdRbjMHMB4qcKdex124nS-ApCW-zfbqlI0,7169
|
|
|
10
10
|
makea_cli/output.py,sha256=VWvZe2Ad8zxT4ZQyBhFRc6wkFwbyYzQFPddepANGAbY,6361
|
|
11
11
|
makea_cli/posthog_client.py,sha256=k0cy9Hq7bhdLlPvC1ZW_esJ70xHDdQzPQUlx-GpVskk,1921
|
|
12
12
|
makea_cli/registry.py,sha256=GYJK_idhwIh1X2ictwFjn8PEMaXT56hFVkoLEVYrVqw,13722
|
|
13
|
-
makea_cli/commands/__init__.py,sha256=
|
|
13
|
+
makea_cli/commands/__init__.py,sha256=pg4rWSbRz-7ZqwDN4tXAq3knR--k58Xlk5HUb4ZvhSU,1860
|
|
14
14
|
makea_cli/commands/_util.py,sha256=zSFwWaWpncARlKxgq4WuJlJvNv7XdZ39HfHrNOELHuw,980
|
|
15
15
|
makea_cli/commands/about/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
makea_cli/commands/about/cmd.py,sha256=smvn0WWfRfyL6h1ZB7vXSmJY67t7qhTHdRqxTk4jqeI,9665
|
|
@@ -23,7 +23,7 @@ makea_cli/commands/brand/cmd.py,sha256=I2L1F-OGoLkwZ6xNXAuM-KWTXhp1ebPNxTjmr7lQt
|
|
|
23
23
|
makea_cli/commands/designer/__init__.py,sha256=Tc3Ju4-BKX2euBljhlrEd-Ksirk6JSPNixq4x0IbQYI,77
|
|
24
24
|
makea_cli/commands/designer/cmd.py,sha256=4oOJ5tWYojUs8FBj3QRmgpwbicpsU1XqswoNlJpLLS8,23615
|
|
25
25
|
makea_cli/commands/directory/__init__.py,sha256=rQHBc0JOFXynlzrBm_YfqoRuNsS-JOl-OOvPjgDbnIA,78
|
|
26
|
-
makea_cli/commands/directory/cmd.py,sha256=
|
|
26
|
+
makea_cli/commands/directory/cmd.py,sha256=yceMXLjPAkPQARYeHVAQ7koPjluhSt14fJmVh95yVkY,12132
|
|
27
27
|
makea_cli/commands/document/__init__.py,sha256=7u8jLBGeryD7ocqX17DCf0eCkyjcrpzXcwc2wEEOXw8,77
|
|
28
28
|
makea_cli/commands/document/cmd.py,sha256=IqjzGoTYXp1RbTIYY1MSEqX93btK4eESDTX40C7qFXA,23026
|
|
29
29
|
makea_cli/commands/email/__init__.py,sha256=EWMqMTgZK1GQDW7-9RGVSGU-CvaHTARjXZL18Hdj80I,74
|
|
@@ -37,7 +37,7 @@ makea_cli/commands/metrics/cmd.py,sha256=ox5OD7Bk3QJcdHQv5u4t6G-OlC6eSbQG5BEH1yB
|
|
|
37
37
|
makea_cli/commands/orders/__init__.py,sha256=6WKPqX02e0RRPmItPIBJ0TA4_yDI2PVvBDkAiMQu9rU,75
|
|
38
38
|
makea_cli/commands/orders/cmd.py,sha256=Nh5lGv5k4SIwsr_hg-ndah8eTorZCYIMpTAz4CCi6oY,13352
|
|
39
39
|
makea_cli/commands/playbook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
makea_cli/commands/playbook/cmd.py,sha256=
|
|
40
|
+
makea_cli/commands/playbook/cmd.py,sha256=NiiVjfGLbNEqzfqqkxjxj-p6DZZI-7owRg1UtxtuG6M,21683
|
|
41
41
|
makea_cli/commands/product/__init__.py,sha256=mfdonFmpbddDSlJq6JWNWgNpM6aOpKtZr-3FJ6scrwg,76
|
|
42
42
|
makea_cli/commands/product/cmd.py,sha256=W0oVTZvsK1QWZWv2x6NC26_JQMXrO16O8gYuKYPWC08,7101
|
|
43
43
|
makea_cli/commands/production/__init__.py,sha256=Whn5ziwVMt4jzcokiFWLhWIpRLYC-ldnjZgAzeQ3We4,79
|
|
@@ -47,7 +47,9 @@ makea_cli/commands/shipping/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
|
|
|
47
47
|
makea_cli/commands/shipping/cmd.py,sha256=ozt73pj3onlOv0NhEwiJlslyG9WOycE0QN4tmzwFlT0,17280
|
|
48
48
|
makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNLu3ipsZ7dfs,77
|
|
49
49
|
makea_cli/commands/supplier/cmd.py,sha256=crRCy9WfhkryHMIL3iufoiT90_SG3-mKChAtdhd06uc,58076
|
|
50
|
-
makea_cli
|
|
51
|
-
makea_cli
|
|
52
|
-
makea_cli-0.2.
|
|
53
|
-
makea_cli-0.2.
|
|
50
|
+
makea_cli/commands/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
|
+
makea_cli/commands/tasks/cmd.py,sha256=SRvv4Ovtcf5-me-8AdKcZ_z_gSrdgC0pbswYbMz7oY4,6539
|
|
52
|
+
makea_cli-0.2.22.dist-info/METADATA,sha256=_4x_4_mqAfhiet0nJk5tmxAGBiGA63OGT8eeEO4Gtnk,37484
|
|
53
|
+
makea_cli-0.2.22.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
54
|
+
makea_cli-0.2.22.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
|
|
55
|
+
makea_cli-0.2.22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|