@deliverart/sdk-js-integration-diagnostics 2.45.0 → 2.45.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/dist/index.cjs CHANGED
@@ -644,7 +644,7 @@ var reasons2 = {
644
644
  elephant_app_deletion_not_confirmed: { it: "La rimozione dell\u2019app non \xE8 ancora confermata.", en: "App removal has not been confirmed." },
645
645
  elephant_operational_failure: { it: "Elephant segnala un problema operativo. La causa esatta non \xE8 ancora verificata.", en: "Elephant reports an operational problem. The exact cause has not been verified." }
646
646
  };
647
- function describeElephantOperation(code, locale) {
647
+ function describeElephantOperation(code, locale, resources = []) {
648
648
  if (code === "elephant_legacy_delivery_unattributed") return locale === "it" ? {
649
649
  title: "Invio storico alla cassa da verificare",
650
650
  explanation: "Per questo ordine esiste una vecchia registrazione Elephant di preparazione o messa in coda. Non permette di ricostruire con certezza tutte le casse destinatarie e il relativo esito. Messo in coda non significa consegnato.",
@@ -655,6 +655,28 @@ function describeElephantOperation(code, locale) {
655
655
  nextStep: "Open the order and check its cash-register exports. Verify receipt on the cash register or request assistance before resending to avoid duplicates. Retry is unavailable from this historical finding."
656
656
  };
657
657
  if (!code || !Object.hasOwn(reasons2, code)) return null;
658
+ const unreachable = resources.some((resource) => resource.kind === "configuration" && resource.role === "context" && resource.identifier === "elephant_connection_unreachable");
659
+ if (unreachable) {
660
+ const restaurant = resources.some((resource) => resource.kind === "restaurant" && resource.role === "affected");
661
+ const platforms = {
662
+ migros_yemek: "Migros Yemek",
663
+ getir: "Getir",
664
+ yemeksepeti: "Yemeksepeti",
665
+ trendyol_go_meal: "Trendyol Go Meal",
666
+ fuudy: "Fuudy"
667
+ };
668
+ const platform = resources.find((resource) => resource.kind === "configuration" && resource.role === "context" && resource.identifier.startsWith("elephant_platform_"))?.identifier.slice("elephant_platform_".length);
669
+ const target = restaurant ? platform && Object.hasOwn(platforms, platform) ? platforms[platform] : locale === "it" ? "la piattaforma del ristorante" : "the restaurant platform" : "Deliverart";
670
+ return locale === "it" ? {
671
+ title: `Elephant non raggiunge ${target}`,
672
+ explanation: `Il test di connessione eseguito da Elephant verso ${target} non \xE8 riuscito. Questo esito non identifica da solo la causa: non conferma credenziali errate n\xE9 un problema della cassa o della sincronizzazione del menu.`,
673
+ nextStep: `Richiedi una verifica del collegamento Elephant \u2192 ${target}, indicando il ristorante e l\u2019orario dell\u2019ultimo test. Dopo la correzione esegui Test connessione: la segnalazione viene archiviata solo quando il controllo riesce.`
674
+ } : {
675
+ title: `Elephant cannot reach ${target}`,
676
+ explanation: `The connection test from Elephant to ${target} failed. This result alone does not identify the cause: it does not prove invalid credentials or a cash-register or menu-sync problem.`,
677
+ nextStep: `Request investigation of the Elephant \u2192 ${target} connection, identifying the restaurant and latest test time. Run Test connection after correction: the finding is archived only after a successful check.`
678
+ };
679
+ }
658
680
  return {
659
681
  title: locale === "it" ? "Operazione Elephant da verificare" : "Elephant operation needs attention",
660
682
  explanation: `${reasons2[code][locale]} ${locale === "it" ? "La risorsa indica dove controllare. La fase mostrata \xE8 l\u2019ultimo passaggio di configurazione salvato e pu\xF2 non coincidere con l\u2019attivit\xE0 fallita. Lo stato distingue un tentativo programmato da un intervento necessario." : "The resource indicates where to investigate. The phase shown is the last saved configuration checkpoint and may not be the activity that failed. Status distinguishes a scheduled retry from required action."}`,
@@ -675,6 +697,12 @@ var phases2 = {
675
697
  deprovisioning: ["Rimozione collegamento", "Disconnection"]
676
698
  };
677
699
  function describeElephantPhase(identifier, locale) {
700
+ if (identifier === "elephant_connection_unreachable") return locale === "it" ? "Esito del test: destinazione non raggiungibile" : "Connection test: destination unreachable";
701
+ const platforms = { migros_yemek: "Migros Yemek", getir: "Getir", yemeksepeti: "Yemeksepeti", trendyol_go_meal: "Trendyol Go Meal", fuudy: "Fuudy" };
702
+ if (identifier.startsWith("elephant_platform_")) {
703
+ const platform = identifier.slice("elephant_platform_".length);
704
+ return Object.hasOwn(platforms, platform) ? platforms[platform] : locale === "it" ? "Piattaforma ristorante" : "Restaurant platform";
705
+ }
678
706
  if (!identifier.startsWith("elephant_step_")) return null;
679
707
  const key = identifier.slice("elephant_step_".length);
680
708
  if (!Object.hasOwn(phases2, key)) return locale === "it" ? "Fase Elephant non riconosciuta" : "Unrecognized Elephant phase";
@@ -1704,7 +1732,7 @@ function describeDiagnostic(finding, locale) {
1704
1732
  if (tilby) return tilby;
1705
1733
  const integration = describeIntegrationIssue(finding?.code, locale);
1706
1734
  if (integration) return integration;
1707
- const operational = describeElephantOperation(finding?.code, locale);
1735
+ const operational = describeElephantOperation(finding?.code, locale, finding?.resources);
1708
1736
  if (operational) return operational;
1709
1737
  const imported = describeElephantImport(finding?.code, locale);
1710
1738
  if (imported) return imported;
package/dist/index.js CHANGED
@@ -538,7 +538,7 @@ var reasons2 = {
538
538
  elephant_app_deletion_not_confirmed: { it: "La rimozione dell\u2019app non \xE8 ancora confermata.", en: "App removal has not been confirmed." },
539
539
  elephant_operational_failure: { it: "Elephant segnala un problema operativo. La causa esatta non \xE8 ancora verificata.", en: "Elephant reports an operational problem. The exact cause has not been verified." }
540
540
  };
541
- function describeElephantOperation(code, locale) {
541
+ function describeElephantOperation(code, locale, resources = []) {
542
542
  if (code === "elephant_legacy_delivery_unattributed") return locale === "it" ? {
543
543
  title: "Invio storico alla cassa da verificare",
544
544
  explanation: "Per questo ordine esiste una vecchia registrazione Elephant di preparazione o messa in coda. Non permette di ricostruire con certezza tutte le casse destinatarie e il relativo esito. Messo in coda non significa consegnato.",
@@ -549,6 +549,28 @@ function describeElephantOperation(code, locale) {
549
549
  nextStep: "Open the order and check its cash-register exports. Verify receipt on the cash register or request assistance before resending to avoid duplicates. Retry is unavailable from this historical finding."
550
550
  };
551
551
  if (!code || !Object.hasOwn(reasons2, code)) return null;
552
+ const unreachable = resources.some((resource) => resource.kind === "configuration" && resource.role === "context" && resource.identifier === "elephant_connection_unreachable");
553
+ if (unreachable) {
554
+ const restaurant = resources.some((resource) => resource.kind === "restaurant" && resource.role === "affected");
555
+ const platforms = {
556
+ migros_yemek: "Migros Yemek",
557
+ getir: "Getir",
558
+ yemeksepeti: "Yemeksepeti",
559
+ trendyol_go_meal: "Trendyol Go Meal",
560
+ fuudy: "Fuudy"
561
+ };
562
+ const platform = resources.find((resource) => resource.kind === "configuration" && resource.role === "context" && resource.identifier.startsWith("elephant_platform_"))?.identifier.slice("elephant_platform_".length);
563
+ const target = restaurant ? platform && Object.hasOwn(platforms, platform) ? platforms[platform] : locale === "it" ? "la piattaforma del ristorante" : "the restaurant platform" : "Deliverart";
564
+ return locale === "it" ? {
565
+ title: `Elephant non raggiunge ${target}`,
566
+ explanation: `Il test di connessione eseguito da Elephant verso ${target} non \xE8 riuscito. Questo esito non identifica da solo la causa: non conferma credenziali errate n\xE9 un problema della cassa o della sincronizzazione del menu.`,
567
+ nextStep: `Richiedi una verifica del collegamento Elephant \u2192 ${target}, indicando il ristorante e l\u2019orario dell\u2019ultimo test. Dopo la correzione esegui Test connessione: la segnalazione viene archiviata solo quando il controllo riesce.`
568
+ } : {
569
+ title: `Elephant cannot reach ${target}`,
570
+ explanation: `The connection test from Elephant to ${target} failed. This result alone does not identify the cause: it does not prove invalid credentials or a cash-register or menu-sync problem.`,
571
+ nextStep: `Request investigation of the Elephant \u2192 ${target} connection, identifying the restaurant and latest test time. Run Test connection after correction: the finding is archived only after a successful check.`
572
+ };
573
+ }
552
574
  return {
553
575
  title: locale === "it" ? "Operazione Elephant da verificare" : "Elephant operation needs attention",
554
576
  explanation: `${reasons2[code][locale]} ${locale === "it" ? "La risorsa indica dove controllare. La fase mostrata \xE8 l\u2019ultimo passaggio di configurazione salvato e pu\xF2 non coincidere con l\u2019attivit\xE0 fallita. Lo stato distingue un tentativo programmato da un intervento necessario." : "The resource indicates where to investigate. The phase shown is the last saved configuration checkpoint and may not be the activity that failed. Status distinguishes a scheduled retry from required action."}`,
@@ -569,6 +591,12 @@ var phases2 = {
569
591
  deprovisioning: ["Rimozione collegamento", "Disconnection"]
570
592
  };
571
593
  function describeElephantPhase(identifier, locale) {
594
+ if (identifier === "elephant_connection_unreachable") return locale === "it" ? "Esito del test: destinazione non raggiungibile" : "Connection test: destination unreachable";
595
+ const platforms = { migros_yemek: "Migros Yemek", getir: "Getir", yemeksepeti: "Yemeksepeti", trendyol_go_meal: "Trendyol Go Meal", fuudy: "Fuudy" };
596
+ if (identifier.startsWith("elephant_platform_")) {
597
+ const platform = identifier.slice("elephant_platform_".length);
598
+ return Object.hasOwn(platforms, platform) ? platforms[platform] : locale === "it" ? "Piattaforma ristorante" : "Restaurant platform";
599
+ }
572
600
  if (!identifier.startsWith("elephant_step_")) return null;
573
601
  const key = identifier.slice("elephant_step_".length);
574
602
  if (!Object.hasOwn(phases2, key)) return locale === "it" ? "Fase Elephant non riconosciuta" : "Unrecognized Elephant phase";
@@ -1598,7 +1626,7 @@ function describeDiagnostic(finding, locale) {
1598
1626
  if (tilby) return tilby;
1599
1627
  const integration = describeIntegrationIssue(finding?.code, locale);
1600
1628
  if (integration) return integration;
1601
- const operational = describeElephantOperation(finding?.code, locale);
1629
+ const operational = describeElephantOperation(finding?.code, locale, finding?.resources);
1602
1630
  if (operational) return operational;
1603
1631
  const imported = describeElephantImport(finding?.code, locale);
1604
1632
  if (imported) return imported;
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.45.0",
4
+ "version": "2.45.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.3.5",
22
- "@deliverart/sdk-js-core": "2.45.0",
23
- "@deliverart/sdk-js-global-types": "2.45.0"
22
+ "@deliverart/sdk-js-global-types": "2.45.1",
23
+ "@deliverart/sdk-js-core": "2.45.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@vitest/coverage-v8": "4.1.11",