makea-cli 0.2.4__py3-none-any.whl → 0.2.6__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 +21 -0
- makea_cli/commands/brand/cmd.py +96 -0
- makea_cli/commands/orders/cmd.py +63 -0
- {makea_cli-0.2.4.dist-info → makea_cli-0.2.6.dist-info}/METADATA +5 -1
- {makea_cli-0.2.4.dist-info → makea_cli-0.2.6.dist-info}/RECORD +8 -8
- {makea_cli-0.2.4.dist-info → makea_cli-0.2.6.dist-info}/WHEEL +0 -0
- {makea_cli-0.2.4.dist-info → makea_cli-0.2.6.dist-info}/entry_points.txt +0 -0
makea_cli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.6"
|
makea_cli/api_client.py
CHANGED
|
@@ -1213,6 +1213,27 @@ def designer_create_checkout(body: dict[str, Any]) -> Any:
|
|
|
1213
1213
|
return post_json("/designer/payments/basket/create-session", body)
|
|
1214
1214
|
|
|
1215
1215
|
|
|
1216
|
+
def designer_production_price(production_order_id: str, phase: str) -> Any:
|
|
1217
|
+
"""GET /designer/production_orders/{id}/calculate_price — deposit or balance, itemised."""
|
|
1218
|
+
return get_json(
|
|
1219
|
+
f"/designer/production_orders/{production_order_id}/calculate_price",
|
|
1220
|
+
params={"payment_type": phase},
|
|
1221
|
+
)
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
def designer_set_production_cart(production_order_id: str, cart: dict[str, int]) -> Any:
|
|
1225
|
+
"""PUT /designer/production_orders/{id}/cart — replace the size x colour quantities."""
|
|
1226
|
+
return put_json(f"/designer/production_orders/{production_order_id}/cart", {"cart_items": cart})
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
def designer_set_production_lock(production_order_id: str, locked: bool) -> Any:
|
|
1230
|
+
"""POST /designer/production_orders/{id}/configuration-lock — place or reopen the run."""
|
|
1231
|
+
return post_json(
|
|
1232
|
+
f"/designer/production_orders/{production_order_id}/configuration-lock",
|
|
1233
|
+
{"locked": locked},
|
|
1234
|
+
)
|
|
1235
|
+
|
|
1236
|
+
|
|
1216
1237
|
def designer_list_collections() -> Any:
|
|
1217
1238
|
"""GET /designer/collections — the brand's collections."""
|
|
1218
1239
|
return get_json("/designer/collections")
|
makea_cli/commands/brand/cmd.py
CHANGED
|
@@ -914,3 +914,99 @@ def register(app: typer.Typer) -> None:
|
|
|
914
914
|
if accept_terms:
|
|
915
915
|
body["terms_accepted"] = True
|
|
916
916
|
print_json_or_exit(console, lambda: api_client.designer_create_checkout(body))
|
|
917
|
+
|
|
918
|
+
# --- the production journey: quantities, place the order, pay the deposit ---
|
|
919
|
+
|
|
920
|
+
@command(
|
|
921
|
+
app,
|
|
922
|
+
"designer",
|
|
923
|
+
"get",
|
|
924
|
+
"production-price",
|
|
925
|
+
api="GET /designer/production_orders/{production_order_id}/calculate_price",
|
|
926
|
+
help=(
|
|
927
|
+
"GET /designer/production_orders/{id}/calculate_price — what the deposit (or the "
|
|
928
|
+
"balance, --phase final) comes to for the quantities on the run right now, line "
|
|
929
|
+
"by line."
|
|
930
|
+
),
|
|
931
|
+
)
|
|
932
|
+
def get_production_price(
|
|
933
|
+
production_order_id: str = typer.Argument(..., help="Production order id."),
|
|
934
|
+
phase: str = typer.Option("deposit", "--phase", help="deposit or final."),
|
|
935
|
+
) -> None:
|
|
936
|
+
"""Price a production order's deposit or balance."""
|
|
937
|
+
if phase not in ("deposit", "final"):
|
|
938
|
+
raise typer.BadParameter("--phase is deposit or final")
|
|
939
|
+
print_json_or_exit(
|
|
940
|
+
console,
|
|
941
|
+
lambda: api_client.designer_production_price(production_order_id, phase),
|
|
942
|
+
)
|
|
943
|
+
|
|
944
|
+
@command(
|
|
945
|
+
app,
|
|
946
|
+
"designer",
|
|
947
|
+
"set",
|
|
948
|
+
"production-cart",
|
|
949
|
+
api="PUT /designer/production_orders/{production_order_id}/cart",
|
|
950
|
+
side_effects=["replaces the run's quantities; nothing is ordered until it is locked"],
|
|
951
|
+
approval="auto",
|
|
952
|
+
help=(
|
|
953
|
+
"PUT /designer/production_orders/{id}/cart — the quantity of every size and "
|
|
954
|
+
"colour on the run. Replaces the whole cart: pass every cell you want kept. "
|
|
955
|
+
"--qty repeats as 'SIZE,#RRGGBB=COUNT' (quote it: # starts a shell comment), "
|
|
956
|
+
"with the sizes and colour hex codes from "
|
|
957
|
+
"the order's available_sizes / available_colors (`designer list "
|
|
958
|
+
"production-order --product <id>`). Refused once the run is locked."
|
|
959
|
+
),
|
|
960
|
+
)
|
|
961
|
+
def set_production_cart(
|
|
962
|
+
production_order_id: str = typer.Argument(..., help="Production order id."),
|
|
963
|
+
qty: list[str] = typer.Option(
|
|
964
|
+
..., "--qty", help="SIZE,#RRGGBB=COUNT for one cell (repeat)."
|
|
965
|
+
),
|
|
966
|
+
) -> None:
|
|
967
|
+
"""Set a production order's size x colour quantities."""
|
|
968
|
+
cart: dict[str, int] = {}
|
|
969
|
+
for cell in qty:
|
|
970
|
+
key, sep, count = cell.rpartition("=")
|
|
971
|
+
if not sep or "," not in key:
|
|
972
|
+
raise typer.BadParameter(f"--qty {cell!r}: expected SIZE,#RRGGBB=COUNT")
|
|
973
|
+
try:
|
|
974
|
+
n = int(count)
|
|
975
|
+
except ValueError as e:
|
|
976
|
+
raise typer.BadParameter(f"--qty {cell!r}: COUNT must be a whole number") from e
|
|
977
|
+
if n < 0:
|
|
978
|
+
raise typer.BadParameter(f"--qty {cell!r}: COUNT cannot be negative")
|
|
979
|
+
size, _, colour = key.partition(",")
|
|
980
|
+
cart[f"{size.strip()},{colour.strip()}"] = n
|
|
981
|
+
print_json_or_exit(
|
|
982
|
+
console,
|
|
983
|
+
lambda: api_client.designer_set_production_cart(production_order_id, cart),
|
|
984
|
+
)
|
|
985
|
+
|
|
986
|
+
@command(
|
|
987
|
+
app,
|
|
988
|
+
"designer",
|
|
989
|
+
"set",
|
|
990
|
+
"production-lock",
|
|
991
|
+
api="POST /designer/production_orders/{production_order_id}/configuration-lock",
|
|
992
|
+
side_effects=[
|
|
993
|
+
"places the order: the quantities are final and the deposit becomes payable",
|
|
994
|
+
"can be unlocked again until the deposit is paid",
|
|
995
|
+
],
|
|
996
|
+
approval="ask",
|
|
997
|
+
help=(
|
|
998
|
+
"POST /designer/production_orders/{id}/configuration-lock — place the order "
|
|
999
|
+
"with the quantities on the run (--unlock to reopen them). Locking is what makes "
|
|
1000
|
+
"the deposit payable: `designer create checkout --key "
|
|
1001
|
+
"production:<id>:deposit --accept-terms`."
|
|
1002
|
+
),
|
|
1003
|
+
)
|
|
1004
|
+
def set_production_lock(
|
|
1005
|
+
production_order_id: str = typer.Argument(..., help="Production order id."),
|
|
1006
|
+
unlock: bool = typer.Option(False, "--unlock", help="Reopen the quantities instead."),
|
|
1007
|
+
) -> None:
|
|
1008
|
+
"""Lock (place) or unlock a production order's configuration."""
|
|
1009
|
+
print_json_or_exit(
|
|
1010
|
+
console,
|
|
1011
|
+
lambda: api_client.designer_set_production_lock(production_order_id, not unlock),
|
|
1012
|
+
)
|
makea_cli/commands/orders/cmd.py
CHANGED
|
@@ -314,3 +314,66 @@ def register(app: typer.Typer) -> None:
|
|
|
314
314
|
offset=offset,
|
|
315
315
|
),
|
|
316
316
|
)
|
|
317
|
+
|
|
318
|
+
@command(
|
|
319
|
+
app,
|
|
320
|
+
"admin",
|
|
321
|
+
"update",
|
|
322
|
+
"tracking-status",
|
|
323
|
+
api="POST /admin/tracking/carrier_status",
|
|
324
|
+
side_effects=[
|
|
325
|
+
"moves the order to delivered when the status says so",
|
|
326
|
+
"emails and messages the designer, supplier and admins as the 17track webhook did",
|
|
327
|
+
],
|
|
328
|
+
approval="ask",
|
|
329
|
+
idempotent=True,
|
|
330
|
+
help=(
|
|
331
|
+
"POST /admin/tracking/carrier_status — apply a carrier status looked up by hand "
|
|
332
|
+
"(the tracking-sweep skill) to one order. Runs the 17track webhook path: status, "
|
|
333
|
+
"fan-out to every order sharing the number, and the delivered emails."
|
|
334
|
+
),
|
|
335
|
+
)
|
|
336
|
+
def update_tracking_status(
|
|
337
|
+
kind: str = typer.Argument(
|
|
338
|
+
...,
|
|
339
|
+
help="sampling | production | restock | shipping | material | reference_sample",
|
|
340
|
+
),
|
|
341
|
+
order_id: str = typer.Argument(..., help="Order id (product id for reference_sample)."),
|
|
342
|
+
tracking_number: str = typer.Argument(..., help="The parcel's tracking number."),
|
|
343
|
+
status: str = typer.Option(
|
|
344
|
+
..., "--status", help="17track status, e.g. Delivered, InTransit."
|
|
345
|
+
),
|
|
346
|
+
sub_status: str | None = typer.Option(None, "--sub-status"),
|
|
347
|
+
event: str | None = typer.Option(None, "--event", help="Latest carrier event text."),
|
|
348
|
+
location: str | None = typer.Option(None, "--location"),
|
|
349
|
+
time_utc: str | None = typer.Option(
|
|
350
|
+
None, "--time", help="Latest event time, ISO 8601 UTC."
|
|
351
|
+
),
|
|
352
|
+
) -> None:
|
|
353
|
+
"""
|
|
354
|
+
Tell Makea what the carrier says about one parcel.
|
|
355
|
+
|
|
356
|
+
Output: JSON from the webhook path: success, status, and one entry per
|
|
357
|
+
order the number was fanned out to. Repeating a Delivered update is a
|
|
358
|
+
no-op (no second email).
|
|
359
|
+
"""
|
|
360
|
+
track_info = {
|
|
361
|
+
"latest_status": {"status": status, "sub_status": sub_status},
|
|
362
|
+
"latest_event": {
|
|
363
|
+
"description": event,
|
|
364
|
+
"location": location,
|
|
365
|
+
"time_utc": time_utc,
|
|
366
|
+
},
|
|
367
|
+
}
|
|
368
|
+
print_json_or_exit(
|
|
369
|
+
console,
|
|
370
|
+
lambda: api_client.post_json(
|
|
371
|
+
"/admin/tracking/carrier_status",
|
|
372
|
+
{
|
|
373
|
+
"kind": kind,
|
|
374
|
+
"order_id": order_id,
|
|
375
|
+
"tracking_number": tracking_number,
|
|
376
|
+
"track_info": track_info,
|
|
377
|
+
},
|
|
378
|
+
),
|
|
379
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: makea-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
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
|
|
@@ -131,6 +131,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
131
131
|
| `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` |
|
|
132
132
|
| `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` |
|
|
133
133
|
| `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
|
|
134
|
+
| `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. Runs the 17track webhook path: status, fan-out, delivered emails. | — |
|
|
134
135
|
| `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` |
|
|
135
136
|
| `makea-cli admin upload financial-document` | write(auto) | `POST /admin/products/{product_id}/financial_documents` | upload one or more files to AWS S3 and return financial document metadata. | `upload-financial-documents` |
|
|
136
137
|
| `makea-cli admin upload link-document` | write(auto) | `POST /admin/upload_link_document` | upload a file to AWS S3 and return document domain metadata for reuse as input in other commands. | `upload-link-document` |
|
|
@@ -157,6 +158,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
157
158
|
| `makea-cli designer get collection` | read | `GET /designer/collections/{collection_id}/overview` | one collection with its products, orders and lifecycle in a single read. | — |
|
|
158
159
|
| `makea-cli designer get lifecycle` | read | `GET /designer/product_orders/{product_order_id}/lifecycle` | which stage this product is in. | — |
|
|
159
160
|
| `makea-cli designer get product` | read | `GET /designer/get_product` | one product: status, documents, prices, links. | — |
|
|
161
|
+
| `makea-cli designer get production-price` | read | `GET /designer/production_orders/{production_order_id}/calculate_price` | what the deposit (or the balance, --phase final) comes to for the quantities on the run right now, line by line. | — |
|
|
160
162
|
| `makea-cli designer get quote-advice` | read | `GET /designer/product/quote_advice` | which quote to award and why, from cache. Reading never spends a model call; the web app is what asks for a fresh one. | — |
|
|
161
163
|
| `makea-cli designer get tech-pack` | read | `GET /designer/products/{product_id}/technical-specifications` | the product's tech pack. | — |
|
|
162
164
|
| `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. | — |
|
|
@@ -173,6 +175,8 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
173
175
|
| `makea-cli designer list task` | read | `GET /designer/tasks` | what the platform is waiting on you for. | — |
|
|
174
176
|
| `makea-cli designer search note` | read | `GET /designer/products/{product_id}/channel_search` | full-text search across a product's conversation; --channel narrows to one channel key. | — |
|
|
175
177
|
| `makea-cli designer set product-collection` | write(auto) | `POST /designer/products/{id}/link-to-collection` | assign product to a collection. | `designer-link-product-to-collection` |
|
|
178
|
+
| `makea-cli designer set production-cart` | write(auto) | `PUT /designer/production_orders/{production_order_id}/cart` | the quantity of every size and colour on the run. Replaces the whole cart: pass every cell you want kept. --qty repea… | — |
|
|
179
|
+
| `makea-cli designer set production-lock` | write(ask) | `POST /designer/production_orders/{production_order_id}/configuration-lock` | place the order with the quantities on the run (--unlock to reopen them). Locking is what makes the deposit payable: … | — |
|
|
176
180
|
| `makea-cli designer submit production-order` | write(ask) | `POST /designer/production_orders/{production_order_id}/submit` | submit a 大货 order. This is the commitment, so --dry-run and confirm with the user first. | — |
|
|
177
181
|
| `makea-cli designer submit sampling-order` | write(ask) | `POST /designer/sampling_orders/{sampling_order_id}/confirm` | confirm a sample order so the supplier starts. Run --dry-run first and read it back to the user. | — |
|
|
178
182
|
| `makea-cli designer submit tech-pack` | write(ask) | `POST /designer/products/{product_id}/technical-specifications/confirm` | confirm the tech pack, the step before anyone is asked to quote. | — |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
makea_cli/__init__.py,sha256=
|
|
1
|
+
makea_cli/__init__.py,sha256=Oz5HbwHMyE87nmwV80AZzpkJPf-wBg7eDuJr_BXZkhU,22
|
|
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=Q17LkGpWs_W87Y8ArFBT2l8LfBfsc_OUGPazOaJhQas,50484
|
|
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=lVPsp-44V9pPyUNbcG-uQNV8srCrBVMZnb0HF38Paks,2906
|
|
@@ -17,7 +17,7 @@ makea_cli/commands/analytics/cmd.py,sha256=_I5fBlomTalAxRpB-jculS01AbjEC5cVG3lAN
|
|
|
17
17
|
makea_cli/commands/auth/__init__.py,sha256=NXoKGfkY2X_hb8GnAyzhoI_qDXfpwKZPqt4HnOrXW3Y,73
|
|
18
18
|
makea_cli/commands/auth/cmd.py,sha256=G9ZeiaJwzUUTptIyynr0V-82wI7eV0qVX0pD6rdPSXg,1321
|
|
19
19
|
makea_cli/commands/brand/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
makea_cli/commands/brand/cmd.py,sha256=
|
|
20
|
+
makea_cli/commands/brand/cmd.py,sha256=khcU-vVYKh6fKs43bQTgGHdMCIYG5QP9lkgVnwsrAew,39177
|
|
21
21
|
makea_cli/commands/designer/__init__.py,sha256=Tc3Ju4-BKX2euBljhlrEd-Ksirk6JSPNixq4x0IbQYI,77
|
|
22
22
|
makea_cli/commands/designer/cmd.py,sha256=4oOJ5tWYojUs8FBj3QRmgpwbicpsU1XqswoNlJpLLS8,23615
|
|
23
23
|
makea_cli/commands/directory/__init__.py,sha256=rQHBc0JOFXynlzrBm_YfqoRuNsS-JOl-OOvPjgDbnIA,78
|
|
@@ -33,7 +33,7 @@ makea_cli/commands/library/cmd.py,sha256=eXZa6iLyPaoEWtRd-UmhRT6Ox-zlfs89gJqGn-I
|
|
|
33
33
|
makea_cli/commands/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
makea_cli/commands/metrics/cmd.py,sha256=mXMSy3zHgJXzqLNy6OrdQqySk9COknPKVDf_SQQdFIA,7662
|
|
35
35
|
makea_cli/commands/orders/__init__.py,sha256=6WKPqX02e0RRPmItPIBJ0TA4_yDI2PVvBDkAiMQu9rU,75
|
|
36
|
-
makea_cli/commands/orders/cmd.py,sha256=
|
|
36
|
+
makea_cli/commands/orders/cmd.py,sha256=_5s_G6vSEvKXYbfZifX41r1s1HX1Cv7CSPWJ0zeXdjY,13022
|
|
37
37
|
makea_cli/commands/product/__init__.py,sha256=mfdonFmpbddDSlJq6JWNWgNpM6aOpKtZr-3FJ6scrwg,76
|
|
38
38
|
makea_cli/commands/product/cmd.py,sha256=W0oVTZvsK1QWZWv2x6NC26_JQMXrO16O8gYuKYPWC08,7101
|
|
39
39
|
makea_cli/commands/production/__init__.py,sha256=Whn5ziwVMt4jzcokiFWLhWIpRLYC-ldnjZgAzeQ3We4,79
|
|
@@ -41,7 +41,7 @@ makea_cli/commands/production/cmd.py,sha256=s6fVAGzOvokF6Va5WKGEA2vw2x2hDQ3PrsF0
|
|
|
41
41
|
makea_cli/commands/production/pricing_spec.py,sha256=xGbj7-ps3PcKuU6Oc59A70b62FjF6Awhr5IY3ymZveU,27174
|
|
42
42
|
makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNLu3ipsZ7dfs,77
|
|
43
43
|
makea_cli/commands/supplier/cmd.py,sha256=crRCy9WfhkryHMIL3iufoiT90_SG3-mKChAtdhd06uc,58076
|
|
44
|
-
makea_cli-0.2.
|
|
45
|
-
makea_cli-0.2.
|
|
46
|
-
makea_cli-0.2.
|
|
47
|
-
makea_cli-0.2.
|
|
44
|
+
makea_cli-0.2.6.dist-info/METADATA,sha256=26l-95HysQaWiBsSEMcpwTvruyaG-uRrFXxg6PQA8PI,31580
|
|
45
|
+
makea_cli-0.2.6.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
46
|
+
makea_cli-0.2.6.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
|
|
47
|
+
makea_cli-0.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|