n8n-nodes-sudomock 0.13.0 → 0.14.0

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/README.md CHANGED
@@ -15,6 +15,7 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
15
15
  - **PSD Mockup: Upload**: Upload PSD templates from a URL
16
16
  - **PSD Mockup: List**: List all your uploaded PSD mockup templates with filtering and pagination
17
17
  - **PSD Mockup: Get**: Get detailed information about a specific PSD mockup template
18
+ - **PSD Mockup: Get Layers**: List every layer of a PSD mockup, including the layers inside its smart objects, with the UUIDs **Hidden Layers** takes
18
19
  - **PSD Mockup: Update**: Update the name of a PSD mockup template
19
20
  - **PSD Mockup: Delete**: Delete a specific PSD mockup template
20
21
 
@@ -31,7 +32,7 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
31
32
 
32
33
  - **PSD Mockup: Render**: Generate mockups with artwork, personalized text, or both. Text overrides support styled segments, fonts, size, color, stroke color, and overflow, shrink, or clip fitting. Optionally run asynchronously with the **Run Asynchronously** toggle, which returns a `job_id` to track with **Get Job**.
33
34
  - **Render Video**: Turn a mockup (or an existing image URL) into a short product video (always asynchronous). Choose a supported duration, optional audio/motion, an optional one-off webhook, and optionally **Wait for Completion** to return the finished clip.
34
- - **Remove Background**: Isolate the subject of an image onto a transparent background. The cutout remains stored, and the returned signed PNG URL is valid for 7 days. Costs 25 credits, refunded automatically if processing fails. The same cleanup is available inline on both render operations with the per-artwork **Remove Background** toggle.
35
+ - **Remove Background**: Isolate the subject of an image onto a transparent background. The returned PNG URL is public and stays available for 7 days. Costs 25 credits, refunded automatically if processing fails. The same cleanup is available inline on both render operations with the per-artwork **Remove Background** toggle.
35
36
 
36
37
  ### Fonts and Order Artwork
37
38
 
@@ -233,6 +234,19 @@ Complete mockup details including all smart objects, thumbnails, and metadata.
233
234
 
234
235
  ---
235
236
 
237
+ ### PSD Mockup: Get Layers
238
+
239
+ List every layer of a mockup template, nested the way Photoshop's Layers panel shows them and front-most first. A smart object whose contents hold layers you can fill lists those layers as its children. An artboard has `kind` `artboard`, and its own layers are listed right before it at the top level rather than as its children. Costs no credits.
240
+
241
+ **Parameters:**
242
+
243
+ - **Mockup UUID** (required): UUID of the mockup
244
+
245
+ **Output:**
246
+ `data.layers`, where each layer has `uuid`, `name`, `kind`, `visible` and `children`. Put a layer's `uuid` in **Hidden Layers** on **PSD Mockup: Render** to leave it out of one render.
247
+
248
+ ---
249
+
236
250
  ### PSD Mockup: Update
237
251
 
238
252
  Update the name of a mockup template.
@@ -261,7 +275,7 @@ Generate a mockup by filling smart objects with your designs.
261
275
  **Parameters:**
262
276
 
263
277
  - **Mockup UUID** (required): UUID from the PSD Mockup: Upload response
264
- - **Smart Objects** (required): One or more smart objects to fill
278
+ - **Smart Objects**: One or more smart objects to fill. Optional when Text Layers or Hidden Layers is set.
265
279
  - Smart Object UUID
266
280
  - Design URL (PNG, JPG, WebP)
267
281
  - Fit Mode: `fill`, `contain`, or `cover` (recommended)
@@ -274,6 +288,8 @@ Generate a mockup by filling smart objects with your designs.
274
288
  - Contrast: -100 to 100
275
289
  - Opacity: 0-100
276
290
 
291
+ - **Hidden Layers** (optional): JSON array of up to 50 layer UUIDs from **PSD Mockup: Get Layers** to leave out of this render, including layers inside a smart object. Hiding a group hides every layer inside it. Works on its own.
292
+
277
293
  - **Export Options** (optional):
278
294
  - Image Format: WebP (recommended), PNG, or JPEG
279
295
  - Image Size: Width in pixels (100-10000, default 2048)
@@ -316,7 +332,7 @@ Export Options:
316
332
 
317
333
  ### Remove Background
318
334
 
319
- Isolate the subject of an image onto a transparent background. The cutout remains stored, and the returned signed PNG URL is valid for 7 days.
335
+ Isolate the subject of an image onto a transparent background. The returned PNG URL is public and stays available for 7 days.
320
336
 
321
337
  **Parameters:**
322
338
 
@@ -342,7 +358,7 @@ Image URL: https://cdn.example.com/product-photo.jpg
342
358
  }
343
359
  ```
344
360
 
345
- The returned signed URL is valid for 7 days and can be fed straight into **PSD Mockup: Render** or **Photo Mockup: Render** as artwork during that window. The cutout remains stored. Processing costs 25 credits per image and is refunded automatically if it fails. To clean artwork as part of a render instead, use the per-artwork **Remove Background** toggle on either render operation.
361
+ The returned URL is public, stays available for 7 days and can be fed straight into **PSD Mockup: Render** or **Photo Mockup: Render** as artwork during that window. Processing costs 25 credits per image and is refunded automatically if it fails. To clean artwork as part of a render instead, use the per-artwork **Remove Background** toggle on either render operation.
346
362
 
347
363
  ---
348
364
 
@@ -173,6 +173,12 @@ class SudoMock {
173
173
  description: 'Get details of a specific PSD mockup template',
174
174
  action: 'Get PSD mockup details',
175
175
  },
176
+ {
177
+ name: 'PSD Mockup: Get Layers',
178
+ value: 'getMockupLayers',
179
+ description: 'List every layer of a PSD mockup with the UUIDs Hidden Layers takes, including the layers inside its smart objects',
180
+ action: 'Get PSD mockup layers',
181
+ },
176
182
  {
177
183
  name: 'PSD Mockup: List',
178
184
  value: 'listMockups',
@@ -200,7 +206,7 @@ class SudoMock {
200
206
  {
201
207
  name: 'Remove Background',
202
208
  value: 'removeBackground',
203
- description: 'Remove the background from an image and get a transparent-PNG cutout through a signed URL valid for 7 days. The cutout remains stored. Costs 25 credits; auto-refunded on failure.',
209
+ description: 'Remove the background from an image and get a transparent-PNG cutout at a public URL that stays available for 7 days. Costs 25 credits; auto-refunded on failure.',
204
210
  action: 'Remove an image background',
205
211
  },
206
212
  {
@@ -1211,6 +1217,14 @@ class SudoMock {
1211
1217
  default: '[]',
1212
1218
  description: 'Optional text layer override array. Each item needs uuid plus text or segments, and can include font, font_size, color, stroke_color, and fit (overflow, shrink, or clip).',
1213
1219
  },
1220
+ {
1221
+ displayName: 'Hidden Layers',
1222
+ name: 'hiddenLayers',
1223
+ type: 'json',
1224
+ displayOptions: { show: { operation: ['render'] } },
1225
+ default: '[]',
1226
+ description: 'Optional JSON array of up to 50 layer UUIDs to leave out of this render, as PSD Mockup: Get Layers lists them, including the layers inside a smart object. Hiding a group hides every layer inside it, and a layer hidden inside a smart object is hidden in every copy of it. Works without smart objects or text layers.',
1227
+ },
1214
1228
  {
1215
1229
  displayName: 'Export Options',
1216
1230
  name: 'exportOptions',
@@ -2082,7 +2096,7 @@ class SudoMock {
2082
2096
  required: true,
2083
2097
  displayOptions: {
2084
2098
  show: {
2085
- operation: ['getMockup'],
2099
+ operation: ['getMockup', 'getMockupLayers'],
2086
2100
  },
2087
2101
  },
2088
2102
  default: '',
@@ -2516,6 +2530,7 @@ class SudoMock {
2516
2530
  const mockupUuid = this.getNodeParameter('mockupUuid', i);
2517
2531
  const smartObjectsData = this.getNodeParameter('smartObjects.items', i, []);
2518
2532
  const textLayers = parseJsonArray.call(this, this.getNodeParameter('textLayers', i, []), 'Text Layers');
2533
+ const hiddenLayers = parseJsonArray.call(this, this.getNodeParameter('hiddenLayers', i, []), 'Hidden Layers');
2519
2534
  const exportOptions = this.getNodeParameter('exportOptions', i, {});
2520
2535
  // Convert smart objects array to API format
2521
2536
  const smartObjects = smartObjectsData.map((so) => {
@@ -2609,8 +2624,11 @@ class SudoMock {
2609
2624
  if (textLayers.length > 0) {
2610
2625
  body.text_layers = textLayers;
2611
2626
  }
2612
- if (smartObjects.length === 0 && textLayers.length === 0) {
2613
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Add at least one smart object or text layer override');
2627
+ if (hiddenLayers.length > 0) {
2628
+ body.hidden_layers = hiddenLayers;
2629
+ }
2630
+ if (smartObjects.length === 0 && textLayers.length === 0 && hiddenLayers.length === 0) {
2631
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Add at least one smart object, text layer override, or hidden layer');
2614
2632
  }
2615
2633
  if (isAsync) {
2616
2634
  body.is_async = true;
@@ -3085,6 +3103,21 @@ class SudoMock {
3085
3103
  });
3086
3104
  }
3087
3105
  // ========================================
3106
+ // GET MOCKUP LAYERS
3107
+ // ========================================
3108
+ else if (operation === 'getMockupLayers') {
3109
+ const mockupUuid = this.getNodeParameter('getMockupUuid', i);
3110
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
3111
+ method: 'GET',
3112
+ url: `https://api.sudomock.com/api/v1/psd-mockups/${mockupUuid}/layers`,
3113
+ json: true,
3114
+ });
3115
+ returnData.push({
3116
+ json: response,
3117
+ pairedItem: { item: i },
3118
+ });
3119
+ }
3120
+ // ========================================
3088
3121
  // UPDATE MOCKUP
3089
3122
  // ========================================
3090
3123
  else if (operation === 'updateMockup') {
@@ -52,6 +52,7 @@ const RESOURCES = [
52
52
  operations: [
53
53
  "deleteMockup",
54
54
  "getMockup",
55
+ "getMockupLayers",
55
56
  "listMockups",
56
57
  "render",
57
58
  "updateMockup",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-sudomock",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "n8n community node for SudoMock mockup rendering API - POD automation",
5
5
  "license": "MIT",
6
6
  "homepage": "https://sudomock.com",