snow-flow-test 10.0.1-test.142 → 10.0.1-test.143

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "10.0.1-test.142",
3
+ "version": "10.0.1-test.143",
4
4
  "name": "snow-flow-test",
5
5
  "description": "Snow-Flow Test - ServiceNow Multi-Agent Development Framework",
6
6
  "license": "Elastic-2.0",
@@ -71,57 +71,61 @@ async function lookupDefinitionParams(client: any, defSysId: string): Promise<an
71
71
  return [];
72
72
  }
73
73
 
74
- function buildGraphQLInput(p: any, defaultValue?: any): any {
74
+ function buildGraphQLInput(p: any, defaultValue?: any, forTrigger?: boolean): any {
75
75
  const name = p.name || p.element || '';
76
76
  const type = p.internal_type || p.type || 'string';
77
77
  const isMandatory = p.mandatory === 'true' || p.mandatory === true;
78
78
  const order = parseInt(p.order) || 100;
79
79
  const defVal = defaultValue !== undefined ? defaultValue : (p.default_value || '');
80
- return {
80
+ const valueObj = type === 'conditions'
81
+ ? { schemaless: false, schemalessValue: '', value: '^EQ' }
82
+ : defVal
83
+ ? { schemaless: false, schemalessValue: '', value: String(defVal) }
84
+ : { value: '' };
85
+ const parameter: any = {
81
86
  id: p.sys_id || '',
82
- name,
83
87
  label: p.label || name,
84
- internalType: type,
85
- mandatory: isMandatory,
86
- order,
87
- valueSysId: '',
88
- field_name: name,
88
+ name,
89
89
  type,
90
- children: [],
91
- displayValue: { value: '' },
92
- value: type === 'conditions'
93
- ? { schemaless: false, schemalessValue: '', value: '^EQ' }
94
- : defVal
95
- ? { schemaless: false, schemalessValue: '', value: String(defVal) }
96
- : { value: '' },
97
- parameter: {
98
- id: p.sys_id || '',
99
- label: p.label || name,
100
- name,
101
- type,
102
- type_label: p.type_label || '',
103
- order,
104
- extended: false,
105
- mandatory: isMandatory,
106
- readonly: p.readonly === 'true' || p.readonly === true,
107
- maxsize: parseInt(p.maxsize) || 80,
108
- data_structure: p.data_structure || '',
109
- reference: p.reference || '',
110
- reference_display: p.reference_display || '',
111
- ref_qual: p.ref_qual || '',
112
- choiceOption: p.choice_option || '',
113
- table: '',
114
- columnName: p.column_name || '',
115
- defaultValue: p.default_value || '',
116
- use_dependent: p.use_dependent === 'true' || p.use_dependent === true,
117
- dependent_on: p.dependent_on || '',
118
- internal_link: p.internal_link || '',
119
- show_ref_finder: false,
120
- local: false,
121
- attributes: p.attributes || '',
122
- sys_class_name: p.sys_class_name || '',
123
- children: []
124
- }
90
+ type_label: p.type_label || '',
91
+ hint: '',
92
+ order,
93
+ extended: false,
94
+ mandatory: isMandatory,
95
+ readonly: p.readonly === 'true' || p.readonly === true,
96
+ maxsize: parseInt(p.maxsize) || 80,
97
+ data_structure: p.data_structure || '',
98
+ reference: p.reference || '',
99
+ reference_display: p.reference_display || '',
100
+ ref_qual: p.ref_qual || '',
101
+ choiceOption: p.choice_option || '',
102
+ table: '',
103
+ columnName: p.column_name || '',
104
+ defaultValue: p.default_value || '',
105
+ use_dependent: p.use_dependent === 'true' || p.use_dependent === true,
106
+ dependent_on: p.dependent_on || '',
107
+ show_ref_finder: false,
108
+ local: false,
109
+ attributes: p.attributes || '',
110
+ sys_class_name: p.sys_class_name || '',
111
+ children: []
112
+ };
113
+ if (!forTrigger) {
114
+ parameter.dynamic = null;
115
+ } else {
116
+ parameter.internal_link = p.internal_link || '';
117
+ }
118
+
119
+ if (forTrigger) {
120
+ return {
121
+ name, label: p.label || name, internalType: type, mandatory: isMandatory,
122
+ order, valueSysId: '', field_name: name, type,
123
+ children: [], displayValue: { value: '' }, value: valueObj, parameter
124
+ };
125
+ }
126
+ return {
127
+ id: p.sys_id || '', name,
128
+ children: [], displayValue: { value: '' }, value: valueObj, parameter
125
129
  };
126
130
  }
127
131
 
@@ -176,12 +180,12 @@ async function addTriggerViaGraphQL(
176
180
  const params = await lookupDefinitionParams(client, trigDefId);
177
181
  steps.params_found = params.length;
178
182
 
179
- const gqlInputs = params.map((p: any) => buildGraphQLInput(p));
183
+ const gqlInputs = params.map((p: any) => buildGraphQLInput(p, undefined, true));
180
184
 
181
185
  if (gqlInputs.length === 0 && config.triggerType === 'Record') {
182
186
  gqlInputs.push(
183
- buildGraphQLInput({ name: 'table', label: 'Table', internal_type: 'table_name', mandatory: 'true', order: '1' }),
184
- buildGraphQLInput({ name: 'condition', label: 'Condition', internal_type: 'conditions', mandatory: 'false', order: '100', use_dependent: 'true', dependent_on: 'table' })
187
+ buildGraphQLInput({ name: 'table', label: 'Table', internal_type: 'table_name', mandatory: 'true', order: '1' }, undefined, true),
188
+ buildGraphQLInput({ name: 'condition', label: 'Condition', internal_type: 'conditions', mandatory: 'false', order: '100', use_dependent: 'true', dependent_on: 'table' }, undefined, true)
185
189
  );
186
190
  }
187
191