@bambuser/n8n-nodes-livecommerce 0.1.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/LICENSE +21 -0
- package/README.md +188 -0
- package/dist/credentials/BambuserApi.credentials.js +55 -0
- package/dist/credentials/bambuser.svg +13 -0
- package/dist/lib/resolveOrigin.js +14 -0
- package/dist/nodes/BambuserCalls/BambuserCalls.node.js +295 -0
- package/dist/nodes/BambuserCalls/bambuser-live.svg +3 -0
- package/dist/nodes/BambuserProductCatalog/BambuserProductCatalog.node.js +236 -0
- package/dist/nodes/BambuserProductCatalog/bambuser-vod.svg +12 -0
- package/dist/nodes/BambuserShopperData/BambuserShopperData.node.js +170 -0
- package/dist/nodes/BambuserShopperData/bambuser-vod.svg +12 -0
- package/dist/nodes/BambuserShows/BambuserShows.node.js +1432 -0
- package/dist/nodes/BambuserShows/bambuser-live.svg +3 -0
- package/dist/nodes/BambuserVod/BambuserVod.node.js +704 -0
- package/dist/nodes/BambuserVod/bambuser-vod.svg +12 -0
- package/dist/nodes/BambuserWebhookTrigger/BambuserWebhookTrigger.node.js +114 -0
- package/dist/nodes/BambuserWebhookTrigger/bambuser-webhook.svg +8 -0
- package/package.json +77 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 72">
|
|
2
|
+
<defs>
|
|
3
|
+
<clipPath id="bvod-a">
|
|
4
|
+
<path d="M36.3354 72h-36V0h36z"/>
|
|
5
|
+
</clipPath>
|
|
6
|
+
<clipPath id="bvod-b">
|
|
7
|
+
<path d="M75.0005 72h-36V0h36z"/>
|
|
8
|
+
</clipPath>
|
|
9
|
+
</defs>
|
|
10
|
+
<circle cx="0.3354" cy="36" r="36" fill="#FB752B" clip-path="url(#bvod-a)"/>
|
|
11
|
+
<circle cx="39.0005" cy="36" r="36" fill="#FB752B" clip-path="url(#bvod-b)"/>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BambuserWebhookTrigger = void 0;
|
|
4
|
+
const resolveOrigin_1 = require("../../lib/resolveOrigin");
|
|
5
|
+
class BambuserWebhookTrigger {
|
|
6
|
+
description = {
|
|
7
|
+
displayName: 'Bambuser Webhook Trigger',
|
|
8
|
+
name: 'bambuserWebhookTrigger',
|
|
9
|
+
icon: 'file:bambuser-webhook.svg',
|
|
10
|
+
group: ['trigger'],
|
|
11
|
+
version: 1,
|
|
12
|
+
description: 'Starts a workflow when Bambuser fires a webhook event. Registers the n8n URL with Bambuser on activation. Requires WRITE_WEBHOOKS scope. Note: deactivating the workflow does not remove the Bambuser subscription — delete it manually from the Bambuser dashboard.',
|
|
13
|
+
defaults: { name: 'Bambuser Webhook Trigger' },
|
|
14
|
+
inputs: [],
|
|
15
|
+
outputs: ['main'],
|
|
16
|
+
credentials: [{ name: 'bambuserApi', required: true }],
|
|
17
|
+
webhooks: [
|
|
18
|
+
{
|
|
19
|
+
name: 'default',
|
|
20
|
+
httpMethod: 'POST',
|
|
21
|
+
responseMode: 'onReceived',
|
|
22
|
+
path: 'webhook',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
properties: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Topics',
|
|
28
|
+
name: 'topics',
|
|
29
|
+
type: 'multiOptions',
|
|
30
|
+
required: true,
|
|
31
|
+
options: [
|
|
32
|
+
{ name: 'Broadcast', value: 'broadcast' },
|
|
33
|
+
{ name: 'Product', value: 'product' },
|
|
34
|
+
{ name: 'Product Highlight', value: 'product-highlight' },
|
|
35
|
+
{ name: 'Show', value: 'show' },
|
|
36
|
+
{ name: 'User', value: 'user' },
|
|
37
|
+
],
|
|
38
|
+
default: [],
|
|
39
|
+
description: 'Event topics this webhook will receive',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Subscription Name',
|
|
43
|
+
name: 'subscriptionName',
|
|
44
|
+
type: 'string',
|
|
45
|
+
default: 'n8n',
|
|
46
|
+
description: 'Label for the webhook registration in the Bambuser dashboard',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
usableAsTool: true,
|
|
50
|
+
};
|
|
51
|
+
webhookMethods = {
|
|
52
|
+
default: {
|
|
53
|
+
async checkExists() {
|
|
54
|
+
const staticData = this.getWorkflowStaticData('node');
|
|
55
|
+
if (typeof staticData.webhookId !== 'string' || !staticData.webhookId)
|
|
56
|
+
return false;
|
|
57
|
+
// If the tunnel URL changed since last registration, re-register with the new URL.
|
|
58
|
+
const currentUrl = this.getNodeWebhookUrl('default');
|
|
59
|
+
return staticData.webhookUrl === currentUrl;
|
|
60
|
+
},
|
|
61
|
+
async create() {
|
|
62
|
+
const credentials = await this.getCredentials('bambuserApi');
|
|
63
|
+
const origin = (0, resolveOrigin_1.resolveOrigin)(credentials.baseUrl, credentials.region);
|
|
64
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
65
|
+
const topics = this.getNodeParameter('topics');
|
|
66
|
+
const subscriptionName = this.getNodeParameter('subscriptionName');
|
|
67
|
+
const staticData = this.getWorkflowStaticData('node');
|
|
68
|
+
const body = { name: subscriptionName, url: webhookUrl, topics, headers: {} };
|
|
69
|
+
// checkExists returns false both when there's no registration AND when the
|
|
70
|
+
// URL drifted. In the latter case we already hold a webhookId — PUT to update
|
|
71
|
+
// rather than POST to create a duplicate.
|
|
72
|
+
if (typeof staticData.webhookId === 'string' && staticData.webhookId) {
|
|
73
|
+
await this.helpers.httpRequestWithAuthentication.call(this, 'bambuserApi', {
|
|
74
|
+
method: 'PUT',
|
|
75
|
+
url: `${origin}/v1/webhooks/${staticData.webhookId}`,
|
|
76
|
+
headers: { 'Content-Type': 'application/json' },
|
|
77
|
+
body,
|
|
78
|
+
});
|
|
79
|
+
staticData.webhookUrl = webhookUrl;
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'bambuserApi', {
|
|
83
|
+
method: 'POST',
|
|
84
|
+
url: `${origin}/v1/webhooks`,
|
|
85
|
+
headers: { 'Content-Type': 'application/json' },
|
|
86
|
+
body,
|
|
87
|
+
});
|
|
88
|
+
staticData.webhookId = response.id;
|
|
89
|
+
staticData.webhookUrl = webhookUrl;
|
|
90
|
+
return true;
|
|
91
|
+
},
|
|
92
|
+
async delete() {
|
|
93
|
+
const staticData = this.getWorkflowStaticData('node');
|
|
94
|
+
if (typeof staticData.webhookId !== 'string' || !staticData.webhookId)
|
|
95
|
+
return true;
|
|
96
|
+
const credentials = await this.getCredentials('bambuserApi');
|
|
97
|
+
const origin = (0, resolveOrigin_1.resolveOrigin)(credentials.baseUrl, credentials.region);
|
|
98
|
+
await this.helpers.httpRequestWithAuthentication.call(this, 'bambuserApi', {
|
|
99
|
+
method: 'DELETE',
|
|
100
|
+
url: `${origin}/v1/webhooks/${staticData.webhookId}`,
|
|
101
|
+
}).catch(() => { });
|
|
102
|
+
delete staticData.webhookId;
|
|
103
|
+
return true;
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
async webhook() {
|
|
108
|
+
const bodyData = this.getBodyData();
|
|
109
|
+
return {
|
|
110
|
+
workflowData: [[{ json: bodyData }]],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.BambuserWebhookTrigger = BambuserWebhookTrigger;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72">
|
|
2
|
+
<circle cx="36" cy="36" r="36" fill="#FB752B"/>
|
|
3
|
+
<path d="M36 44a8 8 0 1 1 0-16 8 8 0 0 1 0 16z" fill="white"/>
|
|
4
|
+
<path d="M22.1 49.9a20 20 0 0 1 0-28.3" fill="none" stroke="white" stroke-width="3.5" stroke-linecap="round"/>
|
|
5
|
+
<path d="M49.9 22.1a20 20 0 0 1 0 27.8" fill="none" stroke="white" stroke-width="3.5" stroke-linecap="round"/>
|
|
6
|
+
<path d="M27.5 44.5a12 12 0 0 1 0-17" fill="none" stroke="white" stroke-width="3.5" stroke-linecap="round"/>
|
|
7
|
+
<path d="M44.5 27.5a12 12 0 0 1 0 17" fill="none" stroke="white" stroke-width="3.5" stroke-linecap="round"/>
|
|
8
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bambuser/n8n-nodes-livecommerce",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n nodes for the Bambuser Live Commerce platform — live shopping, video on demand, calls, product catalog, shopper data, and webhook triggers. Free Bambuser account at https://bambuser.com.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"n8n",
|
|
8
|
+
"bambuser",
|
|
9
|
+
"livecommerce",
|
|
10
|
+
"live-shopping",
|
|
11
|
+
"video-commerce",
|
|
12
|
+
"vod",
|
|
13
|
+
"product-catalog"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://github.com/bambuser/n8n-nodes-livecommerce#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/bambuser/n8n-nodes-livecommerce.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/bambuser/n8n-nodes-livecommerce/issues"
|
|
23
|
+
},
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "Bambuser",
|
|
26
|
+
"url": "https://bambuser.com"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=24"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "n8n-node build",
|
|
41
|
+
"build:watch": "tsc --watch",
|
|
42
|
+
"dev": "n8n-node dev",
|
|
43
|
+
"lint": "n8n-node lint",
|
|
44
|
+
"lint:fix": "n8n-node lint --fix",
|
|
45
|
+
"test": "node --import tsx --test \"tests/unit/**/*.test.ts\"",
|
|
46
|
+
"test:stage": "node --env-file-if-exists=.env.stage --import tsx --test \"tests/stage/**/*.test.ts\"",
|
|
47
|
+
"release": "n8n-node release",
|
|
48
|
+
"prepublishOnly": "n8n-node prerelease"
|
|
49
|
+
},
|
|
50
|
+
"n8n": {
|
|
51
|
+
"n8nNodesApiVersion": 1,
|
|
52
|
+
"strict": true,
|
|
53
|
+
"credentials": [
|
|
54
|
+
"dist/credentials/BambuserApi.credentials.js"
|
|
55
|
+
],
|
|
56
|
+
"nodes": [
|
|
57
|
+
"dist/nodes/BambuserShows/BambuserShows.node.js",
|
|
58
|
+
"dist/nodes/BambuserVod/BambuserVod.node.js",
|
|
59
|
+
"dist/nodes/BambuserCalls/BambuserCalls.node.js",
|
|
60
|
+
"dist/nodes/BambuserProductCatalog/BambuserProductCatalog.node.js",
|
|
61
|
+
"dist/nodes/BambuserShopperData/BambuserShopperData.node.js",
|
|
62
|
+
"dist/nodes/BambuserWebhookTrigger/BambuserWebhookTrigger.node.js"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@n8n/node-cli": "^0.23.0",
|
|
67
|
+
"@types/node": "^24.0.0",
|
|
68
|
+
"eslint": "9.39.4",
|
|
69
|
+
"prettier": "3.8.3",
|
|
70
|
+
"release-it": "20.0.1",
|
|
71
|
+
"tsx": "^4.22.3",
|
|
72
|
+
"typescript": "5.9.3"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"n8n-workflow": "*"
|
|
76
|
+
}
|
|
77
|
+
}
|