makea-cli 0.2.30__py3-none-any.whl → 0.2.31__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 +15 -0
- makea_cli/commands/brand/cmd.py +115 -0
- {makea_cli-0.2.30.dist-info → makea_cli-0.2.31.dist-info}/METADATA +4 -1
- {makea_cli-0.2.30.dist-info → makea_cli-0.2.31.dist-info}/RECORD +7 -7
- {makea_cli-0.2.30.dist-info → makea_cli-0.2.31.dist-info}/WHEEL +0 -0
- {makea_cli-0.2.30.dist-info → makea_cli-0.2.31.dist-info}/entry_points.txt +0 -0
makea_cli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.31"
|
makea_cli/api_client.py
CHANGED
|
@@ -1871,6 +1871,21 @@ def designer_create_proposals(product_id: str, proposals: list[dict[str, Any]])
|
|
|
1871
1871
|
)
|
|
1872
1872
|
|
|
1873
1873
|
|
|
1874
|
+
def designer_create_pack_file(product_id: str, body: dict[str, Any]) -> Any:
|
|
1875
|
+
"""POST /designer/products/{id}/tech_spec/files — put an uploaded file on a pack section."""
|
|
1876
|
+
return post_json(f"/designer/products/{product_id}/tech_spec/files", body)
|
|
1877
|
+
|
|
1878
|
+
|
|
1879
|
+
def designer_library_schema() -> Any:
|
|
1880
|
+
"""GET /designer/library_components/schema — library sections and their field keys."""
|
|
1881
|
+
return get_json("/designer/library_components/schema")
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+
def designer_create_library_component(body: dict[str, Any]) -> Any:
|
|
1885
|
+
"""POST /designer/library_components — {section, name?, values, document_ids?, draft?}."""
|
|
1886
|
+
return post_json("/designer/library_components", body)
|
|
1887
|
+
|
|
1888
|
+
|
|
1874
1889
|
def designer_bulk_accept_actions(channel_id: str, actions: list[dict[str, str]]) -> Any:
|
|
1875
1890
|
"""POST /designer/channels/{id}/suggested_actions/bulk_accept — accept several at once."""
|
|
1876
1891
|
return post_json(
|
makea_cli/commands/brand/cmd.py
CHANGED
|
@@ -750,6 +750,121 @@ def register(app: typer.Typer) -> None:
|
|
|
750
750
|
items = [{k: v for k, v in one.items() if v is not None}]
|
|
751
751
|
print_json_or_exit(console, lambda: api_client.designer_create_proposals(product, items))
|
|
752
752
|
|
|
753
|
+
@command(
|
|
754
|
+
app,
|
|
755
|
+
"designer",
|
|
756
|
+
"create",
|
|
757
|
+
"pack-file",
|
|
758
|
+
api="POST /designer/products/{product_id}/tech_spec/files",
|
|
759
|
+
side_effects=["adds the file to the tech pack section and to the product's documents"],
|
|
760
|
+
approval="auto",
|
|
761
|
+
help=(
|
|
762
|
+
"POST /designer/products/{id}/tech_spec/files — put a file the user uploaded (a "
|
|
763
|
+
"document_id) on a tech pack section. Pattern files (DXF, RUL, PLT, AAMA/ASTM) go "
|
|
764
|
+
"on Patterns, which is the default for them. Name the section as `get tech-pack "
|
|
765
|
+
'--readable` shows it ("Patterns", "Main fabric", "Additional notes"); pick a row '
|
|
766
|
+
"with --item or --entry. A refusal lists the sections that exist."
|
|
767
|
+
),
|
|
768
|
+
)
|
|
769
|
+
def create_pack_file(
|
|
770
|
+
product: str = typer.Option(..., "--product", "-p", help="Product id."),
|
|
771
|
+
document: list[str] = typer.Option(
|
|
772
|
+
..., "--document", "-d", help="document_id of the uploaded file (repeat)."
|
|
773
|
+
),
|
|
774
|
+
section: str | None = typer.Option(
|
|
775
|
+
None,
|
|
776
|
+
"--section",
|
|
777
|
+
help="Section, by label or key. Omit for a pattern file (goes on Patterns).",
|
|
778
|
+
),
|
|
779
|
+
entry: int | None = typer.Option(
|
|
780
|
+
None, "--entry", help="Row number in a repeating section, 0 = first."
|
|
781
|
+
),
|
|
782
|
+
item: str | None = typer.Option(
|
|
783
|
+
None, "--item", help='Pick the row that holds this value now (e.g. "silk crepe").'
|
|
784
|
+
),
|
|
785
|
+
) -> None:
|
|
786
|
+
"""Put uploaded files on a tech pack section."""
|
|
787
|
+
body: dict[str, Any] = {"document_ids": list(document)}
|
|
788
|
+
if section:
|
|
789
|
+
body["section"] = section
|
|
790
|
+
if entry is not None:
|
|
791
|
+
body["entry"] = entry
|
|
792
|
+
if item:
|
|
793
|
+
body["item"] = item
|
|
794
|
+
print_json_or_exit(console, lambda: api_client.designer_create_pack_file(product, body))
|
|
795
|
+
|
|
796
|
+
@command(
|
|
797
|
+
app,
|
|
798
|
+
"designer",
|
|
799
|
+
"get",
|
|
800
|
+
"library-schema",
|
|
801
|
+
api="GET /designer/library_components/schema",
|
|
802
|
+
help=(
|
|
803
|
+
"GET /designer/library_components/schema — the library's sections (fabrics, trims, "
|
|
804
|
+
"colours…) and, for each, its field keys, labels, options and which are required. "
|
|
805
|
+
"Read it before `create library-element`."
|
|
806
|
+
),
|
|
807
|
+
)
|
|
808
|
+
def get_library_schema() -> None:
|
|
809
|
+
"""Print the library sections and their fields."""
|
|
810
|
+
print_json_or_exit(console, api_client.designer_library_schema)
|
|
811
|
+
|
|
812
|
+
@command(
|
|
813
|
+
app,
|
|
814
|
+
"designer",
|
|
815
|
+
"create",
|
|
816
|
+
"library-element",
|
|
817
|
+
api="POST /designer/library_components",
|
|
818
|
+
side_effects=["adds the element to the brand's library, shared with their team"],
|
|
819
|
+
approval="auto",
|
|
820
|
+
help=(
|
|
821
|
+
"POST /designer/library_components — add a fabric, trim or other part to the brand's "
|
|
822
|
+
"library. --section and the --values keys come from `get library-schema`. --document "
|
|
823
|
+
"attaches an uploaded photo or data sheet. When required fields are unknown, pass "
|
|
824
|
+
"--draft: it is saved as a draft for the brand to finish."
|
|
825
|
+
),
|
|
826
|
+
)
|
|
827
|
+
def create_library_element(
|
|
828
|
+
section: str = typer.Option(..., "--section", "-s", help="Section key, e.g. MAIN_FABRIC."),
|
|
829
|
+
values: str | None = typer.Option(
|
|
830
|
+
None, "--values", help="JSON object of {field key: value} from get library-schema."
|
|
831
|
+
),
|
|
832
|
+
values_file: Path | None = typer.Option(
|
|
833
|
+
None,
|
|
834
|
+
"--values-file",
|
|
835
|
+
"-f",
|
|
836
|
+
exists=True,
|
|
837
|
+
dir_okay=False,
|
|
838
|
+
help="JSON file holding the values object (instead of --values).",
|
|
839
|
+
),
|
|
840
|
+
name: str | None = typer.Option(
|
|
841
|
+
None, "--name", "-n", help="Display name (defaults to the name field)."
|
|
842
|
+
),
|
|
843
|
+
document: list[str] = typer.Option(
|
|
844
|
+
[], "--document", "-d", help="document_id of a photo or data sheet (repeat)."
|
|
845
|
+
),
|
|
846
|
+
product: str | None = typer.Option(
|
|
847
|
+
None, "--product", "-p", help="The product it was made for, if any."
|
|
848
|
+
),
|
|
849
|
+
draft: bool = typer.Option(
|
|
850
|
+
False, "--draft", help="Save as a draft when required fields are still unknown."
|
|
851
|
+
),
|
|
852
|
+
) -> None:
|
|
853
|
+
"""Add an element to the brand's library."""
|
|
854
|
+
body: dict[str, Any] = {
|
|
855
|
+
"section": section,
|
|
856
|
+
"values": _json_object(values, values_file, "values"),
|
|
857
|
+
}
|
|
858
|
+
if name:
|
|
859
|
+
body["name"] = name
|
|
860
|
+
if document:
|
|
861
|
+
body["document_ids"] = list(document)
|
|
862
|
+
if product:
|
|
863
|
+
body["product_reference_id"] = product
|
|
864
|
+
if draft:
|
|
865
|
+
body["draft"] = True
|
|
866
|
+
print_json_or_exit(console, lambda: api_client.designer_create_library_component(body))
|
|
867
|
+
|
|
753
868
|
@command(
|
|
754
869
|
app,
|
|
755
870
|
"designer",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: makea-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.31
|
|
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
|
|
@@ -199,7 +199,9 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
199
199
|
|---|---|---|---|---|
|
|
200
200
|
| `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… | — |
|
|
201
201
|
| `makea-cli designer create collection` | write(auto) | `POST /designer/collections/create` | create or update a designer collection. | `designer-create-collection` |
|
|
202
|
+
| `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. | — |
|
|
202
203
|
| `makea-cli designer create note` | write(ask) | `POST /designer/products/{product_id}/notes` | post a message into a product's conversation. | — |
|
|
204
|
+
| `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. | — |
|
|
203
205
|
| `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` |
|
|
204
206
|
| `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 … | — |
|
|
205
207
|
| `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. | — |
|
|
@@ -209,6 +211,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
209
211
|
| `makea-cli designer download document` | read | `GET /designer/document/download` | save bytes for user_id + document_id (designer-authenticated; same query contract as admin document download). | `designer-download-document` |
|
|
210
212
|
| `makea-cli designer 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. | — |
|
|
211
213
|
| `makea-cli designer get collection` | read | `GET /designer/collections/{collection_id}/overview` | one collection with its products, orders and lifecycle in a single read. | — |
|
|
214
|
+
| `makea-cli designer get library-schema` | read | `GET /designer/library_components/schema` | the library's sections and each one's field keys, options and required fields. | — |
|
|
212
215
|
| `makea-cli designer get lifecycle` | read | `GET /designer/product_orders/{product_order_id}/lifecycle` | which stage this product is in. | — |
|
|
213
216
|
| `makea-cli designer get product` | read | `GET /designer/get_product` | one product: status, documents, prices, links. | — |
|
|
214
217
|
| `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. | — |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
makea_cli/__init__.py,sha256=
|
|
1
|
+
makea_cli/__init__.py,sha256=uoxxAPP6x3ekeKjUrqxyllP0-QmXbfUEQA8rJSp6Z3E,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=CtHX0DB9ItpSn0F730XJfTnSSs77u7a8kZS2hFClQTg,81671
|
|
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
|
|
@@ -21,7 +21,7 @@ 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=hMy1nHDzE9i9Pz7EzCSAWmzV7srqDscP0WhB3fQugPk,53800
|
|
25
25
|
makea_cli/commands/designer/__init__.py,sha256=Tc3Ju4-BKX2euBljhlrEd-Ksirk6JSPNixq4x0IbQYI,77
|
|
26
26
|
makea_cli/commands/designer/cmd.py,sha256=4oOJ5tWYojUs8FBj3QRmgpwbicpsU1XqswoNlJpLLS8,23615
|
|
27
27
|
makea_cli/commands/directory/__init__.py,sha256=rQHBc0JOFXynlzrBm_YfqoRuNsS-JOl-OOvPjgDbnIA,78
|
|
@@ -55,7 +55,7 @@ makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNL
|
|
|
55
55
|
makea_cli/commands/supplier/cmd.py,sha256=3M7OYhBd-uQk5naoM2I87vJ6IA_P-gdrsbIX2vbyDns,63763
|
|
56
56
|
makea_cli/commands/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
makea_cli/commands/tasks/cmd.py,sha256=72MrVigmjjQCpDVF2a3aJn_gclw2iBbJdFmyd87mXec,8549
|
|
58
|
-
makea_cli-0.2.
|
|
59
|
-
makea_cli-0.2.
|
|
60
|
-
makea_cli-0.2.
|
|
61
|
-
makea_cli-0.2.
|
|
58
|
+
makea_cli-0.2.31.dist-info/METADATA,sha256=yYR6BXaBwnf8mAUMNfz-1Mz2wSFqRPytJsdpf-e84rc,45219
|
|
59
|
+
makea_cli-0.2.31.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
60
|
+
makea_cli-0.2.31.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
|
|
61
|
+
makea_cli-0.2.31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|