n8n-nodes-wassenger 1.2.1 → 1.2.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.
|
@@ -501,6 +501,7 @@ class WassengerTrigger {
|
|
|
501
501
|
this.webhookMethods = {
|
|
502
502
|
default: {
|
|
503
503
|
async checkExists() {
|
|
504
|
+
var _a;
|
|
504
505
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
505
506
|
const nodeData = this.getWorkflowStaticData('node');
|
|
506
507
|
const webhookId = nodeData.webhookId;
|
|
@@ -517,21 +518,20 @@ class WassengerTrigger {
|
|
|
517
518
|
}
|
|
518
519
|
catch (error) {
|
|
519
520
|
// Delete all workflow specific webhooks
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
console.error(`Error deleting existing webhook existence:`, error.message);
|
|
529
|
-
}
|
|
521
|
+
try {
|
|
522
|
+
await (0, request_1.rawRequest)({
|
|
523
|
+
url: `/webhooks/${webhookId}`,
|
|
524
|
+
method: 'DELETE'
|
|
525
|
+
}, apiKey);
|
|
526
|
+
}
|
|
527
|
+
catch (error) {
|
|
528
|
+
console.error(`Error deleting existing webhook existence:`, webhookId, error.message, (_a = error.response) === null || _a === void 0 ? void 0 : _a.data);
|
|
530
529
|
}
|
|
531
530
|
if (axios_1.default.isAxiosError(error) && error.response && error.response.status === 404) {
|
|
532
531
|
return false;
|
|
533
532
|
}
|
|
534
|
-
|
|
533
|
+
return false;
|
|
534
|
+
// throw error;
|
|
535
535
|
}
|
|
536
536
|
},
|
|
537
537
|
async create() {
|
|
@@ -583,7 +583,7 @@ class WassengerTrigger {
|
|
|
583
583
|
if (error.response.status === 409) {
|
|
584
584
|
return true;
|
|
585
585
|
}
|
|
586
|
-
throw new Error(`Wassenger webhook registration failed: ${((_a = error.response.data) === null || _a === void 0 ? void 0 : _a.message) || error.message}`);
|
|
586
|
+
throw new Error(`Wassenger webhook registration failed: ${device || "(no device)"} ${((_a = error.response.data) === null || _a === void 0 ? void 0 : _a.message) || error.message}`);
|
|
587
587
|
}
|
|
588
588
|
throw error;
|
|
589
589
|
}
|
|
@@ -613,10 +613,10 @@ class WassengerTrigger {
|
|
|
613
613
|
return true;
|
|
614
614
|
}
|
|
615
615
|
if (axios_1.default.isAxiosError(error) && error.response) {
|
|
616
|
-
console.error(`Wassenger webhook deletion failed: ${((_a = error.response.data) === null || _a === void 0 ? void 0 : _a.message) || error.message}`);
|
|
616
|
+
console.error(`Wassenger webhook deletion failed: ${webhookId} ${error.response.status || '<no status>'} ${((_a = error.response.data) === null || _a === void 0 ? void 0 : _a.message) || error.message}`);
|
|
617
617
|
}
|
|
618
618
|
else {
|
|
619
|
-
console.error('Error deleting Wassenger webhook:', error);
|
|
619
|
+
console.error('Error deleting Wassenger webhook:', webhookId, error);
|
|
620
620
|
}
|
|
621
621
|
return true;
|
|
622
622
|
}
|