snow-flow 8.39.2 → 8.39.4
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/mcp/servicenow-mcp-unified/shared/permission-validator.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/shared/types.d.ts +1 -1
- package/dist/mcp/servicenow-mcp-unified/shared/types.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.d.ts +6 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.js +19 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_email_logs.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_email_logs.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_email_logs.js +185 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_email_logs.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_flow_execution_logs.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_flow_execution_logs.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_flow_execution_logs.js +280 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_flow_execution_logs.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_inbound_http_logs.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_inbound_http_logs.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_inbound_http_logs.js +233 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_inbound_http_logs.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_outbound_http_logs.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_outbound_http_logs.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_outbound_http_logs.js +218 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_outbound_http_logs.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_scheduled_job_logs.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_scheduled_job_logs.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_scheduled_job_logs.js +276 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_scheduled_job_logs.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_slow_queries.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_slow_queries.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_slow_queries.js +340 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_slow_queries.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.d.ts +10 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.js +34 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_configure_mid_server.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_configure_mid_server.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_configure_mid_server.js +397 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_configure_mid_server.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_connection_alias.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_connection_alias.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_connection_alias.js +234 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_connection_alias.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_credential_alias.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_credential_alias.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_credential_alias.js +280 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_credential_alias.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_flow_action.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_flow_action.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_flow_action.js +358 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_flow_action.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_oauth_profile.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_oauth_profile.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_oauth_profile.js +237 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_create_oauth_profile.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_install_spoke.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_install_spoke.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_install_spoke.js +326 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_install_spoke.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_mid_capabilities.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_mid_capabilities.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_mid_capabilities.js +442 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_mid_capabilities.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_oauth_tokens.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_oauth_tokens.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_oauth_tokens.js +348 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_oauth_tokens.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_spoke_connection.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_spoke_connection.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_spoke_connection.js +427 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_manage_spoke_connection.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_test_mid_connectivity.d.ts +12 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_test_mid_connectivity.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_test_mid_connectivity.js +432 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_test_mid_connectivity.js.map +1 -0
- package/dist/templates/agents-md-template.d.ts +2 -2
- package/dist/templates/agents-md-template.d.ts.map +1 -1
- package/dist/templates/agents-md-template.js +57 -2
- package/dist/templates/agents-md-template.js.map +1 -1
- package/dist/templates/claude-md-template.d.ts +2 -2
- package/dist/templates/claude-md-template.d.ts.map +1 -1
- package/dist/templates/claude-md-template.js +17 -1
- package/dist/templates/claude-md-template.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* snow_manage_spoke_connection - Manage spoke connection configurations
|
|
4
|
+
*
|
|
5
|
+
* Configure, test, and manage connection settings for IntegrationHub spokes
|
|
6
|
+
* including connection aliases, credentials, and endpoint configurations.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.author = exports.version = exports.toolDefinition = void 0;
|
|
10
|
+
exports.execute = execute;
|
|
11
|
+
const auth_js_1 = require("../../shared/auth.js");
|
|
12
|
+
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
13
|
+
exports.toolDefinition = {
|
|
14
|
+
name: 'snow_manage_spoke_connection',
|
|
15
|
+
description: 'Manage IntegrationHub spoke connections: configure, test, and troubleshoot',
|
|
16
|
+
category: 'integration',
|
|
17
|
+
subcategory: 'integrationhub',
|
|
18
|
+
use_cases: ['spokes', 'connections', 'integration-hub', 'troubleshooting'],
|
|
19
|
+
complexity: 'intermediate',
|
|
20
|
+
frequency: 'medium',
|
|
21
|
+
permission: 'write',
|
|
22
|
+
allowedRoles: ['developer', 'admin'],
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
action: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
enum: ['list', 'configure', 'test', 'status', 'update', 'troubleshoot'],
|
|
29
|
+
description: 'Action to perform',
|
|
30
|
+
default: 'list'
|
|
31
|
+
},
|
|
32
|
+
spoke_name: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
description: 'Name of the spoke to manage connections for'
|
|
35
|
+
},
|
|
36
|
+
connection_alias_id: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'sys_id of specific connection alias'
|
|
39
|
+
},
|
|
40
|
+
configuration: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
description: 'Connection configuration to apply (for configure/update)',
|
|
43
|
+
properties: {
|
|
44
|
+
base_url: { type: 'string', description: 'Base URL for the external system' },
|
|
45
|
+
credential_alias: { type: 'string', description: 'Credential alias sys_id' },
|
|
46
|
+
mid_server: { type: 'string', description: 'MID Server to use' },
|
|
47
|
+
timeout: { type: 'number', description: 'Connection timeout in seconds' },
|
|
48
|
+
retry_count: { type: 'number', description: 'Number of retry attempts' },
|
|
49
|
+
custom_headers: { type: 'object', description: 'Custom headers to include' }
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
include_inactive: {
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
description: 'Include inactive connections',
|
|
55
|
+
default: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
required: ['action']
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
async function execute(args, context) {
|
|
62
|
+
var action = args.action || 'list';
|
|
63
|
+
var spoke_name = args.spoke_name || '';
|
|
64
|
+
var connection_alias_id = args.connection_alias_id || '';
|
|
65
|
+
var configuration = args.configuration || {};
|
|
66
|
+
var include_inactive = args.include_inactive || false;
|
|
67
|
+
try {
|
|
68
|
+
var client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
69
|
+
if (action === 'list') {
|
|
70
|
+
// List all spoke connections
|
|
71
|
+
var queryParts = [];
|
|
72
|
+
if (!include_inactive) {
|
|
73
|
+
queryParts.push('active=true');
|
|
74
|
+
}
|
|
75
|
+
if (spoke_name) {
|
|
76
|
+
// Find spoke first
|
|
77
|
+
var spokeResponse = await client.get('/api/now/table/sys_hub_spoke', {
|
|
78
|
+
params: {
|
|
79
|
+
sysparm_query: 'nameLIKE' + spoke_name,
|
|
80
|
+
sysparm_limit: 1,
|
|
81
|
+
sysparm_fields: 'sys_id,name'
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
if (spokeResponse.data.result && spokeResponse.data.result.length > 0) {
|
|
85
|
+
queryParts.push('sys_scope=' + spokeResponse.data.result[0].sys_id);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Get connection aliases
|
|
89
|
+
var connectionsResponse = await client.get('/api/now/table/sys_alias', {
|
|
90
|
+
params: {
|
|
91
|
+
sysparm_query: queryParts.join('^') + '^type=connection^ORDERBYname',
|
|
92
|
+
sysparm_limit: 100,
|
|
93
|
+
sysparm_fields: 'sys_id,name,type,active,credential,sys_scope',
|
|
94
|
+
sysparm_display_value: 'all'
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var connections = connectionsResponse.data.result || [];
|
|
98
|
+
// Get additional connection details
|
|
99
|
+
var enrichedConnections = [];
|
|
100
|
+
for (var i = 0; i < connections.length; i++) {
|
|
101
|
+
var conn = connections[i];
|
|
102
|
+
// Get HTTP connection details if available
|
|
103
|
+
var httpDetailsResponse = await client.get('/api/now/table/sys_connection', {
|
|
104
|
+
params: {
|
|
105
|
+
sysparm_query: 'connection_alias=' + conn.sys_id,
|
|
106
|
+
sysparm_limit: 1,
|
|
107
|
+
sysparm_fields: 'connection_url,mid_server,use_mutual_auth,timeout'
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
var httpDetails = httpDetailsResponse.data.result?.[0] || null;
|
|
111
|
+
enrichedConnections.push({
|
|
112
|
+
sys_id: conn.sys_id,
|
|
113
|
+
name: conn.name && conn.name.display_value ? conn.name.display_value : conn.name,
|
|
114
|
+
type: conn.type,
|
|
115
|
+
active: conn.active === 'true' || conn.active === true,
|
|
116
|
+
credential: conn.credential && conn.credential.display_value ? conn.credential.display_value : conn.credential,
|
|
117
|
+
scope: conn.sys_scope && conn.sys_scope.display_value ? conn.sys_scope.display_value : conn.sys_scope,
|
|
118
|
+
http_connection: httpDetails ? {
|
|
119
|
+
base_url: httpDetails.connection_url,
|
|
120
|
+
mid_server: httpDetails.mid_server,
|
|
121
|
+
use_mutual_auth: httpDetails.use_mutual_auth === 'true',
|
|
122
|
+
timeout: httpDetails.timeout
|
|
123
|
+
} : null
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return (0, error_handler_js_1.createSuccessResult)({
|
|
127
|
+
action: 'list',
|
|
128
|
+
connections: enrichedConnections,
|
|
129
|
+
total: enrichedConnections.length,
|
|
130
|
+
summary: {
|
|
131
|
+
active: enrichedConnections.filter(function (c) { return c.active; }).length,
|
|
132
|
+
inactive: enrichedConnections.filter(function (c) { return !c.active; }).length,
|
|
133
|
+
with_credentials: enrichedConnections.filter(function (c) { return c.credential; }).length
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
else if (action === 'status') {
|
|
138
|
+
if (!connection_alias_id) {
|
|
139
|
+
return (0, error_handler_js_1.createErrorResult)('connection_alias_id is required for status action');
|
|
140
|
+
}
|
|
141
|
+
// Get detailed status of a connection
|
|
142
|
+
var aliasResponse = await client.get('/api/now/table/sys_alias/' + connection_alias_id, {
|
|
143
|
+
params: {
|
|
144
|
+
sysparm_display_value: 'all'
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
if (!aliasResponse.data.result) {
|
|
148
|
+
return (0, error_handler_js_1.createErrorResult)('Connection alias not found');
|
|
149
|
+
}
|
|
150
|
+
var alias = aliasResponse.data.result;
|
|
151
|
+
// Get HTTP connection
|
|
152
|
+
var httpConnResponse = await client.get('/api/now/table/sys_connection', {
|
|
153
|
+
params: {
|
|
154
|
+
sysparm_query: 'connection_alias=' + connection_alias_id,
|
|
155
|
+
sysparm_fields: 'sys_id,connection_url,mid_server,use_mutual_auth,timeout,retry_count',
|
|
156
|
+
sysparm_display_value: 'all'
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
var httpConn = httpConnResponse.data.result?.[0] || null;
|
|
160
|
+
// Get credential details
|
|
161
|
+
var credentialInfo = null;
|
|
162
|
+
if (alias.credential) {
|
|
163
|
+
var credId = alias.credential.value || alias.credential;
|
|
164
|
+
var credResponse = await client.get('/api/now/table/discovery_credentials/' + credId, {
|
|
165
|
+
params: {
|
|
166
|
+
sysparm_fields: 'name,type,active'
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
if (credResponse.data.result) {
|
|
170
|
+
credentialInfo = {
|
|
171
|
+
name: credResponse.data.result.name,
|
|
172
|
+
type: credResponse.data.result.type,
|
|
173
|
+
active: credResponse.data.result.active === 'true'
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Check recent activity
|
|
178
|
+
var recentLogsResponse = await client.get('/api/now/table/syslog', {
|
|
179
|
+
params: {
|
|
180
|
+
sysparm_query: 'messageLIKE' + (alias.name.display_value || alias.name) + '^ORDERBYDESCsys_created_on',
|
|
181
|
+
sysparm_limit: 5,
|
|
182
|
+
sysparm_fields: 'sys_created_on,level,message'
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
var recentLogs = recentLogsResponse.data.result || [];
|
|
186
|
+
return (0, error_handler_js_1.createSuccessResult)({
|
|
187
|
+
action: 'status',
|
|
188
|
+
connection: {
|
|
189
|
+
sys_id: alias.sys_id,
|
|
190
|
+
name: alias.name && alias.name.display_value ? alias.name.display_value : alias.name,
|
|
191
|
+
type: alias.type,
|
|
192
|
+
active: alias.active === 'true' || alias.active === true,
|
|
193
|
+
scope: alias.sys_scope && alias.sys_scope.display_value ? alias.sys_scope.display_value : alias.sys_scope
|
|
194
|
+
},
|
|
195
|
+
http_settings: httpConn ? {
|
|
196
|
+
base_url: httpConn.connection_url,
|
|
197
|
+
mid_server: httpConn.mid_server && httpConn.mid_server.display_value ? httpConn.mid_server.display_value : httpConn.mid_server,
|
|
198
|
+
use_mutual_auth: httpConn.use_mutual_auth === 'true',
|
|
199
|
+
timeout: httpConn.timeout,
|
|
200
|
+
retry_count: httpConn.retry_count
|
|
201
|
+
} : null,
|
|
202
|
+
credential: credentialInfo,
|
|
203
|
+
recent_activity: recentLogs.map(function (log) {
|
|
204
|
+
return {
|
|
205
|
+
timestamp: log.sys_created_on,
|
|
206
|
+
level: log.level,
|
|
207
|
+
message: log.message ? log.message.substring(0, 200) : ''
|
|
208
|
+
};
|
|
209
|
+
}),
|
|
210
|
+
health: alias.active === 'true' ? 'configured' : 'inactive'
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
else if (action === 'test') {
|
|
214
|
+
if (!connection_alias_id) {
|
|
215
|
+
return (0, error_handler_js_1.createErrorResult)('connection_alias_id is required for test action');
|
|
216
|
+
}
|
|
217
|
+
// Test the connection via background script
|
|
218
|
+
var testScript = `
|
|
219
|
+
var alias = new GlideRecord('sys_alias');
|
|
220
|
+
if (alias.get(${JSON.stringify(connection_alias_id)})) {
|
|
221
|
+
var conn = new GlideRecord('sys_connection');
|
|
222
|
+
conn.addQuery('connection_alias', alias.sys_id);
|
|
223
|
+
conn.query();
|
|
224
|
+
|
|
225
|
+
if (conn.next()) {
|
|
226
|
+
var startTime = new Date().getTime();
|
|
227
|
+
try {
|
|
228
|
+
var request = new sn_ws.RESTMessageV2();
|
|
229
|
+
request.setEndpoint(conn.connection_url.toString());
|
|
230
|
+
request.setHttpMethod('GET');
|
|
231
|
+
request.setHttpTimeout(10000);
|
|
232
|
+
|
|
233
|
+
// Try to resolve credential
|
|
234
|
+
if (alias.credential) {
|
|
235
|
+
var cred = new GlideRecord('discovery_credentials');
|
|
236
|
+
if (cred.get(alias.credential)) {
|
|
237
|
+
if (cred.type == 'basic') {
|
|
238
|
+
request.setBasicAuth(cred.user_name, cred.password.getDecryptedValue());
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
var response = request.execute();
|
|
244
|
+
var endTime = new Date().getTime();
|
|
245
|
+
|
|
246
|
+
gs.print(JSON.stringify({
|
|
247
|
+
success: true,
|
|
248
|
+
status_code: response.getStatusCode(),
|
|
249
|
+
response_time_ms: endTime - startTime,
|
|
250
|
+
endpoint: conn.connection_url.toString()
|
|
251
|
+
}));
|
|
252
|
+
} catch (e) {
|
|
253
|
+
var endTime = new Date().getTime();
|
|
254
|
+
gs.print(JSON.stringify({
|
|
255
|
+
success: false,
|
|
256
|
+
error: e.message,
|
|
257
|
+
response_time_ms: endTime - startTime,
|
|
258
|
+
endpoint: conn.connection_url.toString()
|
|
259
|
+
}));
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
gs.print(JSON.stringify({
|
|
263
|
+
success: false,
|
|
264
|
+
error: 'No HTTP connection found for alias'
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
gs.print(JSON.stringify({
|
|
269
|
+
success: false,
|
|
270
|
+
error: 'Connection alias not found'
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
273
|
+
`;
|
|
274
|
+
var testResponse = await client.post('/api/now/table/sys_script_execution', {
|
|
275
|
+
script: testScript,
|
|
276
|
+
description: 'Test spoke connection: ' + connection_alias_id
|
|
277
|
+
});
|
|
278
|
+
var testOutput = testResponse.data.result?.output || '';
|
|
279
|
+
var testMatch = testOutput.match(/\{[^}]+\}/);
|
|
280
|
+
var testResult = testMatch ? JSON.parse(testMatch[0]) : { success: false, error: 'Unknown error' };
|
|
281
|
+
return (0, error_handler_js_1.createSuccessResult)({
|
|
282
|
+
action: 'test',
|
|
283
|
+
connection_alias_id: connection_alias_id,
|
|
284
|
+
result: testResult,
|
|
285
|
+
recommendation: testResult.success
|
|
286
|
+
? 'Connection is working correctly'
|
|
287
|
+
: 'Check endpoint URL, credentials, and network connectivity'
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
else if (action === 'configure' || action === 'update') {
|
|
291
|
+
if (!connection_alias_id) {
|
|
292
|
+
return (0, error_handler_js_1.createErrorResult)('connection_alias_id is required for ' + action + ' action');
|
|
293
|
+
}
|
|
294
|
+
// Update connection settings
|
|
295
|
+
var updates = {};
|
|
296
|
+
if (configuration.credential_alias) {
|
|
297
|
+
updates.credential = configuration.credential_alias;
|
|
298
|
+
}
|
|
299
|
+
if (Object.keys(updates).length > 0) {
|
|
300
|
+
await client.patch('/api/now/table/sys_alias/' + connection_alias_id, updates);
|
|
301
|
+
}
|
|
302
|
+
// Update HTTP connection if base_url or other settings provided
|
|
303
|
+
if (configuration.base_url || configuration.mid_server || configuration.timeout) {
|
|
304
|
+
var httpFindResponse = await client.get('/api/now/table/sys_connection', {
|
|
305
|
+
params: {
|
|
306
|
+
sysparm_query: 'connection_alias=' + connection_alias_id,
|
|
307
|
+
sysparm_limit: 1,
|
|
308
|
+
sysparm_fields: 'sys_id'
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
var httpUpdates = {};
|
|
312
|
+
if (configuration.base_url)
|
|
313
|
+
httpUpdates.connection_url = configuration.base_url;
|
|
314
|
+
if (configuration.mid_server)
|
|
315
|
+
httpUpdates.mid_server = configuration.mid_server;
|
|
316
|
+
if (configuration.timeout)
|
|
317
|
+
httpUpdates.timeout = configuration.timeout;
|
|
318
|
+
if (configuration.retry_count)
|
|
319
|
+
httpUpdates.retry_count = configuration.retry_count;
|
|
320
|
+
if (httpFindResponse.data.result && httpFindResponse.data.result.length > 0) {
|
|
321
|
+
await client.patch('/api/now/table/sys_connection/' + httpFindResponse.data.result[0].sys_id, httpUpdates);
|
|
322
|
+
}
|
|
323
|
+
else if (configuration.base_url) {
|
|
324
|
+
// Create HTTP connection if doesn't exist
|
|
325
|
+
httpUpdates.connection_alias = connection_alias_id;
|
|
326
|
+
await client.post('/api/now/table/sys_connection', httpUpdates);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return (0, error_handler_js_1.createSuccessResult)({
|
|
330
|
+
action: action,
|
|
331
|
+
connection_alias_id: connection_alias_id,
|
|
332
|
+
updates_applied: configuration,
|
|
333
|
+
message: 'Connection configuration updated successfully'
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
else if (action === 'troubleshoot') {
|
|
337
|
+
if (!connection_alias_id) {
|
|
338
|
+
return (0, error_handler_js_1.createErrorResult)('connection_alias_id is required for troubleshoot action');
|
|
339
|
+
}
|
|
340
|
+
// Gather diagnostic information
|
|
341
|
+
var aliasInfo = await client.get('/api/now/table/sys_alias/' + connection_alias_id, {
|
|
342
|
+
params: { sysparm_display_value: 'all' }
|
|
343
|
+
});
|
|
344
|
+
if (!aliasInfo.data.result) {
|
|
345
|
+
return (0, error_handler_js_1.createErrorResult)('Connection alias not found');
|
|
346
|
+
}
|
|
347
|
+
var diagnostics = {
|
|
348
|
+
alias: {
|
|
349
|
+
name: aliasInfo.data.result.name,
|
|
350
|
+
active: aliasInfo.data.result.active,
|
|
351
|
+
has_credential: !!aliasInfo.data.result.credential
|
|
352
|
+
},
|
|
353
|
+
issues: [],
|
|
354
|
+
recommendations: []
|
|
355
|
+
};
|
|
356
|
+
// Check if alias is active
|
|
357
|
+
if (aliasInfo.data.result.active !== 'true') {
|
|
358
|
+
diagnostics.issues.push('Connection alias is inactive');
|
|
359
|
+
diagnostics.recommendations.push('Activate the connection alias');
|
|
360
|
+
}
|
|
361
|
+
// Check if credential is set
|
|
362
|
+
if (!aliasInfo.data.result.credential) {
|
|
363
|
+
diagnostics.issues.push('No credential configured');
|
|
364
|
+
diagnostics.recommendations.push('Configure credential using snow_create_credential_alias');
|
|
365
|
+
}
|
|
366
|
+
// Check HTTP connection
|
|
367
|
+
var httpCheck = await client.get('/api/now/table/sys_connection', {
|
|
368
|
+
params: {
|
|
369
|
+
sysparm_query: 'connection_alias=' + connection_alias_id,
|
|
370
|
+
sysparm_limit: 1,
|
|
371
|
+
sysparm_fields: 'connection_url,mid_server,timeout'
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
if (!httpCheck.data.result || httpCheck.data.result.length === 0) {
|
|
375
|
+
diagnostics.issues.push('No HTTP connection configured');
|
|
376
|
+
diagnostics.recommendations.push('Configure HTTP connection with base URL');
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
var httpConn = httpCheck.data.result[0];
|
|
380
|
+
diagnostics.http_connection = {
|
|
381
|
+
base_url: httpConn.connection_url,
|
|
382
|
+
has_mid_server: !!httpConn.mid_server,
|
|
383
|
+
timeout: httpConn.timeout || 'default'
|
|
384
|
+
};
|
|
385
|
+
if (!httpConn.connection_url) {
|
|
386
|
+
diagnostics.issues.push('HTTP connection has no URL configured');
|
|
387
|
+
diagnostics.recommendations.push('Set connection_url in HTTP connection');
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
// Check recent errors
|
|
391
|
+
var errorLogs = await client.get('/api/now/table/syslog', {
|
|
392
|
+
params: {
|
|
393
|
+
sysparm_query: 'level=2^messageLIKE' + (aliasInfo.data.result.name.display_value || aliasInfo.data.result.name) + '^ORDERBYDESCsys_created_on',
|
|
394
|
+
sysparm_limit: 10,
|
|
395
|
+
sysparm_fields: 'sys_created_on,message'
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
if (errorLogs.data.result && errorLogs.data.result.length > 0) {
|
|
399
|
+
diagnostics.recent_errors = errorLogs.data.result.map(function (log) {
|
|
400
|
+
return {
|
|
401
|
+
timestamp: log.sys_created_on,
|
|
402
|
+
message: log.message ? log.message.substring(0, 200) : ''
|
|
403
|
+
};
|
|
404
|
+
});
|
|
405
|
+
diagnostics.issues.push('Recent errors found in logs');
|
|
406
|
+
diagnostics.recommendations.push('Review error messages for specific issues');
|
|
407
|
+
}
|
|
408
|
+
diagnostics.health = diagnostics.issues.length === 0 ? 'healthy' : 'issues_detected';
|
|
409
|
+
return (0, error_handler_js_1.createSuccessResult)({
|
|
410
|
+
action: 'troubleshoot',
|
|
411
|
+
connection_alias_id: connection_alias_id,
|
|
412
|
+
diagnostics: diagnostics
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
return (0, error_handler_js_1.createErrorResult)('Unknown action: ' + action);
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
if (error.response?.status === 403) {
|
|
419
|
+
return (0, error_handler_js_1.createErrorResult)('Permission denied (403): Your ServiceNow user lacks permissions to manage spoke connections. ' +
|
|
420
|
+
'Required roles: "flow_designer" or "admin". Please contact your ServiceNow administrator.');
|
|
421
|
+
}
|
|
422
|
+
return (0, error_handler_js_1.createErrorResult)(error.message);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
exports.version = '1.0.0';
|
|
426
|
+
exports.author = 'Snow-Flow Team';
|
|
427
|
+
//# sourceMappingURL=snow_manage_spoke_connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snow_manage_spoke_connection.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/integration/snow_manage_spoke_connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAwDH,0BAoZC;AAzcD,kDAA8D;AAC9D,oEAAuF;AAE1E,QAAA,cAAc,GAAsB;IAC/C,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,4EAA4E;IACzF,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,gBAAgB;IAC7B,SAAS,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;IAC1E,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,QAAQ;IAEnB,UAAU,EAAE,OAAO;IACnB,YAAY,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;IACpC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC;gBACvE,WAAW,EAAE,mBAAmB;gBAChC,OAAO,EAAE,MAAM;aAChB;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6CAA6C;aAC3D;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;aACnD;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;gBACvE,UAAU,EAAE;oBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;oBAC7E,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;oBAC5E,UAAU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ACzB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAA,oCAAiB,EAAC,kBAAkB,GAAG,MAAM,CAAC,CAAC;IAExD,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;YACnC,OAAO,IAAA,oCAAiB,EACtB,+FAA+F;gBAC/F,2FAA2F,CAC5F,CAAC;QACJ,CAAC;QACD,OAAO,IAAA,oCAAiB,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAEY,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,MAAM,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* snow_test_mid_connectivity - Test MID Server connectivity
|
|
3
|
+
*
|
|
4
|
+
* Test connectivity from MID Servers to external endpoints,
|
|
5
|
+
* validate network paths, and diagnose connection issues.
|
|
6
|
+
*/
|
|
7
|
+
import { MCPToolDefinition, ServiceNowContext, ToolResult } from '../../shared/types.js';
|
|
8
|
+
export declare const toolDefinition: MCPToolDefinition;
|
|
9
|
+
export declare function execute(args: any, context: ServiceNowContext): Promise<ToolResult>;
|
|
10
|
+
export declare const version = "1.0.0";
|
|
11
|
+
export declare const author = "Snow-Flow Team";
|
|
12
|
+
//# sourceMappingURL=snow_test_mid_connectivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snow_test_mid_connectivity.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/integration/snow_test_mid_connectivity.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBAuD5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAyYxF;AAED,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,mBAAmB,CAAC"}
|