makea-cli 0.2.39__py3-none-any.whl → 0.2.41__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 +33 -0
- makea_cli/commands/__init__.py +2 -0
- makea_cli/commands/brand/cmd.py +94 -2
- makea_cli/commands/closures/__init__.py +0 -0
- makea_cli/commands/closures/cmd.py +208 -0
- {makea_cli-0.2.39.dist-info → makea_cli-0.2.41.dist-info}/METADATA +7 -2
- {makea_cli-0.2.39.dist-info → makea_cli-0.2.41.dist-info}/RECORD +10 -8
- {makea_cli-0.2.39.dist-info → makea_cli-0.2.41.dist-info}/WHEEL +0 -0
- {makea_cli-0.2.39.dist-info → makea_cli-0.2.41.dist-info}/entry_points.txt +0 -0
makea_cli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.41"
|
makea_cli/api_client.py
CHANGED
|
@@ -1960,6 +1960,11 @@ def designer_list_tasks() -> Any:
|
|
|
1960
1960
|
return get_json("/designer/tasks")
|
|
1961
1961
|
|
|
1962
1962
|
|
|
1963
|
+
def designer_get_address_book() -> Any:
|
|
1964
|
+
"""GET /designer/address-book — the brand's saved addresses (ids for --ships-to)."""
|
|
1965
|
+
return get_json("/designer/address-book")
|
|
1966
|
+
|
|
1967
|
+
|
|
1963
1968
|
def designer_list_payments() -> Any:
|
|
1964
1969
|
"""GET /designer/payments — the brand's charges and their state."""
|
|
1965
1970
|
return get_json("/designer/payments")
|
|
@@ -2360,3 +2365,31 @@ def designer_confirm_receive_shipping_order(shipping_order_id: str) -> Any:
|
|
|
2360
2365
|
def designer_cancel_shipping_order(shipping_order_id: str) -> Any:
|
|
2361
2366
|
"""POST /designer/shipping_orders/{id}/cancel — unlinks every production order, then deletes it."""
|
|
2362
2367
|
return post_json(f"/designer/shipping_orders/{shipping_order_id}/cancel", {})
|
|
2368
|
+
|
|
2369
|
+
|
|
2370
|
+
# --------------------------------------------------------------------------
|
|
2371
|
+
# Factory holiday closures (this year and next). Every date Makea counts for a
|
|
2372
|
+
# factory skips them; the factory confirms its own, or Makea does for it.
|
|
2373
|
+
# --------------------------------------------------------------------------
|
|
2374
|
+
|
|
2375
|
+
|
|
2376
|
+
def supplier_get_closures() -> Any:
|
|
2377
|
+
"""GET /supplier/closures — the logged-in factory's closures, this year and next."""
|
|
2378
|
+
return get_json("/supplier/closures")
|
|
2379
|
+
|
|
2380
|
+
|
|
2381
|
+
def supplier_set_closures(year: int, closures: list[dict[str, str]]) -> Any:
|
|
2382
|
+
"""PUT /supplier/closures — confirm one year's closures (replaces that year)."""
|
|
2383
|
+
return put_json("/supplier/closures", {"year": year, "closures": closures})
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
def admin_get_supplier_closures(supplier_id: str) -> Any:
|
|
2387
|
+
"""GET /admin/suppliers/{id}/closures — a factory's closures, this year and next."""
|
|
2388
|
+
return get_json(f"/admin/suppliers/{supplier_id}/closures")
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
def admin_set_supplier_closures(supplier_id: str, year: int, closures: list[dict[str, str]]) -> Any:
|
|
2392
|
+
"""PUT /admin/suppliers/{id}/closures — confirm one year for the factory, as Makea."""
|
|
2393
|
+
return put_json(
|
|
2394
|
+
f"/admin/suppliers/{supplier_id}/closures", {"year": year, "closures": closures}
|
|
2395
|
+
)
|
makea_cli/commands/__init__.py
CHANGED
|
@@ -6,6 +6,7 @@ from makea_cli.commands.about.cmd import register as register_about
|
|
|
6
6
|
from makea_cli.commands.analytics.cmd import register as register_analytics
|
|
7
7
|
from makea_cli.commands.auth.cmd import register as register_auth
|
|
8
8
|
from makea_cli.commands.brand.cmd import register as register_brand
|
|
9
|
+
from makea_cli.commands.closures.cmd import register as register_closures
|
|
9
10
|
from makea_cli.commands.designer.cmd import register as register_designer
|
|
10
11
|
from makea_cli.commands.directory.cmd import register as register_directory
|
|
11
12
|
from makea_cli.commands.document.cmd import register as register_document
|
|
@@ -42,6 +43,7 @@ def register_all(app: typer.Typer) -> None:
|
|
|
42
43
|
register_email(app)
|
|
43
44
|
register_library(app)
|
|
44
45
|
register_factory(app)
|
|
46
|
+
register_closures(app)
|
|
45
47
|
register_files(app)
|
|
46
48
|
register_brand(app)
|
|
47
49
|
register_playbook(app)
|
makea_cli/commands/brand/cmd.py
CHANGED
|
@@ -21,8 +21,56 @@ from rich.console import Console
|
|
|
21
21
|
|
|
22
22
|
from makea_cli import api_client
|
|
23
23
|
from makea_cli.commands._util import print_json_or_exit
|
|
24
|
+
from makea_cli.errors import ApiError
|
|
24
25
|
from makea_cli.registry import command
|
|
25
26
|
|
|
27
|
+
# What `designer create rfq` can answer itself when the server says the
|
|
28
|
+
# request still owes it (TECH-232); the rest is answered on the order page.
|
|
29
|
+
RFQ_FLAGS = {
|
|
30
|
+
"Ships to": "--ships-to",
|
|
31
|
+
"Physical sample": "--physical-sample",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _ships_to_value(raw: str) -> Any:
|
|
36
|
+
"""A saved address id, or the address as a JSON object."""
|
|
37
|
+
text = raw.strip()
|
|
38
|
+
if not text.startswith("{"):
|
|
39
|
+
return text
|
|
40
|
+
try:
|
|
41
|
+
value = json.loads(text)
|
|
42
|
+
except json.JSONDecodeError as e:
|
|
43
|
+
raise typer.BadParameter(f"--ships-to is not valid JSON: {e}") from e
|
|
44
|
+
if not isinstance(value, dict):
|
|
45
|
+
raise typer.BadParameter("--ships-to JSON must be an object")
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _yes_no(raw: str, flag: str) -> bool:
|
|
50
|
+
word = raw.strip().lower()
|
|
51
|
+
if word in ("yes", "y", "true"):
|
|
52
|
+
return True
|
|
53
|
+
if word in ("no", "n", "false"):
|
|
54
|
+
return False
|
|
55
|
+
raise typer.BadParameter(f"{flag} is yes or no")
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _owed_error(e: ApiError) -> ApiError:
|
|
59
|
+
"""The server's RFQ_INCOMPLETE, said as what to answer and how."""
|
|
60
|
+
detail = e.detail if isinstance(e.detail, dict) else {}
|
|
61
|
+
if detail.get("code") != "RFQ_INCOMPLETE":
|
|
62
|
+
return e
|
|
63
|
+
missing = [str(m) for m in detail.get("missing") or []]
|
|
64
|
+
named = [f"{m} ({RFQ_FLAGS[m]})" if m in RFQ_FLAGS else m for m in missing]
|
|
65
|
+
message = "The request can't go yet. Still to answer: " + ", ".join(named) + "."
|
|
66
|
+
if any(m not in RFQ_FLAGS for m in missing):
|
|
67
|
+
message += " The others are answered on the order's request card."
|
|
68
|
+
out = ApiError(e.status, {**detail, "missing": missing}, method=e.method, path=e.path)
|
|
69
|
+
out.message = message
|
|
70
|
+
out.args = (message,)
|
|
71
|
+
return out
|
|
72
|
+
|
|
73
|
+
|
|
26
74
|
console = Console()
|
|
27
75
|
|
|
28
76
|
|
|
@@ -458,6 +506,21 @@ def register(app: typer.Typer) -> None:
|
|
|
458
506
|
"""List the brand's payments."""
|
|
459
507
|
print_json_or_exit(console, lambda: api_client.designer_list_payments())
|
|
460
508
|
|
|
509
|
+
@command(
|
|
510
|
+
app,
|
|
511
|
+
"designer",
|
|
512
|
+
"list",
|
|
513
|
+
"address",
|
|
514
|
+
api="GET /designer/address-book",
|
|
515
|
+
help=(
|
|
516
|
+
"GET /designer/address-book — the brand's saved addresses. Each shipping "
|
|
517
|
+
"address_id is what `designer create rfq --ships-to` takes."
|
|
518
|
+
),
|
|
519
|
+
)
|
|
520
|
+
def list_addresses() -> None:
|
|
521
|
+
"""List the brand's saved addresses."""
|
|
522
|
+
print_json_or_exit(console, lambda: api_client.designer_get_address_book())
|
|
523
|
+
|
|
461
524
|
@command(
|
|
462
525
|
app,
|
|
463
526
|
"designer",
|
|
@@ -1149,7 +1212,12 @@ def register(app: typer.Typer) -> None:
|
|
|
1149
1212
|
approval="ask",
|
|
1150
1213
|
help=(
|
|
1151
1214
|
"POST /designer/product/send_rfq — ask the chosen suppliers to quote on a product. "
|
|
1152
|
-
"--supplier repeats; --makea-sourcing also asks Makea to source."
|
|
1215
|
+
"--supplier repeats; --makea-sourcing also asks Makea to source. A first send "
|
|
1216
|
+
"needs where bulk ships to and whether a physical sample comes: pass "
|
|
1217
|
+
"--ships-to (a saved address_id from `designer list address`, or the address as "
|
|
1218
|
+
'JSON: \'{"street": "...", "city": "...", "postal_code": "...", "country": "..."}\') '
|
|
1219
|
+
"and --physical-sample yes|no, unless the product already has them. Anything "
|
|
1220
|
+
"still owed is refused (exit 4) with each answer named."
|
|
1153
1221
|
),
|
|
1154
1222
|
)
|
|
1155
1223
|
def create_rfq(
|
|
@@ -1163,6 +1231,19 @@ def register(app: typer.Typer) -> None:
|
|
|
1163
1231
|
makea_sourcing: bool = typer.Option(
|
|
1164
1232
|
False, "--makea-sourcing", help="Also ask Makea to source suppliers."
|
|
1165
1233
|
),
|
|
1234
|
+
ships_to: str | None = typer.Option(
|
|
1235
|
+
None,
|
|
1236
|
+
"--ships-to",
|
|
1237
|
+
help=(
|
|
1238
|
+
"Where bulk ships to: a saved address_id (`designer list address`), or "
|
|
1239
|
+
"the address as a JSON object with street, city, postal_code, country."
|
|
1240
|
+
),
|
|
1241
|
+
),
|
|
1242
|
+
physical_sample: str | None = typer.Option(
|
|
1243
|
+
None,
|
|
1244
|
+
"--physical-sample",
|
|
1245
|
+
help="yes: the brand sends the factory a physical sample; no: the tech pack is enough.",
|
|
1246
|
+
),
|
|
1166
1247
|
) -> None:
|
|
1167
1248
|
"""Send an RFQ."""
|
|
1168
1249
|
if not supplier and not makea_sourcing:
|
|
@@ -1172,7 +1253,18 @@ def register(app: typer.Typer) -> None:
|
|
|
1172
1253
|
body["production_types"] = list(production_type)
|
|
1173
1254
|
if makea_sourcing:
|
|
1174
1255
|
body["makea_sourcing"] = True
|
|
1175
|
-
|
|
1256
|
+
if ships_to:
|
|
1257
|
+
body["ships_to"] = _ships_to_value(ships_to)
|
|
1258
|
+
if physical_sample is not None:
|
|
1259
|
+
body["physical_sample"] = _yes_no(physical_sample, "--physical-sample")
|
|
1260
|
+
|
|
1261
|
+
def send() -> Any:
|
|
1262
|
+
try:
|
|
1263
|
+
return api_client.designer_send_rfq(body)
|
|
1264
|
+
except ApiError as e:
|
|
1265
|
+
raise _owed_error(e) from e
|
|
1266
|
+
|
|
1267
|
+
print_json_or_exit(console, send)
|
|
1176
1268
|
|
|
1177
1269
|
# --- the sampling journey: confirm the pack, award a quote, pay -------------
|
|
1178
1270
|
|
|
File without changes
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"""``makea-cli supplier|admin get|set closures``: a factory's holiday closures.
|
|
2
|
+
|
|
3
|
+
Every date Makea counts for a factory (estimates, chases, the brand's Time &
|
|
4
|
+
Action) skips the days it is shut. Until a year is confirmed, those are the
|
|
5
|
+
country's usual closures; a confirmed year replaces them for that factory.
|
|
6
|
+
|
|
7
|
+
* ``supplier …``: the logged-in factory reads and confirms its own year.
|
|
8
|
+
* ``admin …``: Makea reads and confirms a year for any factory, when the
|
|
9
|
+
factory told the team rather than the platform. Brands then see the dates as
|
|
10
|
+
confirmed by Makea.
|
|
11
|
+
|
|
12
|
+
``set`` replaces the whole year, the same as Confirm on the Holidays tab: read
|
|
13
|
+
the year first, keep what still holds, add what is new. With ``--dry-run`` it
|
|
14
|
+
reads the current year and prints what would change, and writes nothing.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from datetime import date
|
|
20
|
+
from typing import Any, Callable
|
|
21
|
+
|
|
22
|
+
import typer
|
|
23
|
+
from rich.console import Console
|
|
24
|
+
|
|
25
|
+
from makea_cli import api_client
|
|
26
|
+
from makea_cli.commands._util import print_json_or_exit
|
|
27
|
+
from makea_cli.registry import command
|
|
28
|
+
|
|
29
|
+
console = Console()
|
|
30
|
+
|
|
31
|
+
CLOSURE_HELP = (
|
|
32
|
+
"One closure as FIRST_DAY:LAST_DAY:NAME, dates YYYY-MM-DD, both days closed "
|
|
33
|
+
'(e.g. 2027-01-25:2027-02-20:"Spring Festival"). Repeat for each; NAME is optional.'
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def parse_closure(raw: str) -> dict[str, str]:
|
|
38
|
+
"""``FIRST_DAY:LAST_DAY[:NAME]`` -> ``{"start", "end", "name"}``; BadParameter otherwise."""
|
|
39
|
+
parts = raw.split(":", 2)
|
|
40
|
+
if len(parts) < 2:
|
|
41
|
+
raise typer.BadParameter(f"--closure {raw!r}: expected FIRST_DAY:LAST_DAY:NAME")
|
|
42
|
+
start, end = parts[0].strip(), parts[1].strip()
|
|
43
|
+
name = parts[2].strip() if len(parts) == 3 else ""
|
|
44
|
+
try:
|
|
45
|
+
a, b = date.fromisoformat(start), date.fromisoformat(end)
|
|
46
|
+
except ValueError as e:
|
|
47
|
+
raise typer.BadParameter(f"--closure {raw!r}: dates must be YYYY-MM-DD") from e
|
|
48
|
+
if b < a:
|
|
49
|
+
raise typer.BadParameter(f"--closure {raw!r}: ends before it starts")
|
|
50
|
+
return {"start": a.isoformat(), "end": b.isoformat(), "name": name or "Closed"}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def year_rows(view: Any, year: int) -> list[dict[str, str]]:
|
|
54
|
+
"""The closures a GET shows for ``year`` (the country's until confirmed)."""
|
|
55
|
+
for entry in (view or {}).get("years") or []:
|
|
56
|
+
if entry.get("year") == year:
|
|
57
|
+
return [
|
|
58
|
+
{"start": c["start"], "end": c["end"], "name": c.get("name") or "Closed"}
|
|
59
|
+
for c in entry.get("closures") or []
|
|
60
|
+
]
|
|
61
|
+
return []
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def preview(view: Any, year: int, after: list[dict[str, str]]) -> dict[str, Any]:
|
|
65
|
+
"""PURE. What a set would change, for ``--dry-run`` and a confirm card."""
|
|
66
|
+
before = year_rows(view, year)
|
|
67
|
+
|
|
68
|
+
def key(c: dict[str, str]) -> tuple[str, str, str]:
|
|
69
|
+
return (c["start"], c["end"], c["name"])
|
|
70
|
+
|
|
71
|
+
was, now = {key(c) for c in before}, {key(c) for c in after}
|
|
72
|
+
source = next(
|
|
73
|
+
(e.get("source") for e in (view or {}).get("years") or [] if e.get("year") == year),
|
|
74
|
+
None,
|
|
75
|
+
)
|
|
76
|
+
return {
|
|
77
|
+
"dry_run": True,
|
|
78
|
+
"year": year,
|
|
79
|
+
"currently": "the factory's own" if source == "own" else "the country's usual dates",
|
|
80
|
+
"before": before,
|
|
81
|
+
"after": sorted(after, key=lambda c: c["start"]),
|
|
82
|
+
"added": sorted((c for c in after if key(c) not in was), key=lambda c: c["start"]),
|
|
83
|
+
"removed": sorted((c for c in before if key(c) not in now), key=lambda c: c["start"]),
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _closures(closure: list[str] | None, none: bool) -> list[dict[str, str]]:
|
|
88
|
+
if none and closure:
|
|
89
|
+
raise typer.BadParameter("--none confirms a year with no closures; drop --closure")
|
|
90
|
+
if not none and not closure:
|
|
91
|
+
raise typer.BadParameter("pass --closure for each closure, or --none for a year without")
|
|
92
|
+
rows = [parse_closure(c) for c in closure or []]
|
|
93
|
+
return sorted(rows, key=lambda c: c["start"])
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def _set(
|
|
97
|
+
year: int,
|
|
98
|
+
rows: list[dict[str, str]],
|
|
99
|
+
read: Callable[[], Any],
|
|
100
|
+
write: Callable[[], Any],
|
|
101
|
+
) -> None:
|
|
102
|
+
if api_client.state.dry_run:
|
|
103
|
+
print_json_or_exit(console, lambda: preview(read(), year, rows))
|
|
104
|
+
return
|
|
105
|
+
print_json_or_exit(console, write)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def register(app: typer.Typer) -> None:
|
|
109
|
+
@command(
|
|
110
|
+
app,
|
|
111
|
+
"supplier",
|
|
112
|
+
"get",
|
|
113
|
+
"closures",
|
|
114
|
+
api="GET /supplier/closures",
|
|
115
|
+
help=(
|
|
116
|
+
"GET /supplier/closures — your holiday closures for this year and next: "
|
|
117
|
+
"your own where you confirmed the year (source own, confirmed_by), else your "
|
|
118
|
+
"country's usual dates (source country)."
|
|
119
|
+
),
|
|
120
|
+
)
|
|
121
|
+
def supplier_get_closures() -> None:
|
|
122
|
+
"""Read the logged-in factory's closures."""
|
|
123
|
+
print_json_or_exit(console, api_client.supplier_get_closures)
|
|
124
|
+
|
|
125
|
+
@command(
|
|
126
|
+
app,
|
|
127
|
+
"supplier",
|
|
128
|
+
"set",
|
|
129
|
+
"closures",
|
|
130
|
+
api="PUT /supplier/closures",
|
|
131
|
+
side_effects=[
|
|
132
|
+
"replaces the year's closures and marks it confirmed by the factory",
|
|
133
|
+
"every date counted for the factory moves: estimates, chases, brands' Time & Action",
|
|
134
|
+
],
|
|
135
|
+
approval="ask",
|
|
136
|
+
reversible=True,
|
|
137
|
+
idempotent=True,
|
|
138
|
+
help=(
|
|
139
|
+
"PUT /supplier/closures — confirm one year of your holiday closures. Replaces "
|
|
140
|
+
"the whole year: `supplier get closures` first, then pass every closure that "
|
|
141
|
+
"holds. --dry-run shows what would change."
|
|
142
|
+
),
|
|
143
|
+
)
|
|
144
|
+
def supplier_set_closures(
|
|
145
|
+
year: int = typer.Option(..., "--year", help="This year or next."),
|
|
146
|
+
closure: list[str] = typer.Option(None, "--closure", help=CLOSURE_HELP),
|
|
147
|
+
none: bool = typer.Option(False, "--none", help="Confirm a year with no closures."),
|
|
148
|
+
) -> None:
|
|
149
|
+
"""Confirm the logged-in factory's closures for a year."""
|
|
150
|
+
rows = _closures(closure, none)
|
|
151
|
+
_set(
|
|
152
|
+
year,
|
|
153
|
+
rows,
|
|
154
|
+
api_client.supplier_get_closures,
|
|
155
|
+
lambda: api_client.supplier_set_closures(year, rows),
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
@command(
|
|
159
|
+
app,
|
|
160
|
+
"admin",
|
|
161
|
+
"get",
|
|
162
|
+
"closures",
|
|
163
|
+
api="GET /admin/suppliers/{supplier_id}/closures",
|
|
164
|
+
help=(
|
|
165
|
+
"GET /admin/suppliers/{id}/closures — a factory's holiday closures for this "
|
|
166
|
+
"year and next, with who confirmed each year (factory or makea), else the "
|
|
167
|
+
"country's usual dates."
|
|
168
|
+
),
|
|
169
|
+
)
|
|
170
|
+
def admin_get_closures(
|
|
171
|
+
supplier_id: str = typer.Argument(..., help="The factory's supplier id."),
|
|
172
|
+
) -> None:
|
|
173
|
+
"""Read a factory's closures (admin)."""
|
|
174
|
+
print_json_or_exit(console, lambda: api_client.admin_get_supplier_closures(supplier_id))
|
|
175
|
+
|
|
176
|
+
@command(
|
|
177
|
+
app,
|
|
178
|
+
"admin",
|
|
179
|
+
"set",
|
|
180
|
+
"closures",
|
|
181
|
+
api="PUT /admin/suppliers/{supplier_id}/closures",
|
|
182
|
+
side_effects=[
|
|
183
|
+
"replaces the year's closures and marks it confirmed by Makea",
|
|
184
|
+
"every date counted for the factory moves: estimates, chases, brands' Time & Action",
|
|
185
|
+
],
|
|
186
|
+
approval="ask",
|
|
187
|
+
reversible=True,
|
|
188
|
+
idempotent=True,
|
|
189
|
+
help=(
|
|
190
|
+
"PUT /admin/suppliers/{id}/closures — confirm one year of a factory's holiday "
|
|
191
|
+
"closures on its behalf; brands see them as confirmed by Makea. Replaces the "
|
|
192
|
+
"whole year: `admin get closures <id>` first. --dry-run shows what would change."
|
|
193
|
+
),
|
|
194
|
+
)
|
|
195
|
+
def admin_set_closures(
|
|
196
|
+
supplier_id: str = typer.Argument(..., help="The factory's supplier id."),
|
|
197
|
+
year: int = typer.Option(..., "--year", help="This year or next."),
|
|
198
|
+
closure: list[str] = typer.Option(None, "--closure", help=CLOSURE_HELP),
|
|
199
|
+
none: bool = typer.Option(False, "--none", help="Confirm a year with no closures."),
|
|
200
|
+
) -> None:
|
|
201
|
+
"""Confirm a factory's closures for a year (admin)."""
|
|
202
|
+
rows = _closures(closure, none)
|
|
203
|
+
_set(
|
|
204
|
+
year,
|
|
205
|
+
rows,
|
|
206
|
+
lambda: api_client.admin_get_supplier_closures(supplier_id),
|
|
207
|
+
lambda: api_client.admin_set_supplier_closures(supplier_id, year, rows),
|
|
208
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: makea-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.41
|
|
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
|
|
@@ -128,6 +128,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
128
128
|
| `makea-cli admin get about` | read | `GET /admin/about/{target}` | one account's About you (`--user`: a supplier account's person gets their factory's page; `--supplier`): facts, removed, unknown, paused, topic keys. | — |
|
|
129
129
|
| `makea-cli admin get active-users` | read | `POST /admin/analytics/query` | Distinct active users per day over the last N days (DAU series). | `analytics-active-users` |
|
|
130
130
|
| `makea-cli admin get analytics-query` | read | `POST /admin/analytics/query` | Run an arbitrary HogQL query (escape hatch). Example: analytics-query "SELECT count() FROM events" | `analytics-query` |
|
|
131
|
+
| `makea-cli admin get closures` | read | `GET /admin/suppliers/{supplier_id}/closures` | a factory's holiday closures for this year and next, with who confirmed each year (factory or makea), else the country's usual dates. | — |
|
|
131
132
|
| `makea-cli admin get file` | read | local (makea_cli.file_reader) | read a pattern (DXF/RUL/PLT), artwork (AI/EPS/PSD/SVG), embroidery (PES/DST/EMB), ZIP or AVIF/TIFF file on this machine; saves PNG pictures of what it draws next to it. No API call. | — |
|
|
132
133
|
| `makea-cli admin get currency-conversion` | read | `GET /admin/fx/rates` | the platform's own exchange rates and rounding (rate table for several --from; one --from with --amount converts it). | `convert-currency` |
|
|
133
134
|
| `makea-cli admin get engagement-stats` | read | `GET /admin/engagement-stats` | per customer and per product: messages brand↔factory and makea→factory, Beeboo's nudges (reminders to the brand, the morning emails that carried them, chases to the factory) and its other actions; `--start/--end`, `--customer`, `--view`. | — |
|
|
@@ -170,6 +171,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
170
171
|
| `makea-cli admin list ship-log` | read | `GET /admin/ship-log/deploys` | deploys recorded on the Ship log between two days (`--since`, `--until`), newest first. | — |
|
|
171
172
|
| `makea-cli admin list user` | read | `GET /admin/users` | list registered users (admin, optional pagination). | `list-users` |
|
|
172
173
|
| `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` |
|
|
174
|
+
| `makea-cli admin set closures` | write(ask) | `PUT /admin/suppliers/{supplier_id}/closures` | confirm one year of a factory's closures on its behalf (`--closure FIRST_DAY:LAST_DAY:NAME`, repeat; `--none`); replaces the year; brands see them as confirmed by Makea. `--dry-run` shows what would change. | — |
|
|
173
175
|
| `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` |
|
|
174
176
|
| `makea-cli admin set production-order-tracking` | write(ask) | `POST /admin/production_orders/{production_order_id}/tracking` | the bulk parcel: tracking number, URL, shipping method, carrier, plus cartons and gross weight off the packing list. Only what you pass is changed; an empty string clears a field. | — |
|
|
175
177
|
| `makea-cli admin set production-tiers` | write(ask) | `POST /admin/production_orders/{id}/details/update` | Set the order-wide price tiers / MOQ / incoterm / currency on a production order (the schedule used when it has no pr… | `production-tiers-set` |
|
|
@@ -221,7 +223,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
221
223
|
| `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. | — |
|
|
222
224
|
| `makea-cli designer create product` | write(ask) | `POST /designer/product/create_or_update_product` | payload must match manufacture/specifications (all frontend fields; categories/subcategories + collection_id in --hel… | `designer-upsert-product` |
|
|
223
225
|
| `makea-cli designer create quote-award` | write(ask) | `POST /designer/quotes/group_pay_prepare` | choose the supplier quote to sample with. --quote is the supplier link id from `designer list supplier-link`; repeat … | — |
|
|
224
|
-
| `makea-cli designer create rfq` | write(ask) | `POST /designer/product/send_rfq` | ask the chosen suppliers to quote on a product. --supplier repeats; --makea-sourcing also asks Makea to source. | — |
|
|
226
|
+
| `makea-cli designer create rfq` | write(ask) | `POST /designer/product/send_rfq` | ask the chosen suppliers to quote on a product. --supplier repeats; --makea-sourcing also asks Makea to source. A first send needs --ships-to (a saved address_id, or the address as JSON) and --physical-sample yes\|no unless the product has them; anything still owed is refused (exit 4) with each answer named. | — |
|
|
225
227
|
| `makea-cli designer create sampling-order` | write(ask) | `POST /designer/sampling_orders` | order samples. --file is the full order payload (product_order_id, items, fees …); run --dry-run first and read the b… | — |
|
|
226
228
|
| `makea-cli designer delete sampling-order` | write(never) | `DELETE /designer/sampling_orders/{sampling_order_id}` | delete a DRAFT sample order. The backend refuses any other status. Graded `never`. | — |
|
|
227
229
|
| `makea-cli designer delete shipping-order` | write(never) | `POST /designer/shipping_orders/{shipping_order_id}/cancel` | the endpoint is called cancel but it unlinks every production order and removes the shipment, so it is a delete here.… | — |
|
|
@@ -237,6 +239,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
237
239
|
| `makea-cli designer get tech-pack-history` | read | `GET /designer/products/{product_id}/specification-change-history` | who changed which spec field, when, and from what. | — |
|
|
238
240
|
| `makea-cli designer list action` | read | `GET /designer/actions` | the pending actions on you, optionally for one product. An action is closed by the fact it asks for, not by acknowled… | — |
|
|
239
241
|
| `makea-cli designer list channel` | read | `GET /designer/products/{product_id}/channels` | the product's conversation channels. | — |
|
|
242
|
+
| `makea-cli designer list address` | read | `GET /designer/address-book` | the brand's saved addresses; each shipping address_id is what `designer create rfq --ships-to` takes. | — |
|
|
240
243
|
| `makea-cli designer list collection` | read | `GET /designer/collections` | the brand's collections. | — |
|
|
241
244
|
| `makea-cli designer list library-element` | read | `GET /designer/library_components` | the brand's own shelf (fabrics, trims, colours, artwork); --section narrows to one kind. | — |
|
|
242
245
|
| `makea-cli designer list payment` | read | `GET /designer/payments` | your charges and whether they are paid. | — |
|
|
@@ -275,6 +278,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
275
278
|
|---|---|---|---|---|
|
|
276
279
|
| `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. | — |
|
|
277
280
|
| `makea-cli supplier download document` | read | `GET /supplier/document/download` | save a document you are allowed to read. | — |
|
|
281
|
+
| `makea-cli supplier get closures` | read | `GET /supplier/closures` | your holiday closures for this year and next: your own where you confirmed the year, else your country's usual dates. | — |
|
|
278
282
|
| `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. | — |
|
|
279
283
|
| `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`). | — |
|
|
280
284
|
| `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). | — |
|
|
@@ -289,6 +293,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
289
293
|
| `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. | — |
|
|
290
294
|
| `makea-cli supplier list rfq` | read | `GET /supplier/quote_requests` | the RFQs (quote requests) sent to you. | — |
|
|
291
295
|
| `makea-cli supplier list task` | read | `GET /supplier/tasks` | your onboarding and per-order to-dos. | — |
|
|
296
|
+
| `makea-cli supplier set closures` | write(ask) | `PUT /supplier/closures` | confirm one year of your holiday closures (`--closure FIRST_DAY:LAST_DAY:NAME`, repeat; `--none`); replaces the year. `--dry-run` shows what would change. | — |
|
|
292
297
|
| `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. | — |
|
|
293
298
|
| `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`). | — |
|
|
294
299
|
| `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 -… | — |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
makea_cli/__init__.py,sha256=
|
|
1
|
+
makea_cli/__init__.py,sha256=UkGL-D0-v_DX57sRI36Kdzv0WFcOY0k8ej2uP2XX_X4,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=VGpKTPcX-PBaia1zh5gH1gChgc34PXQMfnhoCpVrZkg,92754
|
|
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=
|
|
15
|
+
makea_cli/commands/__init__.py,sha256=tNzlOOY4uoBwoaK1pdElAa0BaoqdAFEI0J3CIS3C1HM,2350
|
|
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
|
|
@@ -21,7 +21,9 @@ makea_cli/commands/analytics/cmd.py,sha256=KVLUtYSeyYZ8_09jIuIAmePjQqcpQS2mb5PBB
|
|
|
21
21
|
makea_cli/commands/auth/__init__.py,sha256=NXoKGfkY2X_hb8GnAyzhoI_qDXfpwKZPqt4HnOrXW3Y,73
|
|
22
22
|
makea_cli/commands/auth/cmd.py,sha256=G9ZeiaJwzUUTptIyynr0V-82wI7eV0qVX0pD6rdPSXg,1321
|
|
23
23
|
makea_cli/commands/brand/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
makea_cli/commands/brand/cmd.py,sha256=
|
|
24
|
+
makea_cli/commands/brand/cmd.py,sha256=VlHzF44xcW4xS-nSmQiRxvY6Hp-ytmvNVyvCPGMVINY,57334
|
|
25
|
+
makea_cli/commands/closures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
makea_cli/commands/closures/cmd.py,sha256=ZMXP-nhm_l5kPf9ZzkpYnhb2wCcNlr89Pbqsc-0Ggjk,8056
|
|
25
27
|
makea_cli/commands/designer/__init__.py,sha256=Tc3Ju4-BKX2euBljhlrEd-Ksirk6JSPNixq4x0IbQYI,77
|
|
26
28
|
makea_cli/commands/designer/cmd.py,sha256=4oOJ5tWYojUs8FBj3QRmgpwbicpsU1XqswoNlJpLLS8,23615
|
|
27
29
|
makea_cli/commands/directory/__init__.py,sha256=rQHBc0JOFXynlzrBm_YfqoRuNsS-JOl-OOvPjgDbnIA,78
|
|
@@ -59,7 +61,7 @@ makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNL
|
|
|
59
61
|
makea_cli/commands/supplier/cmd.py,sha256=12YzQIz8478ksOUbuI7pSwSAwQAqLTvXu-AKjyrwLgA,64039
|
|
60
62
|
makea_cli/commands/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
63
|
makea_cli/commands/tasks/cmd.py,sha256=72MrVigmjjQCpDVF2a3aJn_gclw2iBbJdFmyd87mXec,8549
|
|
62
|
-
makea_cli-0.2.
|
|
63
|
-
makea_cli-0.2.
|
|
64
|
-
makea_cli-0.2.
|
|
65
|
-
makea_cli-0.2.
|
|
64
|
+
makea_cli-0.2.41.dist-info/METADATA,sha256=pAHTXZi4-3hkIL3_jYV90Y02g1_M0G5lU5lluj0VEOU,53257
|
|
65
|
+
makea_cli-0.2.41.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
66
|
+
makea_cli-0.2.41.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
|
|
67
|
+
makea_cli-0.2.41.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|