n8n-nodes-sudomock 0.3.1 → 0.5.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 +82 -15
- package/dist/nodes/SudoMock/SudoMock.node.js +1120 -42
- 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 +4 -2
package/README.md
CHANGED
|
@@ -7,28 +7,48 @@ 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
|
|
16
18
|
- **Update Mockup**: Update the name of a mockup template
|
|
17
19
|
- **Delete Mockup**: Delete a specific mockup template
|
|
18
20
|
|
|
21
|
+
### 2D Mockups
|
|
22
|
+
|
|
23
|
+
- **2D: Create Mockup**: Create a reusable 2D mockup from an image
|
|
24
|
+
- **2D: Get Mockup**: Check preparation status and get ready print areas
|
|
25
|
+
- **2D: List Mockups**: List your 2D mockups
|
|
26
|
+
- **2D: Set Print Areas**: Define print areas with four-point quads
|
|
27
|
+
- **2D: Render Mockup**: Render artwork into ready print areas for 5 credits
|
|
28
|
+
- **2D: Delete Mockup**: Delete a 2D mockup
|
|
29
|
+
|
|
19
30
|
### Rendering
|
|
20
|
-
|
|
21
|
-
- **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
|
+
|
|
35
|
+
### Fonts and Order Artwork
|
|
36
|
+
|
|
37
|
+
- **Fonts**: List available fonts, fetch one by UUID, upload a custom TTF or OTF from a public URL, and delete your custom fonts
|
|
38
|
+
- **Order Artwork**: Store customer artwork and previews for fulfillment, then delete them by URL or mockup UUID when needed
|
|
22
39
|
|
|
23
40
|
### Async Jobs
|
|
24
|
-
|
|
25
|
-
- **
|
|
41
|
+
|
|
42
|
+
- **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.
|
|
43
|
+
- **List Jobs**: List your async render, upload, video, and 2D jobs (keyset paginated, with optional `kind` and Mockup UUID filters).
|
|
26
44
|
|
|
27
45
|
### Webhooks
|
|
28
|
-
|
|
46
|
+
|
|
47
|
+
- **SudoMock Trigger**: Start a workflow from selected SudoMock events with automatic signature verification
|
|
48
|
+
- Manage webhook endpoints that receive a signed HTTPS request the moment a job finishes:
|
|
29
49
|
- **Webhook: List Endpoints**
|
|
30
50
|
- **Webhook: Get Endpoint**
|
|
31
|
-
- **Webhook: Create Endpoint** (set an optional description and choose any
|
|
51
|
+
- **Webhook: Create Endpoint** (set an optional description and choose any current event, or leave empty for all)
|
|
32
52
|
- **Webhook: Update Endpoint**
|
|
33
53
|
- **Webhook: Delete Endpoint**
|
|
34
54
|
- **Webhook: Rotate Secret**
|
|
@@ -38,7 +58,7 @@ Manage webhook endpoints that receive a signed HTTPS request the moment a job fi
|
|
|
38
58
|
- **Webhook: Replay Failed Deliveries**
|
|
39
59
|
- **Webhook: Events Feed** (recent deliveries across all of your endpoints)
|
|
40
60
|
|
|
41
|
-
Canonical events: `render.succeeded`, `render.failed`, `upload.succeeded`, `video.succeeded`, `video.failed`, `webhook.test`. Deliveries are
|
|
61
|
+
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.
|
|
42
62
|
|
|
43
63
|
## Installation
|
|
44
64
|
|
|
@@ -81,12 +101,14 @@ Restart n8n after installation.
|
|
|
81
101
|
Retrieve your account information, subscription details, and credit usage.
|
|
82
102
|
|
|
83
103
|
**Output:**
|
|
104
|
+
|
|
84
105
|
- Account: UUID, email, name, created date
|
|
85
106
|
- Subscription: Plan name, status, billing period
|
|
86
107
|
- Usage: Credits used/remaining, billing dates
|
|
87
108
|
- API Key: Name, creation date, last used, total requests
|
|
88
109
|
|
|
89
110
|
**Example Output:**
|
|
111
|
+
|
|
90
112
|
```json
|
|
91
113
|
{
|
|
92
114
|
"success": true,
|
|
@@ -116,16 +138,19 @@ Retrieve your account information, subscription details, and credit usage.
|
|
|
116
138
|
Upload a PSD template from a public URL.
|
|
117
139
|
|
|
118
140
|
**Parameters:**
|
|
141
|
+
|
|
119
142
|
- **PSD File URL** (required): Public URL to your PSD file (up to Adobe's official PSD file size limit)
|
|
120
143
|
- **Template Name** (optional): Custom name for the template (auto-generated if not provided)
|
|
121
144
|
|
|
122
145
|
**Example:**
|
|
146
|
+
|
|
123
147
|
```
|
|
124
148
|
PSD URL: https://storage.example.com/mockup.psd
|
|
125
149
|
Name: T-Shirt Mockup Front
|
|
126
150
|
```
|
|
127
151
|
|
|
128
152
|
**Output:**
|
|
153
|
+
|
|
129
154
|
- Mockup UUID (use for rendering)
|
|
130
155
|
- Smart object UUIDs and details
|
|
131
156
|
- Thumbnail URLs
|
|
@@ -137,6 +162,7 @@ Name: T-Shirt Mockup Front
|
|
|
137
162
|
List all your uploaded mockup templates with optional filtering and pagination.
|
|
138
163
|
|
|
139
164
|
**Parameters:**
|
|
165
|
+
|
|
140
166
|
- **Return All**: Fetch all mockups or limit results
|
|
141
167
|
- **Limit**: Number of results (1-100, default: 20)
|
|
142
168
|
- **Additional Options**:
|
|
@@ -147,6 +173,7 @@ List all your uploaded mockup templates with optional filtering and pagination.
|
|
|
147
173
|
- Sort Order: `asc` or `desc`
|
|
148
174
|
|
|
149
175
|
**Example:**
|
|
176
|
+
|
|
150
177
|
```
|
|
151
178
|
Limit: 20
|
|
152
179
|
Sort By: Created At
|
|
@@ -163,9 +190,11 @@ Each mockup as a separate item with full details (UUID, name, smart objects, thu
|
|
|
163
190
|
Retrieve detailed information about a specific mockup template.
|
|
164
191
|
|
|
165
192
|
**Parameters:**
|
|
193
|
+
|
|
166
194
|
- **Mockup UUID** (required): UUID of the mockup to retrieve
|
|
167
195
|
|
|
168
196
|
**Example:**
|
|
197
|
+
|
|
169
198
|
```
|
|
170
199
|
Mockup UUID: c315f78f-d2c7-4541-b240-a9372842de94
|
|
171
200
|
```
|
|
@@ -180,10 +209,12 @@ Complete mockup details including all smart objects, thumbnails, and metadata.
|
|
|
180
209
|
Update the name of a mockup template.
|
|
181
210
|
|
|
182
211
|
**Parameters:**
|
|
212
|
+
|
|
183
213
|
- **Mockup UUID** (required): UUID of the mockup to update
|
|
184
214
|
- **New Name** (required): New name for the template
|
|
185
215
|
|
|
186
216
|
**Example:**
|
|
217
|
+
|
|
187
218
|
```
|
|
188
219
|
Mockup UUID: c315f78f-d2c7-4541-b240-a9372842de94
|
|
189
220
|
New Name: Updated T-Shirt Mockup
|
|
@@ -199,6 +230,7 @@ Updated mockup details with the new name.
|
|
|
199
230
|
Generate a mockup by filling smart objects with your designs.
|
|
200
231
|
|
|
201
232
|
**Parameters:**
|
|
233
|
+
|
|
202
234
|
- **Mockup UUID** (required): UUID from Upload PSD response
|
|
203
235
|
- **Smart Objects** (required): One or more smart objects to fill
|
|
204
236
|
- Smart Object UUID
|
|
@@ -219,6 +251,7 @@ Generate a mockup by filling smart objects with your designs.
|
|
|
219
251
|
- Export Label: Custom label for file naming
|
|
220
252
|
|
|
221
253
|
**Example:**
|
|
254
|
+
|
|
222
255
|
```
|
|
223
256
|
Mockup UUID: abc123-def456
|
|
224
257
|
Smart Object 1:
|
|
@@ -235,6 +268,7 @@ Export Options:
|
|
|
235
268
|
```
|
|
236
269
|
|
|
237
270
|
**Output:**
|
|
271
|
+
|
|
238
272
|
```json
|
|
239
273
|
{
|
|
240
274
|
"success": true,
|
|
@@ -255,9 +289,11 @@ Export Options:
|
|
|
255
289
|
Delete a specific mockup template.
|
|
256
290
|
|
|
257
291
|
**Parameters:**
|
|
292
|
+
|
|
258
293
|
- **Mockup UUID** (required): UUID of the mockup to delete
|
|
259
294
|
|
|
260
295
|
**Example:**
|
|
296
|
+
|
|
261
297
|
```
|
|
262
298
|
Mockup UUID: c315f78f-d2c7-4541-b240-a9372842de94
|
|
263
299
|
```
|
|
@@ -267,11 +303,27 @@ Deletion confirmation
|
|
|
267
303
|
|
|
268
304
|
---
|
|
269
305
|
|
|
306
|
+
### 2D Mockup Operations
|
|
307
|
+
|
|
308
|
+
Create, prepare, render, and manage reusable mockups from product images without a PSD.
|
|
309
|
+
|
|
310
|
+
1. **2D: Create Mockup** accepts a public `source_url` or `source_base64`, plus an optional name. Creation is asynchronous and returns the 202 response with `mockup_uuid`, `status_url`, and job details unchanged. Use the job ID with **Get Job** when needed.
|
|
311
|
+
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.
|
|
312
|
+
3. **2D: List Mockups** returns your 2D mockups.
|
|
313
|
+
4. **2D: Set Print Areas** accepts one or more print areas. Each print area is a quad with four `[x, y]` coordinate pairs.
|
|
314
|
+
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.
|
|
315
|
+
6. **2D: Delete Mockup** deletes the selected 2D mockup.
|
|
316
|
+
|
|
317
|
+
Create must reach `ready` through **2D: Get Mockup** before **2D: Render Mockup**.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
270
321
|
### Render Video
|
|
271
322
|
|
|
272
323
|
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**.
|
|
273
324
|
|
|
274
325
|
**Parameters:**
|
|
326
|
+
|
|
275
327
|
- **Input Mode**: `Render Mockup` (render a mockup with your designs first) or `Animate Image URL` (animate a public image directly)
|
|
276
328
|
- **Mockup UUID** (required in Render Mockup mode): UUID of the mockup to animate
|
|
277
329
|
- **Smart Objects** (required in Render Mockup mode): one or more smart objects with a Design URL and Fit Mode
|
|
@@ -292,10 +344,11 @@ The 202 acknowledgement (`job_id`, `kind`, `status`, `status_url`, `estimated_cr
|
|
|
292
344
|
|
|
293
345
|
### Get Job
|
|
294
346
|
|
|
295
|
-
Track an asynchronous render, upload, or
|
|
347
|
+
Track an asynchronous render, upload, video, or 2D mockup job by its `job_id`.
|
|
296
348
|
|
|
297
349
|
**Parameters:**
|
|
298
|
-
|
|
350
|
+
|
|
351
|
+
- **Job ID** (required): the `job_id` from an async render, upload, video, or 2D mockup request
|
|
299
352
|
- **Wait for Completion**: poll until a terminal status (`succeeded`, `failed`, `cancelled`)
|
|
300
353
|
- **Poll Timeout (Seconds)**: max wait when Wait for Completion is on
|
|
301
354
|
|
|
@@ -309,6 +362,7 @@ The job object. On success it surfaces `result_url` / `resultUrl` (render/video)
|
|
|
309
362
|
List your async render, upload, and video jobs (newest first, keyset paginated).
|
|
310
363
|
|
|
311
364
|
**Parameters (all optional, under Filters):**
|
|
365
|
+
|
|
312
366
|
- **Kind**: `render`, `upload`, or `video`
|
|
313
367
|
- **Mockup UUID**: only jobs derived from this source mockup
|
|
314
368
|
- **Limit**: 1-50 (default 20)
|
|
@@ -326,6 +380,7 @@ List your async render, upload, and video jobs (newest first, keyset paginated).
|
|
|
326
380
|
Manage webhook endpoints and their deliveries. See the [Webhooks](#webhooks) feature list above for the full operation set and the canonical event types.
|
|
327
381
|
|
|
328
382
|
**Common parameters:**
|
|
383
|
+
|
|
329
384
|
- **Webhook Endpoint ID** (required for get/update/delete/rotate/test/deliveries/replay/replay-failed)
|
|
330
385
|
- **Endpoint URL** + **Description** (create) and **Events** (create/update): leave Events empty to subscribe to all
|
|
331
386
|
- **Delivery ID** (replay)
|
|
@@ -338,9 +393,11 @@ Manage webhook endpoints and their deliveries. See the [Webhooks](#webhooks) fea
|
|
|
338
393
|
Ready-to-use n8n workflows are available in the [`examples/`](./examples) folder:
|
|
339
394
|
|
|
340
395
|
### 1. Complete API Test Workflow
|
|
396
|
+
|
|
341
397
|
**File**: [`examples/complete-test-workflow.json`](./examples/complete-test-workflow.json)
|
|
342
398
|
|
|
343
399
|
Tests the core mockup operations in sequence:
|
|
400
|
+
|
|
344
401
|
- Get Account Info → Upload PSD → Get Mockup → List Mockups
|
|
345
402
|
- Render Mockup → Update Name → Verify Update → Delete Mockup
|
|
346
403
|
|
|
@@ -349,9 +406,11 @@ Perfect for verifying your setup and understanding the complete workflow.
|
|
|
349
406
|
[View Details →](./examples/README.md#1-complete-api-test-complete-test-workflowjson)
|
|
350
407
|
|
|
351
408
|
### 2. Rate Limit Handling Workflow
|
|
409
|
+
|
|
352
410
|
**File**: [`examples/rate-limit-test-workflow.json`](./examples/rate-limit-test-workflow.json)
|
|
353
411
|
|
|
354
412
|
Demonstrates proper rate limit error handling with automatic retry logic:
|
|
413
|
+
|
|
355
414
|
- Detects 429 errors
|
|
356
415
|
- Extracts retry-after value
|
|
357
416
|
- Waits and automatically retries
|
|
@@ -360,9 +419,11 @@ Demonstrates proper rate limit error handling with automatic retry logic:
|
|
|
360
419
|
[View Details →](./examples/README.md#2-rate-limit-error-handling-test-rate-limit-test-workflowjson)
|
|
361
420
|
|
|
362
421
|
### 3. Sequential Batch Render Workflow
|
|
422
|
+
|
|
363
423
|
**File**: [`examples/batch-render-workflow.json`](./examples/batch-render-workflow.json)
|
|
364
424
|
|
|
365
425
|
Demonstrates the power of n8n workflows with sequential batch processing:
|
|
426
|
+
|
|
366
427
|
- Renders 10 mockups one after another
|
|
367
428
|
- Uses different designs for each render
|
|
368
429
|
- 2-second delay between renders to avoid rate limits
|
|
@@ -375,11 +436,13 @@ Perfect for understanding batch processing and workflow automation.
|
|
|
375
436
|
### Quick Start with Examples
|
|
376
437
|
|
|
377
438
|
1. Import a workflow:
|
|
439
|
+
|
|
378
440
|
```
|
|
379
441
|
n8n UI → Workflows → Import from File → Select workflow JSON
|
|
380
442
|
```
|
|
381
443
|
|
|
382
444
|
2. Configure credentials:
|
|
445
|
+
|
|
383
446
|
```
|
|
384
447
|
Click any SudoMock node → Credentials → Select your API key
|
|
385
448
|
```
|
|
@@ -458,12 +521,12 @@ Unauthenticated requests (IP-based): **30 requests per minute**
|
|
|
458
521
|
|
|
459
522
|
### Concurrent Request Limits (Plan-Based)
|
|
460
523
|
|
|
461
|
-
| Plan
|
|
462
|
-
|
|
463
|
-
| Free
|
|
464
|
-
| Starter | 3
|
|
465
|
-
| Pro
|
|
466
|
-
| Scale
|
|
524
|
+
| Plan | Concurrent Renders | Concurrent Uploads |
|
|
525
|
+
| ------- | ------------------ | ------------------ |
|
|
526
|
+
| Free | 1 | 1 |
|
|
527
|
+
| Starter | 3 | 2 |
|
|
528
|
+
| Pro | 10 | 5 |
|
|
529
|
+
| Scale | 25 | 10 |
|
|
467
530
|
|
|
468
531
|
### Rate Limit Error Handling
|
|
469
532
|
|
|
@@ -472,6 +535,7 @@ The node automatically detects and handles two types of rate limit errors:
|
|
|
472
535
|
#### 1. Request Rate Limit Exceeded (1000 RPM)
|
|
473
536
|
|
|
474
537
|
**Error Output:**
|
|
538
|
+
|
|
475
539
|
```json
|
|
476
540
|
{
|
|
477
541
|
"error": "Rate limit exceeded (1000 requests/minute). Please retry after 42 seconds.",
|
|
@@ -490,6 +554,7 @@ The node automatically detects and handles two types of rate limit errors:
|
|
|
490
554
|
#### 2. Concurrent Limit Exceeded (Plan-Based)
|
|
491
555
|
|
|
492
556
|
**Error Output:**
|
|
557
|
+
|
|
493
558
|
```json
|
|
494
559
|
{
|
|
495
560
|
"error": "Concurrent render limit reached (11/10). Please wait 5 seconds and try again.",
|
|
@@ -526,11 +591,13 @@ The node automatically detects and handles two types of rate limit errors:
|
|
|
526
591
|
## Error Handling
|
|
527
592
|
|
|
528
593
|
All operations support the **Continue On Fail** option in n8n. When enabled:
|
|
594
|
+
|
|
529
595
|
- Errors are captured as output items
|
|
530
596
|
- Workflow continues to next item
|
|
531
597
|
- Error details included in output
|
|
532
598
|
|
|
533
599
|
**Example Error Output:**
|
|
600
|
+
|
|
534
601
|
```json
|
|
535
602
|
{
|
|
536
603
|
"error": "Rate limit exceeded. Retry after 42 seconds.",
|