@deliverart/sdk-js-integration-diagnostics 2.45.0 → 2.45.2
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 +32 -3
- package/dist/index.js +32 -3
- package/package.json +3 -3
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,8 +655,31 @@ 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 restaurant = resources.some((resource) => resource.kind === "restaurant" && resource.role === "affected");
|
|
659
|
+
const platforms = {
|
|
660
|
+
migros_yemek: "Migros Yemek",
|
|
661
|
+
getir: "Getir",
|
|
662
|
+
yemeksepeti: "Yemeksepeti",
|
|
663
|
+
trendyol_go_meal: "Trendyol Go Meal",
|
|
664
|
+
fuudy: "Fuudy"
|
|
665
|
+
};
|
|
666
|
+
const platform = resources.find((resource) => resource.kind === "configuration" && resource.role === "context" && resource.identifier.startsWith("elephant_platform_"))?.identifier.slice("elephant_platform_".length);
|
|
667
|
+
const platformName = restaurant && platform && Object.hasOwn(platforms, platform) ? platforms[platform] : null;
|
|
668
|
+
const unreachable = resources.some((resource) => resource.kind === "configuration" && resource.role === "context" && resource.identifier === "elephant_connection_unreachable");
|
|
669
|
+
if (unreachable) {
|
|
670
|
+
const target = restaurant ? platformName ?? (locale === "it" ? "la piattaforma del ristorante" : "the restaurant platform") : "Deliverart";
|
|
671
|
+
return locale === "it" ? {
|
|
672
|
+
title: `Elephant non raggiunge ${target}`,
|
|
673
|
+
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.`,
|
|
674
|
+
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.`
|
|
675
|
+
} : {
|
|
676
|
+
title: `Elephant cannot reach ${target}`,
|
|
677
|
+
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.`,
|
|
678
|
+
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.`
|
|
679
|
+
};
|
|
680
|
+
}
|
|
658
681
|
return {
|
|
659
|
-
title: locale === "it" ? "Operazione Elephant da verificare" : "Elephant operation needs attention",
|
|
682
|
+
title: platformName ? locale === "it" ? `Operazione Elephant su ${platformName} da verificare` : `Elephant operation for ${platformName} needs attention` : locale === "it" ? "Operazione Elephant da verificare" : "Elephant operation needs attention",
|
|
660
683
|
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."}`,
|
|
661
684
|
nextStep: code === "elephant_sales_mode_missing" ? locale === "it" ? "Apri le impostazioni del ristorante Elephant e verifica la modalit\xE0 di vendita e la categoria Deliverart associate allo stesso POS. Dopo la correzione aggiorna la verifica; questo non conferma da solo il collegamento remoto." : "Open the Elephant restaurant settings and check that its sales mode and Deliverart category belong to the same POS. Refresh verification after correcting them; this alone does not confirm the remote connection." : code === "elephant_parent_tenant_missing" ? locale === "it" ? "La configurazione del tenant gestito \xE8 gestita da Deliverart. Richiedi assistenza indicando questa integrazione; non creare o rimuovere tenant per aggirare il problema." : "Deliverart manages the parent tenant configuration. Contact support and identify this integration; do not create or remove tenants to bypass the issue." : code === "elephant_deliverart_base_url_invalid" ? locale === "it" ? "L\u2019indirizzo HTTPS usato da Elephant per richiamare Deliverart richiede una correzione tecnica. Richiedi assistenza indicando questa integrazione; non modificare le credenziali." : "The HTTPS address Elephant uses to call Deliverart needs a technical correction. Contact support and identify this integration; do not change credentials." : locale === "it" ? "Controlla lo stato dell\u2019integrazione e del ristorante indicato. Se la configurazione non \xE8 modificabile, richiedi assistenza. Non ricreare o rimuovere risorse per aggirare il problema." : "Check the integration and indicated restaurant status. Request assistance if the configuration cannot be edited. Do not recreate or remove resources to bypass the problem."
|
|
662
685
|
};
|
|
@@ -675,6 +698,12 @@ var phases2 = {
|
|
|
675
698
|
deprovisioning: ["Rimozione collegamento", "Disconnection"]
|
|
676
699
|
};
|
|
677
700
|
function describeElephantPhase(identifier, locale) {
|
|
701
|
+
if (identifier === "elephant_connection_unreachable") return locale === "it" ? "Esito del test: destinazione non raggiungibile" : "Connection test: destination unreachable";
|
|
702
|
+
const platforms = { migros_yemek: "Migros Yemek", getir: "Getir", yemeksepeti: "Yemeksepeti", trendyol_go_meal: "Trendyol Go Meal", fuudy: "Fuudy" };
|
|
703
|
+
if (identifier.startsWith("elephant_platform_")) {
|
|
704
|
+
const platform = identifier.slice("elephant_platform_".length);
|
|
705
|
+
return Object.hasOwn(platforms, platform) ? platforms[platform] : locale === "it" ? "Piattaforma ristorante" : "Restaurant platform";
|
|
706
|
+
}
|
|
678
707
|
if (!identifier.startsWith("elephant_step_")) return null;
|
|
679
708
|
const key = identifier.slice("elephant_step_".length);
|
|
680
709
|
if (!Object.hasOwn(phases2, key)) return locale === "it" ? "Fase Elephant non riconosciuta" : "Unrecognized Elephant phase";
|
|
@@ -1704,7 +1733,7 @@ function describeDiagnostic(finding, locale) {
|
|
|
1704
1733
|
if (tilby) return tilby;
|
|
1705
1734
|
const integration = describeIntegrationIssue(finding?.code, locale);
|
|
1706
1735
|
if (integration) return integration;
|
|
1707
|
-
const operational = describeElephantOperation(finding?.code, locale);
|
|
1736
|
+
const operational = describeElephantOperation(finding?.code, locale, finding?.resources);
|
|
1708
1737
|
if (operational) return operational;
|
|
1709
1738
|
const imported = describeElephantImport(finding?.code, locale);
|
|
1710
1739
|
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,8 +549,31 @@ 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 restaurant = resources.some((resource) => resource.kind === "restaurant" && resource.role === "affected");
|
|
553
|
+
const platforms = {
|
|
554
|
+
migros_yemek: "Migros Yemek",
|
|
555
|
+
getir: "Getir",
|
|
556
|
+
yemeksepeti: "Yemeksepeti",
|
|
557
|
+
trendyol_go_meal: "Trendyol Go Meal",
|
|
558
|
+
fuudy: "Fuudy"
|
|
559
|
+
};
|
|
560
|
+
const platform = resources.find((resource) => resource.kind === "configuration" && resource.role === "context" && resource.identifier.startsWith("elephant_platform_"))?.identifier.slice("elephant_platform_".length);
|
|
561
|
+
const platformName = restaurant && platform && Object.hasOwn(platforms, platform) ? platforms[platform] : null;
|
|
562
|
+
const unreachable = resources.some((resource) => resource.kind === "configuration" && resource.role === "context" && resource.identifier === "elephant_connection_unreachable");
|
|
563
|
+
if (unreachable) {
|
|
564
|
+
const target = restaurant ? platformName ?? (locale === "it" ? "la piattaforma del ristorante" : "the restaurant platform") : "Deliverart";
|
|
565
|
+
return locale === "it" ? {
|
|
566
|
+
title: `Elephant non raggiunge ${target}`,
|
|
567
|
+
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.`,
|
|
568
|
+
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.`
|
|
569
|
+
} : {
|
|
570
|
+
title: `Elephant cannot reach ${target}`,
|
|
571
|
+
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.`,
|
|
572
|
+
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.`
|
|
573
|
+
};
|
|
574
|
+
}
|
|
552
575
|
return {
|
|
553
|
-
title: locale === "it" ? "Operazione Elephant da verificare" : "Elephant operation needs attention",
|
|
576
|
+
title: platformName ? locale === "it" ? `Operazione Elephant su ${platformName} da verificare` : `Elephant operation for ${platformName} needs attention` : locale === "it" ? "Operazione Elephant da verificare" : "Elephant operation needs attention",
|
|
554
577
|
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."}`,
|
|
555
578
|
nextStep: code === "elephant_sales_mode_missing" ? locale === "it" ? "Apri le impostazioni del ristorante Elephant e verifica la modalit\xE0 di vendita e la categoria Deliverart associate allo stesso POS. Dopo la correzione aggiorna la verifica; questo non conferma da solo il collegamento remoto." : "Open the Elephant restaurant settings and check that its sales mode and Deliverart category belong to the same POS. Refresh verification after correcting them; this alone does not confirm the remote connection." : code === "elephant_parent_tenant_missing" ? locale === "it" ? "La configurazione del tenant gestito \xE8 gestita da Deliverart. Richiedi assistenza indicando questa integrazione; non creare o rimuovere tenant per aggirare il problema." : "Deliverart manages the parent tenant configuration. Contact support and identify this integration; do not create or remove tenants to bypass the issue." : code === "elephant_deliverart_base_url_invalid" ? locale === "it" ? "L\u2019indirizzo HTTPS usato da Elephant per richiamare Deliverart richiede una correzione tecnica. Richiedi assistenza indicando questa integrazione; non modificare le credenziali." : "The HTTPS address Elephant uses to call Deliverart needs a technical correction. Contact support and identify this integration; do not change credentials." : locale === "it" ? "Controlla lo stato dell\u2019integrazione e del ristorante indicato. Se la configurazione non \xE8 modificabile, richiedi assistenza. Non ricreare o rimuovere risorse per aggirare il problema." : "Check the integration and indicated restaurant status. Request assistance if the configuration cannot be edited. Do not recreate or remove resources to bypass the problem."
|
|
556
579
|
};
|
|
@@ -569,6 +592,12 @@ var phases2 = {
|
|
|
569
592
|
deprovisioning: ["Rimozione collegamento", "Disconnection"]
|
|
570
593
|
};
|
|
571
594
|
function describeElephantPhase(identifier, locale) {
|
|
595
|
+
if (identifier === "elephant_connection_unreachable") return locale === "it" ? "Esito del test: destinazione non raggiungibile" : "Connection test: destination unreachable";
|
|
596
|
+
const platforms = { migros_yemek: "Migros Yemek", getir: "Getir", yemeksepeti: "Yemeksepeti", trendyol_go_meal: "Trendyol Go Meal", fuudy: "Fuudy" };
|
|
597
|
+
if (identifier.startsWith("elephant_platform_")) {
|
|
598
|
+
const platform = identifier.slice("elephant_platform_".length);
|
|
599
|
+
return Object.hasOwn(platforms, platform) ? platforms[platform] : locale === "it" ? "Piattaforma ristorante" : "Restaurant platform";
|
|
600
|
+
}
|
|
572
601
|
if (!identifier.startsWith("elephant_step_")) return null;
|
|
573
602
|
const key = identifier.slice("elephant_step_".length);
|
|
574
603
|
if (!Object.hasOwn(phases2, key)) return locale === "it" ? "Fase Elephant non riconosciuta" : "Unrecognized Elephant phase";
|
|
@@ -1598,7 +1627,7 @@ function describeDiagnostic(finding, locale) {
|
|
|
1598
1627
|
if (tilby) return tilby;
|
|
1599
1628
|
const integration = describeIntegrationIssue(finding?.code, locale);
|
|
1600
1629
|
if (integration) return integration;
|
|
1601
|
-
const operational = describeElephantOperation(finding?.code, locale);
|
|
1630
|
+
const operational = describeElephantOperation(finding?.code, locale, finding?.resources);
|
|
1602
1631
|
if (operational) return operational;
|
|
1603
1632
|
const imported = describeElephantImport(finding?.code, locale);
|
|
1604
1633
|
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.
|
|
4
|
+
"version": "2.45.2",
|
|
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.
|
|
23
|
-
"@deliverart/sdk-js-global-types": "2.45.
|
|
22
|
+
"@deliverart/sdk-js-core": "2.45.2",
|
|
23
|
+
"@deliverart/sdk-js-global-types": "2.45.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@vitest/coverage-v8": "4.1.11",
|