n8n-nodes-elearning-magic 0.1.16 → 0.1.18
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.
|
@@ -103,30 +103,38 @@ class ElearningMagicTrigger extends n8n_workflow_1.Node {
|
|
|
103
103
|
const prepareOutput = (0, utils_1.setupOutputConnection)(this, requestMethod, {
|
|
104
104
|
jwtPayload: validationData,
|
|
105
105
|
});
|
|
106
|
+
let result;
|
|
106
107
|
if (options.binaryData) {
|
|
107
|
-
|
|
108
|
+
result = await handleBinaryData(this, prepareOutput);
|
|
108
109
|
}
|
|
109
|
-
if (req.contentType === 'multipart/form-data') {
|
|
110
|
-
|
|
110
|
+
else if (req.contentType === 'multipart/form-data') {
|
|
111
|
+
result = await (0, utils_1.handleFormData)(this, prepareOutput);
|
|
111
112
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
else {
|
|
114
|
+
if (nodeVersion > 1 && !req.body) {
|
|
115
|
+
try {
|
|
116
|
+
result = await handleBinaryData(this, prepareOutput);
|
|
117
|
+
}
|
|
118
|
+
catch (error) { }
|
|
119
|
+
}
|
|
120
|
+
if (!result) {
|
|
121
|
+
const response = {
|
|
122
|
+
json: {
|
|
123
|
+
headers: req.headers,
|
|
124
|
+
params: req.params,
|
|
125
|
+
query: req.query,
|
|
126
|
+
body: req.body,
|
|
127
|
+
},
|
|
128
|
+
binary: undefined,
|
|
129
|
+
};
|
|
130
|
+
result = { workflowData: prepareOutput(response) };
|
|
115
131
|
}
|
|
116
|
-
catch (error) { }
|
|
117
132
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
headers: req.headers,
|
|
121
|
-
params: req.params,
|
|
122
|
-
query: req.query,
|
|
123
|
-
body: req.body,
|
|
124
|
-
},
|
|
125
|
-
binary: undefined,
|
|
126
|
-
};
|
|
133
|
+
resp.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
|
|
134
|
+
resp.end('OK');
|
|
127
135
|
return {
|
|
128
|
-
|
|
129
|
-
workflowData:
|
|
136
|
+
noWebhookResponse: true,
|
|
137
|
+
workflowData: result.workflowData,
|
|
130
138
|
};
|
|
131
139
|
}
|
|
132
140
|
}
|