n8n-nodes-sudomock 0.10.0 → 0.11.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
|
@@ -41,16 +41,16 @@ n8n community node for the SudoMock API. Integrate mockup rendering into your n8
|
|
|
41
41
|
### Async Jobs
|
|
42
42
|
|
|
43
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.
|
|
44
|
-
- **List Jobs**: List your async render, upload, video, and
|
|
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
|
|
47
47
|
|
|
48
|
-
- **SudoMock Trigger**: Start a workflow from selected SudoMock events with automatic signature verification
|
|
48
|
+
- **SudoMock Trigger**: Start a workflow from selected SudoMock events with automatic signature verification. The endpoint it registers is pinned to the Photo Mockups event names (`event_naming: current`).
|
|
49
49
|
- Manage webhook endpoints that receive a signed HTTPS request the moment a job finishes:
|
|
50
50
|
- **Webhook: List Endpoints**
|
|
51
51
|
- **Webhook: Get Endpoint**
|
|
52
|
-
- **Webhook: Create Endpoint** (set an optional description
|
|
53
|
-
- **Webhook: Update Endpoint**
|
|
52
|
+
- **Webhook: Create Endpoint** (set an optional description, choose any event or leave empty for all, and pick the **Event Naming** the endpoint receives: `current` by default, or `legacy`)
|
|
53
|
+
- **Webhook: Update Endpoint** (change URL, description, enabled state, events, or re-pin **Event Naming**)
|
|
54
54
|
- **Webhook: Delete Endpoint**
|
|
55
55
|
- **Webhook: Rotate Secret**
|
|
56
56
|
- **Webhook: Send Test**
|
|
@@ -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`, `
|
|
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/api/webhooks for verification details.
|
|
63
63
|
|
|
64
64
|
## Installation
|
|
65
65
|
|
|
@@ -427,11 +427,11 @@ The job object. On success it surfaces `result_url` / `resultUrl` (render/video)
|
|
|
427
427
|
|
|
428
428
|
### List Jobs
|
|
429
429
|
|
|
430
|
-
List your async render, upload, and
|
|
430
|
+
List your async render, upload, video, and Photo Mockups jobs (newest first, keyset paginated).
|
|
431
431
|
|
|
432
432
|
**Parameters (all optional, under Filters):**
|
|
433
433
|
|
|
434
|
-
- **Kind**: `render`, `upload`, or `
|
|
434
|
+
- **Kind**: `render`, `upload`, `video`, `photo_mockup_create`, or `photo_mockup_render` (the older `2d_create` / `2d_render` spellings name the same jobs; filtering by either returns both)
|
|
435
435
|
- **Mockup UUID**: only jobs derived from this source mockup
|
|
436
436
|
- **Limit**: 1-50 (default 20)
|
|
437
437
|
- **Cursor**: opaque `next_cursor` from a previous response for pagination
|
|
@@ -451,6 +451,7 @@ Manage webhook endpoints and their deliveries. See the [Webhooks](#webhooks) fea
|
|
|
451
451
|
|
|
452
452
|
- **Webhook Endpoint ID** (required for get/update/delete/rotate/test/deliveries/replay/replay-failed)
|
|
453
453
|
- **Endpoint URL** + **Description** (create) and **Events** (create/update): leave Events empty to subscribe to all
|
|
454
|
+
- **Event Naming** (create, default `current`; update under Update Fields): which spelling of the Photo Mockups events the endpoint receives, `current` (`photo_mockup.*`, kind `photo_mockup_*`) or `legacy` (`2d_mockup.*`, kind `2d_*`)
|
|
454
455
|
- **Delivery ID** (replay)
|
|
455
456
|
- **Webhook: Events Feed** takes no parameters (returns recent deliveries across all your endpoints)
|
|
456
457
|
|
|
@@ -1589,12 +1589,14 @@ class SudoMock {
|
|
|
1589
1589
|
options: [
|
|
1590
1590
|
{ name: '2D Create', value: '2d_create' },
|
|
1591
1591
|
{ name: '2D Render', value: '2d_render' },
|
|
1592
|
+
{ name: 'Photo Mockup Create', value: 'photo_mockup_create' },
|
|
1593
|
+
{ name: 'Photo Mockup Render', value: 'photo_mockup_render' },
|
|
1592
1594
|
{ name: 'Render', value: 'render' },
|
|
1593
1595
|
{ name: 'Upload', value: 'upload' },
|
|
1594
1596
|
{ name: 'Video', value: 'video' },
|
|
1595
1597
|
],
|
|
1596
1598
|
default: 'render',
|
|
1597
|
-
description: 'Only return jobs of this kind',
|
|
1599
|
+
description: 'Only return jobs of this kind. A Photo Mockup kind and its 2D spelling name the same jobs: filtering by either returns both.',
|
|
1598
1600
|
},
|
|
1599
1601
|
{
|
|
1600
1602
|
displayName: 'Mockup UUID',
|
|
@@ -1795,6 +1797,19 @@ class SudoMock {
|
|
|
1795
1797
|
default: [],
|
|
1796
1798
|
description: 'Events this endpoint receives. Leave empty to subscribe to all events, including ones added in the future.',
|
|
1797
1799
|
},
|
|
1800
|
+
{
|
|
1801
|
+
displayName: 'Event Naming',
|
|
1802
|
+
name: 'webhookEventNaming',
|
|
1803
|
+
type: 'options',
|
|
1804
|
+
displayOptions: {
|
|
1805
|
+
show: {
|
|
1806
|
+
operation: ['webhookCreate'],
|
|
1807
|
+
},
|
|
1808
|
+
},
|
|
1809
|
+
options: webhooks_1.WEBHOOK_EVENT_NAMING_OPTIONS,
|
|
1810
|
+
default: 'current',
|
|
1811
|
+
description: 'Which spelling of the Photo Mockups events this endpoint receives. Either spelling can be selected under Events; the endpoint delivers the one chosen here.',
|
|
1812
|
+
},
|
|
1798
1813
|
{
|
|
1799
1814
|
displayName: 'Webhook Endpoint ID',
|
|
1800
1815
|
name: 'webhookId',
|
|
@@ -1851,6 +1866,14 @@ class SudoMock {
|
|
|
1851
1866
|
placeholder: 'https://your-app.com/webhooks/sudomock',
|
|
1852
1867
|
description: 'New HTTPS URL for the endpoint',
|
|
1853
1868
|
},
|
|
1869
|
+
{
|
|
1870
|
+
displayName: 'Event Naming',
|
|
1871
|
+
name: 'eventNaming',
|
|
1872
|
+
type: 'options',
|
|
1873
|
+
options: webhooks_1.WEBHOOK_EVENT_NAMING_OPTIONS,
|
|
1874
|
+
default: 'current',
|
|
1875
|
+
description: 'Re-pin the endpoint to the Photo Mockups names or the older 2D names once its receiver is ready for them. Left out, the pin stays as it is.',
|
|
1876
|
+
},
|
|
1854
1877
|
],
|
|
1855
1878
|
},
|
|
1856
1879
|
{
|
|
@@ -2814,6 +2837,7 @@ class SudoMock {
|
|
|
2814
2837
|
const url = this.getNodeParameter('webhookEndpointUrl', i);
|
|
2815
2838
|
const events = this.getNodeParameter('webhookEvents', i, []);
|
|
2816
2839
|
const description = this.getNodeParameter('webhookDescription', i, '');
|
|
2840
|
+
const eventNaming = this.getNodeParameter('webhookEventNaming', i, 'current');
|
|
2817
2841
|
const body = { url };
|
|
2818
2842
|
if (description) {
|
|
2819
2843
|
body.description = description;
|
|
@@ -2821,6 +2845,10 @@ class SudoMock {
|
|
|
2821
2845
|
if (events.length > 0) {
|
|
2822
2846
|
body.event_types = events;
|
|
2823
2847
|
}
|
|
2848
|
+
// Pinned explicitly, like the trigger's endpoint, so what a receiver
|
|
2849
|
+
// gets never depends on the server default. A workflow saved before
|
|
2850
|
+
// the option existed pins to 'current', which is what the API gave it.
|
|
2851
|
+
body.event_naming = eventNaming;
|
|
2824
2852
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
2825
2853
|
method: 'POST',
|
|
2826
2854
|
url: 'https://api.sudomock.com/api/v1/webhook-endpoints',
|
|
@@ -2852,6 +2880,11 @@ class SudoMock {
|
|
|
2852
2880
|
if (events.length > 0) {
|
|
2853
2881
|
body.event_types = events;
|
|
2854
2882
|
}
|
|
2883
|
+
// Only an explicit choice re-pins; an update that leaves the field out
|
|
2884
|
+
// keeps whatever spelling the endpoint already delivers.
|
|
2885
|
+
if (updateFields.eventNaming) {
|
|
2886
|
+
body.event_naming = updateFields.eventNaming;
|
|
2887
|
+
}
|
|
2855
2888
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'sudoMockApi', {
|
|
2856
2889
|
method: 'PATCH',
|
|
2857
2890
|
url: `https://api.sudomock.com/api/v1/webhook-endpoints/${webhookId}`,
|
|
@@ -19,7 +19,10 @@ class SudoMockTrigger {
|
|
|
19
19
|
defaults: { name: 'SudoMock Trigger' },
|
|
20
20
|
inputs: [],
|
|
21
21
|
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
22
|
-
usableAsTool:
|
|
22
|
+
// usableAsTool YOK: trigger dugumleri AI araci olarak cagrilamaz ve bu
|
|
23
|
+
// bayrak arac seciciyi kirletiyor -- n8n inceleme geri bildirimi,
|
|
24
|
+
// 0.10.0 reddi (2026-08-20). Normal SudoMock dugumundeki bayrak DOGRU
|
|
25
|
+
// ve yerinde duruyor; yalniz trigger'dan kaldirildi.
|
|
23
26
|
credentials: [{ name: 'sudoMockApi', required: true }],
|
|
24
27
|
webhooks: [
|
|
25
28
|
{
|
|
@@ -74,6 +77,11 @@ class SudoMockTrigger {
|
|
|
74
77
|
url,
|
|
75
78
|
description: 'Workflow trigger',
|
|
76
79
|
event_types: this.getNodeParameter('events', []),
|
|
80
|
+
// Pin the endpoint to the Photo Mockups event names explicitly, so
|
|
81
|
+
// the payload `type` and `kind` a workflow receives never depend
|
|
82
|
+
// on the server default. Either spelling may be selected above;
|
|
83
|
+
// the API stores and delivers the pinned one.
|
|
84
|
+
event_naming: 'current',
|
|
77
85
|
},
|
|
78
86
|
json: true,
|
|
79
87
|
}));
|
|
@@ -2,4 +2,9 @@ export declare const WEBHOOK_EVENT_OPTIONS: {
|
|
|
2
2
|
name: string;
|
|
3
3
|
value: string;
|
|
4
4
|
}[];
|
|
5
|
+
export declare const WEBHOOK_EVENT_NAMING_OPTIONS: {
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
description: string;
|
|
9
|
+
}[];
|
|
5
10
|
export declare function verifyWebhookSignature(payload: string, signature: string, timestamp: string | number, secret: string, toleranceSeconds?: number, nowSeconds?: number): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WEBHOOK_EVENT_OPTIONS = void 0;
|
|
3
|
+
exports.WEBHOOK_EVENT_NAMING_OPTIONS = exports.WEBHOOK_EVENT_OPTIONS = void 0;
|
|
4
4
|
exports.verifyWebhookSignature = verifyWebhookSignature;
|
|
5
5
|
const node_crypto_1 = require("node:crypto");
|
|
6
6
|
exports.WEBHOOK_EVENT_OPTIONS = [
|
|
@@ -14,8 +14,34 @@ exports.WEBHOOK_EVENT_OPTIONS = [
|
|
|
14
14
|
{ name: '2d_mockup.failed', value: '2d_mockup.failed' },
|
|
15
15
|
{ name: '2d_render.succeeded', value: '2d_render.succeeded' },
|
|
16
16
|
{ name: '2d_render.failed', value: '2d_render.failed' },
|
|
17
|
+
// Photo Mockups names for the five events above. Which spelling an endpoint
|
|
18
|
+
// receives is its event_naming pin: endpoints created by earlier versions
|
|
19
|
+
// keep the legacy 2d_* names, endpoints the trigger creates are pinned to these.
|
|
20
|
+
{ name: 'photo_mockup.ready', value: 'photo_mockup.ready' },
|
|
21
|
+
{ name: 'photo_mockup.rejected', value: 'photo_mockup.rejected' },
|
|
22
|
+
{ name: 'photo_mockup.failed', value: 'photo_mockup.failed' },
|
|
23
|
+
{ name: 'photo_mockup_render.succeeded', value: 'photo_mockup_render.succeeded' },
|
|
24
|
+
{ name: 'photo_mockup_render.failed', value: 'photo_mockup_render.failed' },
|
|
17
25
|
{ name: 'webhook.test', value: 'webhook.test' },
|
|
18
26
|
];
|
|
27
|
+
// The endpoint's event_naming pin. It decides which spelling of the five
|
|
28
|
+
// Photo Mockups events a delivery carries, and the payload `kind` follows it:
|
|
29
|
+
// 'current' delivers photo_mockup.* / photo_mockup_render.* with kind
|
|
30
|
+
// photo_mockup_create / photo_mockup_render, 'legacy' delivers 2d_mockup.* /
|
|
31
|
+
// 2d_render.* with kind 2d_create / 2d_render. Either spelling can be selected
|
|
32
|
+
// under Events; the pin decides what is delivered.
|
|
33
|
+
exports.WEBHOOK_EVENT_NAMING_OPTIONS = [
|
|
34
|
+
{
|
|
35
|
+
name: 'Current',
|
|
36
|
+
value: 'current',
|
|
37
|
+
description: 'Deliver the Photo Mockups names: photo_mockup.*, photo_mockup_render.*, kind photo_mockup_create or photo_mockup_render',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Legacy',
|
|
41
|
+
value: 'legacy',
|
|
42
|
+
description: 'Deliver the older names: 2d_mockup.*, 2d_render.*, kind 2d_create or 2d_render. Only for a receiver written against them',
|
|
43
|
+
},
|
|
44
|
+
];
|
|
19
45
|
function verifyWebhookSignature(payload, signature, timestamp, secret, toleranceSeconds = 300, nowSeconds = Math.floor(Date.now() / 1000)) {
|
|
20
46
|
if (!signature || !secret)
|
|
21
47
|
return false;
|