n8n-nodes-sudomock 0.11.0 → 0.12.1
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 +37 -37
- package/dist/nodes/SudoMock/SudoMock.node.js +101 -101
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
n8n community node for the SudoMock API. Integrate mockup rendering into your n8n workflows for Print-on-Demand automation.
|
|
4
4
|
|
|
5
|
-
[SudoMock](https://sudomock.com) | [Documentation](https://sudomock.com/docs) | [API Reference](https://sudomock.com/docs/api)
|
|
5
|
+
[SudoMock](https://sudomock.com) | [Documentation](https://sudomock.com/docs) | [API Reference](https://sudomock.com/docs/api-reference/introduction)
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -10,26 +10,26 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
|
|
|
10
10
|
|
|
11
11
|
- **Get Account Info**: Retrieve account details, subscription plan, and usage statistics
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### PSD Mockups
|
|
14
14
|
|
|
15
|
-
- **Upload
|
|
16
|
-
- **List
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
15
|
+
- **PSD Mockup: Upload**: Upload PSD templates from a URL
|
|
16
|
+
- **PSD Mockup: List**: List all your uploaded PSD mockup templates with filtering and pagination
|
|
17
|
+
- **PSD Mockup: Get**: Get detailed information about a specific PSD mockup template
|
|
18
|
+
- **PSD Mockup: Update**: Update the name of a PSD mockup template
|
|
19
|
+
- **PSD Mockup: Delete**: Delete a specific PSD mockup template
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### Photo Mockups
|
|
22
22
|
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
23
|
+
- **Photo Mockup: Create**: Create a reusable mockup from a product photo
|
|
24
|
+
- **Photo Mockup: Get**: Check preparation status and get the ready surfaces and print areas
|
|
25
|
+
- **Photo Mockup: List**: List your photo mockups
|
|
26
|
+
- **Photo Mockup: Set Print Areas**: Define print areas with four-point quads
|
|
27
|
+
- **Photo Mockup: Render**: Render artwork onto a ready surface or print area for 5 credits
|
|
28
|
+
- **Photo Mockup: Delete**: Delete a photo mockup
|
|
29
29
|
|
|
30
30
|
### Rendering
|
|
31
31
|
|
|
32
|
-
- **
|
|
32
|
+
- **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
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
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
35
|
|
|
@@ -40,7 +40,7 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
|
|
|
40
40
|
|
|
41
41
|
### Async Jobs
|
|
42
42
|
|
|
43
|
-
- **Get Job**: Get the status and result of an async render, upload, video, or
|
|
43
|
+
- **Get Job**: Get the status and result of an async render, upload, video, or photo 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 photo mockup creation). Optionally **Wait for Completion** to poll until the job finishes.
|
|
44
44
|
- **List Jobs**: List your async render, upload, video, and Photo Mockups jobs (keyset paginated, with optional `kind` and Mockup UUID filters).
|
|
45
45
|
|
|
46
46
|
### Webhooks
|
|
@@ -59,7 +59,7 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
|
|
|
59
59
|
- **Webhook: Replay Failed Deliveries**
|
|
60
60
|
- **Webhook: Events Feed** (recent deliveries across all of your endpoints)
|
|
61
61
|
|
|
62
|
-
Canonical events: `render.succeeded`, `render.failed`, `upload.succeeded`, `video.succeeded`, `video.failed`, `photo_mockup.ready`, `photo_mockup.rejected`, `photo_mockup.failed`, `photo_mockup_render.succeeded`, `photo_mockup_render.failed`, `webhook.test`. Endpoints created by earlier versions of this package are pinned to the legacy spelling of the five Photo Mockups events (`2d_mockup.ready`, `2d_mockup.rejected`, `2d_mockup.failed`, `2d_render.succeeded`, `2d_render.failed`) and keep receiving those names; both spellings can be selected when subscribing, the endpoint's **Event Naming** pin decides what is delivered, and **Webhook: Update Endpoint** can re-pin it. Deliveries are signed; see https://sudomock.com/docs/
|
|
62
|
+
Canonical events: `render.succeeded`, `render.failed`, `upload.succeeded`, `video.succeeded`, `video.failed`, `photo_mockup.ready`, `photo_mockup.rejected`, `photo_mockup.failed`, `photo_mockup_render.succeeded`, `photo_mockup_render.failed`, `webhook.test`. Endpoints created by earlier versions of this package are pinned to the legacy spelling of the five Photo Mockups events (`2d_mockup.ready`, `2d_mockup.rejected`, `2d_mockup.failed`, `2d_render.succeeded`, `2d_render.failed`) and keep receiving those names; both spellings can be selected when subscribing, the endpoint's **Event Naming** pin decides what is delivered, and **Webhook: Update Endpoint** can re-pin it. Deliveries are signed; see https://sudomock.com/docs/webhooks/overview for verification details.
|
|
63
63
|
|
|
64
64
|
## Installation
|
|
65
65
|
|
|
@@ -152,7 +152,7 @@ while holding a positive `prepaid_balance` and being perfectly able to pay:
|
|
|
152
152
|
|
|
153
153
|
---
|
|
154
154
|
|
|
155
|
-
### Upload
|
|
155
|
+
### PSD Mockup: Upload
|
|
156
156
|
|
|
157
157
|
Upload a PSD template from a public URL.
|
|
158
158
|
|
|
@@ -176,7 +176,7 @@ Name: T-Shirt Mockup Front
|
|
|
176
176
|
|
|
177
177
|
---
|
|
178
178
|
|
|
179
|
-
### List
|
|
179
|
+
### PSD Mockup: List
|
|
180
180
|
|
|
181
181
|
List all your uploaded mockup templates with optional filtering and pagination.
|
|
182
182
|
|
|
@@ -204,7 +204,7 @@ Each mockup as a separate item with full details (UUID, name, smart objects, thu
|
|
|
204
204
|
|
|
205
205
|
---
|
|
206
206
|
|
|
207
|
-
###
|
|
207
|
+
### PSD Mockup: Get
|
|
208
208
|
|
|
209
209
|
Retrieve detailed information about a specific mockup template.
|
|
210
210
|
|
|
@@ -223,7 +223,7 @@ Complete mockup details including all smart objects, thumbnails, and metadata.
|
|
|
223
223
|
|
|
224
224
|
---
|
|
225
225
|
|
|
226
|
-
###
|
|
226
|
+
### PSD Mockup: Update
|
|
227
227
|
|
|
228
228
|
Update the name of a mockup template.
|
|
229
229
|
|
|
@@ -244,13 +244,13 @@ Updated mockup details with the new name.
|
|
|
244
244
|
|
|
245
245
|
---
|
|
246
246
|
|
|
247
|
-
###
|
|
247
|
+
### PSD Mockup: Render
|
|
248
248
|
|
|
249
249
|
Generate a mockup by filling smart objects with your designs.
|
|
250
250
|
|
|
251
251
|
**Parameters:**
|
|
252
252
|
|
|
253
|
-
- **Mockup UUID** (required): UUID from
|
|
253
|
+
- **Mockup UUID** (required): UUID from the PSD Mockup: Upload response
|
|
254
254
|
- **Smart Objects** (required): One or more smart objects to fill
|
|
255
255
|
- Smart Object UUID
|
|
256
256
|
- Design URL (PNG, JPG, WebP)
|
|
@@ -332,11 +332,11 @@ Image URL: https://cdn.example.com/product-photo.jpg
|
|
|
332
332
|
}
|
|
333
333
|
```
|
|
334
334
|
|
|
335
|
-
The returned signed URL is valid for 7 days and can be fed straight into **
|
|
335
|
+
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.
|
|
336
336
|
|
|
337
337
|
---
|
|
338
338
|
|
|
339
|
-
###
|
|
339
|
+
### PSD Mockup: Delete
|
|
340
340
|
|
|
341
341
|
Delete a specific mockup template.
|
|
342
342
|
|
|
@@ -355,16 +355,16 @@ Deletion confirmation
|
|
|
355
355
|
|
|
356
356
|
---
|
|
357
357
|
|
|
358
|
-
###
|
|
358
|
+
### Photo Mockup Operations
|
|
359
359
|
|
|
360
360
|
Create, prepare, render, and manage reusable mockups from product images without a PSD.
|
|
361
361
|
|
|
362
|
-
1. **
|
|
363
|
-
2. **
|
|
364
|
-
3. **
|
|
365
|
-
4. **
|
|
366
|
-
5. **
|
|
367
|
-
6. **
|
|
362
|
+
1. **Photo Mockup: Create** accepts a public `source_url` or `source_base64`, plus an optional name. By default it waits and returns the ready mockup detail unchanged. Enable **Run Asynchronously** to receive a 202 job with `job_id` and `status_url`, then use **Get Job** when needed.
|
|
363
|
+
2. **Photo Mockup: Get** returns `draft`, `ready`, or `failed` status. Poll this operation until the mockup is `ready`. The ready response lists every printable product in `data.surfaces` (addressed by `surface_uuid`), and every print area someone has drawn in `data.quads` (addressed by `print_area_id`).
|
|
364
|
+
3. **Photo Mockup: List** returns your photo mockups with limit, offset, and shopper-customizable filtering.
|
|
365
|
+
4. **Photo Mockup: Set Print Areas** replaces saved areas with quads made from four `[x, y]` coordinate pairs. It can also send an empty list; the API remains authoritative and accepts that only when the mockup can remain renderable without saved areas.
|
|
366
|
+
5. **Photo Mockup: Render** accepts the mockup UUID and one or more ready render targets. Each target names exactly one address: `uuid` for a saved print area, or `surface_uuid` for a surface. Each target also includes either an artwork URL or Base64 artwork, with optional background removal (adds 25 credits per artwork), color, public adjustments, and placement. Export options support PNG, JPG, or WebP from 100 to 10000 pixels, plus quality and optional DPI. Each render costs 5 credits and returns `print_files`, where `print_files[0]` is the CDN URL.
|
|
367
|
+
6. **Photo Mockup: Delete** deletes the selected photo mockup.
|
|
368
368
|
|
|
369
369
|
A surface and a print area are separate render targets. Saving a print area on a
|
|
370
370
|
product does not close off the surface under it, so an all-over print and a chest
|
|
@@ -382,7 +382,7 @@ Placement is where the two kinds differ:
|
|
|
382
382
|
Both kinds take position, offset, and rotation. Anything you do not set is not sent,
|
|
383
383
|
so the API decides it.
|
|
384
384
|
|
|
385
|
-
Create must reach `ready` through **
|
|
385
|
+
Create must reach `ready` through **Photo Mockup: Get** before **Photo Mockup: Render**.
|
|
386
386
|
|
|
387
387
|
---
|
|
388
388
|
|
|
@@ -412,11 +412,11 @@ The 202 acknowledgement (`job_id`, `kind`, `status`, `status_url`, `estimated_cr
|
|
|
412
412
|
|
|
413
413
|
### Get Job
|
|
414
414
|
|
|
415
|
-
Track an asynchronous render, upload, video, or
|
|
415
|
+
Track an asynchronous render, upload, video, or photo mockup job by its `job_id`.
|
|
416
416
|
|
|
417
417
|
**Parameters:**
|
|
418
418
|
|
|
419
|
-
- **Job ID** (required): the `job_id` from an async render, upload, video, or
|
|
419
|
+
- **Job ID** (required): the `job_id` from an async render, upload, video, or photo mockup request
|
|
420
420
|
- **Wait for Completion**: poll until a terminal status (`succeeded`, `failed`, `cancelled`)
|
|
421
421
|
- **Poll Timeout (Seconds)**: max wait when Wait for Completion is on
|
|
422
422
|
|
|
@@ -439,7 +439,7 @@ List your async render, upload, video, and Photo Mockups jobs (newest first, key
|
|
|
439
439
|
**Output:**
|
|
440
440
|
`{ jobs: [...], next_cursor }`.
|
|
441
441
|
|
|
442
|
-
> **Note:** Bulk "delete all mockups" is intentionally not exposed
|
|
442
|
+
> **Note:** Bulk "delete all mockups" is intentionally not exposed: the API accepts `DELETE /psd-mockups/all` only from a dashboard sign-in, so it is not callable with an API key. Delete mockups individually with **PSD Mockup: Delete**, or use the SudoMock dashboard.
|
|
443
443
|
|
|
444
444
|
---
|
|
445
445
|
|
|
@@ -749,7 +749,7 @@ pnpm lintfix
|
|
|
749
749
|
## Resources
|
|
750
750
|
|
|
751
751
|
- [SudoMock Website](https://sudomock.com)
|
|
752
|
-
- [API Documentation](https://sudomock.com/docs/api)
|
|
752
|
+
- [API Documentation](https://sudomock.com/docs/api-reference/introduction)
|
|
753
753
|
- [n8n Documentation](https://docs.n8n.io)
|
|
754
754
|
- [Report Issues](https://github.com/sudomock/n8n-nodes-sudomock/issues)
|
|
755
755
|
|
|
@@ -53,7 +53,7 @@ class SudoMock {
|
|
|
53
53
|
group: ['transform'],
|
|
54
54
|
version: 1,
|
|
55
55
|
subtitle: '={{$parameter["operation"]}}',
|
|
56
|
-
description: 'Generate PSD
|
|
56
|
+
description: 'Generate PSD mockups, photo mockups and product videos for Print-on-Demand automation. Upload PSDs, turn product photos into mockups, render with your designs, render videos, run renders asynchronously, track jobs, and manage webhooks.',
|
|
57
57
|
defaults: {
|
|
58
58
|
name: 'SudoMock',
|
|
59
59
|
},
|
|
@@ -76,54 +76,12 @@ class SudoMock {
|
|
|
76
76
|
type: 'options',
|
|
77
77
|
noDataExpression: true,
|
|
78
78
|
options: [
|
|
79
|
-
{
|
|
80
|
-
name: '2D: Create Mockup',
|
|
81
|
-
value: 'create2DMockup',
|
|
82
|
-
description: 'Create a 2D mockup now or queue it for background processing',
|
|
83
|
-
action: 'Create a 2D mockup',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: '2D: Delete Mockup',
|
|
87
|
-
value: 'delete2DMockup',
|
|
88
|
-
description: 'Delete a 2D mockup',
|
|
89
|
-
action: 'Delete a 2D mockup',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: '2D: Get Mockup',
|
|
93
|
-
value: 'get2DMockup',
|
|
94
|
-
description: 'Get the status and addressable render targets of a 2D mockup',
|
|
95
|
-
action: 'Get a 2D mockup',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: '2D: List Mockups',
|
|
99
|
-
value: 'list2DMockups',
|
|
100
|
-
description: 'List your 2D mockups',
|
|
101
|
-
action: 'List 2D mockups',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: '2D: Render Mockup',
|
|
105
|
-
value: 'render2DMockup',
|
|
106
|
-
description: 'Render artwork on a 2D mockup for 5 credits',
|
|
107
|
-
action: 'Render a 2D mockup',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: '2D: Set Print Areas',
|
|
111
|
-
value: 'set2DPrintAreas',
|
|
112
|
-
description: 'Replace or clear the saved print area quads for a 2D mockup',
|
|
113
|
-
action: 'Set 2D print areas',
|
|
114
|
-
},
|
|
115
79
|
{
|
|
116
80
|
name: 'Artwork: Delete Stored Files',
|
|
117
81
|
value: 'deleteArtworks',
|
|
118
82
|
description: 'Delete stored order artwork by URL or mockup UUID',
|
|
119
83
|
action: 'Delete stored artwork',
|
|
120
84
|
},
|
|
121
|
-
{
|
|
122
|
-
name: 'Delete Mockup',
|
|
123
|
-
value: 'deleteMockup',
|
|
124
|
-
description: 'Delete a specific mockup template',
|
|
125
|
-
action: 'Delete a mockup',
|
|
126
|
-
},
|
|
127
85
|
{
|
|
128
86
|
name: 'Font: Delete Custom Font',
|
|
129
87
|
value: 'deleteFont',
|
|
@@ -160,12 +118,6 @@ class SudoMock {
|
|
|
160
118
|
description: 'Poll an async job by its job_id (GET /jobs/{job_id}) to get its status and result',
|
|
161
119
|
action: 'Get a job',
|
|
162
120
|
},
|
|
163
|
-
{
|
|
164
|
-
name: 'Get Mockup',
|
|
165
|
-
value: 'getMockup',
|
|
166
|
-
description: 'Get details of a specific mockup template',
|
|
167
|
-
action: 'Get mockup details',
|
|
168
|
-
},
|
|
169
121
|
{
|
|
170
122
|
name: 'List Jobs',
|
|
171
123
|
value: 'listJobs',
|
|
@@ -173,41 +125,89 @@ class SudoMock {
|
|
|
173
125
|
action: 'List jobs',
|
|
174
126
|
},
|
|
175
127
|
{
|
|
176
|
-
name: '
|
|
177
|
-
value: '
|
|
178
|
-
description: '
|
|
179
|
-
action: '
|
|
128
|
+
name: 'Photo Mockup: Create',
|
|
129
|
+
value: 'create2DMockup',
|
|
130
|
+
description: 'Create a photo mockup now or queue it for background processing',
|
|
131
|
+
action: 'Create a photo mockup',
|
|
180
132
|
},
|
|
181
133
|
{
|
|
182
|
-
name: '
|
|
183
|
-
value: '
|
|
184
|
-
description: '
|
|
185
|
-
action: '
|
|
134
|
+
name: 'Photo Mockup: Delete',
|
|
135
|
+
value: 'delete2DMockup',
|
|
136
|
+
description: 'Delete a photo mockup',
|
|
137
|
+
action: 'Delete a photo mockup',
|
|
186
138
|
},
|
|
187
139
|
{
|
|
188
|
-
name: '
|
|
189
|
-
value: '
|
|
190
|
-
description: '
|
|
191
|
-
action: '
|
|
140
|
+
name: 'Photo Mockup: Get',
|
|
141
|
+
value: 'get2DMockup',
|
|
142
|
+
description: 'Get the status and addressable render targets of a photo mockup',
|
|
143
|
+
action: 'Get a photo mockup',
|
|
192
144
|
},
|
|
193
145
|
{
|
|
194
|
-
name: '
|
|
195
|
-
value: '
|
|
196
|
-
description: '
|
|
197
|
-
action: '
|
|
146
|
+
name: 'Photo Mockup: List',
|
|
147
|
+
value: 'list2DMockups',
|
|
148
|
+
description: 'List your photo mockups',
|
|
149
|
+
action: 'List photo mockups',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'Photo Mockup: Render',
|
|
153
|
+
value: 'render2DMockup',
|
|
154
|
+
description: 'Render artwork on a photo mockup for 5 credits',
|
|
155
|
+
action: 'Render a photo mockup',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'Photo Mockup: Set Print Areas',
|
|
159
|
+
value: 'set2DPrintAreas',
|
|
160
|
+
description: 'Replace or clear the saved print area quads for a photo mockup',
|
|
161
|
+
action: 'Set photo mockup print areas',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'PSD Mockup: Delete',
|
|
165
|
+
value: 'deleteMockup',
|
|
166
|
+
description: 'Delete a specific PSD mockup template',
|
|
167
|
+
action: 'Delete a PSD mockup',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'PSD Mockup: Get',
|
|
171
|
+
value: 'getMockup',
|
|
172
|
+
description: 'Get details of a specific PSD mockup template',
|
|
173
|
+
action: 'Get PSD mockup details',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'PSD Mockup: List',
|
|
177
|
+
value: 'listMockups',
|
|
178
|
+
description: 'List all your uploaded PSD mockup templates',
|
|
179
|
+
action: 'List PSD mockups',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'PSD Mockup: Render',
|
|
183
|
+
value: 'render',
|
|
184
|
+
description: 'Render a PSD mockup with your design',
|
|
185
|
+
action: 'Render a PSD mockup',
|
|
198
186
|
},
|
|
199
187
|
{
|
|
200
|
-
name: '
|
|
188
|
+
name: 'PSD Mockup: Update',
|
|
201
189
|
value: 'updateMockup',
|
|
202
|
-
description: 'Update mockup template name',
|
|
203
|
-
action: 'Update mockup name',
|
|
190
|
+
description: 'Update PSD mockup template name',
|
|
191
|
+
action: 'Update PSD mockup name',
|
|
204
192
|
},
|
|
205
193
|
{
|
|
206
|
-
name: 'Upload
|
|
194
|
+
name: 'PSD Mockup: Upload',
|
|
207
195
|
value: 'uploadPsd',
|
|
208
196
|
description: 'Upload a PSD template from URL',
|
|
209
197
|
action: 'Upload a PSD template',
|
|
210
198
|
},
|
|
199
|
+
{
|
|
200
|
+
name: 'Remove Background',
|
|
201
|
+
value: 'removeBackground',
|
|
202
|
+
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.',
|
|
203
|
+
action: 'Remove an image background',
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'Render Video',
|
|
207
|
+
value: 'renderVideo',
|
|
208
|
+
description: 'Turn a mockup into a short product video (always async)',
|
|
209
|
+
action: 'Render a video',
|
|
210
|
+
},
|
|
211
211
|
{
|
|
212
212
|
name: 'Webhook: Create Endpoint',
|
|
213
213
|
value: 'webhookCreate',
|
|
@@ -278,7 +278,7 @@ class SudoMock {
|
|
|
278
278
|
default: 'render',
|
|
279
279
|
},
|
|
280
280
|
// ============================================
|
|
281
|
-
//
|
|
281
|
+
// PHOTO MOCKUP PARAMETERS
|
|
282
282
|
// ============================================
|
|
283
283
|
{
|
|
284
284
|
displayName: 'Source Type',
|
|
@@ -293,16 +293,16 @@ class SudoMock {
|
|
|
293
293
|
{
|
|
294
294
|
name: 'Image URL',
|
|
295
295
|
value: 'url',
|
|
296
|
-
description: 'Public image URL for the new
|
|
296
|
+
description: 'Public image URL for the new photo mockup',
|
|
297
297
|
},
|
|
298
298
|
{
|
|
299
299
|
name: 'Base64 Image',
|
|
300
300
|
value: 'base64',
|
|
301
|
-
description: 'Base64 image data for the new
|
|
301
|
+
description: 'Base64 image data for the new photo mockup',
|
|
302
302
|
},
|
|
303
303
|
],
|
|
304
304
|
default: 'url',
|
|
305
|
-
description: 'Image source for the new
|
|
305
|
+
description: 'Image source for the new photo mockup',
|
|
306
306
|
},
|
|
307
307
|
{
|
|
308
308
|
displayName: 'Source URL',
|
|
@@ -317,7 +317,7 @@ class SudoMock {
|
|
|
317
317
|
},
|
|
318
318
|
default: '',
|
|
319
319
|
placeholder: 'https://cdn.example.com/product.png',
|
|
320
|
-
description: 'Public image URL for the new
|
|
320
|
+
description: 'Public image URL for the new photo mockup',
|
|
321
321
|
},
|
|
322
322
|
{
|
|
323
323
|
displayName: 'Source Base64',
|
|
@@ -331,7 +331,7 @@ class SudoMock {
|
|
|
331
331
|
},
|
|
332
332
|
},
|
|
333
333
|
default: '',
|
|
334
|
-
description: 'Base64 image data for the new
|
|
334
|
+
description: 'Base64 image data for the new photo mockup',
|
|
335
335
|
},
|
|
336
336
|
{
|
|
337
337
|
displayName: 'Name',
|
|
@@ -344,7 +344,7 @@ class SudoMock {
|
|
|
344
344
|
},
|
|
345
345
|
default: '',
|
|
346
346
|
placeholder: 'T-Shirt Front',
|
|
347
|
-
description: 'Optional human-readable name for the new
|
|
347
|
+
description: 'Optional human-readable name for the new photo mockup',
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
350
|
displayName: 'Run Asynchronously',
|
|
@@ -352,7 +352,7 @@ class SudoMock {
|
|
|
352
352
|
type: 'boolean',
|
|
353
353
|
displayOptions: { show: { operation: ['create2DMockup'] } },
|
|
354
354
|
default: false,
|
|
355
|
-
description: 'Whether to queue creation and return a job_id (kind:
|
|
355
|
+
description: 'Whether to queue creation and return a job_id (kind: photo_mockup_create) immediately',
|
|
356
356
|
},
|
|
357
357
|
{
|
|
358
358
|
displayName: 'Limit',
|
|
@@ -361,7 +361,7 @@ class SudoMock {
|
|
|
361
361
|
typeOptions: { minValue: 1, maxValue: 100 },
|
|
362
362
|
displayOptions: { show: { operation: ['list2DMockups'] } },
|
|
363
363
|
default: 50,
|
|
364
|
-
description: 'Number of
|
|
364
|
+
description: 'Number of photo mockups to return from 1 to 100',
|
|
365
365
|
},
|
|
366
366
|
{
|
|
367
367
|
displayName: 'Offset',
|
|
@@ -370,7 +370,7 @@ class SudoMock {
|
|
|
370
370
|
typeOptions: { minValue: 0 },
|
|
371
371
|
displayOptions: { show: { operation: ['list2DMockups'] } },
|
|
372
372
|
default: 0,
|
|
373
|
-
description: 'Number of
|
|
373
|
+
description: 'Number of photo mockups to skip',
|
|
374
374
|
},
|
|
375
375
|
{
|
|
376
376
|
displayName: 'Customizable Only',
|
|
@@ -392,7 +392,7 @@ class SudoMock {
|
|
|
392
392
|
},
|
|
393
393
|
default: '',
|
|
394
394
|
placeholder: 'c315f78f-d2c7-4541-b240-a9372842de94',
|
|
395
|
-
description: 'UUID of the
|
|
395
|
+
description: 'UUID of the photo mockup to get, set print areas for, render, or delete',
|
|
396
396
|
},
|
|
397
397
|
{
|
|
398
398
|
displayName: 'Print Areas',
|
|
@@ -726,7 +726,7 @@ class SudoMock {
|
|
|
726
726
|
},
|
|
727
727
|
},
|
|
728
728
|
default: '',
|
|
729
|
-
description: 'The print_area_id returned in data.quads by
|
|
729
|
+
description: 'The print_area_id returned in data.quads by Photo Mockup: Get',
|
|
730
730
|
},
|
|
731
731
|
{
|
|
732
732
|
displayName: 'Surface Placement',
|
|
@@ -817,7 +817,7 @@ class SudoMock {
|
|
|
817
817
|
},
|
|
818
818
|
},
|
|
819
819
|
default: '',
|
|
820
|
-
description: 'The surface_uuid returned in data.surfaces by
|
|
820
|
+
description: 'The surface_uuid returned in data.surfaces by Photo Mockup: Get',
|
|
821
821
|
},
|
|
822
822
|
{
|
|
823
823
|
displayName: 'Target Type',
|
|
@@ -853,7 +853,7 @@ class SudoMock {
|
|
|
853
853
|
},
|
|
854
854
|
},
|
|
855
855
|
default: {},
|
|
856
|
-
description: 'Output image settings for the rendered
|
|
856
|
+
description: 'Output image settings for the rendered photo mockup',
|
|
857
857
|
options: [
|
|
858
858
|
{
|
|
859
859
|
displayName: 'Image Format',
|
|
@@ -902,7 +902,7 @@ class SudoMock {
|
|
|
902
902
|
type: 'boolean',
|
|
903
903
|
displayOptions: { show: { operation: ['render2DMockup'] } },
|
|
904
904
|
default: false,
|
|
905
|
-
description: 'Whether to queue the render and return a job_id (kind:
|
|
905
|
+
description: 'Whether to queue the render and return a job_id (kind: photo_mockup_render) immediately',
|
|
906
906
|
},
|
|
907
907
|
// ============================================
|
|
908
908
|
// UPLOAD PSD PARAMETERS
|
|
@@ -1537,7 +1537,7 @@ class SudoMock {
|
|
|
1537
1537
|
},
|
|
1538
1538
|
default: '',
|
|
1539
1539
|
placeholder: '9d4e2b51-0c7a-4f8e-bb1c-2a6f9e3d8c10',
|
|
1540
|
-
description: 'The job_id returned by an async render, upload, video, or
|
|
1540
|
+
description: 'The job_id returned by an async render, upload, video, or photo mockup request',
|
|
1541
1541
|
},
|
|
1542
1542
|
{
|
|
1543
1543
|
displayName: 'Wait for Completion',
|
|
@@ -2172,7 +2172,7 @@ class SudoMock {
|
|
|
2172
2172
|
});
|
|
2173
2173
|
}
|
|
2174
2174
|
// ========================================
|
|
2175
|
-
//
|
|
2175
|
+
// PHOTO MOCKUP: CREATE
|
|
2176
2176
|
// ========================================
|
|
2177
2177
|
else if (operation === 'create2DMockup') {
|
|
2178
2178
|
const sourceMode = this.getNodeParameter('twoDSourceMode', i);
|
|
@@ -2197,7 +2197,7 @@ class SudoMock {
|
|
|
2197
2197
|
}
|
|
2198
2198
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
2199
2199
|
method: 'POST',
|
|
2200
|
-
url: 'https://api.sudomock.com/api/v1/
|
|
2200
|
+
url: 'https://api.sudomock.com/api/v1/photo-mockups',
|
|
2201
2201
|
body,
|
|
2202
2202
|
json: true,
|
|
2203
2203
|
});
|
|
@@ -2207,13 +2207,13 @@ class SudoMock {
|
|
|
2207
2207
|
});
|
|
2208
2208
|
}
|
|
2209
2209
|
// ========================================
|
|
2210
|
-
//
|
|
2210
|
+
// PHOTO MOCKUP: GET
|
|
2211
2211
|
// ========================================
|
|
2212
2212
|
else if (operation === 'get2DMockup') {
|
|
2213
2213
|
const mockupUuid = this.getNodeParameter('twoDMockupUuid', i);
|
|
2214
2214
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
2215
2215
|
method: 'GET',
|
|
2216
|
-
url: `https://api.sudomock.com/api/v1/
|
|
2216
|
+
url: `https://api.sudomock.com/api/v1/photo-mockups/${mockupUuid}`,
|
|
2217
2217
|
json: true,
|
|
2218
2218
|
});
|
|
2219
2219
|
returnData.push({
|
|
@@ -2222,7 +2222,7 @@ class SudoMock {
|
|
|
2222
2222
|
});
|
|
2223
2223
|
}
|
|
2224
2224
|
// ========================================
|
|
2225
|
-
//
|
|
2225
|
+
// PHOTO MOCKUP: LIST
|
|
2226
2226
|
// ========================================
|
|
2227
2227
|
else if (operation === 'list2DMockups') {
|
|
2228
2228
|
const limit = this.getNodeParameter('twoDListLimit', i, 20);
|
|
@@ -2230,7 +2230,7 @@ class SudoMock {
|
|
|
2230
2230
|
const customizableOnly = this.getNodeParameter('twoDListCustomizableOnly', i, false);
|
|
2231
2231
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
2232
2232
|
method: 'GET',
|
|
2233
|
-
url: 'https://api.sudomock.com/api/v1/
|
|
2233
|
+
url: 'https://api.sudomock.com/api/v1/photo-mockups',
|
|
2234
2234
|
qs: {
|
|
2235
2235
|
limit,
|
|
2236
2236
|
offset,
|
|
@@ -2244,7 +2244,7 @@ class SudoMock {
|
|
|
2244
2244
|
});
|
|
2245
2245
|
}
|
|
2246
2246
|
// ========================================
|
|
2247
|
-
//
|
|
2247
|
+
// PHOTO MOCKUP: SET PRINT AREAS
|
|
2248
2248
|
// ========================================
|
|
2249
2249
|
else if (operation === 'set2DPrintAreas') {
|
|
2250
2250
|
const mockupUuid = this.getNodeParameter('twoDMockupUuid', i);
|
|
@@ -2252,7 +2252,7 @@ class SudoMock {
|
|
|
2252
2252
|
const body = { print_areas: format2DPrintAreas(printAreas) };
|
|
2253
2253
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
2254
2254
|
method: 'PUT',
|
|
2255
|
-
url: `https://api.sudomock.com/api/v1/
|
|
2255
|
+
url: `https://api.sudomock.com/api/v1/photo-mockups/${mockupUuid}/print-areas`,
|
|
2256
2256
|
body,
|
|
2257
2257
|
json: true,
|
|
2258
2258
|
});
|
|
@@ -2262,7 +2262,7 @@ class SudoMock {
|
|
|
2262
2262
|
});
|
|
2263
2263
|
}
|
|
2264
2264
|
// ========================================
|
|
2265
|
-
//
|
|
2265
|
+
// PHOTO MOCKUP: RENDER
|
|
2266
2266
|
// ========================================
|
|
2267
2267
|
else if (operation === 'render2DMockup') {
|
|
2268
2268
|
const mockupUuid = this.getNodeParameter('twoDMockupUuid', i);
|
|
@@ -2366,7 +2366,7 @@ class SudoMock {
|
|
|
2366
2366
|
}
|
|
2367
2367
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
2368
2368
|
method: 'POST',
|
|
2369
|
-
url: `https://api.sudomock.com/api/v1/
|
|
2369
|
+
url: `https://api.sudomock.com/api/v1/photo-mockups/${mockupUuid}/render`,
|
|
2370
2370
|
body,
|
|
2371
2371
|
json: true,
|
|
2372
2372
|
});
|
|
@@ -2376,13 +2376,13 @@ class SudoMock {
|
|
|
2376
2376
|
});
|
|
2377
2377
|
}
|
|
2378
2378
|
// ========================================
|
|
2379
|
-
//
|
|
2379
|
+
// PHOTO MOCKUP: DELETE
|
|
2380
2380
|
// ========================================
|
|
2381
2381
|
else if (operation === 'delete2DMockup') {
|
|
2382
2382
|
const mockupUuid = this.getNodeParameter('twoDMockupUuid', i);
|
|
2383
2383
|
await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
2384
2384
|
method: 'DELETE',
|
|
2385
|
-
url: `https://api.sudomock.com/api/v1/
|
|
2385
|
+
url: `https://api.sudomock.com/api/v1/photo-mockups/${mockupUuid}`,
|
|
2386
2386
|
});
|
|
2387
2387
|
returnData.push({
|
|
2388
2388
|
json: {
|
|
@@ -3049,7 +3049,7 @@ class SudoMock {
|
|
|
3049
3049
|
}
|
|
3050
3050
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
3051
3051
|
method: 'GET',
|
|
3052
|
-
url: 'https://api.sudomock.com/api/v1/mockups',
|
|
3052
|
+
url: 'https://api.sudomock.com/api/v1/psd-mockups',
|
|
3053
3053
|
qs: queryParams,
|
|
3054
3054
|
json: true,
|
|
3055
3055
|
});
|
|
@@ -3075,7 +3075,7 @@ class SudoMock {
|
|
|
3075
3075
|
const mockupUuid = this.getNodeParameter('getMockupUuid', i);
|
|
3076
3076
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
3077
3077
|
method: 'GET',
|
|
3078
|
-
url: `https://api.sudomock.com/api/v1/mockups/${mockupUuid}`,
|
|
3078
|
+
url: `https://api.sudomock.com/api/v1/psd-mockups/${mockupUuid}`,
|
|
3079
3079
|
json: true,
|
|
3080
3080
|
});
|
|
3081
3081
|
returnData.push({
|
|
@@ -3091,7 +3091,7 @@ class SudoMock {
|
|
|
3091
3091
|
const newName = this.getNodeParameter('newName', i);
|
|
3092
3092
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
3093
3093
|
method: 'PATCH',
|
|
3094
|
-
url: `https://api.sudomock.com/api/v1/mockups/${mockupUuid}`,
|
|
3094
|
+
url: `https://api.sudomock.com/api/v1/psd-mockups/${mockupUuid}`,
|
|
3095
3095
|
body: {
|
|
3096
3096
|
name: newName,
|
|
3097
3097
|
},
|
|
@@ -3109,7 +3109,7 @@ class SudoMock {
|
|
|
3109
3109
|
const mockupUuid = this.getNodeParameter('deleteMockupUuid', i);
|
|
3110
3110
|
await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
3111
3111
|
method: 'DELETE',
|
|
3112
|
-
url: `https://api.sudomock.com/api/v1/mockups/${mockupUuid}`,
|
|
3112
|
+
url: `https://api.sudomock.com/api/v1/psd-mockups/${mockupUuid}`,
|
|
3113
3113
|
// No json: true - DELETE returns 204 No Content (no body)
|
|
3114
3114
|
});
|
|
3115
3115
|
// Create manual success response for 204 No Content
|