copilot-hub 0.1.8 → 0.1.9
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/package.json +1 -1
- package/scripts/dist/service.mjs +28 -13
- package/scripts/src/service.mts +29 -13
package/package.json
CHANGED
package/scripts/dist/service.mjs
CHANGED
|
@@ -471,25 +471,40 @@ function isNotFoundMessage(value) {
|
|
|
471
471
|
message.includes("n'existe pas"));
|
|
472
472
|
}
|
|
473
473
|
function isAccessDeniedMessage(value) {
|
|
474
|
-
const
|
|
475
|
-
if (!
|
|
474
|
+
const simplified = simplifyMessageForMatch(value);
|
|
475
|
+
if (!simplified) {
|
|
476
476
|
return false;
|
|
477
477
|
}
|
|
478
|
-
|
|
478
|
+
if (simplified.includes("access is denied")) {
|
|
479
|
+
return true;
|
|
480
|
+
}
|
|
481
|
+
if (simplified.includes("acces refuse")) {
|
|
482
|
+
return true;
|
|
483
|
+
}
|
|
484
|
+
return simplified.includes("refus") && simplified.includes("acc");
|
|
479
485
|
}
|
|
480
486
|
function isRegistryValueNotFoundMessage(value) {
|
|
481
|
-
const
|
|
482
|
-
if (!
|
|
487
|
+
const simplified = simplifyMessageForMatch(value);
|
|
488
|
+
if (!simplified) {
|
|
483
489
|
return false;
|
|
484
490
|
}
|
|
485
|
-
return (
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
491
|
+
return (simplified.includes("unable to find the specified registry key or value") ||
|
|
492
|
+
simplified.includes("the system was unable to find the specified registry key or value") ||
|
|
493
|
+
simplified.includes("impossible de trouver") ||
|
|
494
|
+
simplified.includes("n'a pas trouve") ||
|
|
495
|
+
simplified.includes("n a pas trouve") ||
|
|
496
|
+
simplified.includes("la cle ou la valeur de registre specifiee") ||
|
|
497
|
+
simplified.includes("introuvable"));
|
|
498
|
+
}
|
|
499
|
+
function simplifyMessageForMatch(value) {
|
|
500
|
+
return String(value ?? "")
|
|
501
|
+
.toLowerCase()
|
|
502
|
+
.normalize("NFKD")
|
|
503
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
504
|
+
.replace(/\uFFFD/g, "")
|
|
505
|
+
.replace(/[?]/g, "'")
|
|
506
|
+
.replace(/\s+/g, " ")
|
|
507
|
+
.trim();
|
|
493
508
|
}
|
|
494
509
|
function getErrorMessage(error) {
|
|
495
510
|
if (error instanceof Error && error.message) {
|
package/scripts/src/service.mts
CHANGED
|
@@ -577,30 +577,46 @@ function isNotFoundMessage(value) {
|
|
|
577
577
|
}
|
|
578
578
|
|
|
579
579
|
function isAccessDeniedMessage(value) {
|
|
580
|
-
const
|
|
581
|
-
if (!
|
|
580
|
+
const simplified = simplifyMessageForMatch(value);
|
|
581
|
+
if (!simplified) {
|
|
582
582
|
return false;
|
|
583
583
|
}
|
|
584
|
-
|
|
584
|
+
if (simplified.includes("access is denied")) {
|
|
585
|
+
return true;
|
|
586
|
+
}
|
|
587
|
+
if (simplified.includes("acces refuse")) {
|
|
588
|
+
return true;
|
|
589
|
+
}
|
|
590
|
+
return simplified.includes("refus") && simplified.includes("acc");
|
|
585
591
|
}
|
|
586
592
|
|
|
587
593
|
function isRegistryValueNotFoundMessage(value) {
|
|
588
|
-
const
|
|
589
|
-
if (!
|
|
594
|
+
const simplified = simplifyMessageForMatch(value);
|
|
595
|
+
if (!simplified) {
|
|
590
596
|
return false;
|
|
591
597
|
}
|
|
592
598
|
return (
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
message.includes("introuvable")
|
|
599
|
+
simplified.includes("unable to find the specified registry key or value") ||
|
|
600
|
+
simplified.includes("the system was unable to find the specified registry key or value") ||
|
|
601
|
+
simplified.includes("impossible de trouver") ||
|
|
602
|
+
simplified.includes("n'a pas trouve") ||
|
|
603
|
+
simplified.includes("n a pas trouve") ||
|
|
604
|
+
simplified.includes("la cle ou la valeur de registre specifiee") ||
|
|
605
|
+
simplified.includes("introuvable")
|
|
601
606
|
);
|
|
602
607
|
}
|
|
603
608
|
|
|
609
|
+
function simplifyMessageForMatch(value) {
|
|
610
|
+
return String(value ?? "")
|
|
611
|
+
.toLowerCase()
|
|
612
|
+
.normalize("NFKD")
|
|
613
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
614
|
+
.replace(/\uFFFD/g, "")
|
|
615
|
+
.replace(/[?]/g, "'")
|
|
616
|
+
.replace(/\s+/g, " ")
|
|
617
|
+
.trim();
|
|
618
|
+
}
|
|
619
|
+
|
|
604
620
|
function getErrorMessage(error) {
|
|
605
621
|
if (error instanceof Error && error.message) {
|
|
606
622
|
return error.message;
|