@sinehypernova-0718/n8n-nodes-pinterest 0.0.0-stage → 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.
Files changed (80) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +238 -2
  3. package/dist/credentials/PinterestOAuth2Api.credentials.d.ts +10 -0
  4. package/dist/credentials/PinterestOAuth2Api.credentials.js +61 -0
  5. package/dist/credentials/PinterestOAuth2Api.credentials.js.map +1 -0
  6. package/dist/nodes/Pinterest/Pinterest.node.d.ts +5 -0
  7. package/dist/nodes/Pinterest/Pinterest.node.js +291 -0
  8. package/dist/nodes/Pinterest/Pinterest.node.js.map +1 -0
  9. package/dist/nodes/Pinterest/Pinterest.node.json +18 -0
  10. package/dist/nodes/Pinterest/descriptions/BoardDescriptions.d.ts +2 -0
  11. package/dist/nodes/Pinterest/descriptions/BoardDescriptions.js +407 -0
  12. package/dist/nodes/Pinterest/descriptions/BoardDescriptions.js.map +1 -0
  13. package/dist/nodes/Pinterest/descriptions/PinDescriptions.d.ts +2 -0
  14. package/dist/nodes/Pinterest/descriptions/PinDescriptions.js +885 -0
  15. package/dist/nodes/Pinterest/descriptions/PinDescriptions.js.map +1 -0
  16. package/dist/nodes/Pinterest/descriptions/index.d.ts +2 -0
  17. package/dist/nodes/Pinterest/descriptions/index.js +8 -0
  18. package/dist/nodes/Pinterest/descriptions/index.js.map +1 -0
  19. package/dist/nodes/Pinterest/errors/index.d.ts +2 -0
  20. package/dist/nodes/Pinterest/errors/index.js +6 -0
  21. package/dist/nodes/Pinterest/errors/index.js.map +1 -0
  22. package/dist/nodes/Pinterest/errors/pinterestApiError.d.ts +8 -0
  23. package/dist/nodes/Pinterest/errors/pinterestApiError.js +62 -0
  24. package/dist/nodes/Pinterest/errors/pinterestApiError.js.map +1 -0
  25. package/dist/nodes/Pinterest/pinterest.dark.svg +54 -0
  26. package/dist/nodes/Pinterest/pinterest.svg +54 -0
  27. package/dist/nodes/Pinterest/requests/board/create.d.ts +2 -0
  28. package/dist/nodes/Pinterest/requests/board/create.js +54 -0
  29. package/dist/nodes/Pinterest/requests/board/create.js.map +1 -0
  30. package/dist/nodes/Pinterest/requests/board/delete.d.ts +2 -0
  31. package/dist/nodes/Pinterest/requests/board/delete.js +41 -0
  32. package/dist/nodes/Pinterest/requests/board/delete.js.map +1 -0
  33. package/dist/nodes/Pinterest/requests/board/get.d.ts +2 -0
  34. package/dist/nodes/Pinterest/requests/board/get.js +37 -0
  35. package/dist/nodes/Pinterest/requests/board/get.js.map +1 -0
  36. package/dist/nodes/Pinterest/requests/board/index.d.ts +6 -0
  37. package/dist/nodes/Pinterest/requests/board/index.js +16 -0
  38. package/dist/nodes/Pinterest/requests/board/index.js.map +1 -0
  39. package/dist/nodes/Pinterest/requests/board/list.d.ts +2 -0
  40. package/dist/nodes/Pinterest/requests/board/list.js +58 -0
  41. package/dist/nodes/Pinterest/requests/board/list.js.map +1 -0
  42. package/dist/nodes/Pinterest/requests/board/listPins.d.ts +2 -0
  43. package/dist/nodes/Pinterest/requests/board/listPins.js +104 -0
  44. package/dist/nodes/Pinterest/requests/board/listPins.js.map +1 -0
  45. package/dist/nodes/Pinterest/requests/board/update.d.ts +2 -0
  46. package/dist/nodes/Pinterest/requests/board/update.js +65 -0
  47. package/dist/nodes/Pinterest/requests/board/update.js.map +1 -0
  48. package/dist/nodes/Pinterest/requests/index.d.ts +2 -0
  49. package/dist/nodes/Pinterest/requests/index.js +20 -0
  50. package/dist/nodes/Pinterest/requests/index.js.map +1 -0
  51. package/dist/nodes/Pinterest/requests/pin/create.d.ts +2 -0
  52. package/dist/nodes/Pinterest/requests/pin/create.js +95 -0
  53. package/dist/nodes/Pinterest/requests/pin/create.js.map +1 -0
  54. package/dist/nodes/Pinterest/requests/pin/delete.d.ts +2 -0
  55. package/dist/nodes/Pinterest/requests/pin/delete.js +28 -0
  56. package/dist/nodes/Pinterest/requests/pin/delete.js.map +1 -0
  57. package/dist/nodes/Pinterest/requests/pin/get.d.ts +2 -0
  58. package/dist/nodes/Pinterest/requests/pin/get.js +35 -0
  59. package/dist/nodes/Pinterest/requests/pin/get.js.map +1 -0
  60. package/dist/nodes/Pinterest/requests/pin/getAnalytics.d.ts +2 -0
  61. package/dist/nodes/Pinterest/requests/pin/getAnalytics.js +113 -0
  62. package/dist/nodes/Pinterest/requests/pin/getAnalytics.js.map +1 -0
  63. package/dist/nodes/Pinterest/requests/pin/getMultiple.d.ts +2 -0
  64. package/dist/nodes/Pinterest/requests/pin/getMultiple.js +118 -0
  65. package/dist/nodes/Pinterest/requests/pin/getMultiple.js.map +1 -0
  66. package/dist/nodes/Pinterest/requests/pin/index.d.ts +8 -0
  67. package/dist/nodes/Pinterest/requests/pin/index.js +20 -0
  68. package/dist/nodes/Pinterest/requests/pin/index.js.map +1 -0
  69. package/dist/nodes/Pinterest/requests/pin/list.d.ts +2 -0
  70. package/dist/nodes/Pinterest/requests/pin/list.js +105 -0
  71. package/dist/nodes/Pinterest/requests/pin/list.js.map +1 -0
  72. package/dist/nodes/Pinterest/requests/pin/save.d.ts +2 -0
  73. package/dist/nodes/Pinterest/requests/pin/save.js +69 -0
  74. package/dist/nodes/Pinterest/requests/pin/save.js.map +1 -0
  75. package/dist/nodes/Pinterest/requests/pin/update.d.ts +2 -0
  76. package/dist/nodes/Pinterest/requests/pin/update.js +120 -0
  77. package/dist/nodes/Pinterest/requests/pin/update.js.map +1 -0
  78. package/dist/package.json +61 -0
  79. package/dist/tsconfig.tsbuildinfo +1 -0
  80. package/package.json +60 -5
package/LICENSE.md ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2022 n8n
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,239 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png" width="200" alt="n8n" />
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ <h1 align="center">n8n-nodes-pinterest</h1>
6
+
7
+ <p align="center">
8
+ A community-built <a href="https://www.pinterest.com/">Pinterest</a> integration for <a href="https://n8n.io/">n8n</a>.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <i>Automate Pinterest workflows, from content management to analytics.</i>
13
+ </p>
14
+
15
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
16
+
17
+ **n8n-nodes-pinterest** brings Pinterest API operations into n8n workflows, letting you work with Pinterest resources through the workflow editor instead of manually constructing API requests.
18
+
19
+ ## ✨ Features
20
+
21
+ - **Pinterest API integration** — interact with supported Pinterest resources and operations directly from n8n workflows.
22
+ - **OAuth2 authentication** — authenticate requests using Pinterest OAuth2 credentials.
23
+ - **Native n8n interface** — select resources and operations and configure their parameters through the workflow editor.
24
+ - **Pin management** — create, retrieve, list, update, delete, and save Pins using supported Pinterest API operations.
25
+ - **Board management** — create, retrieve, list, update, and delete boards, and retrieve Pins associated with a board.
26
+ - **Pin analytics** — retrieve analytics for supported metrics and date ranges.
27
+ - **Pagination support** — retrieve paginated API results where supported by an operation.
28
+ - **Modular TypeScript architecture** — resource descriptions, request builders, and execution logic are organized by responsibility.
29
+ - **Extensible design** — add further Pinterest resources and operations while preserving the existing architecture.
30
+
31
+ ## 📁 Repository Structure
32
+
33
+ ```text
34
+ n8n-nodes-pinterest/
35
+ ├── credentials/
36
+ │ └── PinterestOAuth2Api.credentials.ts
37
+ ├── nodes/
38
+ │ └── Pinterest/
39
+ │ ├── descriptions/
40
+ │ │ ├── BoardDescriptions.ts
41
+ │ │ ├── PinDescriptions.ts
42
+ │ │ └── index.ts
43
+ │ ├── requests/
44
+ │ │ ├── board/
45
+ │ │ │ ├── <operation>.ts
46
+ │ │ │ └── index.ts
47
+ │ │ ├── pin/
48
+ │ │ │ ├── <operation>.ts
49
+ │ │ │ └── index.ts
50
+ │ │ └── index.ts
51
+ │ └── Pinterest.node.ts
52
+ ├── package.json
53
+ ├── README.md
54
+ └── LICENSE.md
55
+ ```
56
+
57
+ ### Architecture
58
+
59
+ - **`credentials/`** — defines the Pinterest OAuth2 credentials used to authenticate requests.
60
+ - **`descriptions/`** — contains resource and operation definitions displayed in the n8n editor. Its `index.ts` explicitly exports the descriptions consumed by the main node.
61
+ - **`requests/board/`** — contains request builders for Pinterest Board operations.
62
+ - **`requests/pin/`** — contains request builders for Pinterest Pin operations.
63
+ - **`requests/<resource>/<operation>.ts`** — keeps individual API request builders in separate operation-specific modules, such as `create.ts`, `get.ts`, `list.ts`, and `update.ts`.
64
+ - **Resource `index.ts` files** — explicitly export the request builders belonging to each resource.
65
+ - **`requests/index.ts`** — re-exports the resource-level barrels, providing a single import entry point for request modules.
66
+ - **`Pinterest.node.ts`** — defines the n8n node and coordinates operation execution, authenticated HTTP requests, pagination, and error handling.
67
+
68
+ The architecture separates editor-facing configuration from API request construction and execution. Resource descriptions define the available operations and parameters, while request modules build operation-specific requests. The main node remains responsible for invoking authenticated HTTP requests through n8n's credential-aware helpers and handling execution results.
69
+
70
+ Explicit exports keep imports predictable and avoid unnecessary wildcard exports. The resource-specific modules remain independent, while the barrel files provide convenient entry points without introducing another execution layer.
71
+
72
+ Additional resources can follow the same structure, with their own descriptions and operation-specific request modules. This allows the integration to expand without requiring a redesign of the existing architecture.
73
+
74
+ ## 📦 Installation
75
+
76
+ Install the package through your n8n instance using the community node installation interface.
77
+
78
+ 1. Open your n8n instance.
79
+ 2. Navigate to **Settings → Community Nodes**.
80
+ 3. Select **Install**.
81
+ 4. Enter the package name `@sinehypernova-0718/n8n-nodes-pinterest`.
82
+ 5. Review and accept the installation confirmation.
83
+ 6. Once installation completes, open a workflow and search for the Pinterest node.
84
+
85
+ For detailed instructions, see the [n8n community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).
86
+
87
+ > **Note:** The package name entered during installation must match the name under which this project is published to npm (`@sinehypernova-0718/n8n-nodes-pinterest`). Community node installation availability also depends on your n8n deployment configuration and administrator policies.
88
+
89
+ ## ⚙️ Operations
90
+
91
+ The Pinterest node exposes supported Pinterest API operations through n8n's resource and operation selectors. The available operations and parameters depend on the installed package version.
92
+
93
+ ### Pins
94
+
95
+ The Pin resource supports operations for managing Pins and retrieving their associated information.
96
+
97
+ | Operation | Description |
98
+ |---|---|
99
+ | Create | Create a Pin using the supported Pinterest API parameters. |
100
+ | Get | Retrieve an individual Pin by its ID. |
101
+ | Get Multiple Pin Analytics | Retrieve analytics for multiple Pins in a batch request, using the supported analytics metrics and date range. |
102
+ | List | List Pins with supported filters and pagination. |
103
+ | Update | Update supported fields of an existing Pin. |
104
+ | Delete | Delete a Pin by its ID. |
105
+ | Save | Save a Pin to a board. |
106
+ | Get Analytics | Retrieve analytics for a Pin using supported metrics and date parameters. |
107
+
108
+ ### Boards
109
+
110
+ The Board resource supports operations for managing boards and accessing their associated Pins.
111
+
112
+ | Operation | Description |
113
+ |---|---|
114
+ | Create | Create a Pinterest board. |
115
+ | Get | Retrieve an individual board by its ID. |
116
+ | List | List boards with pagination. |
117
+ | Update | Update supported fields of an existing board. |
118
+ | Delete | Delete a board by its ID. |
119
+ | List Pins | Retrieve Pins associated with a board. |
120
+
121
+ Operation parameters, filters, pagination behavior, and available analytics metrics vary by endpoint. Refer to the operation descriptions in the n8n editor and the [Pinterest API v5 documentation](https://developers.pinterest.com/docs/api/v5/) for endpoint-specific requirements.
122
+
123
+ This list describes the resources currently implemented in the integration. Additional resources and operations can be introduced in future releases.
124
+
125
+ ## 🔐 Credentials
126
+
127
+ The Pinterest node uses OAuth2 authentication to make authorized requests to the Pinterest API v5.
128
+
129
+ ### Prerequisites
130
+
131
+ Before configuring the credentials, you need:
132
+
133
+ - A Pinterest account.
134
+ - A developer application registered through the [Pinterest Developers Portal](https://developers.pinterest.com/).
135
+ - The client ID and client secret issued for your application.
136
+ - Appropriate API access and permissions for the operations you intend to use.
137
+
138
+ Pinterest controls application access and approval. Registering a developer application does not automatically grant unrestricted access to every API endpoint.
139
+
140
+ ### Configure OAuth2 credentials
141
+
142
+ Create a Pinterest OAuth2 API credential in n8n and supply the values required by the credential configuration.
143
+
144
+ | Setting | Value |
145
+ |---|---|
146
+ | Grant type | Authorization Code |
147
+ | Authorization URL | `https://www.pinterest.com/oauth/` |
148
+ | Access token URL | `https://api.pinterest.com/v5/oauth/token` |
149
+ | Client ID | The client ID issued for your Pinterest application |
150
+ | Client secret | The client secret issued for your Pinterest application |
151
+ | Scopes | `user_accounts:read`, `boards:read`, `boards:write`, `pins:read`, `pins:write` |
152
+
153
+ Configure the OAuth redirect URL using the callback URL supplied by n8n. Register that URL with your Pinterest application wherever required by Pinterest's developer configuration.
154
+
155
+ Save the credential and use n8n's authorization flow to connect your Pinterest account. Once authorization succeeds, select the credential in the Pinterest node.
156
+
157
+ ### Permissions and access
158
+
159
+ The configured scopes cover the board and Pin read/write permissions used by the current implementation. The `user_accounts:read` scope supports the credential check against the `GET /v5/user_account` endpoint. Individual operations may still require specific permissions, resource access, or additional API eligibility.
160
+
161
+ Pin analytics availability and supported metrics are subject to Pinterest's API requirements. Application approval status, access restrictions, and Pinterest-side changes can affect whether an operation succeeds.
162
+
163
+ Keep your client secret and access tokens private. Never commit credentials to the repository or include tokens in issue reports, screenshots, or logs.
164
+
165
+ ## 🧩 Compatibility
166
+
167
+ This package is designed for n8n's community node ecosystem and uses the n8n node API.
168
+
169
+ - **Integration type:** n8n community node.
170
+ - **Implementation language:** TypeScript.
171
+ - **API:** Pinterest API v5.
172
+ - **Authentication:** OAuth2.
173
+ - **Package distribution:** npm.
174
+ - **Development package manager:** pnpm.
175
+
176
+ The package declares its n8n node metadata and entry points in `package.json`. Compatibility depends on the n8n version, the available `n8n-workflow` APIs, and the package's dependencies.
177
+
178
+ Refer to the repository's package metadata and release notes when evaluating compatibility with a particular n8n version.
179
+
180
+ The initial `0.1.0` release is a pre-1.0 release. Operation coverage and compatibility may evolve as the integration develops.
181
+
182
+ ## 🚀 Usage
183
+
184
+ After installing the node and configuring OAuth2 credentials, you can incorporate Pinterest API operations into your n8n workflows.
185
+
186
+ ### Basic workflow setup
187
+
188
+ 1. Create a workflow in n8n.
189
+ 2. Add the Pinterest node.
190
+ 3. Select your Pinterest OAuth2 credential.
191
+ 4. Choose the resource you want to work with, such as **Pin** or **Board**.
192
+ 5. Select the required operation.
193
+ 6. Configure its parameters, IDs, filters, and other required fields.
194
+ 7. Connect the node to the other nodes in your workflow.
195
+ 8. Execute the workflow and inspect the returned data.
196
+
197
+ ### Troubleshooting
198
+
199
+ If an operation fails:
200
+
201
+ - Verify that the Pinterest credential is authorized.
202
+ - Confirm that your application has the required API access and scopes.
203
+ - Check that the supplied resource IDs exist and are accessible to the connected account.
204
+ - Verify required fields and supported parameter values.
205
+ - Review the error returned by n8n and consult the relevant Pinterest API documentation.
206
+
207
+ For general workflow guidance, see the [n8n Try it out documentation](https://docs.n8n.io/try-it-out/).
208
+
209
+ ## 🔗 Resources
210
+
211
+ - [Pinterest Developers Portal](https://developers.pinterest.com/) — manage developer applications and API access.
212
+ - [Pinterest API v5 documentation](https://developers.pinterest.com/docs/api/v5/) — API endpoints, request parameters, responses, and permissions.
213
+ - [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes) — community node discovery and installation.
214
+ - [n8n community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) — installation instructions.
215
+ - [n8n documentation](https://docs.n8n.io/) — workflow creation and node configuration.
216
+ - [GitHub repository](https://github.com/sinehypernova-0718/n8n-nodes-pinterest) — source code, issues, and contributions.
217
+
218
+ ## 📝 Version history
219
+
220
+ ### `0.1.0`
221
+
222
+ Initial pre-1.0 release of the Pinterest integration for n8n.
223
+
224
+ - Introduces Pin and Board resources.
225
+ - Adds OAuth2 authentication for Pinterest API requests.
226
+ - Includes Pin creation, retrieval, listing, updating, deletion, saving, and analytics operations.
227
+ - Includes Board creation, retrieval, listing, updating, deletion, and listing Pins associated with a board.
228
+ - Includes pagination and operation-specific request handling where implemented.
229
+
230
+ This release establishes the initial integration structure, with further Pinterest resources and operations available for future development.
231
+
232
+
233
+ ## 📄 License
234
+
235
+ This project is licensed under the [MIT License](LICENSE.md).
236
+
237
+ ---
238
+
239
+ _This is an independent community project and is not an official Pinterest or n8n product._
@@ -0,0 +1,10 @@
1
+ import type { Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class PinterestOAuth2Api implements ICredentialType {
3
+ name: string;
4
+ extends: string[];
5
+ displayName: string;
6
+ icon: Icon;
7
+ documentationUrl: string;
8
+ properties: INodeProperties[];
9
+ test: ICredentialTestRequest;
10
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PinterestOAuth2Api = void 0;
4
+ class PinterestOAuth2Api {
5
+ constructor() {
6
+ this.name = 'pinterestOAuth2Api';
7
+ this.extends = ['oAuth2Api'];
8
+ this.displayName = 'Pinterest OAuth2 API';
9
+ this.icon = { light: 'file:../nodes/Pinterest/pinterest.svg', dark: 'file:../nodes/Pinterest/pinterest.dark.svg' };
10
+ this.documentationUrl = 'https://developers.pinterest.com/docs/getting-started/set-up-authentication-and-authorization/';
11
+ this.properties = [
12
+ {
13
+ displayName: 'Grant Type',
14
+ name: 'grantType',
15
+ type: 'hidden',
16
+ default: 'authorizationCode',
17
+ },
18
+ {
19
+ displayName: 'Authorization URL',
20
+ name: 'authUrl',
21
+ type: 'hidden',
22
+ default: 'https://www.pinterest.com/oauth/',
23
+ required: true,
24
+ },
25
+ {
26
+ displayName: 'Access Token URL',
27
+ name: 'accessTokenUrl',
28
+ type: 'hidden',
29
+ default: 'https://api.pinterest.com/v5/oauth/token',
30
+ required: true,
31
+ },
32
+ {
33
+ displayName: 'Scope',
34
+ name: 'scope',
35
+ type: 'hidden',
36
+ default: 'user_accounts:read,boards:read,boards:write,pins:read,pins:write',
37
+ },
38
+ {
39
+ displayName: 'Auth URI Query Parameters',
40
+ name: 'authQueryParameters',
41
+ type: 'hidden',
42
+ default: '',
43
+ },
44
+ {
45
+ displayName: 'Authentication',
46
+ name: 'authentication',
47
+ type: 'hidden',
48
+ default: 'header',
49
+ },
50
+ ];
51
+ this.test = {
52
+ request: {
53
+ method: 'GET',
54
+ baseURL: 'https://api.pinterest.com/v5',
55
+ url: '/user_account',
56
+ },
57
+ };
58
+ }
59
+ }
60
+ exports.PinterestOAuth2Api = PinterestOAuth2Api;
61
+ //# sourceMappingURL=PinterestOAuth2Api.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinterestOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/PinterestOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,kBAAkB;IAA/B;QACC,SAAI,GAAG,oBAAoB,CAAC;QAE5B,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,gBAAW,GAAG,sBAAsB,CAAC;QAErC,SAAI,GAAS,EAAE,KAAK,EAAE,uCAAuC,EAAE,IAAI,EAAE,4CAA4C,EAAE,CAAC;QAEpH,qBAAgB,GAAG,gGAAgG,CAAC;QAEpH,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC5B;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,kCAAkC;gBAC3C,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,0CAA0C;gBACnD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,kEAAkE;aAC3E;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ;aACjB;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,8BAA8B;gBACvC,GAAG,EAAE,eAAe;aACpB;SACD,CAAC;IACH,CAAC;CAAA;AA3DD,gDA2DC"}
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Pinterest implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,291 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Pinterest = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const descriptions_1 = require("./descriptions");
6
+ const errors_1 = require("./errors");
7
+ const requests_1 = require("./requests");
8
+ const PINTEREST_API_BASE_URL = 'https://api.pinterest.com/v5';
9
+ async function collectPinListPages(firstPageRequest, itemIndex) {
10
+ var _a;
11
+ const returnAll = this.getNodeParameter('returnAll', itemIndex, false);
12
+ const limit = returnAll
13
+ ? Number.POSITIVE_INFINITY
14
+ : this.getNodeParameter('limit', itemIndex, 50);
15
+ const collected = [];
16
+ const seenBookmarks = new Set();
17
+ let requestOptions = {
18
+ baseURL: PINTEREST_API_BASE_URL,
19
+ json: true,
20
+ ...firstPageRequest,
21
+ };
22
+ const initialBookmark = (_a = firstPageRequest.qs) === null || _a === void 0 ? void 0 : _a.bookmark;
23
+ if (typeof initialBookmark === 'string' && initialBookmark !== '') {
24
+ seenBookmarks.add(initialBookmark);
25
+ }
26
+ while (true) {
27
+ let response;
28
+ try {
29
+ response = (await this.helpers.httpRequestWithAuthentication.call(this, 'pinterestOAuth2Api', requestOptions));
30
+ }
31
+ catch (error) {
32
+ throw (0, errors_1.mapPinterestApiError)(error, { itemIndex });
33
+ }
34
+ if (Array.isArray(response === null || response === void 0 ? void 0 : response.items)) {
35
+ collected.push(...response.items);
36
+ }
37
+ if (collected.length >= limit) {
38
+ break;
39
+ }
40
+ const nextBookmark = response === null || response === void 0 ? void 0 : response.bookmark;
41
+ if (typeof nextBookmark !== 'string' ||
42
+ nextBookmark === '' ||
43
+ seenBookmarks.has(nextBookmark)) {
44
+ break;
45
+ }
46
+ seenBookmarks.add(nextBookmark);
47
+ const nextPageRequest = await requests_1.listPinsRequest.call(this, itemIndex, nextBookmark);
48
+ requestOptions = {
49
+ baseURL: PINTEREST_API_BASE_URL,
50
+ json: true,
51
+ ...nextPageRequest,
52
+ };
53
+ }
54
+ return returnAll ? collected : collected.slice(0, limit);
55
+ }
56
+ async function collectBoardListPages(firstPageRequest, itemIndex) {
57
+ var _a;
58
+ const collected = [];
59
+ const seenBookmarks = new Set();
60
+ let requestOptions = {
61
+ baseURL: PINTEREST_API_BASE_URL,
62
+ json: true,
63
+ ...firstPageRequest,
64
+ };
65
+ const initialBookmark = (_a = firstPageRequest.qs) === null || _a === void 0 ? void 0 : _a.bookmark;
66
+ if (typeof initialBookmark === 'string' && initialBookmark !== '') {
67
+ seenBookmarks.add(initialBookmark);
68
+ }
69
+ while (true) {
70
+ let response;
71
+ try {
72
+ response = (await this.helpers.httpRequestWithAuthentication.call(this, 'pinterestOAuth2Api', requestOptions));
73
+ }
74
+ catch (error) {
75
+ throw (0, errors_1.mapPinterestApiError)(error, { itemIndex });
76
+ }
77
+ if (Array.isArray(response === null || response === void 0 ? void 0 : response.items)) {
78
+ collected.push(...response.items);
79
+ }
80
+ const nextBookmark = response === null || response === void 0 ? void 0 : response.bookmark;
81
+ if (typeof nextBookmark !== 'string' ||
82
+ nextBookmark === '' ||
83
+ seenBookmarks.has(nextBookmark)) {
84
+ break;
85
+ }
86
+ seenBookmarks.add(nextBookmark);
87
+ const nextPageRequest = await requests_1.listBoardsRequest.call(this, itemIndex, nextBookmark);
88
+ requestOptions = {
89
+ baseURL: PINTEREST_API_BASE_URL,
90
+ json: true,
91
+ ...nextPageRequest,
92
+ };
93
+ }
94
+ return collected;
95
+ }
96
+ async function collectBoardPinsListPages(firstPageRequest, itemIndex) {
97
+ var _a;
98
+ const collected = [];
99
+ const seenBookmarks = new Set();
100
+ let requestOptions = {
101
+ baseURL: PINTEREST_API_BASE_URL,
102
+ json: true,
103
+ ...firstPageRequest,
104
+ };
105
+ const initialBookmark = (_a = firstPageRequest.qs) === null || _a === void 0 ? void 0 : _a.bookmark;
106
+ if (typeof initialBookmark === 'string' && initialBookmark !== '') {
107
+ seenBookmarks.add(initialBookmark);
108
+ }
109
+ while (true) {
110
+ let response;
111
+ try {
112
+ response = (await this.helpers.httpRequestWithAuthentication.call(this, 'pinterestOAuth2Api', requestOptions));
113
+ }
114
+ catch (error) {
115
+ throw (0, errors_1.mapPinterestApiError)(error, { itemIndex });
116
+ }
117
+ if (Array.isArray(response === null || response === void 0 ? void 0 : response.items)) {
118
+ collected.push(...response.items);
119
+ }
120
+ const nextBookmark = response === null || response === void 0 ? void 0 : response.bookmark;
121
+ if (typeof nextBookmark !== 'string' ||
122
+ nextBookmark === '' ||
123
+ seenBookmarks.has(nextBookmark)) {
124
+ break;
125
+ }
126
+ seenBookmarks.add(nextBookmark);
127
+ const nextPageRequest = await requests_1.listBoardPinsRequest.call(this, itemIndex, nextBookmark);
128
+ requestOptions = {
129
+ baseURL: PINTEREST_API_BASE_URL,
130
+ json: true,
131
+ ...nextPageRequest,
132
+ };
133
+ }
134
+ return collected;
135
+ }
136
+ class Pinterest {
137
+ constructor() {
138
+ this.description = {
139
+ displayName: 'Pinterest',
140
+ name: 'pinterest',
141
+ icon: { light: 'file:pinterest.svg', dark: 'file:pinterest.dark.svg' },
142
+ group: ['transform'],
143
+ version: 1,
144
+ description: 'Pinterest integration for n8n. Integrate Pinterest with n8n to automate API workflows, manage content, access analytics, and more.',
145
+ subtitle: '',
146
+ defaults: {
147
+ name: 'Pinterest',
148
+ },
149
+ credentials: [
150
+ {
151
+ name: 'pinterestOAuth2Api',
152
+ required: true,
153
+ },
154
+ ],
155
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
156
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
157
+ usableAsTool: true,
158
+ properties: [
159
+ {
160
+ displayName: 'Resource',
161
+ name: 'resource',
162
+ type: 'options',
163
+ noDataExpression: true,
164
+ options: [
165
+ {
166
+ name: 'Pin',
167
+ value: 'pin',
168
+ },
169
+ {
170
+ name: 'Board',
171
+ value: 'board',
172
+ },
173
+ ],
174
+ default: 'pin',
175
+ },
176
+ ...descriptions_1.pinFields,
177
+ ...descriptions_1.boardFields,
178
+ ],
179
+ };
180
+ }
181
+ async execute() {
182
+ const items = this.getInputData();
183
+ const returnData = [];
184
+ for (let i = 0; i < items.length; i++) {
185
+ try {
186
+ const resource = this.getNodeParameter('resource', i);
187
+ const operation = this.getNodeParameter('operation', i);
188
+ let requestOptions;
189
+ switch (resource) {
190
+ case 'pin':
191
+ switch (operation) {
192
+ case 'create':
193
+ requestOptions = await requests_1.createPinRequest.call(this, i);
194
+ break;
195
+ case 'get':
196
+ requestOptions = await requests_1.getPinRequest.call(this, i);
197
+ break;
198
+ case 'list':
199
+ requestOptions = await requests_1.listPinsRequest.call(this, i);
200
+ break;
201
+ case 'getMultiple':
202
+ requestOptions = await requests_1.getMultiplePinsRequest.call(this, i);
203
+ break;
204
+ case 'getAnalytics':
205
+ requestOptions = await requests_1.getPinAnalyticsRequest.call(this, i);
206
+ break;
207
+ case 'update':
208
+ requestOptions = await requests_1.updatePinRequest.call(this, i);
209
+ break;
210
+ case 'delete':
211
+ requestOptions = await requests_1.deletePinRequest.call(this, i);
212
+ break;
213
+ case 'save':
214
+ requestOptions = await requests_1.savePinRequest.call(this, i);
215
+ break;
216
+ default:
217
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The Pin operation "${operation}" is not implemented yet`, { itemIndex: i });
218
+ }
219
+ break;
220
+ case 'board':
221
+ switch (operation) {
222
+ case 'create':
223
+ requestOptions = await requests_1.createBoardRequest.call(this, i);
224
+ break;
225
+ case 'get':
226
+ requestOptions = await requests_1.getBoardRequest.call(this, i);
227
+ break;
228
+ case 'list':
229
+ requestOptions = await requests_1.listBoardsRequest.call(this, i);
230
+ break;
231
+ case 'listPins':
232
+ requestOptions = await requests_1.listBoardPinsRequest.call(this, i);
233
+ break;
234
+ case 'delete':
235
+ requestOptions = await requests_1.deleteBoardRequest.call(this, i);
236
+ break;
237
+ case 'update':
238
+ requestOptions = await requests_1.updateBoardRequest.call(this, i);
239
+ break;
240
+ default:
241
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The Board operation "${operation}" is not implemented yet`, { itemIndex: i });
242
+ }
243
+ break;
244
+ default:
245
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported resource: ${resource}`, {
246
+ itemIndex: i,
247
+ });
248
+ }
249
+ let responseData;
250
+ if (resource === 'pin' && operation === 'list') {
251
+ responseData = await collectPinListPages.call(this, requestOptions, i);
252
+ }
253
+ else if (resource === 'board' && operation === 'list') {
254
+ responseData = await collectBoardListPages.call(this, requestOptions, i);
255
+ }
256
+ else if (resource === 'board' && operation === 'listPins') {
257
+ responseData = await collectBoardPinsListPages.call(this, requestOptions, i);
258
+ }
259
+ else {
260
+ const options = {
261
+ baseURL: PINTEREST_API_BASE_URL,
262
+ json: true,
263
+ ...requestOptions,
264
+ };
265
+ try {
266
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'pinterestOAuth2Api', options);
267
+ }
268
+ catch (error) {
269
+ throw (0, errors_1.mapPinterestApiError)(error, { itemIndex: i });
270
+ }
271
+ }
272
+ const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData !== null && responseData !== void 0 ? responseData : {}), { itemData: { item: i } });
273
+ returnData.push(...executionData);
274
+ }
275
+ catch (error) {
276
+ if (this.continueOnFail()) {
277
+ const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
278
+ returnData.push(...executionData);
279
+ continue;
280
+ }
281
+ if (error instanceof n8n_workflow_1.NodeApiError || error instanceof n8n_workflow_1.NodeOperationError) {
282
+ throw error;
283
+ }
284
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
285
+ }
286
+ }
287
+ return [returnData];
288
+ }
289
+ }
290
+ exports.Pinterest = Pinterest;
291
+ //# sourceMappingURL=Pinterest.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pinterest.node.js","sourceRoot":"","sources":["../../../nodes/Pinterest/Pinterest.node.ts"],"names":[],"mappings":";;;AAQA,+CAAqF;AACrF,iDAAwD;A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