n8n-nodes-sudomock 0.4.0 → 0.6.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 +91 -13
- package/dist/nodes/SudoMock/SudoMock.node.js +466 -70
- package/dist/nodes/SudoMock/SudoMockTrigger.node.d.ts +12 -0
- package/dist/nodes/SudoMock/SudoMockTrigger.node.js +118 -0
- package/dist/nodes/SudoMock/webhooks.d.ts +5 -0
- package/dist/nodes/SudoMock/webhooks.js +38 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -7,9 +7,11 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
9
|
### Account Operations
|
|
10
|
+
|
|
10
11
|
- **Get Account Info**: Retrieve account details, subscription plan, and usage statistics
|
|
11
12
|
|
|
12
13
|
### Mockup Management
|
|
14
|
+
|
|
13
15
|
- **Upload PSD**: Upload PSD templates from a URL
|
|
14
16
|
- **List Mockups**: List all your uploaded mockup templates with filtering and pagination
|
|
15
17
|
- **Get Mockup**: Get detailed information about a specific mockup template
|
|
@@ -17,6 +19,7 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
|
|
|
17
19
|
- **Delete Mockup**: Delete a specific mockup template
|
|
18
20
|
|
|
19
21
|
### 2D Mockups
|
|
22
|
+
|
|
20
23
|
- **2D: Create Mockup**: Create a reusable 2D mockup from an image
|
|
21
24
|
- **2D: Get Mockup**: Check preparation status and get ready print areas
|
|
22
25
|
- **2D: List Mockups**: List your 2D mockups
|
|
@@ -25,18 +28,28 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
|
|
|
25
28
|
- **2D: Delete Mockup**: Delete a 2D mockup
|
|
26
29
|
|
|
27
30
|
### Rendering
|
|
28
|
-
|
|
29
|
-
- **Render
|
|
31
|
+
|
|
32
|
+
- **Render Mockup**: 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
|
+
- **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
|
+
|
|
36
|
+
### Fonts and Order Artwork
|
|
37
|
+
|
|
38
|
+
- **Fonts**: List available fonts, fetch one by UUID, upload a custom TTF or OTF from a public URL, and delete your custom fonts
|
|
39
|
+
- **Artwork: Delete Stored Files**: Delete stored order artwork by URL or mockup UUID
|
|
30
40
|
|
|
31
41
|
### Async Jobs
|
|
42
|
+
|
|
32
43
|
- **Get Job**: Get the status and result of an async render, upload, video, or 2D mockup job by its `job_id`. Terminal statuses are `succeeded`, `failed`, and `cancelled` (pending jobs report `queued`). On success it surfaces `result_url` (render/video) or `mockup_uuid` (upload and 2D creation). Optionally **Wait for Completion** to poll until the job finishes.
|
|
33
|
-
- **List Jobs**: List your async render, upload, and
|
|
44
|
+
- **List Jobs**: List your async render, upload, video, and 2D jobs (keyset paginated, with optional `kind` and Mockup UUID filters).
|
|
34
45
|
|
|
35
46
|
### Webhooks
|
|
36
|
-
|
|
47
|
+
|
|
48
|
+
- **SudoMock Trigger**: Start a workflow from selected SudoMock events with automatic signature verification
|
|
49
|
+
- Manage webhook endpoints that receive a signed HTTPS request the moment a job finishes:
|
|
37
50
|
- **Webhook: List Endpoints**
|
|
38
51
|
- **Webhook: Get Endpoint**
|
|
39
|
-
- **Webhook: Create Endpoint** (set an optional description and choose any
|
|
52
|
+
- **Webhook: Create Endpoint** (set an optional description and choose any current event, or leave empty for all)
|
|
40
53
|
- **Webhook: Update Endpoint**
|
|
41
54
|
- **Webhook: Delete Endpoint**
|
|
42
55
|
- **Webhook: Rotate Secret**
|
|
@@ -46,7 +59,7 @@ Manage webhook endpoints that receive a signed HTTPS request the moment a job fi
|
|
|
46
59
|
- **Webhook: Replay Failed Deliveries**
|
|
47
60
|
- **Webhook: Events Feed** (recent deliveries across all of your endpoints)
|
|
48
61
|
|
|
49
|
-
Canonical events: `render.succeeded`, `render.failed`, `upload.succeeded`, `video.succeeded`, `video.failed`, `webhook.test`. Deliveries are
|
|
62
|
+
Canonical events: `render.succeeded`, `render.failed`, `upload.succeeded`, `video.succeeded`, `video.failed`, `2d_mockup.ready`, `2d_mockup.rejected`, `2d_mockup.failed`, `2d_render.succeeded`, `2d_render.failed`, `webhook.test`. Deliveries are signed; see https://sudomock.com/docs/api/webhooks for verification details.
|
|
50
63
|
|
|
51
64
|
## Installation
|
|
52
65
|
|
|
@@ -89,12 +102,14 @@ Restart n8n after installation.
|
|
|
89
102
|
Retrieve your account information, subscription details, and credit usage.
|
|
90
103
|
|
|
91
104
|
**Output:**
|
|
105
|
+
|
|
92
106
|
- Account: UUID, email, name, created date
|
|
93
107
|
- Subscription: Plan name, status, billing period
|
|
94
108
|
- Usage: Credits used/remaining, billing dates
|
|
95
109
|
- API Key: Name, creation date, last used, total requests
|
|
96
110
|
|
|
97
111
|
**Example Output:**
|
|
112
|
+
|
|
98
113
|
```json
|
|
99
114
|
{
|
|
100
115
|
"success": true,
|
|
@@ -124,16 +139,19 @@ Retrieve your account information, subscription details, and credit usage.
|
|
|
124
139
|
Upload a PSD template from a public URL.
|
|
125
140
|
|
|
126
141
|
**Parameters:**
|
|
142
|
+
|
|
127
143
|
- **PSD File URL** (required): Public URL to your PSD file (up to Adobe's official PSD file size limit)
|
|
128
144
|
- **Template Name** (optional): Custom name for the template (auto-generated if not provided)
|
|
129
145
|
|
|
130
146
|
**Example:**
|
|
147
|
+
|
|
131
148
|
```
|
|
132
149
|
PSD URL: https://storage.example.com/mockup.psd
|
|
133
150
|
Name: T-Shirt Mockup Front
|
|
134
151
|
```
|
|
135
152
|
|
|
136
153
|
**Output:**
|
|
154
|
+
|
|
137
155
|
- Mockup UUID (use for rendering)
|
|
138
156
|
- Smart object UUIDs and details
|
|
139
157
|
- Thumbnail URLs
|
|
@@ -145,6 +163,7 @@ Name: T-Shirt Mockup Front
|
|
|
145
163
|
List all your uploaded mockup templates with optional filtering and pagination.
|
|
146
164
|
|
|
147
165
|
**Parameters:**
|
|
166
|
+
|
|
148
167
|
- **Return All**: Fetch all mockups or limit results
|
|
149
168
|
- **Limit**: Number of results (1-100, default: 20)
|
|
150
169
|
- **Additional Options**:
|
|
@@ -155,6 +174,7 @@ List all your uploaded mockup templates with optional filtering and pagination.
|
|
|
155
174
|
- Sort Order: `asc` or `desc`
|
|
156
175
|
|
|
157
176
|
**Example:**
|
|
177
|
+
|
|
158
178
|
```
|
|
159
179
|
Limit: 20
|
|
160
180
|
Sort By: Created At
|
|
@@ -171,9 +191,11 @@ Each mockup as a separate item with full details (UUID, name, smart objects, thu
|
|
|
171
191
|
Retrieve detailed information about a specific mockup template.
|
|
172
192
|
|
|
173
193
|
**Parameters:**
|
|
194
|
+
|
|
174
195
|
- **Mockup UUID** (required): UUID of the mockup to retrieve
|
|
175
196
|
|
|
176
197
|
**Example:**
|
|
198
|
+
|
|
177
199
|
```
|
|
178
200
|
Mockup UUID: c315f78f-d2c7-4541-b240-a9372842de94
|
|
179
201
|
```
|
|
@@ -188,10 +210,12 @@ Complete mockup details including all smart objects, thumbnails, and metadata.
|
|
|
188
210
|
Update the name of a mockup template.
|
|
189
211
|
|
|
190
212
|
**Parameters:**
|
|
213
|
+
|
|
191
214
|
- **Mockup UUID** (required): UUID of the mockup to update
|
|
192
215
|
- **New Name** (required): New name for the template
|
|
193
216
|
|
|
194
217
|
**Example:**
|
|
218
|
+
|
|
195
219
|
```
|
|
196
220
|
Mockup UUID: c315f78f-d2c7-4541-b240-a9372842de94
|
|
197
221
|
New Name: Updated T-Shirt Mockup
|
|
@@ -207,6 +231,7 @@ Updated mockup details with the new name.
|
|
|
207
231
|
Generate a mockup by filling smart objects with your designs.
|
|
208
232
|
|
|
209
233
|
**Parameters:**
|
|
234
|
+
|
|
210
235
|
- **Mockup UUID** (required): UUID from Upload PSD response
|
|
211
236
|
- **Smart Objects** (required): One or more smart objects to fill
|
|
212
237
|
- Smart Object UUID
|
|
@@ -214,6 +239,7 @@ Generate a mockup by filling smart objects with your designs.
|
|
|
214
239
|
- Fit Mode: `fill`, `contain`, or `cover` (recommended)
|
|
215
240
|
- **Additional Options** (optional):
|
|
216
241
|
- Rotation: -360 to 360 degrees
|
|
242
|
+
- Remove Background: clean the artwork before placing it (adds 25 credits per artwork)
|
|
217
243
|
- Color Overlay: Hex color code
|
|
218
244
|
- Color Blend Mode: Various blend modes
|
|
219
245
|
- Brightness: -150 to 150
|
|
@@ -227,6 +253,7 @@ Generate a mockup by filling smart objects with your designs.
|
|
|
227
253
|
- Export Label: Custom label for file naming
|
|
228
254
|
|
|
229
255
|
**Example:**
|
|
256
|
+
|
|
230
257
|
```
|
|
231
258
|
Mockup UUID: abc123-def456
|
|
232
259
|
Smart Object 1:
|
|
@@ -243,6 +270,7 @@ Export Options:
|
|
|
243
270
|
```
|
|
244
271
|
|
|
245
272
|
**Output:**
|
|
273
|
+
|
|
246
274
|
```json
|
|
247
275
|
{
|
|
248
276
|
"success": true,
|
|
@@ -258,14 +286,48 @@ Export Options:
|
|
|
258
286
|
|
|
259
287
|
---
|
|
260
288
|
|
|
289
|
+
### Remove Background
|
|
290
|
+
|
|
291
|
+
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.
|
|
292
|
+
|
|
293
|
+
**Parameters:**
|
|
294
|
+
|
|
295
|
+
- **Image URL** (required): public URL of the image to process
|
|
296
|
+
|
|
297
|
+
**Example:**
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
Image URL: https://cdn.example.com/product-photo.jpg
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Output:**
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"success": true,
|
|
308
|
+
"data": {
|
|
309
|
+
"url": "https://cdn.sudomock.com/bg-cutouts/abc123.png",
|
|
310
|
+
"width": 2000,
|
|
311
|
+
"height": 2000,
|
|
312
|
+
"credits_charged": 25
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
The returned signed URL is valid for 7 days and can be fed straight into **Render Mockup** or **2D: Render Mockup** 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.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
261
321
|
### Delete Mockup
|
|
262
322
|
|
|
263
323
|
Delete a specific mockup template.
|
|
264
324
|
|
|
265
325
|
**Parameters:**
|
|
326
|
+
|
|
266
327
|
- **Mockup UUID** (required): UUID of the mockup to delete
|
|
267
328
|
|
|
268
329
|
**Example:**
|
|
330
|
+
|
|
269
331
|
```
|
|
270
332
|
Mockup UUID: c315f78f-d2c7-4541-b240-a9372842de94
|
|
271
333
|
```
|
|
@@ -283,7 +345,7 @@ Create, prepare, render, and manage reusable mockups from product images without
|
|
|
283
345
|
2. **2D: Get Mockup** returns `draft`, `ready`, or `failed` status. Poll this operation until the mockup is `ready`; the ready response includes each print area's UUID and points.
|
|
284
346
|
3. **2D: List Mockups** returns your 2D mockups.
|
|
285
347
|
4. **2D: Set Print Areas** accepts one or more print areas. Each print area is a quad with four `[x, y]` coordinate pairs.
|
|
286
|
-
5. **2D: Render Mockup** accepts the mockup UUID and one or more ready print area UUIDs. Each print area includes either an artwork URL or Base64 artwork, with optional color, adjustments, and placement. Export options support PNG or JPG at 1024, 2048, or 4096 pixels, plus quality and DPI. Each render costs 5 credits and returns `print_files`, where `print_files[0]` is the CDN URL.
|
|
348
|
+
5. **2D: Render Mockup** accepts the mockup UUID and one or more ready print area UUIDs. Each print area includes either an artwork URL or Base64 artwork, with optional background removal (adds 25 credits per artwork), color, adjustments, and placement. Export options support PNG or JPG at 1024, 2048, or 4096 pixels, plus quality and DPI. Each render costs 5 credits and returns `print_files`, where `print_files[0]` is the CDN URL.
|
|
287
349
|
6. **2D: Delete Mockup** deletes the selected 2D mockup.
|
|
288
350
|
|
|
289
351
|
Create must reach `ready` through **2D: Get Mockup** before **2D: Render Mockup**.
|
|
@@ -295,6 +357,7 @@ Create must reach `ready` through **2D: Get Mockup** before **2D: Render Mockup*
|
|
|
295
357
|
Turn a mockup (or an existing image URL) into a short product video. Always asynchronous: returns a `job_id` you can track with **Get Job**.
|
|
296
358
|
|
|
297
359
|
**Parameters:**
|
|
360
|
+
|
|
298
361
|
- **Input Mode**: `Render Mockup` (render a mockup with your designs first) or `Animate Image URL` (animate a public image directly)
|
|
299
362
|
- **Mockup UUID** (required in Render Mockup mode): UUID of the mockup to animate
|
|
300
363
|
- **Smart Objects** (required in Render Mockup mode): one or more smart objects with a Design URL and Fit Mode
|
|
@@ -318,6 +381,7 @@ The 202 acknowledgement (`job_id`, `kind`, `status`, `status_url`, `estimated_cr
|
|
|
318
381
|
Track an asynchronous render, upload, video, or 2D mockup job by its `job_id`.
|
|
319
382
|
|
|
320
383
|
**Parameters:**
|
|
384
|
+
|
|
321
385
|
- **Job ID** (required): the `job_id` from an async render, upload, video, or 2D mockup request
|
|
322
386
|
- **Wait for Completion**: poll until a terminal status (`succeeded`, `failed`, `cancelled`)
|
|
323
387
|
- **Poll Timeout (Seconds)**: max wait when Wait for Completion is on
|
|
@@ -332,6 +396,7 @@ The job object. On success it surfaces `result_url` / `resultUrl` (render/video)
|
|
|
332
396
|
List your async render, upload, and video jobs (newest first, keyset paginated).
|
|
333
397
|
|
|
334
398
|
**Parameters (all optional, under Filters):**
|
|
399
|
+
|
|
335
400
|
- **Kind**: `render`, `upload`, or `video`
|
|
336
401
|
- **Mockup UUID**: only jobs derived from this source mockup
|
|
337
402
|
- **Limit**: 1-50 (default 20)
|
|
@@ -349,6 +414,7 @@ List your async render, upload, and video jobs (newest first, keyset paginated).
|
|
|
349
414
|
Manage webhook endpoints and their deliveries. See the [Webhooks](#webhooks) feature list above for the full operation set and the canonical event types.
|
|
350
415
|
|
|
351
416
|
**Common parameters:**
|
|
417
|
+
|
|
352
418
|
- **Webhook Endpoint ID** (required for get/update/delete/rotate/test/deliveries/replay/replay-failed)
|
|
353
419
|
- **Endpoint URL** + **Description** (create) and **Events** (create/update): leave Events empty to subscribe to all
|
|
354
420
|
- **Delivery ID** (replay)
|
|
@@ -361,9 +427,11 @@ Manage webhook endpoints and their deliveries. See the [Webhooks](#webhooks) fea
|
|
|
361
427
|
Ready-to-use n8n workflows are available in the [`examples/`](./examples) folder:
|
|
362
428
|
|
|
363
429
|
### 1. Complete API Test Workflow
|
|
430
|
+
|
|
364
431
|
**File**: [`examples/complete-test-workflow.json`](./examples/complete-test-workflow.json)
|
|
365
432
|
|
|
366
433
|
Tests the core mockup operations in sequence:
|
|
434
|
+
|
|
367
435
|
- Get Account Info → Upload PSD → Get Mockup → List Mockups
|
|
368
436
|
- Render Mockup → Update Name → Verify Update → Delete Mockup
|
|
369
437
|
|
|
@@ -372,9 +440,11 @@ Perfect for verifying your setup and understanding the complete workflow.
|
|
|
372
440
|
[View Details →](./examples/README.md#1-complete-api-test-complete-test-workflowjson)
|
|
373
441
|
|
|
374
442
|
### 2. Rate Limit Handling Workflow
|
|
443
|
+
|
|
375
444
|
**File**: [`examples/rate-limit-test-workflow.json`](./examples/rate-limit-test-workflow.json)
|
|
376
445
|
|
|
377
446
|
Demonstrates proper rate limit error handling with automatic retry logic:
|
|
447
|
+
|
|
378
448
|
- Detects 429 errors
|
|
379
449
|
- Extracts retry-after value
|
|
380
450
|
- Waits and automatically retries
|
|
@@ -383,9 +453,11 @@ Demonstrates proper rate limit error handling with automatic retry logic:
|
|
|
383
453
|
[View Details →](./examples/README.md#2-rate-limit-error-handling-test-rate-limit-test-workflowjson)
|
|
384
454
|
|
|
385
455
|
### 3. Sequential Batch Render Workflow
|
|
456
|
+
|
|
386
457
|
**File**: [`examples/batch-render-workflow.json`](./examples/batch-render-workflow.json)
|
|
387
458
|
|
|
388
459
|
Demonstrates the power of n8n workflows with sequential batch processing:
|
|
460
|
+
|
|
389
461
|
- Renders 10 mockups one after another
|
|
390
462
|
- Uses different designs for each render
|
|
391
463
|
- 2-second delay between renders to avoid rate limits
|
|
@@ -398,11 +470,13 @@ Perfect for understanding batch processing and workflow automation.
|
|
|
398
470
|
### Quick Start with Examples
|
|
399
471
|
|
|
400
472
|
1. Import a workflow:
|
|
473
|
+
|
|
401
474
|
```
|
|
402
475
|
n8n UI → Workflows → Import from File → Select workflow JSON
|
|
403
476
|
```
|
|
404
477
|
|
|
405
478
|
2. Configure credentials:
|
|
479
|
+
|
|
406
480
|
```
|
|
407
481
|
Click any SudoMock node → Credentials → Select your API key
|
|
408
482
|
```
|
|
@@ -481,12 +555,12 @@ Unauthenticated requests (IP-based): **30 requests per minute**
|
|
|
481
555
|
|
|
482
556
|
### Concurrent Request Limits (Plan-Based)
|
|
483
557
|
|
|
484
|
-
| Plan
|
|
485
|
-
|
|
486
|
-
| Free
|
|
487
|
-
| Starter | 3
|
|
488
|
-
| Pro
|
|
489
|
-
| Scale
|
|
558
|
+
| Plan | Concurrent Renders | Concurrent Uploads |
|
|
559
|
+
| ------- | ------------------ | ------------------ |
|
|
560
|
+
| Free | 1 | 1 |
|
|
561
|
+
| Starter | 3 | 2 |
|
|
562
|
+
| Pro | 10 | 5 |
|
|
563
|
+
| Scale | 25 | 10 |
|
|
490
564
|
|
|
491
565
|
### Rate Limit Error Handling
|
|
492
566
|
|
|
@@ -495,6 +569,7 @@ The node automatically detects and handles two types of rate limit errors:
|
|
|
495
569
|
#### 1. Request Rate Limit Exceeded (1000 RPM)
|
|
496
570
|
|
|
497
571
|
**Error Output:**
|
|
572
|
+
|
|
498
573
|
```json
|
|
499
574
|
{
|
|
500
575
|
"error": "Rate limit exceeded (1000 requests/minute). Please retry after 42 seconds.",
|
|
@@ -513,6 +588,7 @@ The node automatically detects and handles two types of rate limit errors:
|
|
|
513
588
|
#### 2. Concurrent Limit Exceeded (Plan-Based)
|
|
514
589
|
|
|
515
590
|
**Error Output:**
|
|
591
|
+
|
|
516
592
|
```json
|
|
517
593
|
{
|
|
518
594
|
"error": "Concurrent render limit reached (11/10). Please wait 5 seconds and try again.",
|
|
@@ -549,11 +625,13 @@ The node automatically detects and handles two types of rate limit errors:
|
|
|
549
625
|
## Error Handling
|
|
550
626
|
|
|
551
627
|
All operations support the **Continue On Fail** option in n8n. When enabled:
|
|
628
|
+
|
|
552
629
|
- Errors are captured as output items
|
|
553
630
|
- Workflow continues to next item
|
|
554
631
|
- Error details included in output
|
|
555
632
|
|
|
556
633
|
**Example Error Output:**
|
|
634
|
+
|
|
557
635
|
```json
|
|
558
636
|
{
|
|
559
637
|
"error": "Rate limit exceeded. Retry after 42 seconds.",
|