makea-cli 0.2.30__py3-none-any.whl → 0.2.32__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
makea_cli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.2.30"
1
+ __version__ = "0.2.32"
makea_cli/api_client.py CHANGED
@@ -418,9 +418,13 @@ def create_quote_request(
418
418
  message: str | None = None,
419
419
  quote_type: str = "SAMPLING",
420
420
  due_date: str | None = None,
421
+ release_anyway: bool = False,
421
422
  ) -> Any:
422
423
  """
423
424
  POST /admin/supplier/create_quote_request — admin creates a quote request for a supplier.
425
+
426
+ The server holds the request (409 FILES_DISAGREE) while the brand's files
427
+ disagree (TECH-181); ``release_anyway`` sends it regardless.
424
428
  """
425
429
  body: dict[str, Any] = {
426
430
  "supplier_id": supplier_id,
@@ -431,6 +435,8 @@ def create_quote_request(
431
435
  body["message"] = message
432
436
  if due_date is not None:
433
437
  body["due_date"] = due_date
438
+ if release_anyway:
439
+ body["release_anyway"] = True
434
440
  return post_json("/admin/supplier/create_quote_request", body)
435
441
 
436
442
 
@@ -1871,6 +1877,21 @@ def designer_create_proposals(product_id: str, proposals: list[dict[str, Any]])
1871
1877
  )
1872
1878
 
1873
1879
 
1880
+ def designer_create_pack_file(product_id: str, body: dict[str, Any]) -> Any:
1881
+ """POST /designer/products/{id}/tech_spec/files — put an uploaded file on a pack section."""
1882
+ return post_json(f"/designer/products/{product_id}/tech_spec/files", body)
1883
+
1884
+
1885
+ def designer_library_schema() -> Any:
1886
+ """GET /designer/library_components/schema — library sections and their field keys."""
1887
+ return get_json("/designer/library_components/schema")
1888
+
1889
+
1890
+ def designer_create_library_component(body: dict[str, Any]) -> Any:
1891
+ """POST /designer/library_components — {section, name?, values, document_ids?, draft?}."""
1892
+ return post_json("/designer/library_components", body)
1893
+
1894
+
1874
1895
  def designer_bulk_accept_actions(channel_id: str, actions: list[dict[str, str]]) -> Any:
1875
1896
  """POST /designer/channels/{id}/suggested_actions/bulk_accept — accept several at once."""
1876
1897
  return post_json(
@@ -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",
@@ -367,6 +367,11 @@ def register(app: typer.Typer) -> None:
367
367
  "--due-date",
368
368
  help="due_date: optional due date in YYYY-MM-DD format.",
369
369
  ),
370
+ release_anyway: bool = typer.Option(
371
+ False,
372
+ "--release-anyway",
373
+ help="Send even though the brand's files disagree (the server holds the request otherwise, FILES_DISAGREE).",
374
+ ),
370
375
  ) -> None:
371
376
  """
372
377
  Create/send a quote request as admin.
@@ -383,6 +388,7 @@ def register(app: typer.Typer) -> None:
383
388
  message=message,
384
389
  quote_type=qt,
385
390
  due_date=due_date,
391
+ release_anyway=release_anyway,
386
392
  ),
387
393
  )
388
394
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.30
3
+ Version: 0.2.32
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
@@ -97,7 +97,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
97
97
  | `makea-cli admin create feature-flag` | write(ask) | `POST /admin/feature-flags` | add a flag (off unless --enabled). An existing key is refused. | — |
98
98
  | `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` |
99
99
  | `makea-cli admin create product-note` | write(ask) | `POST /admin/products/{product_id}/notes` | write a note on a product. Without --internal it goes to the brand. | — |
100
- | `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` |
100
+ | `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). Held (409 FILES_DISAGREE) while the brand's files disagree; --release-anyway sends regardless. | `create-quote-request` |
101
101
  | `makea-cli admin create quote-request-note` | write(ask) | `POST /admin/quote_requests/{quote_request_id}/reply_status_note` | write to the factory on a quote request (e.g. answer its clarification). --requirements-updated words the email as a change to the product's requirements. | — |
102
102
  | `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. | — |
103
103
  | `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. | — |
@@ -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=R75QzgJ-X9Ixa6UnK5Wm3Jn0Wd9dnVdrtup0aqecq6U,23
1
+ makea_cli/__init__.py,sha256=TZEL7NbFvxLaphGOCsAqfJrHhPB2LHR2ab0Eb5xxaU0,23
2
2
  makea_cli/__main__.py,sha256=AkQjxWfKE3w9iD1d6I-2Zqvv2t9cct0oYyFF0UiA-Z0,144
3
- makea_cli/api_client.py,sha256=jQX6ogn9kt5rHXSmWst0J-1esLb0BYXzDTpPEboEN7Q,80996
3
+ makea_cli/api_client.py,sha256=34LrVR6vcG3lCK6lRlUJbdHt3HOxIDA4mA9MeJL98Pg,81910
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=qwocVgpUhOd1SRCmaxPF5yVuH-PcL8InvOvVOidHrn8,49011
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
@@ -52,10 +52,10 @@ makea_cli/commands/production/pricing_spec.py,sha256=xGbj7-ps3PcKuU6Oc59A70b62Fj
52
52
  makea_cli/commands/shipping/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  makea_cli/commands/shipping/cmd.py,sha256=ozt73pj3onlOv0NhEwiJlslyG9WOycE0QN4tmzwFlT0,17280
54
54
  makea_cli/commands/supplier/__init__.py,sha256=qfQDeQdQ-B7I_uwFVfcp1vXFUTL4fAcNLu3ipsZ7dfs,77
55
- makea_cli/commands/supplier/cmd.py,sha256=3M7OYhBd-uQk5naoM2I87vJ6IA_P-gdrsbIX2vbyDns,63763
55
+ makea_cli/commands/supplier/cmd.py,sha256=12YzQIz8478ksOUbuI7pSwSAwQAqLTvXu-AKjyrwLgA,64039
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.30.dist-info/METADATA,sha256=XTw-VoX0stheFedgcCuM-P5Hn6jxWGUv5mzP-2CT5-I,44539
59
- makea_cli-0.2.30.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
60
- makea_cli-0.2.30.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
61
- makea_cli-0.2.30.dist-info/RECORD,,
58
+ makea_cli-0.2.32.dist-info/METADATA,sha256=9sFWNB18VghSrKcdoQoXpoQgEd_O0czP-FJu3fRh7zc,45314
59
+ makea_cli-0.2.32.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
60
+ makea_cli-0.2.32.dist-info/entry_points.txt,sha256=4x-lbVa1jBbNlkNq7L-rYyfRh2spZmc3BLIzP-Dl-Qk,50
61
+ makea_cli-0.2.32.dist-info/RECORD,,