n8n-nodes-ilovevideoeditor 0.1.3 → 0.1.4
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.
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IloveVideoEditor = void 0;
|
|
4
|
+
// n8n's `json` parameter type can hand us the raw string instead of a parsed
|
|
5
|
+
// object — normalize before sending so the API always receives an object.
|
|
6
|
+
const parseJsonParam = (value) => {
|
|
7
|
+
if (typeof value === 'string') {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(value || '{}');
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return (value ?? {});
|
|
16
|
+
};
|
|
4
17
|
class IloveVideoEditor {
|
|
5
18
|
description = {
|
|
6
19
|
displayName: 'iLoveVideoEditor',
|
|
@@ -70,7 +83,7 @@ class IloveVideoEditor {
|
|
|
70
83
|
send: {
|
|
71
84
|
preSend: [
|
|
72
85
|
async function (requestOptions) {
|
|
73
|
-
const videoJSON = this.getNodeParameter('videoJSON');
|
|
86
|
+
const videoJSON = parseJsonParam(this.getNodeParameter('videoJSON'));
|
|
74
87
|
const webhookUrl = this.getNodeParameter('webhookUrl', '');
|
|
75
88
|
const body = { videoJSON };
|
|
76
89
|
if (webhookUrl) {
|
|
@@ -96,7 +109,7 @@ class IloveVideoEditor {
|
|
|
96
109
|
send: {
|
|
97
110
|
preSend: [
|
|
98
111
|
async function (requestOptions) {
|
|
99
|
-
const variables = this.getNodeParameter('variables', {});
|
|
112
|
+
const variables = parseJsonParam(this.getNodeParameter('variables', {}));
|
|
100
113
|
const webhookUrl = this.getNodeParameter('webhookUrl', '');
|
|
101
114
|
const body = { variables };
|
|
102
115
|
if (webhookUrl) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-ilovevideoeditor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "n8n community nodes for the iLoveVideoEditor API — generate videos from templates or VideoJSON and receive render webhooks",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://ilovevideoeditor.com",
|