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
|
@@ -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
|
-
|
|
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
|
-
|
|
85
|
-
mandatory: isMandatory,
|
|
86
|
-
order,
|
|
87
|
-
valueSysId: '',
|
|
88
|
-
field_name: name,
|
|
88
|
+
name,
|
|
89
89
|
type,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
|