@deliverart/sdk-js-integration-diagnostics 2.48.2-dev.20261103124000 → 3.0.0-dev.1

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/README.md CHANGED
@@ -297,6 +297,30 @@ copy explains exhausted setup attempts without asserting a technical root cause
297
297
  or live device connectivity. Public evidence must never contain credential
298
298
  values. Unknown codes continue to use the common safe fallback.
299
299
 
300
+ Tilby department selection uses the tax rate saved in the order. A valid explicit
301
+ product department takes precedence; percentage fallback requires exactly one
302
+ resolved department belonging to the integration. `tilby_department_mapping_ambiguous`
303
+ explains the operator action when multiple departments match. Verification only
304
+ checks local evidence; it never retries an export or proves delivery.
305
+
306
+
307
+ Tilby order diagnostics include `tilby_product_mapping_ambiguous` for retained
308
+ product mappings whose IDs cannot safely authorize a sale write. Display the
309
+ shared narrative and the local `mapping_ambiguous` verification reason. A corrected
310
+ local cause does not prove sale delivery or authorize an automatic retry; preserve
311
+ explicit operation selection and recovery authorization in every consumer.
312
+
313
+
314
+ `tilby_ingredient_mapping_unresolved` identifies a raw ingredient/component
315
+ association independently of a variation/value association. Use the shared
316
+ narrative to name the saved ingredient, explain that it cannot be replaced by a
317
+ same-name variation, and keep any recovery explicitly selected and authorized.
318
+
300
319
  ## Remote investigations
301
320
 
302
321
  Problem details optionally expose `remoteVerification`: queued/running/completed/superseded state, request/check timestamps, freshness, and bounded typed checks. `VerifyDiagnosticProblem` queues supported read-only investigations; existing clients and unsupported errors retain local verification. Remote checks describe current observations, never historical causation, successful order delivery, or automatic recovery. Use `describeRemoteDiagnosticCheck` for Italian/English explanations. Unknown check codes must remain explicitly unsupported.
322
+
323
+
324
+ ## Runtime and compiler libraries
325
+
326
+ The existing diagnostics runtime uses `Object.hasOwn`; the consuming runtime must provide it or a compatible polyfill. The ES2021 TypeScript target controls emitted syntax and does not supply built-ins. Type checking preserves the original ES2021 default libraries and adds only `ES2022.Object` declarations; this compiler alignment adds no runtime polyfill.
package/dist/index.cjs CHANGED
@@ -894,7 +894,7 @@ function describeLocalVerification(verification, locale) {
894
894
  return locale === "it" ? "La configurazione locale richiesta manca ancora. Completa l\u2019impostazione indicata e aggiorna la verifica; nessuna operazione \xE8 stata ritentata." : "The required local configuration is still missing. Complete the indicated setting and refresh verification; no operation has been retried.";
895
895
  }
896
896
  if (verification.outcome === "cause_present" && verification.reason === "mapping_ambiguous") {
897
- return locale === "it" ? "I collegamenti duplicati sono ancora presenti. Correggi l\u2019ambiguit\xE0 nel gruppo e nel prodotto indicati, poi aggiorna la verifica. Nessuna operazione \xE8 stata ritentata." : "The duplicate mappings are still present. Resolve the ambiguity for the indicated group and product, then refresh verification. No operation has been retried.";
897
+ return locale === "it" ? "I collegamenti ambigui sono ancora presenti. Correggi l\u2019ambiguit\xE0 nel gruppo e nel prodotto indicati, poi aggiorna la verifica. Nessuna operazione \xE8 stata ritentata." : "The ambiguous mappings are still present. Resolve the ambiguity for the indicated group and product, then refresh verification. No operation has been retried.";
898
898
  }
899
899
  if (verification.outcome !== "unknown" || !Object.hasOwn(unknownReasons, verification.reason))
900
900
  return null;
@@ -1413,6 +1413,17 @@ function describeMenuPublication(code, locale) {
1413
1413
 
1414
1414
  // src/recorded-order-narrative.ts
1415
1415
  function describeRecordedOrderRows(finding, locale) {
1416
+ if (finding?.code === "order_export_recorded_pricing_unsupported") {
1417
+ return locale === "it" ? {
1418
+ title: "Invio non disponibile per i prezzi originali",
1419
+ explanation: "L\u2019ordine conserva gli importi del vecchio sistema. L\u2019invio richiede una gestione fiscale compatibile: riprovare ora non corregge il problema.",
1420
+ nextStep: "Contatta l\u2019assistenza. Se un invio precedente \xE8 incerto, puoi ancora verificarne l\u2019esito senza inviare un nuovo ordine."
1421
+ } : {
1422
+ title: "Sending is unavailable for recorded prices",
1423
+ explanation: "This order retains amounts from the old system. Sending requires compatible fiscal handling: retrying now cannot resolve the problem.",
1424
+ nextStep: "Contact support. If an earlier submission is uncertain, you can still verify its outcome without sending another order."
1425
+ };
1426
+ }
1416
1427
  if (!finding || finding.confirmed || finding.resources.some((resource) => resource.role === "cause")) return null;
1417
1428
  const orders = finding.resources.filter((resource) => resource.kind === "order" && resource.role === "affected");
1418
1429
  if (orders.length !== 1 || !finding.resources.some(
@@ -1553,6 +1564,14 @@ var causes2 = {
1553
1564
  it: ["Reparto fiscale Tilby non risolto", "Non \xE8 stato trovato un reparto Tilby utilizzabile per l\u2019aliquota della riga indicata.", "Controlla i collegamenti dei reparti fiscali Tilby e l\u2019aliquota dell\u2019elemento."],
1554
1565
  en: ["Tilby fiscal department unresolved", "No usable Tilby department was found for the indicated row\u2019s tax rate.", "Check Tilby fiscal department mappings and the item\u2019s tax rate."]
1555
1566
  },
1567
+ tilby_department_mapping_ambiguous: {
1568
+ it: ["Scegli il reparto fiscale Tilby", "Pi\xF9 reparti Tilby hanno l\u2019aliquota salvata nell\u2019ordine e manca un collegamento valido del prodotto a un reparto preciso.", "Chiedi al gestore dell\u2019integrazione di collegare il prodotto al reparto corretto. Se la riga non ha un prodotto collegato, deve risolvere la scelta del reparto per quell\u2019aliquota, senza cambiare l\u2019IVA dell\u2019ordine."],
1569
+ en: ["Choose the Tilby fiscal department", "Several Tilby departments match the tax rate saved in the order, and the product has no valid mapping to a specific department.", "Ask the integration manager to map the product to the correct department. For a row without a mapped product, they must resolve the department choice for that rate without changing the order\u2019s tax."]
1570
+ },
1571
+ tilby_product_mapping_ambiguous: {
1572
+ it: ["Collegamento del prodotto Tilby da correggere", "Il collegamento Tilby di questo prodotto \xE8 stato segnalato come ambiguo. Gli ID salvati non bastano per usarlo nell\u2019invio dell\u2019ordine.", "Chiedi al gestore dell\u2019integrazione di verificare e correggere il collegamento del prodotto, dei gruppi e delle scelte su Tilby. Non cancellare i collegamenti o crearne altri con lo stesso nome per aggirare il problema."],
1573
+ en: ["Tilby product mapping needs correction", "This product\u2019s Tilby mapping has been flagged as ambiguous. Stored IDs alone are not enough to use it for order submission.", "Ask the integration manager to verify and correct the product, group and choice mappings in Tilby. Do not delete mappings or create same-name alternatives to bypass the problem."]
1574
+ },
1556
1575
  tilby_product_mapping_missing_for_variant: {
1557
1576
  it: ["Prodotto Tilby non collegato per la variante", "La variante selezionata richiede un collegamento del prodotto a Tilby che non \xE8 disponibile. Questo non significa che ogni prodotto senza collegamento sia bloccato.", "Controlla il riferimento del prodotto e il suo collegamento Tilby prima di verificare la combinazione della variante."],
1558
1577
  en: ["Tilby product mapping unavailable for variant", "The selected variant requires a Tilby product mapping that is unavailable. This does not mean every unmapped product is blocked.", "Check the product reference and its Tilby mapping before checking the variant combination."]
@@ -1565,6 +1584,10 @@ var causes2 = {
1565
1584
  it: ["Modificatore Tilby non risolto", "Non \xE8 stato possibile risolvere la variazione Tilby per il modificatore e il prodotto indicati. Le scelte mostrano il contesto; non sono tutte necessariamente mancanti.", "Controlla il collegamento del modificatore e le variazioni del prodotto Tilby."],
1566
1585
  en: ["Tilby modifier unresolved", "The Tilby variation could not be resolved for the indicated modifier and product. Choices provide context; they are not necessarily all missing.", "Check the modifier mapping and the Tilby product variations."]
1567
1586
  },
1587
+ tilby_ingredient_mapping_unresolved: {
1588
+ it: ["Ingrediente Tilby da collegare", "L\u2019aggiunta indicata usa un ingrediente del catalogo Tilby. Il suo collegamento \xE8 mancante o non utilizzabile; non \xE8 una scelta di variante.", "Chiedi al gestore dell\u2019integrazione di controllare il collegamento dell\u2019ingrediente e del gruppo di aggiunte. Non scegliere una variante con lo stesso nome per aggirare il problema."],
1589
+ en: ["Tilby ingredient needs a mapping", "The indicated extra uses a Tilby catalog ingredient. Its mapping is missing or unusable; it is not a variation choice.", "Ask the integration manager to check the ingredient and extra-group mappings. Do not select a same-name variation to bypass the problem."]
1590
+ },
1568
1591
  tilby_choice_mapping_missing: {
1569
1592
  it: ["Scelta del modificatore Tilby non risolta", "La variazione Tilby \xE8 stata identificata, ma il valore della scelta indicata non \xE8 disponibile.", "Controlla quella scelta, l\u2019eventuale prezzo specifico e il valore associato alla variazione Tilby."],
1570
1593
  en: ["Tilby modifier choice unresolved", "The Tilby variation was identified, but the indicated choice value is unavailable.", "Check that choice, any price override, and the value mapped to the Tilby variation."]
package/dist/index.js CHANGED
@@ -785,7 +785,7 @@ function describeLocalVerification(verification, locale) {
785
785
  return locale === "it" ? "La configurazione locale richiesta manca ancora. Completa l\u2019impostazione indicata e aggiorna la verifica; nessuna operazione \xE8 stata ritentata." : "The required local configuration is still missing. Complete the indicated setting and refresh verification; no operation has been retried.";
786
786
  }
787
787
  if (verification.outcome === "cause_present" && verification.reason === "mapping_ambiguous") {
788
- return locale === "it" ? "I collegamenti duplicati sono ancora presenti. Correggi l\u2019ambiguit\xE0 nel gruppo e nel prodotto indicati, poi aggiorna la verifica. Nessuna operazione \xE8 stata ritentata." : "The duplicate mappings are still present. Resolve the ambiguity for the indicated group and product, then refresh verification. No operation has been retried.";
788
+ return locale === "it" ? "I collegamenti ambigui sono ancora presenti. Correggi l\u2019ambiguit\xE0 nel gruppo e nel prodotto indicati, poi aggiorna la verifica. Nessuna operazione \xE8 stata ritentata." : "The ambiguous mappings are still present. Resolve the ambiguity for the indicated group and product, then refresh verification. No operation has been retried.";
789
789
  }
790
790
  if (verification.outcome !== "unknown" || !Object.hasOwn(unknownReasons, verification.reason))
791
791
  return null;
@@ -1304,6 +1304,17 @@ function describeMenuPublication(code, locale) {
1304
1304
 
1305
1305
  // src/recorded-order-narrative.ts
1306
1306
  function describeRecordedOrderRows(finding, locale) {
1307
+ if (finding?.code === "order_export_recorded_pricing_unsupported") {
1308
+ return locale === "it" ? {
1309
+ title: "Invio non disponibile per i prezzi originali",
1310
+ explanation: "L\u2019ordine conserva gli importi del vecchio sistema. L\u2019invio richiede una gestione fiscale compatibile: riprovare ora non corregge il problema.",
1311
+ nextStep: "Contatta l\u2019assistenza. Se un invio precedente \xE8 incerto, puoi ancora verificarne l\u2019esito senza inviare un nuovo ordine."
1312
+ } : {
1313
+ title: "Sending is unavailable for recorded prices",
1314
+ explanation: "This order retains amounts from the old system. Sending requires compatible fiscal handling: retrying now cannot resolve the problem.",
1315
+ nextStep: "Contact support. If an earlier submission is uncertain, you can still verify its outcome without sending another order."
1316
+ };
1317
+ }
1307
1318
  if (!finding || finding.confirmed || finding.resources.some((resource) => resource.role === "cause")) return null;
1308
1319
  const orders = finding.resources.filter((resource) => resource.kind === "order" && resource.role === "affected");
1309
1320
  if (orders.length !== 1 || !finding.resources.some(
@@ -1444,6 +1455,14 @@ var causes2 = {
1444
1455
  it: ["Reparto fiscale Tilby non risolto", "Non \xE8 stato trovato un reparto Tilby utilizzabile per l\u2019aliquota della riga indicata.", "Controlla i collegamenti dei reparti fiscali Tilby e l\u2019aliquota dell\u2019elemento."],
1445
1456
  en: ["Tilby fiscal department unresolved", "No usable Tilby department was found for the indicated row\u2019s tax rate.", "Check Tilby fiscal department mappings and the item\u2019s tax rate."]
1446
1457
  },
1458
+ tilby_department_mapping_ambiguous: {
1459
+ it: ["Scegli il reparto fiscale Tilby", "Pi\xF9 reparti Tilby hanno l\u2019aliquota salvata nell\u2019ordine e manca un collegamento valido del prodotto a un reparto preciso.", "Chiedi al gestore dell\u2019integrazione di collegare il prodotto al reparto corretto. Se la riga non ha un prodotto collegato, deve risolvere la scelta del reparto per quell\u2019aliquota, senza cambiare l\u2019IVA dell\u2019ordine."],
1460
+ en: ["Choose the Tilby fiscal department", "Several Tilby departments match the tax rate saved in the order, and the product has no valid mapping to a specific department.", "Ask the integration manager to map the product to the correct department. For a row without a mapped product, they must resolve the department choice for that rate without changing the order\u2019s tax."]
1461
+ },
1462
+ tilby_product_mapping_ambiguous: {
1463
+ it: ["Collegamento del prodotto Tilby da correggere", "Il collegamento Tilby di questo prodotto \xE8 stato segnalato come ambiguo. Gli ID salvati non bastano per usarlo nell\u2019invio dell\u2019ordine.", "Chiedi al gestore dell\u2019integrazione di verificare e correggere il collegamento del prodotto, dei gruppi e delle scelte su Tilby. Non cancellare i collegamenti o crearne altri con lo stesso nome per aggirare il problema."],
1464
+ en: ["Tilby product mapping needs correction", "This product\u2019s Tilby mapping has been flagged as ambiguous. Stored IDs alone are not enough to use it for order submission.", "Ask the integration manager to verify and correct the product, group and choice mappings in Tilby. Do not delete mappings or create same-name alternatives to bypass the problem."]
1465
+ },
1447
1466
  tilby_product_mapping_missing_for_variant: {
1448
1467
  it: ["Prodotto Tilby non collegato per la variante", "La variante selezionata richiede un collegamento del prodotto a Tilby che non \xE8 disponibile. Questo non significa che ogni prodotto senza collegamento sia bloccato.", "Controlla il riferimento del prodotto e il suo collegamento Tilby prima di verificare la combinazione della variante."],
1449
1468
  en: ["Tilby product mapping unavailable for variant", "The selected variant requires a Tilby product mapping that is unavailable. This does not mean every unmapped product is blocked.", "Check the product reference and its Tilby mapping before checking the variant combination."]
@@ -1456,6 +1475,10 @@ var causes2 = {
1456
1475
  it: ["Modificatore Tilby non risolto", "Non \xE8 stato possibile risolvere la variazione Tilby per il modificatore e il prodotto indicati. Le scelte mostrano il contesto; non sono tutte necessariamente mancanti.", "Controlla il collegamento del modificatore e le variazioni del prodotto Tilby."],
1457
1476
  en: ["Tilby modifier unresolved", "The Tilby variation could not be resolved for the indicated modifier and product. Choices provide context; they are not necessarily all missing.", "Check the modifier mapping and the Tilby product variations."]
1458
1477
  },
1478
+ tilby_ingredient_mapping_unresolved: {
1479
+ it: ["Ingrediente Tilby da collegare", "L\u2019aggiunta indicata usa un ingrediente del catalogo Tilby. Il suo collegamento \xE8 mancante o non utilizzabile; non \xE8 una scelta di variante.", "Chiedi al gestore dell\u2019integrazione di controllare il collegamento dell\u2019ingrediente e del gruppo di aggiunte. Non scegliere una variante con lo stesso nome per aggirare il problema."],
1480
+ en: ["Tilby ingredient needs a mapping", "The indicated extra uses a Tilby catalog ingredient. Its mapping is missing or unusable; it is not a variation choice.", "Ask the integration manager to check the ingredient and extra-group mappings. Do not select a same-name variation to bypass the problem."]
1481
+ },
1459
1482
  tilby_choice_mapping_missing: {
1460
1483
  it: ["Scelta del modificatore Tilby non risolta", "La variazione Tilby \xE8 stata identificata, ma il valore della scelta indicata non \xE8 disponibile.", "Controlla quella scelta, l\u2019eventuale prezzo specifico e il valore associato alla variazione Tilby."],
1461
1484
  en: ["Tilby modifier choice unresolved", "The Tilby variation was identified, but the indicated choice value is unavailable.", "Check that choice, any price override, and the value mapped to the Tilby variation."]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-integration-diagnostics",
3
3
  "description": "Shared integration diagnostics, verification and explicit recovery contracts",
4
- "version": "2.48.2-dev.20261103124000",
4
+ "version": "3.0.0-dev.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -19,8 +19,8 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "zod": "4.6.6",
22
- "@deliverart/sdk-js-core": "2.48.1",
23
- "@deliverart/sdk-js-global-types": "2.48.1"
22
+ "@deliverart/sdk-js-core": "3.0.0-dev.1",
23
+ "@deliverart/sdk-js-global-types": "3.0.0-dev.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@vitest/coverage-v8": "4.1.12",