snow-flow 2.0.8 → 2.0.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.
|
@@ -649,11 +649,44 @@ class ServiceNowDeploymentMCP {
|
|
|
649
649
|
}
|
|
650
650
|
catch (error) {
|
|
651
651
|
directError = error;
|
|
652
|
-
this.logger.warn('⚠️ Direct widget deployment failed,
|
|
652
|
+
this.logger.warn('⚠️ Direct widget deployment failed, checking if widget was created anyway', directError);
|
|
653
|
+
// Check if this is a 403 error - widget might have been created despite the error
|
|
654
|
+
const is403Error = error?.response?.status === 403 ||
|
|
655
|
+
error?.message?.includes('403') ||
|
|
656
|
+
error?.message?.includes('Forbidden');
|
|
657
|
+
if (is403Error) {
|
|
658
|
+
this.logger.info('403 error detected, verifying if widget was actually created...');
|
|
659
|
+
try {
|
|
660
|
+
const verificationResult = await this.verifyWidgetInServiceNow(args.name);
|
|
661
|
+
if (verificationResult.exists) {
|
|
662
|
+
// Widget was created successfully despite 403 error!
|
|
663
|
+
this.logger.info('🎉 Widget verification SUCCESS: Widget exists despite 403 error', {
|
|
664
|
+
widgetName: args.name,
|
|
665
|
+
sys_id: verificationResult.sys_id,
|
|
666
|
+
completenessScore: verificationResult.completenessScore
|
|
667
|
+
});
|
|
668
|
+
// Set result as successful with the verified data
|
|
669
|
+
result = {
|
|
670
|
+
success: true,
|
|
671
|
+
data: {
|
|
672
|
+
sys_id: verificationResult.sys_id,
|
|
673
|
+
name: args.name,
|
|
674
|
+
title: verificationResult.title || args.title
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
deploymentMethod = 'direct_api (with error recovery)';
|
|
678
|
+
deploymentSuccess = true;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
catch (verifyError) {
|
|
682
|
+
this.logger.warn('Could not verify widget existence after 403 error', verifyError);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
653
685
|
}
|
|
654
686
|
}
|
|
655
|
-
//
|
|
687
|
+
// Only try fallback strategies if the primary deployment failed
|
|
656
688
|
if (!deploymentSuccess) {
|
|
689
|
+
// Strategy 2: Direct table record creation (fallback)
|
|
657
690
|
try {
|
|
658
691
|
this.logger.info('🔄 Attempting fallback: Direct table record creation');
|
|
659
692
|
result = await this.client.createRecord('sp_widget', {
|
|
@@ -674,6 +707,9 @@ class ServiceNowDeploymentMCP {
|
|
|
674
707
|
servicenow: false
|
|
675
708
|
});
|
|
676
709
|
deploymentMethod = 'table_record';
|
|
710
|
+
deploymentSuccess = true;
|
|
711
|
+
// createRecord should already return a ServiceNowAPIResponse structure
|
|
712
|
+
// No need to wrap it again
|
|
677
713
|
}
|
|
678
714
|
catch (error) {
|
|
679
715
|
tableError = error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "Snow-Flow: ServiceNow Advanced Intelligence Platform - 100+ real MCP tools with AI-powered swarm orchestration. Zero Mock Data, 100% Real API Integration. Natural language interface for ServiceNow operations.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|