n8n-nodes-pinbridge 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 pinbridge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # n8n-nodes-pinbridge
2
+
3
+ PinBridge community node for n8n. It publishes Pinterest pins through the PinBridge API and checks publish status.
4
+
5
+ ## Features
6
+
7
+ - Credentials: PinBridge API Key + Base URL
8
+ - Boards:
9
+ - List Boards
10
+ - Board dropdown via loadOptions
11
+ - Pins:
12
+ - Publish Pin (item-by-item bulk from incoming n8n items)
13
+ - Get Pin Status (job status)
14
+ - Connections:
15
+ - List connected Pinterest accounts
16
+
17
+ ## API contract source
18
+
19
+ This node is implemented from the PinBridge API source in `../api` and `../api/docs/openapi.json`.
20
+ Contract notes used for implementation: `docs/api-contract-notes.md`.
21
+
22
+ ## Authentication
23
+
24
+ PinBridge accepts:
25
+
26
+ - `X-API-Key: <key>`
27
+ - `Authorization: Bearer <jwt-or-api-key>`
28
+
29
+ This node uses `X-API-Key`.
30
+
31
+ ## Installation (self-hosted n8n)
32
+
33
+ 1. In your n8n custom nodes environment, install the package:
34
+
35
+ ```bash
36
+ npm install n8n-nodes-pinbridge
37
+ ```
38
+
39
+ 2. Restart n8n.
40
+
41
+ 3. In n8n, create credentials:
42
+ - **Credential type**: `PinBridge API Key`
43
+ - **Base URL**: your PinBridge API URL (default from API config is `http://localhost:8000`)
44
+ - **API Key**: your PinBridge API key
45
+
46
+ If you do not already have a key, create one from your PinBridge setup flow (dashboard/API, depending on your deployment).
47
+
48
+ ## Operations
49
+
50
+ ### Connections -> List
51
+ Calls `GET /v1/pinterest/accounts`.
52
+
53
+ ### Boards -> List
54
+ Calls `GET /v1/pinterest/boards?account_id=...`.
55
+
56
+ ### Pins -> Publish
57
+ Calls `POST /v1/pins` with:
58
+ - `account_id`
59
+ - `board_id`
60
+ - `title`
61
+ - `description` (optional)
62
+ - `link_url` (optional)
63
+ - `image_url`
64
+ - `idempotency_key`
65
+
66
+ Idempotency key defaults to `{{$execution.id}}-{{$itemIndex}}`.
67
+
68
+ ### Pins -> Get Status
69
+ Calls `GET /v1/jobs/{job_id}`.
70
+
71
+ ## Notes
72
+
73
+ - Current PinBridge publish endpoint accepts `image_url` only. Binary image upload is not supported by the API contract used here.
74
+ - Plan/billing errors may return structured details under `detail.error` (`code`, `message`, `upgrade_url`).
75
+
76
+ ## Example workflows
77
+
78
+ ### 1) Publish one pin from image URL + link
79
+ 1. Set `resource=Pins`, `operation=Publish`.
80
+ 2. Choose Connection and Board.
81
+ 3. Fill `Title`, `Image URL`, optional `Link URL` and `Description`.
82
+ 4. Execute node.
83
+
84
+ ### 2) Publish multiple pins via SplitInBatches
85
+ 1. Feed a list of pin payload items into `SplitInBatches`.
86
+ 2. Map fields into PinBridge Publish parameters with expressions.
87
+ 3. Keep default idempotency key or map your own unique key per item.
88
+ 4. Each incoming item publishes one pin.
89
+
90
+ ### 3) Poll status after publish
91
+ 1. Use Publish output `id`.
92
+ 2. Add another PinBridge node with `resource=Pins`, `operation=Get Status` and `Pin ID={{$json.id}}`.
93
+ 3. Optional: place `Wait` + loop until status is `published` or `failed`.
94
+
95
+ ## Development
96
+
97
+ ```bash
98
+ npm install
99
+ npm run lint
100
+ npm run build
101
+ npm run dev
102
+ ```
@@ -0,0 +1,22 @@
1
+ import type { ICredentialType, IHttpRequestMethods, INodeProperties } from 'n8n-workflow';
2
+ export declare class PinBridgeApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: {
8
+ readonly type: "generic";
9
+ readonly properties: {
10
+ readonly headers: {
11
+ readonly 'X-API-Key': "={{$credentials.apiKey}}";
12
+ };
13
+ };
14
+ };
15
+ test: {
16
+ request: {
17
+ baseURL: string;
18
+ url: string;
19
+ method: IHttpRequestMethods;
20
+ };
21
+ };
22
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PinBridgeApi = void 0;
4
+ class PinBridgeApi {
5
+ constructor() {
6
+ this.name = 'pinBridgeApi';
7
+ this.displayName = 'PinBridge API Key';
8
+ this.documentationUrl = 'https://docs.n8n.io/integrations/creating-nodes/';
9
+ this.properties = [
10
+ {
11
+ displayName: 'Base URL',
12
+ name: 'baseUrl',
13
+ type: 'string',
14
+ default: 'http://localhost:8000',
15
+ required: true,
16
+ placeholder: 'https://api.pinbridge.io',
17
+ description: 'PinBridge API base URL. Use your self-hosted API URL or the hosted API endpoint.',
18
+ },
19
+ {
20
+ displayName: 'API Key',
21
+ name: 'apiKey',
22
+ type: 'string',
23
+ typeOptions: {
24
+ password: true,
25
+ },
26
+ default: '',
27
+ required: true,
28
+ description: 'PinBridge API key sent in the X-API-Key header',
29
+ },
30
+ ];
31
+ this.authenticate = {
32
+ type: 'generic',
33
+ properties: {
34
+ headers: {
35
+ 'X-API-Key': '={{$credentials.apiKey}}',
36
+ },
37
+ },
38
+ };
39
+ this.test = {
40
+ request: {
41
+ baseURL: '={{$credentials.baseUrl}}',
42
+ url: '/v1/pinterest/accounts',
43
+ method: 'GET',
44
+ },
45
+ };
46
+ }
47
+ }
48
+ exports.PinBridgeApi = PinBridgeApi;
49
+ //# sourceMappingURL=PinBridgeApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinBridgeApi.credentials.js","sourceRoot":"","sources":["../../credentials/PinBridgeApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAY;IAAzB;QACC,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,mBAAmB,CAAC;QAClC,qBAAgB,GAAG,kDAAkD,CAAC;QAEtE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAuB;gBAChC,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,0BAA0B;gBACvC,WAAW,EACV,kFAAkF;aACnF;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gDAAgD;aAC7D;SACD,CAAC;QAEF,iBAAY,GAAG;YACd,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,WAAW,EAAE,0BAA0B;iBACvC;aACD;SACQ,CAAC;QAEX,SAAI,GAAG;YACN,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,wBAAwB;gBAC7B,MAAM,EAAE,KAA4B;aACpC;SACD,CAAC;IACH,CAAC;CAAA;AA7CD,oCA6CC"}
@@ -0,0 +1,2 @@
1
+ export { PinBridge } from './nodes/PinBridge/PinBridge.node';
2
+ export { PinBridgeApi } from './credentials/PinBridgeApi.credentials';
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PinBridgeApi = exports.PinBridge = void 0;
4
+ var PinBridge_node_1 = require("./nodes/PinBridge/PinBridge.node");
5
+ Object.defineProperty(exports, "PinBridge", { enumerable: true, get: function () { return PinBridge_node_1.PinBridge; } });
6
+ var PinBridgeApi_credentials_1 = require("./credentials/PinBridgeApi.credentials");
7
+ Object.defineProperty(exports, "PinBridgeApi", { enumerable: true, get: function () { return PinBridgeApi_credentials_1.PinBridgeApi; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,mEAA6D;AAApD,2GAAA,SAAS,OAAA;AAClB,mFAAsE;AAA7D,wHAAA,YAAY,OAAA"}
@@ -0,0 +1,7 @@
1
+ import type { IDataObject, IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-workflow';
2
+ import type { PinBridgeMethod, PinBridgeQuery } from '../../src/transport/PinBridgeClient';
3
+ import { PinBridgeClient } from '../../src/transport/PinBridgeClient';
4
+ type PinBridgeContext = IExecuteFunctions | ILoadOptionsFunctions;
5
+ export declare function getPinBridgeClient(this: PinBridgeContext): Promise<PinBridgeClient>;
6
+ export declare function pinBridgeApiRequest<TResponse = IDataObject>(this: PinBridgeContext, method: PinBridgeMethod, path: string, query?: PinBridgeQuery, body?: IDataObject): Promise<TResponse>;
7
+ export {};
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPinBridgeClient = getPinBridgeClient;
4
+ exports.pinBridgeApiRequest = pinBridgeApiRequest;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const PinBridgeClient_1 = require("../../src/transport/PinBridgeClient");
7
+ async function getPinBridgeCredentials() {
8
+ var _a, _b;
9
+ const rawCredentials = await this.getCredentials('pinBridgeApi');
10
+ const baseUrl = String((_a = rawCredentials.baseUrl) !== null && _a !== void 0 ? _a : '').trim();
11
+ const apiKey = String((_b = rawCredentials.apiKey) !== null && _b !== void 0 ? _b : '').trim();
12
+ if (!baseUrl) {
13
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'PinBridge base URL is required in credentials.');
14
+ }
15
+ if (!apiKey) {
16
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'PinBridge API key is required in credentials.');
17
+ }
18
+ return {
19
+ baseUrl,
20
+ apiKey,
21
+ };
22
+ }
23
+ function buildNodeApiError(context, error) {
24
+ const errorDetails = [];
25
+ if (error.statusCode !== undefined) {
26
+ errorDetails.push(`HTTP ${error.statusCode}`);
27
+ }
28
+ if (error.requestId) {
29
+ errorDetails.push(`request_id: ${error.requestId}`);
30
+ }
31
+ let description = `PinBridge request failed for ${error.method} ${error.path}`;
32
+ if (errorDetails.length > 0) {
33
+ description = `${description} (${errorDetails.join(', ')})`;
34
+ }
35
+ return new n8n_workflow_1.NodeApiError(context.getNode(), {
36
+ message: error.message,
37
+ detail: error.detail,
38
+ }, {
39
+ message: error.message,
40
+ description,
41
+ });
42
+ }
43
+ async function getPinBridgeClient() {
44
+ const credentials = await getPinBridgeCredentials.call(this);
45
+ return new PinBridgeClient_1.PinBridgeClient({
46
+ baseUrl: credentials.baseUrl,
47
+ apiKey: credentials.apiKey,
48
+ executor: async (request) => {
49
+ const requestOptions = {
50
+ method: request.method,
51
+ url: request.url,
52
+ headers: request.headers,
53
+ };
54
+ if (request.body !== undefined) {
55
+ requestOptions.body = request.body;
56
+ }
57
+ return (await this.helpers.httpRequest.call(this, requestOptions));
58
+ },
59
+ });
60
+ }
61
+ async function pinBridgeApiRequest(method, path, query, body) {
62
+ const client = await getPinBridgeClient.call(this);
63
+ try {
64
+ return await client.request({
65
+ method,
66
+ path,
67
+ query,
68
+ body,
69
+ });
70
+ }
71
+ catch (error) {
72
+ if (error instanceof PinBridgeClient_1.PinBridgeApiError) {
73
+ throw buildNodeApiError(this, error);
74
+ }
75
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
76
+ description: `Unexpected PinBridge request error for ${method} ${path}`,
77
+ });
78
+ }
79
+ }
80
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/PinBridge/GenericFunctions.ts"],"names":[],"mappings":";;AAsEA,gDAoBC;AAED,kDAyBC;AA9GD,+CAAgE;AAOhE,yEAAyF;AASzF,KAAK,UAAU,uBAAuB;;IACrC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,MAAM,CAAC,MAAA,cAAc,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAA,cAAc,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAE1D,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,gDAAgD,CAAC,CAAC;IAChG,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,+CAA+C,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO;QACN,OAAO;QACP,MAAM;KACN,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAyB,EAAE,KAAwB;IAC7E,MAAM,YAAY,GAAa,EAAE,CAAC;IAElC,IAAI,KAAK,CAAC,UAAU,KAAK,SAA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AC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAc,CAAC;QACjF,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,mBAAmB,CAExC,MAAuB,EACvB,IAAY,EACZ,KAAsB,EACtB,IAAkB;IAElB,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEnD,IAAI,CAAC;QACJ,OAAO,MAAM,MAAM,CAAC,OAAO,CAAY;YACtC,MAAM;YACN,IAAI;YACJ,KAAK;YACL,IAAI;SACJ,CAAC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,mCAAiB,EAAE,CAAC;YACxC,MAAM,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAmB,EAAE;YAC3D,WAAW,EAAE,0CAA0C,MAAM,IAAI,IAAI,EAAE;SACvE,CAAC,CAAC;IACJ,CAAC;AACF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { IExecuteFunctions, ILoadOptionsFunctions, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class PinBridge implements INodeType {
3
+ description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getAccounts(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
+ getBoards(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
8
+ };
9
+ };
10
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
11
+ }
@@ -0,0 +1,458 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PinBridge = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const GenericFunctions_1 = require("./GenericFunctions");
6
+ function normalizeAccountName(account) {
7
+ return (account.display_name ||
8
+ account.username ||
9
+ account.pinterest_user_id ||
10
+ `Account ${account.id}`);
11
+ }
12
+ class PinBridge {
13
+ constructor() {
14
+ this.description = {
15
+ displayName: 'PinBridge',
16
+ name: 'pinBridge',
17
+ icon: 'file:pinbridge.svg',
18
+ group: ['output'],
19
+ version: 1,
20
+ subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
21
+ description: 'Publish and track Pinterest pins through the PinBridge API',
22
+ defaults: {
23
+ name: 'PinBridge',
24
+ },
25
+ inputs: ['main'],
26
+ outputs: ['main'],
27
+ credentials: [
28
+ {
29
+ name: 'pinBridgeApi',
30
+ required: true,
31
+ },
32
+ ],
33
+ properties: [
34
+ {
35
+ displayName: 'Resource',
36
+ name: 'resource',
37
+ type: 'options',
38
+ noDataExpression: true,
39
+ options: [
40
+ {
41
+ name: 'Boards',
42
+ value: 'boards',
43
+ },
44
+ {
45
+ name: 'Pins',
46
+ value: 'pins',
47
+ },
48
+ {
49
+ name: 'Connections',
50
+ value: 'connections',
51
+ },
52
+ ],
53
+ default: 'pins',
54
+ },
55
+ {
56
+ displayName: 'Operation',
57
+ name: 'operation',
58
+ type: 'options',
59
+ noDataExpression: true,
60
+ displayOptions: {
61
+ show: {
62
+ resource: ['boards'],
63
+ },
64
+ },
65
+ options: [
66
+ {
67
+ name: 'List',
68
+ value: 'list',
69
+ action: 'List boards',
70
+ },
71
+ ],
72
+ default: 'list',
73
+ },
74
+ {
75
+ displayName: 'Operation',
76
+ name: 'operation',
77
+ type: 'options',
78
+ noDataExpression: true,
79
+ displayOptions: {
80
+ show: {
81
+ resource: ['pins'],
82
+ },
83
+ },
84
+ options: [
85
+ {
86
+ name: 'Publish',
87
+ value: 'publish',
88
+ action: 'Publish a pin',
89
+ },
90
+ {
91
+ name: 'Get Status',
92
+ value: 'getStatus',
93
+ action: 'Get a pin status',
94
+ },
95
+ ],
96
+ default: 'publish',
97
+ },
98
+ {
99
+ displayName: 'Operation',
100
+ name: 'operation',
101
+ type: 'options',
102
+ noDataExpression: true,
103
+ displayOptions: {
104
+ show: {
105
+ resource: ['connections'],
106
+ },
107
+ },
108
+ options: [
109
+ {
110
+ name: 'List',
111
+ value: 'list',
112
+ action: 'List connected Pinterest accounts',
113
+ },
114
+ ],
115
+ default: 'list',
116
+ },
117
+ {
118
+ displayName: 'Connection',
119
+ name: 'accountId',
120
+ type: 'options',
121
+ typeOptions: {
122
+ loadOptionsMethod: 'getAccounts',
123
+ },
124
+ displayOptions: {
125
+ show: {
126
+ resource: ['boards'],
127
+ operation: ['list'],
128
+ },
129
+ },
130
+ default: '',
131
+ required: true,
132
+ description: 'Pinterest connection/account ID from PinBridge',
133
+ },
134
+ {
135
+ displayName: 'Return All',
136
+ name: 'returnAll',
137
+ type: 'boolean',
138
+ displayOptions: {
139
+ show: {
140
+ resource: ['boards', 'connections'],
141
+ operation: ['list'],
142
+ },
143
+ },
144
+ default: true,
145
+ description: 'Whether to return all records or only up to a given limit',
146
+ },
147
+ {
148
+ displayName: 'Limit',
149
+ name: 'limit',
150
+ type: 'number',
151
+ typeOptions: {
152
+ minValue: 1,
153
+ maxValue: 1000,
154
+ },
155
+ displayOptions: {
156
+ show: {
157
+ resource: ['boards', 'connections'],
158
+ operation: ['list'],
159
+ returnAll: [false],
160
+ },
161
+ },
162
+ default: 50,
163
+ description: 'Max number of records to return when Return All is disabled',
164
+ },
165
+ {
166
+ displayName: 'Connection',
167
+ name: 'accountId',
168
+ type: 'options',
169
+ typeOptions: {
170
+ loadOptionsMethod: 'getAccounts',
171
+ },
172
+ displayOptions: {
173
+ show: {
174
+ resource: ['pins'],
175
+ operation: ['publish'],
176
+ },
177
+ },
178
+ default: '',
179
+ required: true,
180
+ description: 'Pinterest connection/account used for publishing',
181
+ },
182
+ {
183
+ displayName: 'Board',
184
+ name: 'boardId',
185
+ type: 'options',
186
+ typeOptions: {
187
+ loadOptionsMethod: 'getBoards',
188
+ },
189
+ displayOptions: {
190
+ show: {
191
+ resource: ['pins'],
192
+ operation: ['publish'],
193
+ },
194
+ },
195
+ default: '',
196
+ required: true,
197
+ description: 'Pinterest board ID where the pin will be published',
198
+ },
199
+ {
200
+ displayName: 'Title',
201
+ name: 'title',
202
+ type: 'string',
203
+ displayOptions: {
204
+ show: {
205
+ resource: ['pins'],
206
+ operation: ['publish'],
207
+ },
208
+ },
209
+ default: '',
210
+ required: true,
211
+ description: 'Pin title (max 500 characters)',
212
+ },
213
+ {
214
+ displayName: 'Description',
215
+ name: 'description',
216
+ type: 'string',
217
+ typeOptions: {
218
+ rows: 3,
219
+ },
220
+ displayOptions: {
221
+ show: {
222
+ resource: ['pins'],
223
+ operation: ['publish'],
224
+ },
225
+ },
226
+ default: '',
227
+ description: 'Optional pin description',
228
+ },
229
+ {
230
+ displayName: 'Link URL',
231
+ name: 'linkUrl',
232
+ type: 'string',
233
+ displayOptions: {
234
+ show: {
235
+ resource: ['pins'],
236
+ operation: ['publish'],
237
+ },
238
+ },
239
+ default: '',
240
+ description: 'Optional destination URL for the pin',
241
+ },
242
+ {
243
+ displayName: 'Image URL',
244
+ name: 'imageUrl',
245
+ type: 'string',
246
+ displayOptions: {
247
+ show: {
248
+ resource: ['pins'],
249
+ operation: ['publish'],
250
+ },
251
+ },
252
+ default: '',
253
+ required: true,
254
+ description: 'Public image URL. PinBridge /v1/pins currently accepts image_url only (no binary upload).',
255
+ },
256
+ {
257
+ displayName: 'Idempotency Key',
258
+ name: 'idempotencyKey',
259
+ type: 'string',
260
+ displayOptions: {
261
+ show: {
262
+ resource: ['pins'],
263
+ operation: ['publish'],
264
+ },
265
+ },
266
+ default: '={{$execution.id + "-" + $itemIndex}}',
267
+ required: true,
268
+ description: 'Deduplication key sent to PinBridge as idempotency_key',
269
+ },
270
+ {
271
+ displayName: 'Pin ID',
272
+ name: 'pinId',
273
+ type: 'string',
274
+ displayOptions: {
275
+ show: {
276
+ resource: ['pins'],
277
+ operation: ['getStatus'],
278
+ },
279
+ },
280
+ default: '={{$json["id"]}}',
281
+ required: true,
282
+ description: 'Pin/Job UUID returned by publish operation',
283
+ },
284
+ ],
285
+ };
286
+ this.methods = {
287
+ loadOptions: {
288
+ async getAccounts() {
289
+ const accounts = await GenericFunctions_1.pinBridgeApiRequest.call(this, 'GET', '/v1/pinterest/accounts');
290
+ const typedAccounts = accounts;
291
+ return typedAccounts
292
+ .map((account) => ({
293
+ name: normalizeAccountName(account),
294
+ value: account.id,
295
+ description: account.scopes || undefined,
296
+ }))
297
+ .sort((a, b) => a.name.localeCompare(b.name));
298
+ },
299
+ async getBoards() {
300
+ const accountId = this.getCurrentNodeParameter('accountId');
301
+ if (!accountId) {
302
+ return [];
303
+ }
304
+ const boards = await GenericFunctions_1.pinBridgeApiRequest.call(this, 'GET', '/v1/pinterest/boards', { account_id: accountId });
305
+ const typedBoards = boards;
306
+ return typedBoards
307
+ .map((board) => ({
308
+ name: board.name,
309
+ value: board.id,
310
+ description: board.privacy || undefined,
311
+ }))
312
+ .sort((a, b) => a.name.localeCompare(b.name));
313
+ },
314
+ },
315
+ };
316
+ }
317
+ async execute() {
318
+ var _a, _b, _c, _d, _e, _f, _g, _h;
319
+ const items = this.getInputData();
320
+ const resource = this.getNodeParameter('resource', 0);
321
+ const operation = this.getNodeParameter('operation', 0);
322
+ const returnData = [];
323
+ if (resource === 'boards' && operation === 'list') {
324
+ const accountId = this.getNodeParameter('accountId', 0);
325
+ const returnAll = this.getNodeParameter('returnAll', 0);
326
+ const limit = this.getNodeParameter('limit', 0, 50);
327
+ const boards = (await GenericFunctions_1.pinBridgeApiRequest.call(this, 'GET', '/v1/pinterest/boards', { account_id: accountId }));
328
+ const selectedBoards = returnAll ? boards : boards.slice(0, limit);
329
+ for (const board of selectedBoards) {
330
+ returnData.push({
331
+ json: {
332
+ id: board.id,
333
+ name: board.name,
334
+ description: (_a = board.description) !== null && _a !== void 0 ? _a : null,
335
+ privacy: (_b = board.privacy) !== null && _b !== void 0 ? _b : null,
336
+ raw: board,
337
+ },
338
+ });
339
+ }
340
+ return [returnData];
341
+ }
342
+ if (resource === 'connections' && operation === 'list') {
343
+ const returnAll = this.getNodeParameter('returnAll', 0);
344
+ const limit = this.getNodeParameter('limit', 0, 50);
345
+ const accounts = (await GenericFunctions_1.pinBridgeApiRequest.call(this, 'GET', '/v1/pinterest/accounts'));
346
+ const selectedAccounts = returnAll ? accounts : accounts.slice(0, limit);
347
+ for (const account of selectedAccounts) {
348
+ returnData.push({
349
+ json: {
350
+ id: account.id,
351
+ name: normalizeAccountName(account),
352
+ scopes: account.scopes,
353
+ pinterestUserId: account.pinterest_user_id,
354
+ raw: account,
355
+ },
356
+ });
357
+ }
358
+ return [returnData];
359
+ }
360
+ if (resource === 'pins' && operation === 'publish') {
361
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
362
+ try {
363
+ const accountId = this.getNodeParameter('accountId', itemIndex);
364
+ const boardId = this.getNodeParameter('boardId', itemIndex);
365
+ const title = this.getNodeParameter('title', itemIndex);
366
+ const description = this.getNodeParameter('description', itemIndex, '');
367
+ const linkUrl = this.getNodeParameter('linkUrl', itemIndex, '');
368
+ const imageUrl = this.getNodeParameter('imageUrl', itemIndex);
369
+ const idempotencyKey = this.getNodeParameter('idempotencyKey', itemIndex);
370
+ const body = {
371
+ account_id: accountId,
372
+ board_id: boardId,
373
+ title,
374
+ image_url: imageUrl,
375
+ idempotency_key: idempotencyKey,
376
+ };
377
+ if (description) {
378
+ body.description = description;
379
+ }
380
+ if (linkUrl) {
381
+ body.link_url = linkUrl;
382
+ }
383
+ const pin = (await GenericFunctions_1.pinBridgeApiRequest.call(this, 'POST', '/v1/pins', undefined, body));
384
+ returnData.push({
385
+ json: {
386
+ id: pin.id,
387
+ status: pin.status,
388
+ pinterestPinId: (_c = pin.pinterest_pin_id) !== null && _c !== void 0 ? _c : null,
389
+ boardId: pin.board_id,
390
+ imageUrl: pin.image_url,
391
+ linkUrl: (_d = pin.link_url) !== null && _d !== void 0 ? _d : null,
392
+ raw: pin,
393
+ },
394
+ pairedItem: { item: itemIndex },
395
+ });
396
+ }
397
+ catch (error) {
398
+ if (this.continueOnFail()) {
399
+ returnData.push({
400
+ json: {
401
+ error: error.message,
402
+ itemIndex,
403
+ },
404
+ pairedItem: { item: itemIndex },
405
+ });
406
+ continue;
407
+ }
408
+ throw error;
409
+ }
410
+ }
411
+ return [returnData];
412
+ }
413
+ if (resource === 'pins' && operation === 'getStatus') {
414
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
415
+ try {
416
+ const pinId = this.getNodeParameter('pinId', itemIndex);
417
+ if (!pinId) {
418
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Pin ID is required', {
419
+ itemIndex,
420
+ });
421
+ }
422
+ const statusResponse = (await GenericFunctions_1.pinBridgeApiRequest.call(this, 'GET', `/v1/jobs/${encodeURIComponent(pinId)}`));
423
+ returnData.push({
424
+ json: {
425
+ jobId: statusResponse.job_id,
426
+ pinId: statusResponse.pin_id,
427
+ status: statusResponse.status,
428
+ submittedAt: statusResponse.submitted_at,
429
+ completedAt: (_e = statusResponse.completed_at) !== null && _e !== void 0 ? _e : null,
430
+ pinterestPinId: (_f = statusResponse.pinterest_pin_id) !== null && _f !== void 0 ? _f : null,
431
+ errorCode: (_g = statusResponse.error_code) !== null && _g !== void 0 ? _g : null,
432
+ errorMessage: (_h = statusResponse.error_message) !== null && _h !== void 0 ? _h : null,
433
+ raw: statusResponse,
434
+ },
435
+ pairedItem: { item: itemIndex },
436
+ });
437
+ }
438
+ catch (error) {
439
+ if (this.continueOnFail()) {
440
+ returnData.push({
441
+ json: {
442
+ error: error.message,
443
+ itemIndex,
444
+ },
445
+ pairedItem: { item: itemIndex },
446
+ });
447
+ continue;
448
+ }
449
+ throw error;
450
+ }
451
+ }
452
+ return [returnData];
453
+ }
454
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported operation: ${resource}.${operation}`);
455
+ }
456
+ }
457
+ exports.PinBridge = PinBridge;
458
+ //# sourceMappingURL=PinBridge.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinBridge.node.js","sourceRoot":"","sources":["../../../nodes/PinBridge/PinBridge.node.ts"],"names":[],"mappings":";;;AASA,+CAAkD;AAElD,yDAAyD;AAyCzD,SAAS,oBAAoB,CAAC,OAAyB;IACtD,OAAO,CACN,OAAO,CAAC,YAAY;QACpB,OAAO,CAAC,QAAQ;QAChB,OAAO,CAAC,iBAAiB;QACzB,WAAW,OAAO,CAAC,EAAE,EAAE,CACvB,CAAC;AACH,CAAC;AAED,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,cAAc;oBACpB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,QAAQ;yBACf;wBACD;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;yBACb;wBACD;4BACC,IAAI,EAAE,aAAa;4BACnB,KAAK,EAAE,aAAa;yBACpB;qBACD;oBACD,OAAO,EAAE,MAAM;iBACf;gBACD;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,S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AAC;gBACJ,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;wBAC3B,UAAU,CAAC,IAAI,CAAC;4BACf,IAAI,EAAE;gCACL,KAAK,EAAG,KAAe,CAAC,OAAO;gCAC/B,SAAS;6BACT;4BACD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;yBAC/B,CAAC,CAAC;wBACH,SAAS;oBACV,CAAC;oBACD,MAAM,KAAK,CAAC;gBACb,CAAC;YACF,CAAC;YAED,OAAO,CAAC,UAAU,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,0BAA0B,QAAQ,IAAI,SAAS,EAAE,CAAC,CAAC;IACjG,CAAC;CACD;AAxeD,8BAweC"}
@@ -0,0 +1,4 @@
1
+ <svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="2" y="2" width="60" height="60" rx="14" fill="#E60023"/>
3
+ <path d="M33.9 15.5c-9.2 0-15.3 6.5-15.3 14.6 0 5.6 3.2 10.6 8.3 12.5.9.3 1.4.1 1.6-.7.1-.5.9-3.5 1.1-4.5.1-.5.1-.8-.3-1.3-1-1.2-1.8-3.4-1.8-5.5 0-5.3 4-10.1 10.8-10.1 5.9 0 10 3.9 10 9.5 0 6.3-3.2 10.7-7.3 10.7-2.3 0-4-1.9-3.4-4.2.7-2.8 2-5.8 2-7.9 0-1.8-1-3.3-3-3.3-2.4 0-4.3 2.5-4.3 5.8 0 2.1.7 3.5.7 3.5l-2.8 11.7c-.5 2.2-.1 5.1 0 6.7.1.6.8.8 1.2.3 1.3-1.8 3-4.8 3.6-7 .2-.8 1-3.8 1-3.8.9 1.8 3.4 3.2 6 3.2 7.9 0 13.6-7.3 13.6-16.4 0-8.7-7.1-15.3-16.4-15.3z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,45 @@
1
+ export type PinBridgeMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
2
+ export interface PinBridgeQuery {
3
+ [key: string]: string | number | boolean | null | undefined;
4
+ }
5
+ export interface PinBridgeRequestOptions {
6
+ method: PinBridgeMethod;
7
+ path: string;
8
+ query?: PinBridgeQuery;
9
+ body?: unknown;
10
+ headers?: Record<string, string>;
11
+ }
12
+ export interface PinBridgeHttpRequest {
13
+ method: PinBridgeMethod;
14
+ url: string;
15
+ headers: Record<string, string>;
16
+ body?: unknown;
17
+ }
18
+ export type PinBridgeRequestExecutor = <TResponse = unknown>(request: PinBridgeHttpRequest) => Promise<TResponse>;
19
+ export interface PinBridgeClientConfig {
20
+ baseUrl: string;
21
+ apiKey: string;
22
+ executor: PinBridgeRequestExecutor;
23
+ }
24
+ interface PinBridgeApiErrorContext {
25
+ method: PinBridgeMethod;
26
+ path: string;
27
+ statusCode?: number;
28
+ detail?: unknown;
29
+ requestId?: string;
30
+ }
31
+ export declare class PinBridgeApiError extends Error {
32
+ readonly method: PinBridgeMethod;
33
+ readonly path: string;
34
+ readonly statusCode?: number;
35
+ readonly detail?: unknown;
36
+ readonly requestId?: string;
37
+ constructor(message: string, context: PinBridgeApiErrorContext);
38
+ }
39
+ export declare class PinBridgeClient {
40
+ private readonly config;
41
+ private readonly baseUrl;
42
+ constructor(config: PinBridgeClientConfig);
43
+ request<TResponse = unknown>(options: PinBridgeRequestOptions): Promise<TResponse>;
44
+ }
45
+ export {};
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PinBridgeClient = exports.PinBridgeApiError = void 0;
4
+ class PinBridgeApiError extends Error {
5
+ constructor(message, context) {
6
+ super(message);
7
+ this.name = 'PinBridgeApiError';
8
+ this.method = context.method;
9
+ this.path = context.path;
10
+ this.statusCode = context.statusCode;
11
+ this.detail = context.detail;
12
+ this.requestId = context.requestId;
13
+ }
14
+ }
15
+ exports.PinBridgeApiError = PinBridgeApiError;
16
+ function normalizeBaseUrl(baseUrl) {
17
+ return baseUrl.replace(/\/+$/, '');
18
+ }
19
+ function appendQuery(url, query) {
20
+ for (const [key, value] of Object.entries(query)) {
21
+ if (value === undefined || value === null || value === '') {
22
+ continue;
23
+ }
24
+ url.searchParams.set(key, String(value));
25
+ }
26
+ }
27
+ function asRecord(value) {
28
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
29
+ return undefined;
30
+ }
31
+ return value;
32
+ }
33
+ function asString(value) {
34
+ return typeof value === 'string' ? value : undefined;
35
+ }
36
+ function asNumber(value) {
37
+ if (typeof value === 'number') {
38
+ return value;
39
+ }
40
+ if (typeof value === 'string') {
41
+ const parsed = Number(value);
42
+ return Number.isNaN(parsed) ? undefined : parsed;
43
+ }
44
+ return undefined;
45
+ }
46
+ function extractMessage(detail) {
47
+ if (typeof detail === 'string' && detail.trim()) {
48
+ return detail;
49
+ }
50
+ if (Array.isArray(detail) && detail.length > 0) {
51
+ const first = asRecord(detail[0]);
52
+ const message = first ? asString(first.msg) : undefined;
53
+ if (message) {
54
+ return message;
55
+ }
56
+ }
57
+ const detailRecord = asRecord(detail);
58
+ if (!detailRecord) {
59
+ return undefined;
60
+ }
61
+ const nestedError = asRecord(detailRecord.error);
62
+ const nestedMessage = nestedError ? asString(nestedError.message) : undefined;
63
+ if (nestedMessage) {
64
+ return nestedMessage;
65
+ }
66
+ const directMessage = asString(detailRecord.message);
67
+ if (directMessage) {
68
+ return directMessage;
69
+ }
70
+ return undefined;
71
+ }
72
+ function extractRequestId(response) {
73
+ var _a;
74
+ const headers = asRecord(response === null || response === void 0 ? void 0 : response.headers);
75
+ if (!headers) {
76
+ return undefined;
77
+ }
78
+ const requestId = (_a = headers['x-request-id']) !== null && _a !== void 0 ? _a : headers['X-Request-ID'];
79
+ if (Array.isArray(requestId)) {
80
+ return asString(requestId[0]);
81
+ }
82
+ return asString(requestId);
83
+ }
84
+ function errorFromUnknown(error, method, path) {
85
+ var _a, _b, _c, _d, _e, _f, _g;
86
+ const fallbackMessage = `PinBridge request failed (${method} ${path})`;
87
+ const errorRecord = asRecord(error);
88
+ const response = asRecord(errorRecord === null || errorRecord === void 0 ? void 0 : errorRecord.response);
89
+ const detail = (_b = (_a = response === null || response === void 0 ? void 0 : response.body) !== null && _a !== void 0 ? _a : errorRecord === null || errorRecord === void 0 ? void 0 : errorRecord.body) !== null && _b !== void 0 ? _b : errorRecord === null || errorRecord === void 0 ? void 0 : errorRecord.error;
90
+ const statusCode = (_d = (_c = asNumber(errorRecord === null || errorRecord === void 0 ? void 0 : errorRecord.statusCode)) !== null && _c !== void 0 ? _c : asNumber(response === null || response === void 0 ? void 0 : response.statusCode)) !== null && _d !== void 0 ? _d : undefined;
91
+ const message = (_g = (_f = (_e = extractMessage(detail)) !== null && _e !== void 0 ? _e : asString(errorRecord === null || errorRecord === void 0 ? void 0 : errorRecord.message)) !== null && _f !== void 0 ? _f : asString(errorRecord === null || errorRecord === void 0 ? void 0 : errorRecord.name)) !== null && _g !== void 0 ? _g : fallbackMessage;
92
+ const requestId = extractRequestId(response);
93
+ return new PinBridgeApiError(message, {
94
+ method,
95
+ path,
96
+ statusCode,
97
+ detail,
98
+ requestId,
99
+ });
100
+ }
101
+ class PinBridgeClient {
102
+ constructor(config) {
103
+ this.config = config;
104
+ this.baseUrl = normalizeBaseUrl(config.baseUrl);
105
+ }
106
+ async request(options) {
107
+ const url = new URL(`${this.baseUrl}${options.path}`);
108
+ if (options.query) {
109
+ appendQuery(url, options.query);
110
+ }
111
+ const headers = {
112
+ Accept: 'application/json',
113
+ 'X-API-Key': this.config.apiKey,
114
+ ...options.headers,
115
+ };
116
+ if (options.body !== undefined) {
117
+ headers['Content-Type'] = 'application/json';
118
+ }
119
+ try {
120
+ return await this.config.executor({
121
+ method: options.method,
122
+ url: url.toString(),
123
+ headers,
124
+ body: options.body,
125
+ });
126
+ }
127
+ catch (error) {
128
+ throw errorFromUnknown(error, options.method, options.path);
129
+ }
130
+ }
131
+ }
132
+ exports.PinBridgeClient = PinBridgeClient;
133
+ //# sourceMappingURL=PinBridgeClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinBridgeClient.js","sourceRoot":"","sources":["../../../src/transport/PinBridgeClient.ts"],"names":[],"mappings":";;;AAuCA,MAAa,iBAAkB,SAAQ,KAAK;IAO3C,YAAY,OAAe,EAAE,OAAiC;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,CAAC;CACD;AAhBD,8CAgBC;AAED,SAAS,gBAAgB,CAAC,OAAe;IACxC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,WAAW,CAAC,GAAQ,EAAE,KAAqB;IACnD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YAC3D,SAAS;QACV,CAAC;QACD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,CAAC;AACF,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC/B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAA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AAC,MAAM;YAC/B,GAAG,OAAO,CAAC,OAAO;SAClB,CAAC;QAEF,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;QAC9C,CAAC;QAED,IAAI,CAAC;YACJ,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAY;gBAC5C,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;gBACnB,OAAO;gBACP,IAAI,EAAE,OAAO,CAAC,IAAI;aAClB,CAAC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7D,CAAC;IACF,CAAC;CACD;AAlCD,0CAkCC"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "n8n-nodes-pinbridge",
3
+ "version": "0.1.0",
4
+ "description": "n8n community node for PinBridge",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "n8n-community-node-package",
8
+ "n8n",
9
+ "n8n-nodes",
10
+ "pinbridge"
11
+ ],
12
+ "homepage": "",
13
+ "author": "",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": ""
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "main": "dist/index.js",
22
+ "types": "dist/index.d.ts",
23
+ "scripts": {
24
+ "build": "tsc -p tsconfig.json && npm run copy-assets",
25
+ "copy-assets": "mkdir -p dist/nodes/PinBridge && cp nodes/PinBridge/pinbridge.svg dist/nodes/PinBridge/pinbridge.svg",
26
+ "clean": "rm -rf dist",
27
+ "dev": "tsc -w -p tsconfig.json",
28
+ "lint": "eslint . --ext .ts",
29
+ "lint:fix": "eslint . --ext .ts --fix"
30
+ },
31
+ "dependencies": {
32
+ "n8n-workflow": "^1.95.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "^20.17.57",
36
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
37
+ "@typescript-eslint/parser": "^7.18.0",
38
+ "eslint": "^8.57.1",
39
+ "typescript": "^5.6.3"
40
+ },
41
+ "peerDependencies": {
42
+ "n8n-workflow": "*"
43
+ },
44
+ "n8n": {
45
+ "n8nNodesApiVersion": 1,
46
+ "credentials": [
47
+ "dist/credentials/PinBridgeApi.credentials.js"
48
+ ],
49
+ "nodes": [
50
+ "dist/nodes/PinBridge/PinBridge.node.js"
51
+ ]
52
+ }
53
+ }