snow-flow 3.0.21 → 3.0.23
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.
|
@@ -1139,7 +1139,7 @@ Use \`snow_deployment_debug\` for more information about this session.`,
|
|
|
1139
1139
|
4. Try widget preview: snow_preview_widget()
|
|
1140
1140
|
|
|
1141
1141
|
💡 Alternative Approaches:
|
|
1142
|
-
• Use
|
|
1142
|
+
• Use snow_deploy with smaller components first
|
|
1143
1143
|
• Test with snow_widget_test() before deployment
|
|
1144
1144
|
• Check dependencies with check_dependencies: true
|
|
1145
1145
|
|
|
@@ -3427,14 +3427,38 @@ Use ServiceNow's official deployment process:
|
|
|
3427
3427
|
artifact_tracker_js_1.artifactTracker.trackArtifact(args.sys_id, args.table, args.name, args.type, 'update' // Assume existing artifact
|
|
3428
3428
|
);
|
|
3429
3429
|
}
|
|
3430
|
-
//
|
|
3431
|
-
|
|
3432
|
-
// Get the artifact details if valid
|
|
3430
|
+
// Use direct API query (snow_query_table approach) for validation
|
|
3431
|
+
let isValid = false;
|
|
3433
3432
|
let artifactDetails = null;
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3433
|
+
try {
|
|
3434
|
+
// Direct API call using query parameter with sys_id
|
|
3435
|
+
const apiResponse = await this.client.get(`/api/now/table/${args.table}`, {
|
|
3436
|
+
sysparm_query: `sys_id=${args.sys_id}`,
|
|
3437
|
+
sysparm_limit: 1,
|
|
3438
|
+
sysparm_fields: 'sys_id,name,title,active,sys_created_on,sys_updated_on,sys_created_by,sys_updated_by'
|
|
3439
|
+
});
|
|
3440
|
+
if (apiResponse?.result && apiResponse.result.length > 0) {
|
|
3441
|
+
isValid = true;
|
|
3442
|
+
artifactDetails = apiResponse.result[0];
|
|
3443
|
+
this.logger.info(`✅ Artifact found via direct API: ${artifactDetails.sys_id}`);
|
|
3444
|
+
}
|
|
3445
|
+
else {
|
|
3446
|
+
this.logger.info(`❌ Artifact not found: ${args.sys_id} in table ${args.table}`);
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
catch (error) {
|
|
3450
|
+
this.logger.warn(`Failed to query artifact: ${error}`);
|
|
3451
|
+
// Try alternative method as fallback
|
|
3452
|
+
try {
|
|
3453
|
+
const response = await this.client.getRecord(args.table, args.sys_id);
|
|
3454
|
+
if (response.success && response.data) {
|
|
3455
|
+
isValid = true;
|
|
3456
|
+
artifactDetails = response.data;
|
|
3457
|
+
this.logger.info(`✅ Artifact found via getRecord fallback: ${args.sys_id}`);
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
catch (fallbackError) {
|
|
3461
|
+
this.logger.error(`Both validation methods failed: ${fallbackError}`);
|
|
3438
3462
|
}
|
|
3439
3463
|
}
|
|
3440
3464
|
// Check for inconsistencies
|
|
@@ -3452,14 +3476,16 @@ Use ServiceNow's official deployment process:
|
|
|
3452
3476
|
- Expected Name: ${args.name || 'Not specified'}
|
|
3453
3477
|
- Expected Type: ${args.type || 'Not specified'}
|
|
3454
3478
|
|
|
3455
|
-
**Validation Status:** ${isValid ? '✅ Valid' : '❌
|
|
3479
|
+
**Validation Status:** ${isValid ? '✅ Valid - Artifact exists' : '❌ Not Found - Artifact does not exist in this table'}
|
|
3456
3480
|
|
|
3457
3481
|
${artifactDetails ? `**Actual Artifact Details:**
|
|
3458
3482
|
- Name: ${artifactDetails.name || artifactDetails.title || 'Unknown'}
|
|
3459
|
-
- Active: ${artifactDetails.active}
|
|
3460
|
-
- Created: ${artifactDetails.sys_created_on}
|
|
3461
|
-
- Updated: ${artifactDetails.sys_updated_on}
|
|
3462
|
-
|
|
3483
|
+
- Active: ${artifactDetails.active !== undefined ? artifactDetails.active : 'N/A'}
|
|
3484
|
+
- Created: ${artifactDetails.sys_created_on || 'N/A'}
|
|
3485
|
+
- Updated: ${artifactDetails.sys_updated_on || 'N/A'}
|
|
3486
|
+
- Created By: ${artifactDetails.sys_created_by || 'N/A'}
|
|
3487
|
+
- Updated By: ${artifactDetails.sys_updated_by || 'N/A'}
|
|
3488
|
+
` : '**Artifact not found in ServiceNow**'}
|
|
3463
3489
|
|
|
3464
3490
|
${trackedArtifact ? `**Tracking Info:**
|
|
3465
3491
|
- Status: ${trackedArtifact.status}
|
|
@@ -8066,94 +8092,6 @@ ${updateSetSession ? `📋 **Update Set**: ${updateSetSession.name}
|
|
|
8066
8092
|
throw new Error(`Update Set session required for deployment. Error: ${error.message}`);
|
|
8067
8093
|
}
|
|
8068
8094
|
}
|
|
8069
|
-
/**
|
|
8070
|
-
* DEPRECATION HANDLERS - Redirect old tools to new unified system
|
|
8071
|
-
*/
|
|
8072
|
-
async handleDeprecatedWidgetDeploy(args) {
|
|
8073
|
-
const deprecationWarning = `⚠️ **DEPRECATED TOOL USED**
|
|
8074
|
-
|
|
8075
|
-
🚨 **snow_deploy_widget is deprecated** - Use \`snow_deploy\` instead
|
|
8076
|
-
|
|
8077
|
-
📋 **Automatic Redirect**: Converting to unified deployment...
|
|
8078
|
-
|
|
8079
|
-
`;
|
|
8080
|
-
// Convert old widget args to unified deploy format
|
|
8081
|
-
const unifiedArgs = {
|
|
8082
|
-
type: 'widget',
|
|
8083
|
-
config: args,
|
|
8084
|
-
auto_update_set: true,
|
|
8085
|
-
fallback_strategy: 'manual_steps'
|
|
8086
|
-
};
|
|
8087
|
-
const result = await this.unifiedDeploy(unifiedArgs);
|
|
8088
|
-
// Prepend deprecation warning to the result
|
|
8089
|
-
if (result.content && result.content[0]) {
|
|
8090
|
-
result.content[0].text = deprecationWarning + result.content[0].text;
|
|
8091
|
-
}
|
|
8092
|
-
return result;
|
|
8093
|
-
}
|
|
8094
|
-
async handleDeprecatedApplicationDeploy(args) {
|
|
8095
|
-
const deprecationWarning = `⚠️ **DEPRECATED TOOL USED**
|
|
8096
|
-
|
|
8097
|
-
🚨 **snow_deploy_application is deprecated** - Use \`snow_deploy\` instead
|
|
8098
|
-
|
|
8099
|
-
📋 **Automatic Redirect**: Converting to unified deployment...
|
|
8100
|
-
|
|
8101
|
-
`;
|
|
8102
|
-
// Convert old application args to unified deploy format
|
|
8103
|
-
const unifiedArgs = {
|
|
8104
|
-
type: 'application',
|
|
8105
|
-
config: args,
|
|
8106
|
-
auto_update_set: true,
|
|
8107
|
-
fallback_strategy: 'manual_steps'
|
|
8108
|
-
};
|
|
8109
|
-
const result = await this.unifiedDeploy(unifiedArgs);
|
|
8110
|
-
// Prepend deprecation warning to the result
|
|
8111
|
-
if (result.content && result.content[0]) {
|
|
8112
|
-
result.content[0].text = deprecationWarning + result.content[0].text;
|
|
8113
|
-
}
|
|
8114
|
-
return result;
|
|
8115
|
-
}
|
|
8116
|
-
async handleDeprecatedBulkDeploy(args) {
|
|
8117
|
-
const deprecationWarning = `⚠️ **DEPRECATED TOOL USED**
|
|
8118
|
-
|
|
8119
|
-
🚨 **snow_bulk_deploy is deprecated** - Use \`snow_deploy\` with batch configuration instead
|
|
8120
|
-
|
|
8121
|
-
📋 **Automatic Redirect**: Converting to unified deployment...
|
|
8122
|
-
|
|
8123
|
-
💡 **New Usage**: Use \`snow_deploy\` for single artifacts or implement batch logic with multiple \`snow_deploy\` calls
|
|
8124
|
-
|
|
8125
|
-
`;
|
|
8126
|
-
return {
|
|
8127
|
-
content: [{
|
|
8128
|
-
type: 'text',
|
|
8129
|
-
text: `${deprecationWarning}
|
|
8130
|
-
|
|
8131
|
-
❌ **Bulk Deploy No Longer Supported in Unified System**
|
|
8132
|
-
|
|
8133
|
-
🔧 **Alternative Solutions:**
|
|
8134
|
-
|
|
8135
|
-
**Option 1: Single Artifact Deployment**
|
|
8136
|
-
\`\`\`
|
|
8137
|
-
snow_deploy({
|
|
8138
|
-
type: 'widget',
|
|
8139
|
-
config: { /* your widget config */ }
|
|
8140
|
-
})
|
|
8141
|
-
\`\`\`
|
|
8142
|
-
|
|
8143
|
-
**Option 2: Multiple Sequential Deployments**
|
|
8144
|
-
Deploy each artifact individually using \`snow_deploy\` - the unified system automatically manages Update Sets across all deployments.
|
|
8145
|
-
|
|
8146
|
-
**Option 3: Use Existing Bulk Deploy (Legacy)**
|
|
8147
|
-
The original \`snow_bulk_deploy\` functionality is still available but deprecated. Consider migrating to the simplified \`snow_deploy\` approach.
|
|
8148
|
-
|
|
8149
|
-
📊 **Benefits of New Approach:**
|
|
8150
|
-
- Automatic Update Set management
|
|
8151
|
-
- Better error handling per artifact
|
|
8152
|
-
- Clearer deployment tracking
|
|
8153
|
-
- Resilient fallback strategies`
|
|
8154
|
-
}]
|
|
8155
|
-
};
|
|
8156
|
-
}
|
|
8157
8095
|
async start() {
|
|
8158
8096
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
8159
8097
|
await this.server.connect(transport);
|
|
@@ -49,19 +49,6 @@ class MCPToolRegistry {
|
|
|
49
49
|
actualTool: 'mcp__servicenow-deployment__snow_deploy',
|
|
50
50
|
description: 'Deploy flows to ServiceNow'
|
|
51
51
|
});
|
|
52
|
-
// Widget deployment
|
|
53
|
-
this.registerTool({
|
|
54
|
-
canonicalName: 'deploy_widget',
|
|
55
|
-
aliases: [
|
|
56
|
-
'mcp__servicenow-deployment__snow_deploy_widget',
|
|
57
|
-
'snow_deploy_widget',
|
|
58
|
-
'deploy_widget',
|
|
59
|
-
'widget_deploy'
|
|
60
|
-
],
|
|
61
|
-
provider: 'servicenow-deployment',
|
|
62
|
-
actualTool: 'mcp__servicenow-deployment__snow_deploy',
|
|
63
|
-
description: 'Deploy widgets to ServiceNow'
|
|
64
|
-
});
|
|
65
52
|
// Update Set management
|
|
66
53
|
this.registerTool({
|
|
67
54
|
canonicalName: 'update_set_create',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.23",
|
|
4
4
|
"description": "Snow-Flow v3.0.18: DIRECT API VERIFICATION! 🚀 Replaced unreliable searchRecords with direct API calls (snow_query_table style) for widget verification. All null/403 error recovery now uses GET /api/now/table/sp_widget with precise queries. NO MORE FALSE NEGATIVES - verification works consistently every time!",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|