makea-cli 0.2.38__tar.gz → 0.2.40__tar.gz
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-0.2.38 → makea_cli-0.2.40}/CHANGELOG.md +25 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/PKG-INFO +6 -1
- {makea_cli-0.2.38 → makea_cli-0.2.40}/README.md +5 -0
- makea_cli-0.2.40/makea_cli/__init__.py +1 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/api_client.py +35 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/__init__.py +2 -0
- makea_cli-0.2.40/makea_cli/commands/closures/cmd.py +208 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/metrics/cmd.py +47 -0
- makea_cli-0.2.40/makea_cli/commands/tasks/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/pyproject.toml +1 -1
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/golden_manifest.json +246 -0
- makea_cli-0.2.40/tests/test_closures.py +64 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/uv.lock +1 -1
- makea_cli-0.2.38/makea_cli/__init__.py +0 -1
- {makea_cli-0.2.38 → makea_cli-0.2.40}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/.claude/skills/link-supplier-user/SKILL.md +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/.gitignore +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea-collection-upload/SKILL.md +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea-collection-upload/scripts/create_products.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/__main__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/auth_pkce.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/broker.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/_util.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/about/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/about/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/analytics/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/analytics/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/auth/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/auth/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/brand/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/brand/cmd.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/factory → makea_cli-0.2.40/makea_cli/commands/closures}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/designer/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/designer/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/directory/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/directory/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/document/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/document/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/email/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/email/cmd.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/files → makea_cli-0.2.40/makea_cli/commands/factory}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/factory/cmd.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/flags → makea_cli-0.2.40/makea_cli/commands/files}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/files/cmd.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/library → makea_cli-0.2.40/makea_cli/commands/flags}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/flags/cmd.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/metrics → makea_cli-0.2.40/makea_cli/commands/library}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/library/cmd.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/playbook → makea_cli-0.2.40/makea_cli/commands/metrics}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/order_flow/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/order_flow/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/orders/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/orders/cmd.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/shiplog → makea_cli-0.2.40/makea_cli/commands/playbook}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/playbook/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/product/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/product/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/production/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/production/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/production/pricing_spec.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/shipping → makea_cli-0.2.40/makea_cli/commands/shiplog}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/shiplog/cmd.py +0 -0
- {makea_cli-0.2.38/makea_cli/commands/tasks → makea_cli-0.2.40/makea_cli/commands/shipping}/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/shipping/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/supplier/__init__.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/supplier/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/commands/tasks/cmd.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/companion.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/config.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/errors.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/file_reader.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/identity.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/main.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/output.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/posthog_client.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/makea_cli/registry.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/npm/makea-cli/README.md +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/npm/makea-cli/makea-cli.mjs +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/npm/makea-cli/package.json +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_broker.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_companion.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_currency_conversion.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_file_reader.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_output_contract.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_persona_commands.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_pm_reads.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_registry.py +0 -0
- {makea_cli-0.2.38 → makea_cli-0.2.40}/tests/test_supplier_scorecard.py +0 -0
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.40
|
|
4
|
+
|
|
5
|
+
Factory holidays. Needs the backend with `/admin/suppliers/{id}/closures`.
|
|
6
|
+
|
|
7
|
+
- `supplier get closures` / `supplier set closures`: the logged-in factory
|
|
8
|
+
reads and confirms its holiday closures for this year or next. Every date
|
|
9
|
+
Makea counts for it (estimates, chases, brands' Time & Action) skips them.
|
|
10
|
+
- `admin get closures <supplier_id>` / `admin set closures <supplier_id>`: the
|
|
11
|
+
same for any factory, confirmed by Makea on its behalf; brands then see the
|
|
12
|
+
dates as confirmed by Makea.
|
|
13
|
+
- `set` replaces the whole year: pass every closure as
|
|
14
|
+
`--closure FIRST_DAY:LAST_DAY:NAME` (repeat), or `--none`. With `--dry-run`
|
|
15
|
+
it reads the year and prints what would be added and removed.
|
|
16
|
+
|
|
17
|
+
## 0.2.39
|
|
18
|
+
|
|
19
|
+
Engagement numbers for sales. Needs the backend with `/admin/engagement-stats`.
|
|
20
|
+
|
|
21
|
+
- `admin get engagement-stats`: per customer (a team counts once) and per
|
|
22
|
+
product, the messages the brand, the factory and makea wrote in factory
|
|
23
|
+
threads, Beeboo's nudges (reminders to the brand, the morning emails that
|
|
24
|
+
carried them, chases to the factory) and its other actions. `--start/--end`
|
|
25
|
+
bound the days, `--customer` filters by name, `--view` keeps one part. Every
|
|
26
|
+
counter comes with a one-line definition fit for a slide.
|
|
27
|
+
|
|
3
28
|
## 0.2.38
|
|
4
29
|
|
|
5
30
|
Set an order up like the last ones. Needs the backend with the step library.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: makea-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.40
|
|
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,8 +128,10 @@ 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` |
|
|
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`. | — |
|
|
133
135
|
| `makea-cli admin get feature-usage` | read | `POST /admin/analytics/query` | How many distinct users used a feature recently, plus event volume. Matches $pageview path and feature_time_spent eve… | `analytics-feature-usage` |
|
|
134
136
|
| `makea-cli admin get growth-snapshot` | read | `GET /admin/growth/snapshots/{id}` | one reconciled Growth Analysis snapshot (default `latest`); `--block` prints one block (headline, gates, review_items, …). | — |
|
|
135
137
|
| `makea-cli admin get library-schema` | read | `GET /admin/library_components/schema` | the tech-pack library taxonomy: sections and their library-role field keys (run this before create/update). | `library-schema` |
|
|
@@ -169,6 +171,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
169
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. | — |
|
|
170
172
|
| `makea-cli admin list user` | read | `GET /admin/users` | list registered users (admin, optional pagination). | `list-users` |
|
|
171
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. | — |
|
|
172
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` |
|
|
173
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. | — |
|
|
174
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` |
|
|
@@ -274,6 +277,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
274
277
|
|---|---|---|---|---|
|
|
275
278
|
| `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. | — |
|
|
276
279
|
| `makea-cli supplier download document` | read | `GET /supplier/document/download` | save a document you are allowed to read. | — |
|
|
280
|
+
| `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. | — |
|
|
277
281
|
| `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. | — |
|
|
278
282
|
| `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`). | — |
|
|
279
283
|
| `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). | — |
|
|
@@ -288,6 +292,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
288
292
|
| `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. | — |
|
|
289
293
|
| `makea-cli supplier list rfq` | read | `GET /supplier/quote_requests` | the RFQs (quote requests) sent to you. | — |
|
|
290
294
|
| `makea-cli supplier list task` | read | `GET /supplier/tasks` | your onboarding and per-order to-dos. | — |
|
|
295
|
+
| `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. | — |
|
|
291
296
|
| `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. | — |
|
|
292
297
|
| `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`). | — |
|
|
293
298
|
| `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 -… | — |
|
|
@@ -112,8 +112,10 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
112
112
|
| `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. | — |
|
|
113
113
|
| `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` |
|
|
114
114
|
| `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` |
|
|
115
|
+
| `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. | — |
|
|
115
116
|
| `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. | — |
|
|
116
117
|
| `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` |
|
|
118
|
+
| `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`. | — |
|
|
117
119
|
| `makea-cli admin get feature-usage` | read | `POST /admin/analytics/query` | How many distinct users used a feature recently, plus event volume. Matches $pageview path and feature_time_spent eve… | `analytics-feature-usage` |
|
|
118
120
|
| `makea-cli admin get growth-snapshot` | read | `GET /admin/growth/snapshots/{id}` | one reconciled Growth Analysis snapshot (default `latest`); `--block` prints one block (headline, gates, review_items, …). | — |
|
|
119
121
|
| `makea-cli admin get library-schema` | read | `GET /admin/library_components/schema` | the tech-pack library taxonomy: sections and their library-role field keys (run this before create/update). | `library-schema` |
|
|
@@ -153,6 +155,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
153
155
|
| `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. | — |
|
|
154
156
|
| `makea-cli admin list user` | read | `GET /admin/users` | list registered users (admin, optional pagination). | `list-users` |
|
|
155
157
|
| `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` |
|
|
158
|
+
| `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. | — |
|
|
156
159
|
| `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` |
|
|
157
160
|
| `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. | — |
|
|
158
161
|
| `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` |
|
|
@@ -258,6 +261,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
258
261
|
|---|---|---|---|---|
|
|
259
262
|
| `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. | — |
|
|
260
263
|
| `makea-cli supplier download document` | read | `GET /supplier/document/download` | save a document you are allowed to read. | — |
|
|
264
|
+
| `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. | — |
|
|
261
265
|
| `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. | — |
|
|
262
266
|
| `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`). | — |
|
|
263
267
|
| `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). | — |
|
|
@@ -272,6 +276,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
272
276
|
| `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. | — |
|
|
273
277
|
| `makea-cli supplier list rfq` | read | `GET /supplier/quote_requests` | the RFQs (quote requests) sent to you. | — |
|
|
274
278
|
| `makea-cli supplier list task` | read | `GET /supplier/tasks` | your onboarding and per-order to-dos. | — |
|
|
279
|
+
| `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. | — |
|
|
275
280
|
| `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. | — |
|
|
276
281
|
| `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`). | — |
|
|
277
282
|
| `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 -… | — |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.40"
|
|
@@ -973,6 +973,13 @@ def get_growth_snapshot(snapshot_id: str = "latest") -> Any:
|
|
|
973
973
|
return get_json(f"/admin/growth/snapshots/{quote(snapshot_id, safe='')}", timeout=120.0)
|
|
974
974
|
|
|
975
975
|
|
|
976
|
+
def get_engagement_stats(start: str = "", end: str = "", customer: str = "") -> Any:
|
|
977
|
+
"""GET /admin/engagement-stats?start=&end=&customer= — brand/factory messages
|
|
978
|
+
and Beeboo's actions per customer and per product. Scans the table: slow-ish."""
|
|
979
|
+
params = {k: v for k, v in (("start", start), ("end", end), ("customer", customer)) if v}
|
|
980
|
+
return get_json("/admin/engagement-stats", params=params, timeout=120.0)
|
|
981
|
+
|
|
982
|
+
|
|
976
983
|
def import_growth_snapshot(sources_path: Path, *, check_only: bool = False) -> Any:
|
|
977
984
|
"""POST /admin/growth/snapshots — gate and publish one reconciled snapshot.
|
|
978
985
|
|
|
@@ -2353,3 +2360,31 @@ def designer_confirm_receive_shipping_order(shipping_order_id: str) -> Any:
|
|
|
2353
2360
|
def designer_cancel_shipping_order(shipping_order_id: str) -> Any:
|
|
2354
2361
|
"""POST /designer/shipping_orders/{id}/cancel — unlinks every production order, then deletes it."""
|
|
2355
2362
|
return post_json(f"/designer/shipping_orders/{shipping_order_id}/cancel", {})
|
|
2363
|
+
|
|
2364
|
+
|
|
2365
|
+
# --------------------------------------------------------------------------
|
|
2366
|
+
# Factory holiday closures (this year and next). Every date Makea counts for a
|
|
2367
|
+
# factory skips them; the factory confirms its own, or Makea does for it.
|
|
2368
|
+
# --------------------------------------------------------------------------
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
def supplier_get_closures() -> Any:
|
|
2372
|
+
"""GET /supplier/closures — the logged-in factory's closures, this year and next."""
|
|
2373
|
+
return get_json("/supplier/closures")
|
|
2374
|
+
|
|
2375
|
+
|
|
2376
|
+
def supplier_set_closures(year: int, closures: list[dict[str, str]]) -> Any:
|
|
2377
|
+
"""PUT /supplier/closures — confirm one year's closures (replaces that year)."""
|
|
2378
|
+
return put_json("/supplier/closures", {"year": year, "closures": closures})
|
|
2379
|
+
|
|
2380
|
+
|
|
2381
|
+
def admin_get_supplier_closures(supplier_id: str) -> Any:
|
|
2382
|
+
"""GET /admin/suppliers/{id}/closures — a factory's closures, this year and next."""
|
|
2383
|
+
return get_json(f"/admin/suppliers/{supplier_id}/closures")
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
def admin_set_supplier_closures(supplier_id: str, year: int, closures: list[dict[str, str]]) -> Any:
|
|
2387
|
+
"""PUT /admin/suppliers/{id}/closures — confirm one year for the factory, as Makea."""
|
|
2388
|
+
return put_json(
|
|
2389
|
+
f"/admin/suppliers/{supplier_id}/closures", {"year": year, "closures": closures}
|
|
2390
|
+
)
|
|
@@ -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)
|
|
@@ -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
|
+
)
|
|
@@ -133,6 +133,53 @@ def register(app: typer.Typer) -> None:
|
|
|
133
133
|
|
|
134
134
|
print_json_or_exit(console, _do)
|
|
135
135
|
|
|
136
|
+
@command(
|
|
137
|
+
app,
|
|
138
|
+
"admin",
|
|
139
|
+
"get",
|
|
140
|
+
"engagement-stats",
|
|
141
|
+
api="GET /admin/engagement-stats",
|
|
142
|
+
help=(
|
|
143
|
+
"GET /admin/engagement-stats — per customer and per product: messages "
|
|
144
|
+
"brand to factory, factory to brand and makea to factory, Beeboo's "
|
|
145
|
+
"nudges (reminders to the brand, morning emails that carried them, "
|
|
146
|
+
"chases to the factory) and every other action Beeboo took."
|
|
147
|
+
),
|
|
148
|
+
)
|
|
149
|
+
def get_engagement_stats(
|
|
150
|
+
start: str = typer.Option(None, "--start", help="First day, YYYY-MM-DD (inclusive)."),
|
|
151
|
+
end: str = typer.Option(None, "--end", help="Last day, YYYY-MM-DD (inclusive)."),
|
|
152
|
+
customer: str = typer.Option(
|
|
153
|
+
None, "--customer", "-c", help="Only customers whose name contains this."
|
|
154
|
+
),
|
|
155
|
+
view: str = typer.Option(
|
|
156
|
+
"all",
|
|
157
|
+
"--view",
|
|
158
|
+
"-v",
|
|
159
|
+
help="all | customers | products | totals | definitions.",
|
|
160
|
+
),
|
|
161
|
+
) -> None:
|
|
162
|
+
"""A customer is a team (named after its owner's brand) or a lone account.
|
|
163
|
+
Counts come from the threads and Beeboo's day log; nothing is estimated.
|
|
164
|
+
|
|
165
|
+
Output JSON: {"period", "definitions", "totals", "customers", "products"};
|
|
166
|
+
every row has the same counters plus "messages" (the three message
|
|
167
|
+
counts) and "beeboo_actions" (every Beeboo counter). "definitions" says
|
|
168
|
+
what each counter means, in words fit for a slide. --view keeps one part.
|
|
169
|
+
"""
|
|
170
|
+
views = ("all", "customers", "products", "totals", "definitions")
|
|
171
|
+
if view not in views:
|
|
172
|
+
console.print(f"[red]--view must be one of {', '.join(views)}.[/red]")
|
|
173
|
+
raise typer.Exit(1)
|
|
174
|
+
|
|
175
|
+
def _do():
|
|
176
|
+
result = (
|
|
177
|
+
api_client.get_engagement_stats(start or "", end or "", customer or "") or {}
|
|
178
|
+
).get("result") or {}
|
|
179
|
+
return result if view == "all" else result.get(view)
|
|
180
|
+
|
|
181
|
+
print_json_or_exit(console, _do)
|
|
182
|
+
|
|
136
183
|
@command(
|
|
137
184
|
app,
|
|
138
185
|
"admin",
|
|
File without changes
|
|
@@ -3062,6 +3062,37 @@
|
|
|
3062
3062
|
}
|
|
3063
3063
|
]
|
|
3064
3064
|
},
|
|
3065
|
+
{
|
|
3066
|
+
"name": "admin get closures",
|
|
3067
|
+
"persona": "admin",
|
|
3068
|
+
"verb": "get",
|
|
3069
|
+
"noun": "closures",
|
|
3070
|
+
"access": "read",
|
|
3071
|
+
"api": "GET /admin/suppliers/{supplier_id}/closures",
|
|
3072
|
+
"external": null,
|
|
3073
|
+
"side_effects": [],
|
|
3074
|
+
"approval": "auto",
|
|
3075
|
+
"reversible": null,
|
|
3076
|
+
"idempotent": null,
|
|
3077
|
+
"limit": null,
|
|
3078
|
+
"legacy": [],
|
|
3079
|
+
"help": "GET /admin/suppliers/{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.",
|
|
3080
|
+
"function": "makea_cli.commands.closures.cmd.register.<locals>.admin_get_closures",
|
|
3081
|
+
"flags": [
|
|
3082
|
+
{
|
|
3083
|
+
"name": "supplier_id",
|
|
3084
|
+
"kind": "argument",
|
|
3085
|
+
"opts": [
|
|
3086
|
+
"supplier_id"
|
|
3087
|
+
],
|
|
3088
|
+
"type": "text",
|
|
3089
|
+
"required": true,
|
|
3090
|
+
"multiple": false,
|
|
3091
|
+
"default": null,
|
|
3092
|
+
"help": "The factory's supplier id."
|
|
3093
|
+
}
|
|
3094
|
+
]
|
|
3095
|
+
},
|
|
3065
3096
|
{
|
|
3066
3097
|
"name": "admin get currency-conversion",
|
|
3067
3098
|
"persona": "admin",
|
|
@@ -3122,6 +3153,75 @@
|
|
|
3122
3153
|
}
|
|
3123
3154
|
]
|
|
3124
3155
|
},
|
|
3156
|
+
{
|
|
3157
|
+
"name": "admin get engagement-stats",
|
|
3158
|
+
"persona": "admin",
|
|
3159
|
+
"verb": "get",
|
|
3160
|
+
"noun": "engagement-stats",
|
|
3161
|
+
"access": "read",
|
|
3162
|
+
"api": "GET /admin/engagement-stats",
|
|
3163
|
+
"external": null,
|
|
3164
|
+
"side_effects": [],
|
|
3165
|
+
"approval": "auto",
|
|
3166
|
+
"reversible": null,
|
|
3167
|
+
"idempotent": null,
|
|
3168
|
+
"limit": null,
|
|
3169
|
+
"legacy": [],
|
|
3170
|
+
"help": "GET /admin/engagement-stats — per customer and per product: messages brand to factory, factory to brand and makea to factory, Beeboo's nudges (reminders to the brand, morning emails that carried them, chases to the factory) and every other action Beeboo took.",
|
|
3171
|
+
"function": "makea_cli.commands.metrics.cmd.register.<locals>.get_engagement_stats",
|
|
3172
|
+
"flags": [
|
|
3173
|
+
{
|
|
3174
|
+
"name": "start",
|
|
3175
|
+
"kind": "option",
|
|
3176
|
+
"opts": [
|
|
3177
|
+
"--start"
|
|
3178
|
+
],
|
|
3179
|
+
"type": "text",
|
|
3180
|
+
"required": false,
|
|
3181
|
+
"multiple": false,
|
|
3182
|
+
"default": null,
|
|
3183
|
+
"help": "First day, YYYY-MM-DD (inclusive)."
|
|
3184
|
+
},
|
|
3185
|
+
{
|
|
3186
|
+
"name": "end",
|
|
3187
|
+
"kind": "option",
|
|
3188
|
+
"opts": [
|
|
3189
|
+
"--end"
|
|
3190
|
+
],
|
|
3191
|
+
"type": "text",
|
|
3192
|
+
"required": false,
|
|
3193
|
+
"multiple": false,
|
|
3194
|
+
"default": null,
|
|
3195
|
+
"help": "Last day, YYYY-MM-DD (inclusive)."
|
|
3196
|
+
},
|
|
3197
|
+
{
|
|
3198
|
+
"name": "customer",
|
|
3199
|
+
"kind": "option",
|
|
3200
|
+
"opts": [
|
|
3201
|
+
"--customer",
|
|
3202
|
+
"-c"
|
|
3203
|
+
],
|
|
3204
|
+
"type": "text",
|
|
3205
|
+
"required": false,
|
|
3206
|
+
"multiple": false,
|
|
3207
|
+
"default": null,
|
|
3208
|
+
"help": "Only customers whose name contains this."
|
|
3209
|
+
},
|
|
3210
|
+
{
|
|
3211
|
+
"name": "view",
|
|
3212
|
+
"kind": "option",
|
|
3213
|
+
"opts": [
|
|
3214
|
+
"--view",
|
|
3215
|
+
"-v"
|
|
3216
|
+
],
|
|
3217
|
+
"type": "text",
|
|
3218
|
+
"required": false,
|
|
3219
|
+
"multiple": false,
|
|
3220
|
+
"default": "all",
|
|
3221
|
+
"help": "all | customers | products | totals | definitions."
|
|
3222
|
+
}
|
|
3223
|
+
]
|
|
3224
|
+
},
|
|
3125
3225
|
{
|
|
3126
3226
|
"name": "admin get feature-usage",
|
|
3127
3227
|
"persona": "admin",
|
|
@@ -4947,6 +5047,76 @@
|
|
|
4947
5047
|
}
|
|
4948
5048
|
]
|
|
4949
5049
|
},
|
|
5050
|
+
{
|
|
5051
|
+
"name": "admin set closures",
|
|
5052
|
+
"persona": "admin",
|
|
5053
|
+
"verb": "set",
|
|
5054
|
+
"noun": "closures",
|
|
5055
|
+
"access": "write",
|
|
5056
|
+
"api": "PUT /admin/suppliers/{supplier_id}/closures",
|
|
5057
|
+
"external": null,
|
|
5058
|
+
"side_effects": [
|
|
5059
|
+
"replaces the year's closures and marks it confirmed by Makea",
|
|
5060
|
+
"every date counted for the factory moves: estimates, chases, brands' Time & Action"
|
|
5061
|
+
],
|
|
5062
|
+
"approval": "ask",
|
|
5063
|
+
"reversible": true,
|
|
5064
|
+
"idempotent": true,
|
|
5065
|
+
"limit": null,
|
|
5066
|
+
"legacy": [],
|
|
5067
|
+
"help": "PUT /admin/suppliers/{id}/closures — confirm one year of a factory's holiday closures on its behalf; brands see them as confirmed by Makea. Replaces the whole year: `admin get closures <id>` first. --dry-run shows what would change.",
|
|
5068
|
+
"function": "makea_cli.commands.closures.cmd.register.<locals>.admin_set_closures",
|
|
5069
|
+
"flags": [
|
|
5070
|
+
{
|
|
5071
|
+
"name": "supplier_id",
|
|
5072
|
+
"kind": "argument",
|
|
5073
|
+
"opts": [
|
|
5074
|
+
"supplier_id"
|
|
5075
|
+
],
|
|
5076
|
+
"type": "text",
|
|
5077
|
+
"required": true,
|
|
5078
|
+
"multiple": false,
|
|
5079
|
+
"default": null,
|
|
5080
|
+
"help": "The factory's supplier id."
|
|
5081
|
+
},
|
|
5082
|
+
{
|
|
5083
|
+
"name": "year",
|
|
5084
|
+
"kind": "option",
|
|
5085
|
+
"opts": [
|
|
5086
|
+
"--year"
|
|
5087
|
+
],
|
|
5088
|
+
"type": "integer",
|
|
5089
|
+
"required": true,
|
|
5090
|
+
"multiple": false,
|
|
5091
|
+
"default": null,
|
|
5092
|
+
"help": "This year or next."
|
|
5093
|
+
},
|
|
5094
|
+
{
|
|
5095
|
+
"name": "closure",
|
|
5096
|
+
"kind": "option",
|
|
5097
|
+
"opts": [
|
|
5098
|
+
"--closure"
|
|
5099
|
+
],
|
|
5100
|
+
"type": "text",
|
|
5101
|
+
"required": false,
|
|
5102
|
+
"multiple": true,
|
|
5103
|
+
"default": null,
|
|
5104
|
+
"help": "One closure as FIRST_DAY:LAST_DAY:NAME, dates YYYY-MM-DD, both days closed (e.g. 2027-01-25:2027-02-20:\"Spring Festival\"). Repeat for each; NAME is optional."
|
|
5105
|
+
},
|
|
5106
|
+
{
|
|
5107
|
+
"name": "none",
|
|
5108
|
+
"kind": "option",
|
|
5109
|
+
"opts": [
|
|
5110
|
+
"--none"
|
|
5111
|
+
],
|
|
5112
|
+
"type": "flag",
|
|
5113
|
+
"required": false,
|
|
5114
|
+
"multiple": false,
|
|
5115
|
+
"default": false,
|
|
5116
|
+
"help": "Confirm a year with no closures."
|
|
5117
|
+
}
|
|
5118
|
+
]
|
|
5119
|
+
},
|
|
4950
5120
|
{
|
|
4951
5121
|
"name": "admin set pricing-groups",
|
|
4952
5122
|
"persona": "admin",
|
|
@@ -13195,6 +13365,24 @@
|
|
|
13195
13365
|
}
|
|
13196
13366
|
]
|
|
13197
13367
|
},
|
|
13368
|
+
{
|
|
13369
|
+
"name": "supplier get closures",
|
|
13370
|
+
"persona": "supplier",
|
|
13371
|
+
"verb": "get",
|
|
13372
|
+
"noun": "closures",
|
|
13373
|
+
"access": "read",
|
|
13374
|
+
"api": "GET /supplier/closures",
|
|
13375
|
+
"external": null,
|
|
13376
|
+
"side_effects": [],
|
|
13377
|
+
"approval": "auto",
|
|
13378
|
+
"reversible": null,
|
|
13379
|
+
"idempotent": null,
|
|
13380
|
+
"limit": null,
|
|
13381
|
+
"legacy": [],
|
|
13382
|
+
"help": "GET /supplier/closures — your holiday closures for this year and next: your own where you confirmed the year (source own, confirmed_by), else your country's usual dates (source country).",
|
|
13383
|
+
"function": "makea_cli.commands.closures.cmd.register.<locals>.supplier_get_closures",
|
|
13384
|
+
"flags": []
|
|
13385
|
+
},
|
|
13198
13386
|
{
|
|
13199
13387
|
"name": "supplier get file",
|
|
13200
13388
|
"persona": "supplier",
|
|
@@ -13783,6 +13971,64 @@
|
|
|
13783
13971
|
"function": "makea_cli.commands.factory.cmd.register.<locals>.list_tasks",
|
|
13784
13972
|
"flags": []
|
|
13785
13973
|
},
|
|
13974
|
+
{
|
|
13975
|
+
"name": "supplier set closures",
|
|
13976
|
+
"persona": "supplier",
|
|
13977
|
+
"verb": "set",
|
|
13978
|
+
"noun": "closures",
|
|
13979
|
+
"access": "write",
|
|
13980
|
+
"api": "PUT /supplier/closures",
|
|
13981
|
+
"external": null,
|
|
13982
|
+
"side_effects": [
|
|
13983
|
+
"replaces the year's closures and marks it confirmed by the factory",
|
|
13984
|
+
"every date counted for the factory moves: estimates, chases, brands' Time & Action"
|
|
13985
|
+
],
|
|
13986
|
+
"approval": "ask",
|
|
13987
|
+
"reversible": true,
|
|
13988
|
+
"idempotent": true,
|
|
13989
|
+
"limit": null,
|
|
13990
|
+
"legacy": [],
|
|
13991
|
+
"help": "PUT /supplier/closures — confirm one year of your holiday closures. Replaces the whole year: `supplier get closures` first, then pass every closure that holds. --dry-run shows what would change.",
|
|
13992
|
+
"function": "makea_cli.commands.closures.cmd.register.<locals>.supplier_set_closures",
|
|
13993
|
+
"flags": [
|
|
13994
|
+
{
|
|
13995
|
+
"name": "year",
|
|
13996
|
+
"kind": "option",
|
|
13997
|
+
"opts": [
|
|
13998
|
+
"--year"
|
|
13999
|
+
],
|
|
14000
|
+
"type": "integer",
|
|
14001
|
+
"required": true,
|
|
14002
|
+
"multiple": false,
|
|
14003
|
+
"default": null,
|
|
14004
|
+
"help": "This year or next."
|
|
14005
|
+
},
|
|
14006
|
+
{
|
|
14007
|
+
"name": "closure",
|
|
14008
|
+
"kind": "option",
|
|
14009
|
+
"opts": [
|
|
14010
|
+
"--closure"
|
|
14011
|
+
],
|
|
14012
|
+
"type": "text",
|
|
14013
|
+
"required": false,
|
|
14014
|
+
"multiple": true,
|
|
14015
|
+
"default": null,
|
|
14016
|
+
"help": "One closure as FIRST_DAY:LAST_DAY:NAME, dates YYYY-MM-DD, both days closed (e.g. 2027-01-25:2027-02-20:\"Spring Festival\"). Repeat for each; NAME is optional."
|
|
14017
|
+
},
|
|
14018
|
+
{
|
|
14019
|
+
"name": "none",
|
|
14020
|
+
"kind": "option",
|
|
14021
|
+
"opts": [
|
|
14022
|
+
"--none"
|
|
14023
|
+
],
|
|
14024
|
+
"type": "flag",
|
|
14025
|
+
"required": false,
|
|
14026
|
+
"multiple": false,
|
|
14027
|
+
"default": false,
|
|
14028
|
+
"help": "Confirm a year with no closures."
|
|
14029
|
+
}
|
|
14030
|
+
]
|
|
14031
|
+
},
|
|
13786
14032
|
{
|
|
13787
14033
|
"name": "supplier submit custom-step",
|
|
13788
14034
|
"persona": "supplier",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Factory holiday closures from the CLI: parsing, and what a dry run shows.
|
|
2
|
+
|
|
3
|
+
Run with ``.venv/bin/python -m unittest tests.test_closures``.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import unittest
|
|
9
|
+
|
|
10
|
+
import typer
|
|
11
|
+
|
|
12
|
+
from makea_cli.commands.closures.cmd import parse_closure, preview
|
|
13
|
+
|
|
14
|
+
VIEW = {
|
|
15
|
+
"country": "CN",
|
|
16
|
+
"years": [
|
|
17
|
+
{"year": 2026, "source": "own", "closures": []},
|
|
18
|
+
{
|
|
19
|
+
"year": 2027,
|
|
20
|
+
"source": "country",
|
|
21
|
+
"closures": [
|
|
22
|
+
{"start": "2027-01-27", "end": "2027-02-17", "name": "Spring Festival"},
|
|
23
|
+
{"start": "2027-10-01", "end": "2027-10-07", "name": "National Day"},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ParseTest(unittest.TestCase):
|
|
31
|
+
def test_first_last_and_a_name_with_spaces(self):
|
|
32
|
+
self.assertEqual(
|
|
33
|
+
parse_closure("2027-01-25:2027-02-20:Spring Festival"),
|
|
34
|
+
{"start": "2027-01-25", "end": "2027-02-20", "name": "Spring Festival"},
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
def test_no_name_is_closed(self):
|
|
38
|
+
self.assertEqual(parse_closure("2027-05-01:2027-05-01")["name"], "Closed")
|
|
39
|
+
|
|
40
|
+
def test_mistakes_are_refused(self):
|
|
41
|
+
for raw in ("2027-01-25", "25/01/2027:2027-02-20:x", "2027-02-20:2027-01-25:x"):
|
|
42
|
+
with self.assertRaises(typer.BadParameter, msg=raw):
|
|
43
|
+
parse_closure(raw)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class PreviewTest(unittest.TestCase):
|
|
47
|
+
def test_what_a_set_would_change(self):
|
|
48
|
+
after = [
|
|
49
|
+
{"start": "2027-01-25", "end": "2027-02-20", "name": "Spring Festival"},
|
|
50
|
+
{"start": "2027-10-01", "end": "2027-10-07", "name": "National Day"},
|
|
51
|
+
]
|
|
52
|
+
got = preview(VIEW, 2027, after)
|
|
53
|
+
self.assertTrue(got["dry_run"])
|
|
54
|
+
self.assertEqual(got["currently"], "the country's usual dates")
|
|
55
|
+
self.assertEqual([c["start"] for c in got["added"]], ["2027-01-25"])
|
|
56
|
+
self.assertEqual([c["start"] for c in got["removed"]], ["2027-01-27"])
|
|
57
|
+
|
|
58
|
+
def test_a_year_not_shown_has_nothing_before(self):
|
|
59
|
+
got = preview(VIEW, 2028, [])
|
|
60
|
+
self.assertEqual((got["before"], got["added"], got["removed"]), ([], [], []))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
if __name__ == "__main__":
|
|
64
|
+
unittest.main()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.38"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{makea_cli-0.2.38/makea_cli/commands/flags → makea_cli-0.2.40/makea_cli/commands/files}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|