--- name: upload-lista description: Use when the user provides a list of products and quantities to add to the Chá do Martin wishlist at chadomartin.omeu.website. Triggers on "adicionar itens", "upload lista", "adicionar à lista do Martin", or when given a product/quantity table. --- # Upload Lista — Chá do Martin Adds items to the "Chá do Martin" wishlist via the admin API. ## Config - **URL**: `https://chadomartin.omeu.website` - **Wishlist ID**: `r7ug0ez62x7ljx8c870ofwcv` - **Admin token**: read from `/home/adriano/chadebebe/.env` (key `ADMIN_TOKEN`) - **Auth**: cookie `adm_token=` sent with every request ## Instructions The user will provide a list of items (name + quantity). For each item: 1. Load the admin token: ```bash ADMIN_TOKEN=$(grep ADMIN_TOKEN /home/adriano/chadebebe/.env | cut -d= -f2) ``` 2. POST to the items endpoint: ```bash curl -s -X POST \ "https://chadomartin.omeu.website/api/wishlists/r7ug0ez62x7ljx8c870ofwcv/items" \ -H "Content-Type: application/json" \ -H "Cookie: adm_token=${ADMIN_TOKEN}" \ -d '{"name": "", "quantity": }' ``` 3. Check the response for `"id"` to confirm success. If it contains `"error"`, report it. 4. After all items are posted, print a summary table: | Item | Qty | Status | |------|-----|--------| | ... | ... | ✓ / ✗ | ## Input formats accepted - Free text: "3x fralda tamanho P, 2x body branco" - Markdown table with Name/Quantidade columns - Numbered list: "1. Fralda P — 3 unidades" Parse whatever the user gives and map to `name` + `quantity` before calling the API. ## Notes - `quantity` must be an integer ≥ 1 (defaults to 1 if omitted) - `name` is required; `description`, `imageUrl`, `purchaseUrls` are optional — only include if the user provides them - Items are appended to the end of the list (sortOrder is set automatically) - Run all POSTs in parallel where possible to be fast