snow-flow 10.0.35 → 10.0.36
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/package.json
CHANGED
|
@@ -3182,7 +3182,19 @@ export const toolDefinition: MCPToolDefinition = {
|
|
|
3182
3182
|
},
|
|
3183
3183
|
table: {
|
|
3184
3184
|
type: 'string',
|
|
3185
|
-
description: 'Table for record-based triggers (e.g. "incident") or list filter'
|
|
3185
|
+
description: 'Table for record-based triggers (e.g. "incident") or list filter. Also accepted as "trigger_table".'
|
|
3186
|
+
},
|
|
3187
|
+
trigger_table: {
|
|
3188
|
+
type: 'string',
|
|
3189
|
+
description: 'Alias for "table" — table for record-based triggers (e.g. "incident")'
|
|
3190
|
+
},
|
|
3191
|
+
action_table: {
|
|
3192
|
+
type: 'string',
|
|
3193
|
+
description: 'Shorthand for setting the table input on an action (e.g. "incident" for create_record/update_record/lookup_record). Injected as the "table" input.'
|
|
3194
|
+
},
|
|
3195
|
+
action_field_values: {
|
|
3196
|
+
type: 'object',
|
|
3197
|
+
description: 'Alias for "action_inputs" — key-value pairs for action inputs. Same behavior as action_inputs.'
|
|
3186
3198
|
},
|
|
3187
3199
|
trigger_condition: {
|
|
3188
3200
|
type: 'string',
|
|
@@ -3370,7 +3382,7 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
3370
3382
|
var isSubflow = action === 'create_subflow';
|
|
3371
3383
|
var flowDescription = args.description || flowName;
|
|
3372
3384
|
var triggerType = isSubflow ? 'manual' : (args.trigger_type || 'manual');
|
|
3373
|
-
var flowTable = args.table || '';
|
|
3385
|
+
var flowTable = args.table || args.trigger_table || '';
|
|
3374
3386
|
var triggerCondition = args.trigger_condition || '';
|
|
3375
3387
|
var flowCategory = args.category || 'custom';
|
|
3376
3388
|
var flowRunAs = isSubflow ? 'user_who_calls' : (args.run_as || 'user');
|
|
@@ -4128,7 +4140,7 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
4128
4140
|
}
|
|
4129
4141
|
var addTrigFlowId = await resolveFlowId(client, args.flow_id);
|
|
4130
4142
|
var addTrigType = args.trigger_type || 'record_create_or_update';
|
|
4131
|
-
var addTrigTable = args.table || '';
|
|
4143
|
+
var addTrigTable = args.table || args.trigger_table || '';
|
|
4132
4144
|
var addTrigCondition = args.trigger_condition || '';
|
|
4133
4145
|
|
|
4134
4146
|
var addTrigResult = await addTriggerViaGraphQL(client, addTrigFlowId, addTrigType, addTrigTable, addTrigCondition);
|
|
@@ -4159,7 +4171,7 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
4159
4171
|
}
|
|
4160
4172
|
var updTrigFlowId = await resolveFlowId(client, args.flow_id);
|
|
4161
4173
|
var updTrigType = args.trigger_type || 'record_create_or_update';
|
|
4162
|
-
var updTrigTable = args.table || '';
|
|
4174
|
+
var updTrigTable = args.table || args.trigger_table || '';
|
|
4163
4175
|
var updTrigCondition = args.trigger_condition || '';
|
|
4164
4176
|
var updTrigSteps: any = {};
|
|
4165
4177
|
|
|
@@ -4223,7 +4235,11 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
4223
4235
|
var addActFlowId = await resolveFlowId(client, args.flow_id);
|
|
4224
4236
|
var addActType = args.action_type || 'log';
|
|
4225
4237
|
var addActName = args.action_name || args.name || addActType;
|
|
4226
|
-
var addActInputs = args.action_inputs || args.action_config || args.inputs || args.config || {};
|
|
4238
|
+
var addActInputs = args.action_inputs || args.action_config || args.action_field_values || args.field_values || args.inputs || args.config || {};
|
|
4239
|
+
// Accept action_table as a shorthand — inject into inputs as table/table_name
|
|
4240
|
+
if (args.action_table && !addActInputs.table && !addActInputs.table_name) {
|
|
4241
|
+
addActInputs = { ...addActInputs, table: args.action_table };
|
|
4242
|
+
}
|
|
4227
4243
|
|
|
4228
4244
|
var addActResult = await addActionViaGraphQL(client, addActFlowId, addActType, addActName, addActInputs, args.parent_ui_id, args.order, args.spoke);
|
|
4229
4245
|
|
|
@@ -4286,8 +4302,16 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
4286
4302
|
addLogicSummary.error('Failed to add flow logic: ' + (addLogicResult.error || 'unknown'));
|
|
4287
4303
|
}
|
|
4288
4304
|
|
|
4305
|
+
// For IF/ELSEIF: add a hint about saving uiUniqueIdentifier for ELSE/ELSEIF connected_to
|
|
4306
|
+
var logicUpperType = addLogicType.toUpperCase().replace(/[^A-Z]/g, '');
|
|
4307
|
+
var logicHints: any = { reminder: 'Call close_flow when all steps are added.' };
|
|
4308
|
+
if (logicUpperType === 'IF' || logicUpperType === 'ELSEIF') {
|
|
4309
|
+
logicHints.important = 'Save the uiUniqueIdentifier ("' + (addLogicResult.uiUniqueIdentifier || '') + '") — you MUST pass it as connected_to when adding ELSE or ELSEIF blocks for this IF.';
|
|
4310
|
+
logicHints.connected_to_value = addLogicResult.uiUniqueIdentifier || '';
|
|
4311
|
+
}
|
|
4312
|
+
|
|
4289
4313
|
return addLogicResult.success
|
|
4290
|
-
? createSuccessResult({ action: 'add_flow_logic', ...addLogicResult,
|
|
4314
|
+
? createSuccessResult({ action: 'add_flow_logic', ...addLogicResult, ...logicHints }, {}, addLogicSummary.build())
|
|
4291
4315
|
: createErrorResult(addLogicResult.error || 'Failed to add flow logic');
|
|
4292
4316
|
}
|
|
4293
4317
|
|
|
@@ -4303,7 +4327,7 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
4303
4327
|
}
|
|
4304
4328
|
var addSubFlowId = await resolveFlowId(client, args.flow_id);
|
|
4305
4329
|
var addSubSubflowId = args.subflow_id;
|
|
4306
|
-
var addSubInputs = args.action_inputs || args.action_config || args.inputs || args.config || {};
|
|
4330
|
+
var addSubInputs = args.action_inputs || args.action_config || args.action_field_values || args.field_values || args.inputs || args.config || {};
|
|
4307
4331
|
var addSubOrder = args.order;
|
|
4308
4332
|
var addSubParentUiId = args.parent_ui_id || '';
|
|
4309
4333
|
|
|
@@ -4335,7 +4359,11 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
4335
4359
|
if (!args.element_id) throw new SnowFlowError(ErrorType.VALIDATION_ERROR, 'element_id is required (sys_id or uiUniqueIdentifier of the element)');
|
|
4336
4360
|
var updElemFlowId = await resolveFlowId(client, args.flow_id);
|
|
4337
4361
|
var updElemType = action === 'update_action' ? 'action' : action === 'update_flow_logic' ? 'flowlogic' : 'subflow';
|
|
4338
|
-
var updElemInputs = args.action_inputs || args.action_config || args.logic_inputs || args.inputs || args.config || {};
|
|
4362
|
+
var updElemInputs = args.action_inputs || args.action_config || args.action_field_values || args.field_values || args.logic_inputs || args.inputs || args.config || {};
|
|
4363
|
+
// Accept action_table as a shorthand — inject into inputs as table/table_name
|
|
4364
|
+
if (args.action_table && !updElemInputs.table && !updElemInputs.table_name) {
|
|
4365
|
+
updElemInputs = { ...updElemInputs, table: args.action_table };
|
|
4366
|
+
}
|
|
4339
4367
|
|
|
4340
4368
|
var updElemResult = await updateElementViaGraphQL(client, updElemFlowId, updElemType, args.element_id, updElemInputs);
|
|
4341
4369
|
|