@miravia_test/miravia-publish-skill 0.1.2 → 0.1.4
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.
- package/dist/SKILL.md +23 -9
- package/dist/TECHNICAL.md +1 -1
- package/dist/VERSION +1 -1
- package/dist/reference_publish.md +2 -2
- package/dist/scripts/cli_common.py +2 -2
- package/dist/scripts/{modules/extraction_engine.py → extraction_engine.py} +15 -6
- package/dist/scripts/field_definitions.py +3 -3
- package/dist/scripts/{modules/file_reader.py → file_reader.py} +84 -16
- package/dist/scripts/i18n.py +158 -5
- package/dist/scripts/miravia_client.py +1 -0
- package/dist/scripts/product_client.py +25 -0
- package/dist/scripts/product_skill.py +258 -8
- package/dist/scripts/{modules/publish_module.py → publish_module.py} +1151 -132
- package/package.json +1 -1
- package/dist/scripts/modules/__init__.py +0 -1
package/dist/scripts/i18n.py
CHANGED
|
@@ -144,10 +144,20 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
144
144
|
"exported_to_excel": "Exported to Excel: {file} ({count} rows)",
|
|
145
145
|
"exported_to_csv": "Exported to CSV: {file} ({count} rows)",
|
|
146
146
|
# publish module
|
|
147
|
-
"pub_greeting": "Just upload
|
|
147
|
+
"pub_greeting": "Just upload your product materials here — upload a source file, select the folder where product information is located, or enter the web URL of the product information. Supported formats: PDF, Word, Excel, Images, URL. This skill will extract the information accordingly and publish the product to Miravia. Note: currently only single product publishing is supported.",
|
|
148
148
|
"pub_hint": "Or enter directly, e.g., \"Create a new product\"",
|
|
149
149
|
"pub_option_create_title": "Create a new product",
|
|
150
150
|
"pub_option_create_description": "Publish a new product listing",
|
|
151
|
+
"pub_supported_formats": "Supported formats: PDF, Word, Excel, Images, URL",
|
|
152
|
+
"pub_single_product_notice": "Note: currently only single product publishing is supported.",
|
|
153
|
+
# multiple products in Excel
|
|
154
|
+
"pub_multiple_products_detected": "Detected {count} products in the Excel file. Please select which one(s) to publish:",
|
|
155
|
+
"pub_multiple_products_select_index": "Enter a product number (1-{count}) to publish that product.",
|
|
156
|
+
"pub_multiple_products_select_all": "Enter 'all' to publish all products one by one.",
|
|
157
|
+
"pub_multiple_products_cancel": "Enter 'cancel' to cancel.",
|
|
158
|
+
"pub_multiple_products_product_line": " {index}. {title} | Price: {price} | SKU: {sku}",
|
|
159
|
+
"pub_multiple_products_publishing": "Publishing product {index}/{total}: {title}",
|
|
160
|
+
"pub_multiple_products_all_done": "All {count} products have been published.",
|
|
151
161
|
# authorization request
|
|
152
162
|
"pub_authorization_title": "Authorization required",
|
|
153
163
|
"pub_authorization_message": "Before proceeding, I need your authorization to perform the following actions:",
|
|
@@ -156,6 +166,12 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
156
166
|
"pub_authorization_item_update_products": "Update your product data",
|
|
157
167
|
"pub_authorization_confirm_next": "Please confirm that you authorize the above actions to continue.",
|
|
158
168
|
"pub_authorization_confirmed": "Authorization confirmed. Proceeding with your request.",
|
|
169
|
+
"pub_authorization_cancelled": "Authorization cancelled. Please confirm authorization to continue. Upload your file again to trigger the authorization request.",
|
|
170
|
+
# file / URL error messages
|
|
171
|
+
"pub_file_empty_or_corrupted": "File content is empty or corrupted: {source}. Please upload a valid file.",
|
|
172
|
+
"pub_unsupported_format": "Unsupported file format: {source}. Only PDF, Word, Excel, Image, and URL are supported.",
|
|
173
|
+
"pub_invalid_url": "Failed to fetch URL: {source}. Please check the URL and try again.",
|
|
174
|
+
"pub_url_fetch_failed": "Failed to fetch content from {source}: {error}. Please check the URL and try again.",
|
|
159
175
|
"pub_create_requires_category": "create_product requires --category-id (leaf category)",
|
|
160
176
|
"pub_create_requires_name": "create_product requires --product-name",
|
|
161
177
|
"pub_create_preview_message": "Please review the product creation details below and confirm before I create the product.",
|
|
@@ -165,8 +181,10 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
165
181
|
"pub_title_too_short": "Product title is too short (minimum {min} characters, got {actual}).",
|
|
166
182
|
"pub_title_too_long": "Product title is too long (maximum {max} characters, got {actual}).",
|
|
167
183
|
"pub_title_too_few_words": "Product title must have at least {min} words (got {actual}).",
|
|
184
|
+
"pub_title_format_suggestion": "Recommended title format: Brand + Category + Model + Key Features + Usage Scenario. Example: \"Nike Women's White Running Shoes Lightweight Breathable Sports Sneakers for Outdoor Jogging\".",
|
|
168
185
|
"pub_too_many_images": "Too many images (maximum {max}, got {count}).",
|
|
169
186
|
"pub_too_many_skus": "Too many SKUs (maximum {max}, got {count}).",
|
|
187
|
+
"pub_too_many_variations": "Miravia supports at most 2 sales attribute dimensions, but {count} extra dimensions were detected ({variations}). Please choose which 2 to keep and remove the rest.",
|
|
170
188
|
"pub_price_must_be_positive": "SKU #{idx} price must be greater than 0.",
|
|
171
189
|
"pub_price_out_of_range": "SKU #{idx} price must be greater than 0 and less than or equal to {max}.",
|
|
172
190
|
"pub_price_too_many_decimals": "SKU #{idx} price must have at most two decimal places.",
|
|
@@ -180,25 +198,75 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
180
198
|
"pub_ean_duplicate_in_product": "Duplicate EAN code found within the same product. Each SKU must have a unique EAN code.",
|
|
181
199
|
"pub_invalid_image_format": "Image #{idx} has invalid format '{format}'. Allowed formats: {allowed}.",
|
|
182
200
|
"pub_image_too_large": "Image #{idx} is too large ({size_mb}MB). Maximum size is {max_mb}MB.",
|
|
201
|
+
"pub_white_background_warning": "Image #{idx} may not have a white background. Miravia recommends using pure white background for the main image.",
|
|
183
202
|
"pub_invalid_dimension": "{name} value '{value}' is invalid.",
|
|
184
203
|
"pub_dimension_out_of_range": "{name} must be greater than 0 and less than or equal to {max} (got {value}).",
|
|
204
|
+
"pub_dimension_incomplete": "SKU #{idx} has weight but is missing package dimensions (length/width/height). All four values are required together.",
|
|
185
205
|
"pub_invalid_delivery_method": "Delivery method must be DBM or DBS (got '{value}').",
|
|
186
206
|
"pub_invalid_safety_warning": "Safety warning must be Yes or No (got '{value}').",
|
|
187
207
|
"pub_safety_warning_content_required": "Safety warning content is required when safety warning is Yes.",
|
|
208
|
+
# compliance fields
|
|
209
|
+
"pub_compliance_manufacturer_eurp_both_empty": "Manufacturer and EU Responsible Person are both empty. Non-EU manufacturers require an EU Responsible Person.",
|
|
210
|
+
"pub_compliance_eurp_missing_with_manufacturer": "Manufacturer is filled but EU Responsible Person is empty. Non-EU manufacturers require an EU Responsible Person.",
|
|
211
|
+
"pub_safety_warning_content_missing": "Safety Warning is set to Yes but the warning content is empty. Please provide the safety warning content.",
|
|
212
|
+
"pub_compliance_docs_missing": "Compliance documents are required for this category but not provided.",
|
|
213
|
+
"pub_compliance_missing_message": "Some compliance fields are missing. You can fill them or publish to Draft.",
|
|
214
|
+
"pub_compliance_fill_or_draft": "Fill the missing compliance fields, or publish as Draft to complete them later.",
|
|
215
|
+
"pub_draft_option_hint": "Publish as Draft (--draft) to skip these fields and complete them later in Seller Center.",
|
|
216
|
+
# special category rules
|
|
217
|
+
"pub_ppu_both_missing": "Unit count type and unit count are both empty. Price-per-unit calculation requires both fields.",
|
|
218
|
+
"pub_ppu_type_missing": "Unit count type is empty. Price-per-unit calculation requires the unit type.",
|
|
219
|
+
"pub_ppu_count_missing": "Unit count is empty. Price-per-unit calculation requires the unit count.",
|
|
220
|
+
"pub_ppu_count_invalid": "Unit count must be a positive number (got '{value}').",
|
|
221
|
+
"pub_ppu_count_not_number": "Unit count must be a number (got '{value}').",
|
|
222
|
+
"pub_ppu_validation_failed": "Unit count validation failed. Please fix the value and rerun.",
|
|
223
|
+
"pub_ppu_fix_and_rerun": "Fix the unit count value and rerun.",
|
|
224
|
+
"pub_isbn_required_for_books": "ISBN is required for book category products.",
|
|
225
|
+
"pub_isbn_missing": "ISBN is empty. Book products must have a valid ISBN.",
|
|
226
|
+
"pub_isbn_fix_and_rerun": "Provide a valid ISBN and rerun.",
|
|
227
|
+
"pub_food_attrs_missing": "Food & health attributes are empty. This category requires food-specific attributes.",
|
|
228
|
+
"pub_special_category_missing_message": "Some special category fields are missing. You can fill them or publish to Draft.",
|
|
229
|
+
"pub_special_category_fill_or_draft": "Fill the missing fields, or publish as Draft to complete them later.",
|
|
230
|
+
# field summary sections
|
|
231
|
+
"pub_summary_mandatory_section": "[Mandatory Fields]",
|
|
232
|
+
"pub_summary_conditional_section": "[Conditional Fields]",
|
|
233
|
+
"pub_field_status_filled": "Filled",
|
|
234
|
+
"pub_field_status_missing": "MISSING",
|
|
235
|
+
"pub_mandatory_missing_block": "Cannot publish: missing mandatory fields [{fields}]. Please fill them and rerun.",
|
|
236
|
+
"pub_conditional_missing_draft": "Missing conditional fields [{fields}]. The product will be saved as Inactive (Draft) and auto-activated once completed. Confirm to proceed?",
|
|
237
|
+
# DBM/DBS auto-switch
|
|
238
|
+
"pub_dbm_weight_exceeded": "Weight {weight} exceeds DBM limit {limit}KG.",
|
|
239
|
+
"pub_dbm_dim_sum_exceeded": "Dimension sum {dim_sum} exceeds DBM limit {limit}cm.",
|
|
240
|
+
"pub_dbm_volume_exceeded": "Volumetric weight {volume} exceeds DBM limit {limit}.",
|
|
241
|
+
"pub_dbm_auto_switch_to_dbs": "Package exceeds DBM limits. Delivery method auto-switched to DBS.",
|
|
242
|
+
"pub_dbm_no_dbs_permission": "Package exceeds DBM limits but seller has no DBS permission. Cannot auto-switch to DBS.",
|
|
243
|
+
"pub_dbm_fix_or_apply_dbs": "Please reduce package size/weight to meet DBM limits, or apply for DBS permission in Seller Center.",
|
|
244
|
+
# SKU already exists (concurrency conflict)
|
|
245
|
+
"pub_sku_already_exists": "One or more Seller SKU codes are already used by existing products. This may be caused by a concurrent publish or duplicate SKU.",
|
|
246
|
+
"pub_sku_already_exists_next": "Please refresh the product list to check, or modify the Seller SKU code and rerun.",
|
|
188
247
|
"pub_scenario_create_product": "Create a new product",
|
|
189
248
|
# ai_post (source-driven create_product)
|
|
190
249
|
"pub_ai_post_requires_source": "create_product --source requires at least one source (file, folder, or URL).",
|
|
191
250
|
"pub_ai_post_no_content": "No readable content found in the provided sources.",
|
|
192
251
|
"pub_ai_post_need_category": "Please provide or confirm the Miravia leaf category for this product.",
|
|
193
252
|
"pub_ai_post_provide_category": "Rerun with --category-id <id> or --confirmed-category-id <id>.",
|
|
194
|
-
"pub_ai_post_category_not_found": "No category matching \"{name}\" was found. Please check the category name
|
|
253
|
+
"pub_ai_post_category_not_found": "No category matching \"{name}\" was found. Please check the category name, provide a category ID, or browse the full category tree at Seller Center.",
|
|
254
|
+
"pub_ai_post_category_id_invalid": "Category ID {category_id} does not exist in the Miravia category tree. Please provide a valid category ID or browse the category tree below to find one.",
|
|
255
|
+
"pub_category_tree_link": "Browse full category tree: https://sellercenter.miravia.es/apps/setting/category",
|
|
195
256
|
"pub_ai_post_category_multiple": "Found {count} matching categories. Please choose one.",
|
|
257
|
+
"pub_ai_post_category_recommend": "Category recommendation found {count} candidates. Please choose one.",
|
|
196
258
|
"pub_ai_post_category_confirm": "Found category: {name} (ID: {category_id}). Confirm to use it.",
|
|
197
259
|
"pub_category_confirm_next": "Rerun with --confirmed-category-id {category_id} to use this category.",
|
|
198
260
|
"pub_ai_post_need_brand": "Please provide or confirm the brand for this product.",
|
|
199
261
|
"pub_ai_post_provide_brand": "Rerun with --brand-name <name> or --confirmed-brand-id <id>.",
|
|
200
262
|
"pub_ai_post_prevalidate_failed": "Pre-validation found potential issues. Please review the errors below.",
|
|
201
263
|
"pub_ai_post_prevalidate_fix": "Fix the issues above and rerun.",
|
|
264
|
+
# category permission
|
|
265
|
+
"pub_category_permission_title": "Category permission required",
|
|
266
|
+
"pub_category_permission_message": "You do not have permission to publish in category \"{category_name}\" (ID: {category_id}). Would you like to publish as a draft? The product will be automatically activated once category permission is approved.",
|
|
267
|
+
"pub_category_permission_draft_next": "Rerun with --draft to publish as an inactive draft.",
|
|
268
|
+
"pub_category_permission_apply_link": "Apply for category permission: https://sellercenter.miravia.es/apps/setting/category",
|
|
269
|
+
"pub_category_permission_change_next": "Or choose a different category and rerun with --category-id <id>.",
|
|
202
270
|
# field definition guides for sellers
|
|
203
271
|
"pub_guide_brand": "Brand: the registered brand of the product. If you do not have permission for this brand, apply in Seller Center or choose a brand you are authorized to use.",
|
|
204
272
|
"pub_guide_category": "Category: the Miravia leaf category where the product will be listed. You must have selling permission for this category; category restrictions will be reported in pre-validation.",
|
|
@@ -245,6 +313,7 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
245
313
|
"pub_manufacturer_eurp_mismatch": "The manufacturer / EU responsible person does not match an approved record. Please choose a valid one or publish as draft.",
|
|
246
314
|
"pub_seller_sku_recommended": "Seller SKU is strongly recommended as the internal identifier for this SKU. Please provide one if available.",
|
|
247
315
|
"pub_seller_sku_required": "SKU #{idx} is missing the required Seller SKU. Please provide a unique SellerSku for every SKU.",
|
|
316
|
+
"pub_seller_sku_duplicate_in_product": "Duplicate Seller SKU found within the same product. Each SKU must have a unique SellerSku.",
|
|
248
317
|
"pub_country_price_recommended": "This product appears to be sold in multiple countries ({countries}). It is strongly recommended to set country-specific prices.",
|
|
249
318
|
"pub_final_confirm_title": "Final confirmation",
|
|
250
319
|
"pub_final_confirm_message": "Please review all extracted fields below. If any field needs to be updated, change the source material or rerun with the corresponding argument.",
|
|
@@ -255,6 +324,7 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
255
324
|
"pub_need_category_attributes_description": "The category {category_id} requires the following attributes that were not found in the extracted data. Please provide them via --attribute-data or rerun with --draft to publish as an inactive draft.",
|
|
256
325
|
"pub_need_category_attributes_item": "{idx}. {label} ({en_name}) - {input_type}",
|
|
257
326
|
"pub_need_category_attributes_next": "Provide the missing attributes and rerun with --attribute-data '<json>', or use --draft to publish as inactive draft and complete them later.",
|
|
327
|
+
"pub_html_cleaned_notice": "The product description has been cleaned: unsafe HTML tags (script, iframe, style attributes, etc.) were removed. Only safe formatting tags (p, br, b, ul, li, etc.) are kept.",
|
|
258
328
|
"pub_create_pending_review": "Product submitted successfully. It is currently under Miravia review and temporarily unavailable for sale; approval may take up to 48 hours, especially if package photos or documents are required. Once approved, it will be activated automatically. If rejected, please check the Suspended tab.",
|
|
259
329
|
"pub_pdp_link": "Product detail page: {url}",
|
|
260
330
|
},
|
|
@@ -375,10 +445,12 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
375
445
|
"exported_to_excel": "Exportado a Excel: {file} ({count} filas)",
|
|
376
446
|
"exported_to_csv": "Exportado a CSV: {file} ({count} filas)",
|
|
377
447
|
# publish module
|
|
378
|
-
"pub_greeting": "Simplemente sube aquí
|
|
448
|
+
"pub_greeting": "Simplemente sube aquí los materiales de tu producto: un archivo fuente, la carpeta donde se encuentra la información del producto, o la URL web de la información del producto. Formatos soportados: PDF, Word, Excel, Imágenes, URL. Esta skill extraerá la información correspondiente y publicará el producto en Miravia. Nota: actualmente solo se admite la publicación de un solo producto.",
|
|
379
449
|
"pub_hint": "O escribe directamente, p. ej., \"Crear un nuevo producto\"",
|
|
380
450
|
"pub_option_create_title": "Crear un nuevo producto",
|
|
381
451
|
"pub_option_create_description": "Publicar un nuevo listing de producto",
|
|
452
|
+
"pub_supported_formats": "Formatos soportados: PDF, Word, Excel, Imágenes, URL",
|
|
453
|
+
"pub_single_product_notice": "Nota: actualmente solo se admite la publicación de un solo producto.",
|
|
382
454
|
# authorization request
|
|
383
455
|
"pub_authorization_title": "Autorización requerida",
|
|
384
456
|
"pub_authorization_message": "Antes de continuar, necesito tu autorización para realizar las siguientes acciones:",
|
|
@@ -387,6 +459,12 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
387
459
|
"pub_authorization_item_update_products": "Actualizar los datos de tus productos",
|
|
388
460
|
"pub_authorization_confirm_next": "Confirma que autorizas las acciones anteriores para continuar.",
|
|
389
461
|
"pub_authorization_confirmed": "Autorización confirmada. Procediendo con tu solicitud.",
|
|
462
|
+
"pub_authorization_cancelled": "Autorización cancelada. Por favor, confirma la autorización para continuar. Vuelve a subir tu archivo para activar la solicitud de autorización.",
|
|
463
|
+
# file / URL error messages
|
|
464
|
+
"pub_file_empty_or_corrupted": "El contenido del archivo está vacío o corrupto: {source}. Por favor, sube un archivo válido.",
|
|
465
|
+
"pub_unsupported_format": "Formato de archivo no soportado: {source}. Solo se admiten PDF, Word, Excel, Imagen y URL.",
|
|
466
|
+
"pub_invalid_url": "No se pudo obtener la URL: {source}. Por favor, verifica la URL e inténtalo de nuevo.",
|
|
467
|
+
"pub_url_fetch_failed": "No se pudo obtener contenido de {source}: {error}. Por favor, verifica la URL e inténtalo de nuevo.",
|
|
390
468
|
"pub_create_requires_category": "create_product requiere --category-id (categoría hoja)",
|
|
391
469
|
"pub_create_requires_name": "create_product requiere --product-name",
|
|
392
470
|
"pub_create_preview_message": "Revisa los detalles del producto y confirma antes de crearlo.",
|
|
@@ -534,10 +612,12 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
534
612
|
"exported_to_excel": "Esportato in Excel: {file} ({count} righe)",
|
|
535
613
|
"exported_to_csv": "Esportato in CSV: {file} ({count} righe)",
|
|
536
614
|
# publish module
|
|
537
|
-
"pub_greeting": "Carica qui
|
|
615
|
+
"pub_greeting": "Carica qui i materiali del tuo prodotto: un file sorgente, la cartella in cui si trovano le informazioni del prodotto o l'URL web delle informazioni del prodotto. Formati supportati: PDF, Word, Excel, Immagini, URL. Questa skill estrarrà le informazioni di conseguenza e pubblicherà il prodotto su Miravia. Nota: attualmente è supportata solo la pubblicazione di un singolo prodotto.",
|
|
538
616
|
"pub_hint": "Oppure scrivi direttamente, ad es. \"Crea un nuovo prodotto\"",
|
|
539
617
|
"pub_option_create_title": "Crea un nuovo prodotto",
|
|
540
618
|
"pub_option_create_description": "Pubblica un nuovo listing di prodotto",
|
|
619
|
+
"pub_supported_formats": "Formati supportati: PDF, Word, Excel, Immagini, URL",
|
|
620
|
+
"pub_single_product_notice": "Nota: attualmente è supportata solo la pubblicazione di un singolo prodotto.",
|
|
541
621
|
# authorization request
|
|
542
622
|
"pub_authorization_title": "Autorizzazione richiesta",
|
|
543
623
|
"pub_authorization_message": "Prima di procedere, ho bisogno della tua autorizzazione per le seguenti azioni:",
|
|
@@ -546,6 +626,12 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
546
626
|
"pub_authorization_item_update_products": "Aggiornare i dati dei tuoi prodotti",
|
|
547
627
|
"pub_authorization_confirm_next": "Conferma che autorizzi le azioni sopra indicate per continuare.",
|
|
548
628
|
"pub_authorization_confirmed": "Autorizzazione confermata. Procedo con la tua richiesta.",
|
|
629
|
+
"pub_authorization_cancelled": "Autorizzazione annullata. Conferma l'autorizzazione per continuare. Carica di nuovo il tuo file per attivare la richiesta di autorizzazione.",
|
|
630
|
+
# file / URL error messages
|
|
631
|
+
"pub_file_empty_or_corrupted": "Il contenuto del file è vuoto o corrotto: {source}. Carica un file valido.",
|
|
632
|
+
"pub_unsupported_format": "Formato file non supportato: {source}. Sono supportati solo PDF, Word, Excel, Immagine e URL.",
|
|
633
|
+
"pub_invalid_url": "Impossibile recuperare l'URL: {source}. Verifica l'URL e riprova.",
|
|
634
|
+
"pub_url_fetch_failed": "Impossibile recuperare il contenuto da {source}: {error}. Verifica l'URL e riprova.",
|
|
549
635
|
"pub_create_requires_category": "create_product richiede --category-id (categoria foglia)",
|
|
550
636
|
"pub_create_requires_name": "create_product richiede --product-name",
|
|
551
637
|
"pub_create_preview_message": "Rivedi i dettagli del prodotto e conferma prima di crearlo.",
|
|
@@ -693,10 +779,20 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
693
779
|
"exported_to_excel": "已导出 Excel: {file}(共 {count} 行)",
|
|
694
780
|
"exported_to_csv": "已导出 CSV: {file}(共 {count} 行)",
|
|
695
781
|
# publish module
|
|
696
|
-
"pub_greeting": "
|
|
782
|
+
"pub_greeting": "只需在此处上传您产品的资料,例如上传源文件,或选择产品信息所在的文件夹位置,或输入产品信息的网页 URL。支持格式:PDF、Word、Excel、图片、URL。本技能将相应地提取信息并将产品发布到 Miravia。注意:当前仅支持发布单个商品。",
|
|
697
783
|
"pub_hint": "也可以直接输入,例如:「帮我创建一个新商品」",
|
|
698
784
|
"pub_option_create_title": "创建新商品",
|
|
699
785
|
"pub_option_create_description": "发布一个新的商品 listing",
|
|
786
|
+
"pub_supported_formats": "支持格式:PDF、Word、Excel、图片、URL",
|
|
787
|
+
"pub_single_product_notice": "注意:当前仅支持发布单个商品。",
|
|
788
|
+
# multiple products in Excel
|
|
789
|
+
"pub_multiple_products_detected": "检测到 Excel 文件中有 {count} 个商品。请选择要发布的商品:",
|
|
790
|
+
"pub_multiple_products_select_index": "输入商品序号(1-{count})发布该商品。",
|
|
791
|
+
"pub_multiple_products_select_all": "输入 'all' 逐个发布所有商品。",
|
|
792
|
+
"pub_multiple_products_cancel": "输入 'cancel' 取消。",
|
|
793
|
+
"pub_multiple_products_product_line": " {index}. {title} | 价格:{price} | SKU:{sku}",
|
|
794
|
+
"pub_multiple_products_publishing": "正在发布商品 {index}/{total}:{title}",
|
|
795
|
+
"pub_multiple_products_all_done": "全部 {count} 个商品已发布完成。",
|
|
700
796
|
# authorization request
|
|
701
797
|
"pub_authorization_title": "需要授权",
|
|
702
798
|
"pub_authorization_message": "在继续之前,我需要您授权以下操作:",
|
|
@@ -705,6 +801,12 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
705
801
|
"pub_authorization_item_update_products": "更新您的商品数据",
|
|
706
802
|
"pub_authorization_confirm_next": "请确认您授权以上操作,以便继续。",
|
|
707
803
|
"pub_authorization_confirmed": "授权已确认,正在处理您的请求。",
|
|
804
|
+
"pub_authorization_cancelled": "授权已取消。请确认授权后继续。重新上传文件将触发授权请求。",
|
|
805
|
+
# file / URL error messages
|
|
806
|
+
"pub_file_empty_or_corrupted": "文件内容为空或损坏:{source}。请上传有效文件。",
|
|
807
|
+
"pub_unsupported_format": "不支持的文件格式:{source}。仅支持 PDF、Word、Excel、图片和 URL。",
|
|
808
|
+
"pub_invalid_url": "无法获取 URL:{source}。请检查 URL 后重试。",
|
|
809
|
+
"pub_url_fetch_failed": "无法从 {source} 获取内容:{error}。请检查 URL 后重试。",
|
|
708
810
|
"pub_create_requires_category": "创建商品必须提供 --category-id(叶子类目 ID)",
|
|
709
811
|
"pub_create_requires_name": "创建商品必须提供 --product-name(商品标题)",
|
|
710
812
|
"pub_create_preview_message": "请检查以下商品信息,确认无误后我将创建商品。",
|
|
@@ -714,8 +816,10 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
714
816
|
"pub_title_too_short": "商品标题过短(最少 {min} 个字符,当前 {actual} 个)。",
|
|
715
817
|
"pub_title_too_long": "商品标题过长(最多 {max} 个字符,当前 {actual} 个)。",
|
|
716
818
|
"pub_title_too_few_words": "商品标题至少需要 {min} 个单词(当前 {actual} 个)。",
|
|
819
|
+
"pub_title_format_suggestion": "建议标题格式:品牌 + 类目 + 型号 + 核心卖点 + 使用场景。示例:\"Nike 女士白色跑步鞋 轻便透气运动鞋 户外慢跑专用\"。",
|
|
717
820
|
"pub_too_many_images": "图片过多(最多 {max} 张,当前 {count} 张)。",
|
|
718
821
|
"pub_too_many_skus": "SKU 过多(最多 {max} 个,当前 {count} 个)。",
|
|
822
|
+
"pub_too_many_variations": "Miravia 最多支持 2 个销售属性维度,但检测到 {count} 个额外维度({variations})。请选择保留哪 2 个,并删除其余的。",
|
|
719
823
|
"pub_price_must_be_positive": "第 {idx} 个 SKU 的价格必须大于 0。",
|
|
720
824
|
"pub_price_out_of_range": "第 {idx} 个 SKU 的价格必须大于 0 且不超过 {max}。",
|
|
721
825
|
"pub_price_too_many_decimals": "第 {idx} 个 SKU 的价格最多保留两位小数。",
|
|
@@ -729,11 +833,52 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
729
833
|
"pub_ean_duplicate_in_product": "同一商品内发现重复的 EAN 码。每个 SKU 必须有唯一的 EAN 码。",
|
|
730
834
|
"pub_invalid_image_format": "第 {idx} 张图片格式无效 '{format}'。允许的格式:{allowed}。",
|
|
731
835
|
"pub_image_too_large": "第 {idx} 张图片过大({size_mb}MB)。最大大小为 {max_mb}MB。",
|
|
836
|
+
"pub_white_background_warning": "第 {idx} 张图片可能不是纯白背景。Miravia 建议主图使用纯白背景。",
|
|
732
837
|
"pub_invalid_dimension": "{name} 值 '{value}' 无效。",
|
|
733
838
|
"pub_dimension_out_of_range": "{name} 必须大于 0 且不超过 {max}(当前 {value})。",
|
|
839
|
+
"pub_dimension_incomplete": "第 {idx} 个 SKU 有重量但缺少包裹尺寸(长/宽/高)。这四个值必须一起提供。",
|
|
734
840
|
"pub_invalid_delivery_method": "物流方式必须是 DBM 或 DBS(当前 '{value}')。",
|
|
735
841
|
"pub_invalid_safety_warning": "安全警告必须是 Yes 或 No(当前 '{value}')。",
|
|
736
842
|
"pub_safety_warning_content_required": "安全警告选择 Yes 时必须填写安全警告内容。",
|
|
843
|
+
# compliance fields
|
|
844
|
+
"pub_compliance_manufacturer_eurp_both_empty": "制造商和欧盟负责人均为空。非欧盟制造商必须填写欧盟负责人。",
|
|
845
|
+
"pub_compliance_eurp_missing_with_manufacturer": "已填写制造商但欧盟负责人为空。非欧盟制造商必须填写欧盟负责人。",
|
|
846
|
+
"pub_safety_warning_content_missing": "安全警告已设为 Yes 但未填写警告内容。请补充安全警告内容。",
|
|
847
|
+
"pub_compliance_docs_missing": "该类目要求上传合规文档但未提供。",
|
|
848
|
+
"pub_compliance_missing_message": "部分合规字段缺失。您可以补充完整或发布为草稿。",
|
|
849
|
+
"pub_compliance_fill_or_draft": "补充缺失的合规字段,或发布为草稿(Draft)稍后在 Seller Center 中完善。",
|
|
850
|
+
"pub_draft_option_hint": "使用草稿模式(--draft)跳过这些字段,稍后在 Seller Center 中补充完善。",
|
|
851
|
+
# special category rules
|
|
852
|
+
"pub_ppu_both_missing": "单位类型和单位数量均为空。单价计算需要同时填写这两个字段。",
|
|
853
|
+
"pub_ppu_type_missing": "单位类型为空。单价计算需要填写单位类型。",
|
|
854
|
+
"pub_ppu_count_missing": "单位数量为空。单价计算需要填写单位数量。",
|
|
855
|
+
"pub_ppu_count_invalid": "单位数量必须为正数(当前 '{value}')。",
|
|
856
|
+
"pub_ppu_count_not_number": "单位数量必须为数字(当前 '{value}')。",
|
|
857
|
+
"pub_ppu_validation_failed": "单位数量校验失败。请修正后重新运行。",
|
|
858
|
+
"pub_ppu_fix_and_rerun": "修正单位数量后重新运行。",
|
|
859
|
+
"pub_isbn_required_for_books": "图书类目商品必须填写 ISBN。",
|
|
860
|
+
"pub_isbn_missing": "ISBN 为空。图书类商品必须提供有效的 ISBN。",
|
|
861
|
+
"pub_isbn_fix_and_rerun": "提供有效的 ISBN 后重新运行。",
|
|
862
|
+
"pub_food_attrs_missing": "食品属性为空。该类目要求填写食品相关属性。",
|
|
863
|
+
"pub_special_category_missing_message": "部分特殊类目字段缺失。您可以补充完整或发布为草稿。",
|
|
864
|
+
"pub_special_category_fill_or_draft": "补充缺失字段,或发布为草稿(Draft)稍后完善。",
|
|
865
|
+
# field summary sections
|
|
866
|
+
"pub_summary_mandatory_section": "【必填字段】",
|
|
867
|
+
"pub_summary_conditional_section": "【条件必填字段】",
|
|
868
|
+
"pub_field_status_filled": "已填写",
|
|
869
|
+
"pub_field_status_missing": "缺失",
|
|
870
|
+
"pub_mandatory_missing_block": "无法发布:缺少必填字段 [{fields}]。请补充后重新运行。",
|
|
871
|
+
"pub_conditional_missing_draft": "缺少条件必填字段 [{fields}]。商品将以未激活(Draft)状态保存,待补全后自动激活。是否确认?",
|
|
872
|
+
# DBM/DBS auto-switch
|
|
873
|
+
"pub_dbm_weight_exceeded": "重量 {weight} 超过 DBM 限制 {limit}KG。",
|
|
874
|
+
"pub_dbm_dim_sum_exceeded": "三边之和 {dim_sum} 超过 DBM 限制 {limit}cm。",
|
|
875
|
+
"pub_dbm_volume_exceeded": "体积重 {volume} 超过 DBM 限制 {limit}。",
|
|
876
|
+
"pub_dbm_auto_switch_to_dbs": "包裹超出 DBM 限制,物流方式自动转为 DBS。",
|
|
877
|
+
"pub_dbm_no_dbs_permission": "包裹超出 DBM 限制,但卖家无 DBS 权限,无法自动转为 DBS。",
|
|
878
|
+
"pub_dbm_fix_or_apply_dbs": "请减小包裹尺寸/重量以满足 DBM 限制,或在 Seller Center 申请 DBS 权限。",
|
|
879
|
+
# SKU already exists (concurrency conflict)
|
|
880
|
+
"pub_sku_already_exists": "一个或多个 Seller SKU 已被其他商品占用。可能是并发发布或 SKU 重复导致。",
|
|
881
|
+
"pub_sku_already_exists_next": "请刷新商品列表检查,或修改 Seller SKU 后重新运行。",
|
|
737
882
|
"pub_scenario_create_product": "创建新商品",
|
|
738
883
|
# create_product interactive confirmations
|
|
739
884
|
"pub_need_brand_title": "需要选择品牌",
|
|
@@ -768,6 +913,7 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
768
913
|
"pub_manufacturer_eurp_mismatch": "制造商 / 欧盟负责人与已审核记录不匹配。请选择有效的记录,或以草稿模式发布。",
|
|
769
914
|
"pub_seller_sku_recommended": "强烈建议填写商家 SKU,作为该 SKU 的内部标识符,方便后续查找。如有请补充。",
|
|
770
915
|
"pub_seller_sku_required": "第 {idx} 个 SKU 缺少必填的商家 SKU。请为每个 SKU 提供一个唯一的 SellerSku。",
|
|
916
|
+
"pub_seller_sku_duplicate_in_product": "同一商品内发现重复的商家 SKU。每个 SKU 必须有唯一的 SellerSku。",
|
|
771
917
|
"pub_country_price_recommended": "检测到该商品将在多个国家销售({countries})。强烈建议为每个国家设置站点价格。",
|
|
772
918
|
"pub_final_confirm_title": "最终确认",
|
|
773
919
|
"pub_final_confirm_message": "请检查以下提取出的字段。如需修改,请更新原始素材或使用对应参数重新运行。",
|
|
@@ -778,8 +924,15 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
778
924
|
"pub_need_category_attributes_description": "类目 {category_id} 要求以下属性,但 AI 抽取的数据中未包含。请通过 --attribute-data 补充,或使用 --draft 发布为未激活草稿。",
|
|
779
925
|
"pub_need_category_attributes_item": "{idx}. {label}({en_name})- {input_type}",
|
|
780
926
|
"pub_need_category_attributes_next": "补充缺失属性后使用 --attribute-data '<json>' 重新运行,或使用 --draft 发布为未激活草稿稍后补充。",
|
|
927
|
+
"pub_html_cleaned_notice": "商品描述已清理:不安全的 HTML 标签(script、iframe、style 属性等)已被移除。仅保留安全格式标签(p、br、b、ul、li 等)。",
|
|
781
928
|
"pub_create_pending_review": "商品提交成功,目前正在接受 Miravia 审核,暂不可售;审核最长可能需要 48 小时,特别是需要包装照片或文件时。审核通过后会自动激活,如被拒绝请在“已暂停(Suspended)”选项卡中查看。",
|
|
782
929
|
"pub_pdp_link": "商品详情页:{url}",
|
|
930
|
+
# category permission
|
|
931
|
+
"pub_category_permission_title": "需要类目权限",
|
|
932
|
+
"pub_category_permission_message": "您没有类目 \"{category_name}\"(ID: {category_id})的发布权限。是否以草稿模式发布?待类目权限审批通过后商品将自动激活。",
|
|
933
|
+
"pub_category_permission_draft_next": "加上 --draft 重新运行,以未激活草稿模式发布。",
|
|
934
|
+
"pub_category_permission_apply_link": "申请类目权限:https://sellercenter.miravia.es/apps/setting/category",
|
|
935
|
+
"pub_category_permission_change_next": "或更换类目后使用 --category-id <id> 重新运行。",
|
|
783
936
|
# field definition guides for sellers
|
|
784
937
|
"pub_guide_brand": "品牌:商品的注册品牌。如没有权限使用该品牌,请前往 Seller Center 申请或选择已授权品牌。",
|
|
785
938
|
"pub_guide_category": "类目:商品将发布的 Miravia 叶子类目。必须拥有该类目的销售权限;类目限制将在 pre-validation 中统一反馈。",
|
|
@@ -76,6 +76,7 @@ _BUSINESS_ERROR_HINTS = {
|
|
|
76
76
|
),
|
|
77
77
|
"NO_DATA": "No matching data found for the given criteria.",
|
|
78
78
|
"SKU_NOT_BELONG_TO_SELLER": "One or more SKUs do not belong to the current seller.",
|
|
79
|
+
"SKU_ALREADY_EXISTS": "One or more Seller SKU codes are already used by existing products. Please use different SKU codes.",
|
|
79
80
|
"BRAND_PERMISSION_DENIED": "Your seller account does not have permission for this brand.",
|
|
80
81
|
"BRAND_PENDING": "Brand is pending approval. Use --draft to publish as inactive draft until the brand permission is granted.",
|
|
81
82
|
"PARAM_ILLEGAL": "Request parameter validation failed. Please check the input fields.",
|
|
@@ -226,6 +226,31 @@ class ProductClient:
|
|
|
226
226
|
body = self.client.request("GET", "/category/tree/get", params)
|
|
227
227
|
return body.get("data", {}) or {}
|
|
228
228
|
|
|
229
|
+
def recommend_category(
|
|
230
|
+
self,
|
|
231
|
+
title: Optional[str] = None,
|
|
232
|
+
image_urls: Optional[List[str]] = None,
|
|
233
|
+
) -> List[Dict[str, Any]]:
|
|
234
|
+
"""Call /product/category/recommend/get to get category recommendations.
|
|
235
|
+
|
|
236
|
+
Args:
|
|
237
|
+
title: Product title for recommendation
|
|
238
|
+
image_urls: List of product image URLs for recommendation
|
|
239
|
+
|
|
240
|
+
Returns:
|
|
241
|
+
List of category candidates, each with category_id, name, confidence, etc.
|
|
242
|
+
"""
|
|
243
|
+
params: Dict[str, Any] = {}
|
|
244
|
+
if title:
|
|
245
|
+
params["title"] = title
|
|
246
|
+
if image_urls:
|
|
247
|
+
params["imageUrls"] = image_urls
|
|
248
|
+
result = self.client.request("GET", "/product/category/recommend/get", params)
|
|
249
|
+
data = result.get("data", []) or []
|
|
250
|
+
if isinstance(data, list):
|
|
251
|
+
return data
|
|
252
|
+
return [data] if data else []
|
|
253
|
+
|
|
229
254
|
def get_warehouses(self) -> List[Dict[str, Any]]:
|
|
230
255
|
body = self.client.request("GET", "/rc/warehouse/get", {})
|
|
231
256
|
result = body.get("result", {}) or {}
|