snow-flow 8.41.24 → 8.42.0
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/CLAUDE.md +9 -6
- package/dist/mcp/servicenow-automation-mcp.js +8 -8
- package/dist/mcp/servicenow-automation-mcp.js.map +1 -1
- package/dist/mcp/servicenow-mcp-server.js +4 -4
- package/dist/mcp/servicenow-mcp-server.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.d.ts +1 -2
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.js +6 -8
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_confirm_script_execution.d.ts +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_confirm_script_execution.js +2 -2
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_confirm_script_execution.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_scheduled_job_logs.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_scheduled_job_logs.js +14 -5
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_get_scheduled_job_logs.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_schedule_script_job.d.ts +26 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_schedule_script_job.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/{snow_execute_script.js → snow_schedule_script_job.js} +19 -13
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_schedule_script_job.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_trace_execution.d.ts +12 -4
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_trace_execution.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_trace_execution.js +69 -67
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_trace_execution.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_artifact.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_artifact.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_artifact.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_requirements.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_requirements.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_requirements.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_artifact.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_artifact.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_artifact.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_by_sysid.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_by_sysid.js +5 -2
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_by_sysid.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_find_artifact.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_find_artifact.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_find_artifact.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_get_by_sysid.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_get_by_sysid.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_get_by_sysid.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_memory_search.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_memory_search.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_memory_search.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_orchestrate_development.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_orchestrate_development.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_orchestrate_development.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_sync_data_consistency.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_sync_data_consistency.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_sync_data_consistency.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_validate_live_connection.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_validate_live_connection.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_validate_live_connection.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.d.ts +1 -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 +4 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_analyze_query.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_analyze_query.js +53 -32
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_analyze_query.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_rest_message_manage.d.ts +26 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_rest_message_manage.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_rest_message_manage.js +1280 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_rest_message_manage.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/operations/snow_cmdb_search.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/operations/snow_cmdb_search.js +30 -7
- package/dist/mcp/servicenow-mcp-unified/tools/operations/snow_cmdb_search.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/index.d.ts +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/index.js +4 -4
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_trigger_scheduled_job.d.ts +19 -0
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_trigger_scheduled_job.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_trigger_scheduled_job.js +142 -0
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_trigger_scheduled_job.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/index.d.ts +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/index.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/index.js +4 -4
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_start_workflow.d.ts +15 -0
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_start_workflow.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_start_workflow.js +136 -0
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_start_workflow.js.map +1 -0
- package/dist/templates/agents-md-template.d.ts +1 -1
- package/dist/templates/agents-md-template.d.ts.map +1 -1
- package/dist/templates/agents-md-template.js +5 -5
- package/dist/templates/claude-md-template.d.ts +1 -1
- package/dist/templates/claude-md-template.d.ts.map +1 -1
- package/dist/templates/claude-md-template.js +11 -9
- package/dist/templates/claude-md-template.js.map +1 -1
- package/package.json +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script.d.ts +0 -20
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.d.ts +0 -11
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.js +0 -142
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.d.ts +0 -9
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.js +0 -57
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.d.ts +0 -9
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.js +0 -58
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.d.ts +0 -9
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.js +0 -59
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.d.ts +0 -9
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.js +0 -55
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.js.map +0 -1
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* snow_test_rest_connection - Test REST message connections
|
|
4
|
-
*
|
|
5
|
-
* Tests a REST message connection with full response details and diagnostics.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.author = exports.version = exports.toolDefinition = void 0;
|
|
9
|
-
exports.execute = execute;
|
|
10
|
-
const auth_js_1 = require("../../shared/auth.js");
|
|
11
|
-
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
12
|
-
exports.toolDefinition = {
|
|
13
|
-
name: 'snow_test_rest_connection',
|
|
14
|
-
description: 'Test REST message connection with full response details and diagnostics',
|
|
15
|
-
// Metadata for tool discovery (not sent to LLM)
|
|
16
|
-
category: 'automation',
|
|
17
|
-
subcategory: 'testing',
|
|
18
|
-
use_cases: ['automation', 'rest', 'connection'],
|
|
19
|
-
complexity: 'intermediate',
|
|
20
|
-
frequency: 'medium',
|
|
21
|
-
// Permission enforcement
|
|
22
|
-
// Classification: READ - Read-only operation based on name pattern
|
|
23
|
-
permission: 'read',
|
|
24
|
-
allowedRoles: ['developer', 'stakeholder', 'admin'],
|
|
25
|
-
inputSchema: {
|
|
26
|
-
type: 'object',
|
|
27
|
-
properties: {
|
|
28
|
-
rest_message: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
description: 'REST Message name'
|
|
31
|
-
},
|
|
32
|
-
method: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'HTTP Method name'
|
|
35
|
-
},
|
|
36
|
-
test_params: {
|
|
37
|
-
type: 'object',
|
|
38
|
-
description: 'Test parameters for the request'
|
|
39
|
-
},
|
|
40
|
-
return_full_response: {
|
|
41
|
-
type: 'boolean',
|
|
42
|
-
description: 'Return complete response details',
|
|
43
|
-
default: true
|
|
44
|
-
},
|
|
45
|
-
validate_auth: {
|
|
46
|
-
type: 'boolean',
|
|
47
|
-
description: 'Validate authentication',
|
|
48
|
-
default: true
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
required: ['rest_message']
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
async function execute(args, context) {
|
|
55
|
-
const { rest_message, method, test_params = {}, return_full_response = true, validate_auth = true } = args;
|
|
56
|
-
try {
|
|
57
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
58
|
-
// Find REST message
|
|
59
|
-
const restMessageResponse = await client.get(`/api/now/table/sys_rest_message?sysparm_query=name=${rest_message}&sysparm_limit=1`);
|
|
60
|
-
if (!restMessageResponse.data.result || restMessageResponse.data.result.length === 0) {
|
|
61
|
-
throw new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.NOT_FOUND, `REST message not found: ${rest_message}`, { retryable: false });
|
|
62
|
-
}
|
|
63
|
-
const restMessage = restMessageResponse.data.result[0];
|
|
64
|
-
// Find method if specified
|
|
65
|
-
let methodRecord = null;
|
|
66
|
-
if (method) {
|
|
67
|
-
const methodResponse = await client.get(`/api/now/table/sys_rest_message_fn?sysparm_query=rest_message=${restMessage.sys_id}^name=${method}&sysparm_limit=1`);
|
|
68
|
-
if (methodResponse.data.result && methodResponse.data.result.length > 0) {
|
|
69
|
-
methodRecord = methodResponse.data.result[0];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// Build test script
|
|
73
|
-
const testScript = `
|
|
74
|
-
var restMessage = new sn_ws.RESTMessageV2('${rest_message}', ${method ? `'${method}'` : 'null'});
|
|
75
|
-
|
|
76
|
-
// Set test parameters
|
|
77
|
-
var testParams = ${JSON.stringify(test_params)};
|
|
78
|
-
for (var key in testParams) {
|
|
79
|
-
restMessage.setStringParameterNoEscape(key, testParams[key]);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
var response = restMessage.execute();
|
|
84
|
-
var responseBody = response.getBody();
|
|
85
|
-
var httpStatus = response.getStatusCode();
|
|
86
|
-
var headers = response.getHeaders();
|
|
87
|
-
|
|
88
|
-
var result = {
|
|
89
|
-
success: httpStatus >= 200 && httpStatus < 300,
|
|
90
|
-
status_code: httpStatus,
|
|
91
|
-
response_body: responseBody,
|
|
92
|
-
headers: headers,
|
|
93
|
-
error_message: response.getErrorMessage() || null
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
JSON.stringify(result);
|
|
97
|
-
} catch(e) {
|
|
98
|
-
JSON.stringify({
|
|
99
|
-
success: false,
|
|
100
|
-
error_message: e.toString()
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
`;
|
|
104
|
-
// Execute test script
|
|
105
|
-
const scriptResponse = await client.post('/api/now/table/sys_script_execution', {
|
|
106
|
-
script: testScript
|
|
107
|
-
});
|
|
108
|
-
let testResult;
|
|
109
|
-
try {
|
|
110
|
-
const resultData = scriptResponse.data.result || scriptResponse.data;
|
|
111
|
-
testResult = JSON.parse(typeof resultData === 'string' ? resultData : JSON.stringify(resultData));
|
|
112
|
-
}
|
|
113
|
-
catch (parseError) {
|
|
114
|
-
testResult = {
|
|
115
|
-
success: false,
|
|
116
|
-
error_message: 'Failed to parse test results'
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
120
|
-
rest_message: rest_message,
|
|
121
|
-
method: method || 'default',
|
|
122
|
-
test_successful: testResult.success,
|
|
123
|
-
status_code: testResult.status_code,
|
|
124
|
-
response_body: return_full_response ? testResult.response_body : '[Response body hidden]',
|
|
125
|
-
headers: testResult.headers || {},
|
|
126
|
-
error_message: testResult.error_message,
|
|
127
|
-
endpoint: restMessage.endpoint,
|
|
128
|
-
authentication_type: restMessage.authentication_type
|
|
129
|
-
}, {
|
|
130
|
-
operation: 'test_rest_connection',
|
|
131
|
-
rest_message_name: rest_message
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
return (0, error_handler_js_1.createErrorResult)(error instanceof error_handler_js_1.SnowFlowError
|
|
136
|
-
? error
|
|
137
|
-
: new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.UNKNOWN_ERROR, error.message, { originalError: error }));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
exports.version = '1.0.0';
|
|
141
|
-
exports.author = 'Snow-Flow SDK Migration';
|
|
142
|
-
//# sourceMappingURL=snow_test_rest_connection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_test_rest_connection.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAkDH,0BA8GC;AA7JD,kDAA8D;AAC9D,oEAAiH;AAEpG,QAAA,cAAc,GAAsB;IAC/C,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,yEAAyE;IACtF,gDAAgD;IAChD,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC;IAC/C,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,QAAQ;IAEnB,yBAAyB;IACzB,mEAAmE;IACnE,UAAU,EAAE,MAAM;IAClB,YAAY,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC;IACnD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;aACjC;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kBAAkB;aAChC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,oBAAoB,EAAE;gBACpB,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,kCAAkC;gBAC/C,OAAO,EAAE,IAAI;aACd;YACD,aAAa,EAAE;gBACb,IAAI,EAA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ACjC,iBAAiB,EAAE,YAAY;SAChC,CAAC,CAAC;IAEL,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,IAAA,oCAAiB,EACtB,KAAK,YAAY,gCAAa;YAC5B,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,gCAAa,CAAC,4BAAS,CAAC,aAAa,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CACxF,CAAC;IACJ,CAAC;AACH,CAAC;AAEY,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,MAAM,GAAG,yBAAyB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* snow_create_rest_method
|
|
3
|
-
*/
|
|
4
|
-
import { MCPToolDefinition, ServiceNowContext, ToolResult } from '../../shared/types.js';
|
|
5
|
-
export declare const toolDefinition: MCPToolDefinition;
|
|
6
|
-
export declare function execute(args: any, context: ServiceNowContext): Promise<ToolResult>;
|
|
7
|
-
export declare const version = "1.0.0";
|
|
8
|
-
export declare const author = "Snow-Flow SDK Migration";
|
|
9
|
-
//# sourceMappingURL=snow_create_rest_method.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_create_rest_method.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBAyB5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAgBxF;AAED,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* snow_create_rest_method
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.author = exports.version = exports.toolDefinition = void 0;
|
|
7
|
-
exports.execute = execute;
|
|
8
|
-
const auth_js_1 = require("../../shared/auth.js");
|
|
9
|
-
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
10
|
-
exports.toolDefinition = {
|
|
11
|
-
name: 'snow_create_rest_method',
|
|
12
|
-
description: 'Create REST method for REST message',
|
|
13
|
-
// Metadata for tool discovery (not sent to LLM)
|
|
14
|
-
category: 'integration',
|
|
15
|
-
subcategory: 'rest-api',
|
|
16
|
-
use_cases: ['rest-integration', 'api', 'http-methods'],
|
|
17
|
-
complexity: 'intermediate',
|
|
18
|
-
frequency: 'medium',
|
|
19
|
-
// Permission enforcement
|
|
20
|
-
// Classification: WRITE - Create operation - modifies data
|
|
21
|
-
permission: 'write',
|
|
22
|
-
allowedRoles: ['developer', 'admin'],
|
|
23
|
-
inputSchema: {
|
|
24
|
-
type: 'object',
|
|
25
|
-
properties: {
|
|
26
|
-
rest_message_sys_id: { type: 'string', description: 'REST message sys_id' },
|
|
27
|
-
name: { type: 'string', description: 'Method name' },
|
|
28
|
-
http_method: { type: 'string', enum: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], default: 'GET' },
|
|
29
|
-
endpoint: { type: 'string', description: 'Endpoint path' },
|
|
30
|
-
content: { type: 'string', description: 'Request body template' }
|
|
31
|
-
},
|
|
32
|
-
required: ['rest_message_sys_id', 'name']
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
async function execute(args, context) {
|
|
36
|
-
const { rest_message_sys_id, name, http_method = 'GET', endpoint, content } = args;
|
|
37
|
-
try {
|
|
38
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
39
|
-
const methodData = {
|
|
40
|
-
rest_message: rest_message_sys_id,
|
|
41
|
-
name,
|
|
42
|
-
http_method
|
|
43
|
-
};
|
|
44
|
-
if (endpoint)
|
|
45
|
-
methodData.endpoint = endpoint;
|
|
46
|
-
if (content)
|
|
47
|
-
methodData.content = content;
|
|
48
|
-
const response = await client.post('/api/now/table/sys_rest_message_fn', methodData);
|
|
49
|
-
return (0, error_handler_js_1.createSuccessResult)({ created: true, rest_method: response.data.result });
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
return (0, error_handler_js_1.createErrorResult)(error.message);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.version = '1.0.0';
|
|
56
|
-
exports.author = 'Snow-Flow SDK Migration';
|
|
57
|
-
//# sourceMappingURL=snow_create_rest_method.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_create_rest_method.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAiCH,0BAgBC;AA9CD,kDAA8D;AAC9D,oEAAuF;AAE1E,QAAA,cAAc,GAAsB;IAC/C,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,qCAAqC;IAClD,gDAAgD;IAChD,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,UAAU;IACvB,SAAS,EAAE,CAAC,kBAAkB,EAAE,KAAK,EAAE,cAAc,CAAC;IACtD,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,QAAQ;IAEnB,yBAAyB;IACzB,2DAA2D;IAC3D,UAAU,EAAE,OAAO;IACnB,YAAY,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;IACpC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;YAC3E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aA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AClB,QAAA,MAAM,GAAG,yBAAyB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* snow_test_rest_message
|
|
3
|
-
*/
|
|
4
|
-
import { MCPToolDefinition, ServiceNowContext, ToolResult } from '../../shared/types.js';
|
|
5
|
-
export declare const toolDefinition: MCPToolDefinition;
|
|
6
|
-
export declare function execute(args: any, context: ServiceNowContext): Promise<ToolResult>;
|
|
7
|
-
export declare const version = "1.0.0";
|
|
8
|
-
export declare const author = "Snow-Flow SDK Migration";
|
|
9
|
-
//# sourceMappingURL=snow_test_rest_message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_test_rest_message.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBAuB5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAqBxF;AAED,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* snow_test_rest_message
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.author = exports.version = exports.toolDefinition = void 0;
|
|
7
|
-
exports.execute = execute;
|
|
8
|
-
const auth_js_1 = require("../../shared/auth.js");
|
|
9
|
-
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
10
|
-
exports.toolDefinition = {
|
|
11
|
-
name: 'snow_test_rest_message',
|
|
12
|
-
description: 'Test REST message method',
|
|
13
|
-
// Metadata for tool discovery (not sent to LLM)
|
|
14
|
-
category: 'integration',
|
|
15
|
-
subcategory: 'rest-api',
|
|
16
|
-
use_cases: ['rest-testing', 'integration-testing', 'api'],
|
|
17
|
-
complexity: 'beginner',
|
|
18
|
-
frequency: 'high',
|
|
19
|
-
// Permission enforcement
|
|
20
|
-
// Classification: READ - Read-only operation based on name pattern
|
|
21
|
-
permission: 'read',
|
|
22
|
-
allowedRoles: ['developer', 'stakeholder', 'admin'],
|
|
23
|
-
inputSchema: {
|
|
24
|
-
type: 'object',
|
|
25
|
-
properties: {
|
|
26
|
-
rest_message_name: { type: 'string', description: 'REST message name' },
|
|
27
|
-
method_name: { type: 'string', description: 'Method name' },
|
|
28
|
-
parameters: { type: 'object', description: 'Request parameters' }
|
|
29
|
-
},
|
|
30
|
-
required: ['rest_message_name', 'method_name']
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
async function execute(args, context) {
|
|
34
|
-
const { rest_message_name, method_name, parameters = {} } = args;
|
|
35
|
-
try {
|
|
36
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
37
|
-
const testScript = `
|
|
38
|
-
var rm = new sn_ws.RESTMessageV2('${rest_message_name}', '${method_name}');
|
|
39
|
-
${Object.entries(parameters).map(([key, value]) => `rm.setStringParameter('${key}', '${value}');`).join('\n')}
|
|
40
|
-
var response = rm.execute();
|
|
41
|
-
var statusCode = response.getStatusCode();
|
|
42
|
-
var body = response.getBody();
|
|
43
|
-
gs.info('Status: ' + statusCode + ', Body: ' + body);
|
|
44
|
-
`;
|
|
45
|
-
const response = await client.post('/api/now/table/sys_script_execution', { script: testScript });
|
|
46
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
47
|
-
tested: true,
|
|
48
|
-
rest_message: rest_message_name,
|
|
49
|
-
method: method_name
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
return (0, error_handler_js_1.createErrorResult)(error.message);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.version = '1.0.0';
|
|
57
|
-
exports.author = 'Snow-Flow SDK Migration';
|
|
58
|
-
//# sourceMappingURL=snow_test_rest_message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_test_rest_message.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA+BH,0BAqBC;AAjDD,kDAA8D;AAC9D,oEAAuF;AAE1E,QAAA,cAAc,GAAsB;IAC/C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,0BAA0B;IACvC,gDAAgD;IAChD,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,UAAU;IACvB,SAAS,EAAE,CAAC,cAAc,EAAE,qBAAqB,EAAE,KAAK,CAAC;IACzD,UAAU,EAAE,UAAU;IACtB,SAAS,EAAE,MAAM;IAEjB,yBAAyB;IACzB,mEAAmE;IACnE,UAAU,EAAE,MAAM;IAClB,YAAY,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC;IACnD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;YACvE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE;YAC3D,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;SAClE;QACD,QAAQ,EAAE,CAAC,mBAAmB,EAAE,aAAa,CAAC;KAC/C;CACF,CAAC;AAEK,KAAK,UAAU,OAAO,CAAC,IAAS,EAAE,OAA0B;IACjE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;IACjE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAsB,EAAC,OAAO,CAAC,CAAC;QACrD,MAAM,UAAU,GAAG;oCACa,iBAAiB,OAAO,WAAW;EACrE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,0BAA0B,GAAG,OAAO,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;KAKxG,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,qCAAqC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QAClG,OAAO,IAAA,sCAAmB,EAAC;YACzB,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,iBAAiB;YAC/B,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,IAAA,oCAAiB,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAEY,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,MAAM,GAAG,yBAAyB,CAAC"}
|
package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* snow_execute_scheduled_job
|
|
3
|
-
*/
|
|
4
|
-
import { MCPToolDefinition, ServiceNowContext, ToolResult } from '../../shared/types.js';
|
|
5
|
-
export declare const toolDefinition: MCPToolDefinition;
|
|
6
|
-
export declare function execute(args: any, context: ServiceNowContext): Promise<ToolResult>;
|
|
7
|
-
export declare const version = "1.0.0";
|
|
8
|
-
export declare const author = "Snow-Flow SDK Migration";
|
|
9
|
-
//# sourceMappingURL=snow_execute_scheduled_job.d.ts.map
|
package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_execute_scheduled_job.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBAqB5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAwBxF;AAED,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* snow_execute_scheduled_job
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.author = exports.version = exports.toolDefinition = void 0;
|
|
7
|
-
exports.execute = execute;
|
|
8
|
-
const auth_js_1 = require("../../shared/auth.js");
|
|
9
|
-
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
10
|
-
exports.toolDefinition = {
|
|
11
|
-
name: 'snow_execute_scheduled_job',
|
|
12
|
-
description: 'Execute scheduled job immediately',
|
|
13
|
-
// Metadata for tool discovery (not sent to LLM)
|
|
14
|
-
category: 'automation',
|
|
15
|
-
subcategory: 'scheduling',
|
|
16
|
-
use_cases: ['job-execution', 'testing', 'manual-trigger'],
|
|
17
|
-
complexity: 'intermediate',
|
|
18
|
-
frequency: 'medium',
|
|
19
|
-
// Permission enforcement
|
|
20
|
-
// Classification: WRITE - Execution operation - can have side effects
|
|
21
|
-
permission: 'write',
|
|
22
|
-
allowedRoles: ['developer', 'admin'],
|
|
23
|
-
inputSchema: {
|
|
24
|
-
type: 'object',
|
|
25
|
-
properties: {
|
|
26
|
-
job_sys_id: { type: 'string', description: 'Scheduled job sys_id' }
|
|
27
|
-
},
|
|
28
|
-
required: ['job_sys_id']
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
async function execute(args, context) {
|
|
32
|
-
const { job_sys_id } = args;
|
|
33
|
-
try {
|
|
34
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
35
|
-
const executeScript = `
|
|
36
|
-
var job = new GlideRecord('sysauto_script');
|
|
37
|
-
if (job.get('${job_sys_id}')) {
|
|
38
|
-
var worker = new GlideScriptedHierarchicalWorker();
|
|
39
|
-
worker.setProgressName('Scheduled Job: ' + job.name);
|
|
40
|
-
worker.setScriptIncludeName('ScheduledScriptExecution');
|
|
41
|
-
worker.putMethodArg('sys_id', '${job_sys_id}');
|
|
42
|
-
worker.setBackground(true);
|
|
43
|
-
worker.start();
|
|
44
|
-
gs.info('Job executed: ' + job.name);
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
47
|
-
await client.post('/api/now/table/sys_script_execution', { script: executeScript });
|
|
48
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
49
|
-
executed: true,
|
|
50
|
-
job: job_sys_id
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
return (0, error_handler_js_1.createErrorResult)(error.message);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.version = '1.0.0';
|
|
58
|
-
exports.author = 'Snow-Flow SDK Migration';
|
|
59
|
-
//# sourceMappingURL=snow_execute_scheduled_job.js.map
|
package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_execute_scheduled_job.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA6BH,0B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CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* snow_execute_workflow
|
|
3
|
-
*/
|
|
4
|
-
import { MCPToolDefinition, ServiceNowContext, ToolResult } from '../../shared/types.js';
|
|
5
|
-
export declare const toolDefinition: MCPToolDefinition;
|
|
6
|
-
export declare function execute(args: any, context: ServiceNowContext): Promise<ToolResult>;
|
|
7
|
-
export declare const version = "1.0.0";
|
|
8
|
-
export declare const author = "Snow-Flow SDK Migration";
|
|
9
|
-
//# sourceMappingURL=snow_execute_workflow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_execute_workflow.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBAsB5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBxF;AAED,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* snow_execute_workflow
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.author = exports.version = exports.toolDefinition = void 0;
|
|
7
|
-
exports.execute = execute;
|
|
8
|
-
const auth_js_1 = require("../../shared/auth.js");
|
|
9
|
-
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
10
|
-
exports.toolDefinition = {
|
|
11
|
-
name: 'snow_execute_workflow',
|
|
12
|
-
description: 'Execute workflow on record',
|
|
13
|
-
// Metadata for tool discovery (not sent to LLM)
|
|
14
|
-
category: 'automation',
|
|
15
|
-
subcategory: 'workflow',
|
|
16
|
-
use_cases: ['workflow', 'workflow-execution', 'automation'],
|
|
17
|
-
complexity: 'beginner',
|
|
18
|
-
frequency: 'high',
|
|
19
|
-
// Permission enforcement
|
|
20
|
-
// Classification: WRITE - Execution operation - can have side effects
|
|
21
|
-
permission: 'write',
|
|
22
|
-
allowedRoles: ['developer', 'admin'],
|
|
23
|
-
inputSchema: {
|
|
24
|
-
type: 'object',
|
|
25
|
-
properties: {
|
|
26
|
-
workflow_sys_id: { type: 'string', description: 'Workflow sys_id' },
|
|
27
|
-
record_sys_id: { type: 'string', description: 'Record to process' }
|
|
28
|
-
},
|
|
29
|
-
required: ['workflow_sys_id', 'record_sys_id']
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
async function execute(args, context) {
|
|
33
|
-
const { workflow_sys_id, record_sys_id } = args;
|
|
34
|
-
try {
|
|
35
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
36
|
-
const executeScript = `
|
|
37
|
-
var workflow = new Workflow();
|
|
38
|
-
workflow.startFlow('${workflow_sys_id}', null, 'insert', {'sys_id': '${record_sys_id}'});
|
|
39
|
-
`;
|
|
40
|
-
const response = await client.post('/api/now/table/sys_script_execution', {
|
|
41
|
-
script: executeScript
|
|
42
|
-
});
|
|
43
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
44
|
-
executed: true,
|
|
45
|
-
workflow: workflow_sys_id,
|
|
46
|
-
record: record_sys_id
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
return (0, error_handler_js_1.createErrorResult)(error.message);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.version = '1.0.0';
|
|
54
|
-
exports.author = 'Snow-Flow SDK Migration';
|
|
55
|
-
//# sourceMappingURL=snow_execute_workflow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snow_exec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