n8n-nodes-ilovevideoeditor 0.1.2 → 0.1.3

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.
@@ -277,12 +277,15 @@ class IloveVideoEditor {
277
277
  async getTemplates() {
278
278
  const credentials = await this.getCredentials('iloveVideoEditorApi');
279
279
  const baseUrl = String(credentials.baseUrl || 'https://api.ilovevideoeditor.com').replace(/\/+$/, '');
280
- const templates = (await this.helpers.httpRequestWithAuthentication.call(this, 'iloveVideoEditorApi', {
280
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'iloveVideoEditorApi', {
281
281
  method: 'GET',
282
282
  baseURL: baseUrl,
283
283
  url: '/v1/templates',
284
284
  json: true,
285
- }));
285
+ });
286
+ const templates = Array.isArray(response)
287
+ ? response
288
+ : (response.templates ?? []);
286
289
  return templates.map((template) => ({
287
290
  name: template.name,
288
291
  value: template.id,
@@ -112,12 +112,16 @@ class IloveVideoEditorTrigger {
112
112
  }
113
113
  const credentials = await this.getCredentials('iloveVideoEditorApi');
114
114
  const baseUrl = String(credentials.baseUrl || 'https://api.ilovevideoeditor.com').replace(/\/+$/, '');
115
- const subscriptions = (await this.helpers.httpRequestWithAuthentication.call(this, 'iloveVideoEditorApi', {
115
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'iloveVideoEditorApi', {
116
116
  method: 'GET',
117
117
  baseURL: baseUrl,
118
118
  url: '/v1/webhooks',
119
119
  json: true,
120
- }));
120
+ });
121
+ const subscriptions = Array.isArray(response)
122
+ ? response
123
+ : (response
124
+ .subscriptions ?? []);
121
125
  return subscriptions.some((subscription) => subscription.url === webhookUrl);
122
126
  },
123
127
  async create() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-ilovevideoeditor",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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",