n8n-nodes-sudomock 0.13.0 → 0.15.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
|
|
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
|
|
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,9 +288,12 @@ 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)
|
|
296
|
+
- PSD's Own Size and Resolution: render at the template's own width, with the resolution the PSD was saved with unless DPI is set
|
|
280
297
|
- Quality: 1-100 for JPG/WebP
|
|
281
298
|
- Export Label: Custom label for file naming
|
|
282
299
|
|
|
@@ -316,7 +333,7 @@ Export Options:
|
|
|
316
333
|
|
|
317
334
|
### Remove Background
|
|
318
335
|
|
|
319
|
-
Isolate the subject of an image onto a transparent background. The
|
|
336
|
+
Isolate the subject of an image onto a transparent background. The returned PNG URL is public and stays available for 7 days.
|
|
320
337
|
|
|
321
338
|
**Parameters:**
|
|
322
339
|
|
|
@@ -342,7 +359,7 @@ Image URL: https://cdn.example.com/product-photo.jpg
|
|
|
342
359
|
}
|
|
343
360
|
```
|
|
344
361
|
|
|
345
|
-
The returned
|
|
362
|
+
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
363
|
|
|
347
364
|
---
|
|
348
365
|
|
|
@@ -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
|
|
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',
|
|
@@ -1275,6 +1289,13 @@ class SudoMock {
|
|
|
1275
1289
|
default: 2048,
|
|
1276
1290
|
description: 'Output width in pixels (100-10000). Height scales proportionally. Powers of 2 (1024, 2048, 4096) recommended.',
|
|
1277
1291
|
},
|
|
1292
|
+
{
|
|
1293
|
+
displayName: "PSD's Own Size and Resolution",
|
|
1294
|
+
name: 'originalSize',
|
|
1295
|
+
type: 'boolean',
|
|
1296
|
+
default: false,
|
|
1297
|
+
description: "Whether to render at the PSD's own size and resolution: its own width, and the resolution it was saved with unless DPI is set. Image Size (Width) is not used when this is on.",
|
|
1298
|
+
},
|
|
1278
1299
|
{
|
|
1279
1300
|
displayName: 'Quality',
|
|
1280
1301
|
name: 'quality',
|
|
@@ -2082,7 +2103,7 @@ class SudoMock {
|
|
|
2082
2103
|
required: true,
|
|
2083
2104
|
displayOptions: {
|
|
2084
2105
|
show: {
|
|
2085
|
-
operation: ['getMockup'],
|
|
2106
|
+
operation: ['getMockup', 'getMockupLayers'],
|
|
2086
2107
|
},
|
|
2087
2108
|
},
|
|
2088
2109
|
default: '',
|
|
@@ -2516,6 +2537,7 @@ class SudoMock {
|
|
|
2516
2537
|
const mockupUuid = this.getNodeParameter('mockupUuid', i);
|
|
2517
2538
|
const smartObjectsData = this.getNodeParameter('smartObjects.items', i, []);
|
|
2518
2539
|
const textLayers = parseJsonArray.call(this, this.getNodeParameter('textLayers', i, []), 'Text Layers');
|
|
2540
|
+
const hiddenLayers = parseJsonArray.call(this, this.getNodeParameter('hiddenLayers', i, []), 'Hidden Layers');
|
|
2519
2541
|
const exportOptions = this.getNodeParameter('exportOptions', i, {});
|
|
2520
2542
|
// Convert smart objects array to API format
|
|
2521
2543
|
const smartObjects = smartObjectsData.map((so) => {
|
|
@@ -2609,8 +2631,11 @@ class SudoMock {
|
|
|
2609
2631
|
if (textLayers.length > 0) {
|
|
2610
2632
|
body.text_layers = textLayers;
|
|
2611
2633
|
}
|
|
2612
|
-
if (
|
|
2613
|
-
|
|
2634
|
+
if (hiddenLayers.length > 0) {
|
|
2635
|
+
body.hidden_layers = hiddenLayers;
|
|
2636
|
+
}
|
|
2637
|
+
if (smartObjects.length === 0 && textLayers.length === 0 && hiddenLayers.length === 0) {
|
|
2638
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Add at least one smart object, text layer override, or hidden layer');
|
|
2614
2639
|
}
|
|
2615
2640
|
if (isAsync) {
|
|
2616
2641
|
body.is_async = true;
|
|
@@ -2621,7 +2646,10 @@ class SudoMock {
|
|
|
2621
2646
|
if (exportOptions.imageFormat) {
|
|
2622
2647
|
expOpts.image_format = exportOptions.imageFormat;
|
|
2623
2648
|
}
|
|
2624
|
-
if (exportOptions.
|
|
2649
|
+
if (exportOptions.originalSize) {
|
|
2650
|
+
expOpts.image_size = 'original';
|
|
2651
|
+
}
|
|
2652
|
+
else if (exportOptions.imageSize) {
|
|
2625
2653
|
expOpts.image_size = exportOptions.imageSize;
|
|
2626
2654
|
}
|
|
2627
2655
|
if (exportOptions.quality) {
|
|
@@ -3085,6 +3113,21 @@ class SudoMock {
|
|
|
3085
3113
|
});
|
|
3086
3114
|
}
|
|
3087
3115
|
// ========================================
|
|
3116
|
+
// GET MOCKUP LAYERS
|
|
3117
|
+
// ========================================
|
|
3118
|
+
else if (operation === 'getMockupLayers') {
|
|
3119
|
+
const mockupUuid = this.getNodeParameter('getMockupUuid', i);
|
|
3120
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
3121
|
+
method: 'GET',
|
|
3122
|
+
url: `https://api.sudomock.com/api/v1/psd-mockups/${mockupUuid}/layers`,
|
|
3123
|
+
json: true,
|
|
3124
|
+
});
|
|
3125
|
+
returnData.push({
|
|
3126
|
+
json: response,
|
|
3127
|
+
pairedItem: { item: i },
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
// ========================================
|
|
3088
3131
|
// UPDATE MOCKUP
|
|
3089
3132
|
// ========================================
|
|
3090
3133
|
else if (operation === 'updateMockup') {
|