@rizkifirmansyah/n8n-nodes-threads-api 1.0.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 +165 -0
- package/dist/credentials/ThreadsApi.credentials.d.ts +10 -0
- package/dist/credentials/ThreadsApi.credentials.js +43 -0
- package/dist/credentials/ThreadsApi.credentials.js.map +1 -0
- package/dist/credentials/ThreadsOAuth2Api.credentials.d.ts +11 -0
- package/dist/credentials/ThreadsOAuth2Api.credentials.js +69 -0
- package/dist/credentials/ThreadsOAuth2Api.credentials.js.map +1 -0
- package/dist/credentials/threads.dark.svg +4 -0
- package/dist/credentials/threads.svg +4 -0
- package/dist/nodes/Threads/GenericFunctions.d.ts +6 -0
- package/dist/nodes/Threads/GenericFunctions.js +94 -0
- package/dist/nodes/Threads/GenericFunctions.js.map +1 -0
- package/dist/nodes/Threads/InsightDescription.d.ts +3 -0
- package/dist/nodes/Threads/InsightDescription.js +171 -0
- package/dist/nodes/Threads/InsightDescription.js.map +1 -0
- package/dist/nodes/Threads/PostDescription.d.ts +3 -0
- package/dist/nodes/Threads/PostDescription.js +417 -0
- package/dist/nodes/Threads/PostDescription.js.map +1 -0
- package/dist/nodes/Threads/ReplyDescription.d.ts +3 -0
- package/dist/nodes/Threads/ReplyDescription.js +308 -0
- package/dist/nodes/Threads/ReplyDescription.js.map +1 -0
- package/dist/nodes/Threads/SearchDescription.d.ts +3 -0
- package/dist/nodes/Threads/SearchDescription.js +95 -0
- package/dist/nodes/Threads/SearchDescription.js.map +1 -0
- package/dist/nodes/Threads/Threads.node.d.ts +5 -0
- package/dist/nodes/Threads/Threads.node.js +512 -0
- package/dist/nodes/Threads/Threads.node.js.map +1 -0
- package/dist/nodes/Threads/ThreadsTrigger.node.d.ts +5 -0
- package/dist/nodes/Threads/ThreadsTrigger.node.js +139 -0
- package/dist/nodes/Threads/ThreadsTrigger.node.js.map +1 -0
- package/dist/nodes/Threads/UserDescription.d.ts +3 -0
- package/dist/nodes/Threads/UserDescription.js +94 -0
- package/dist/nodes/Threads/UserDescription.js.map +1 -0
- package/dist/nodes/Threads/threads.dark.svg +3 -0
- package/dist/nodes/Threads/threads.svg +3 -0
- package/dist/package.json +60 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rizki Firmansyah
|
|
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,165 @@
|
|
|
1
|
+
# @rizkifirmansyah/n8n-nodes-threads-api
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
An official community node package for **n8n** to interact with the **Meta Threads API**.
|
|
6
|
+
|
|
7
|
+
Manage your Threads presence at scale: create posts (text, images, videos, carousels), moderate replies, fetch user profiles, retrieve insights/analytics, search posts, and listen to webhook events.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Table of Contents
|
|
12
|
+
|
|
13
|
+
- [Features](#features)
|
|
14
|
+
- [Installation](#installation)
|
|
15
|
+
- [Credentials & Authentication](#credentials--authentication)
|
|
16
|
+
- [1. OAuth2 Authentication](#1-oauth2-authentication)
|
|
17
|
+
- [2. User Access Token Authentication](#2-user-access-token-authentication)
|
|
18
|
+
- [Available Resources & Operations](#available-resources--operations)
|
|
19
|
+
- [Post](#post)
|
|
20
|
+
- [Reply](#reply)
|
|
21
|
+
- [User](#user)
|
|
22
|
+
- [Insight](#insight)
|
|
23
|
+
- [Search](#search)
|
|
24
|
+
- [Threads Trigger (Webhook)](#threads-trigger-webhook)
|
|
25
|
+
- [Meta Threads API Requirements](#meta-threads-api-requirements)
|
|
26
|
+
- [Development & Contributing](#development--contributing)
|
|
27
|
+
- [License](#license)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- ✨ **Seamless Post Creation**: Auto-handles the 2-step media container creation & publishing workflow in a single action.
|
|
34
|
+
- 🖼️ **Multi-Format Support**: Create **Text**, **Single Image**, **Single Video**, and multi-media **Carousels** (2–10 items).
|
|
35
|
+
- 💬 **Reply & Conversation Management**: Create replies, view full discussion threads, and hide/unhide replies.
|
|
36
|
+
- 📊 **Rich Analytics**: Retrieve engagement metrics (views, likes, replies, reposts, quotes) for posts and user accounts.
|
|
37
|
+
- 🔍 **Keyword Search**: Discover and monitor public Threads conversations.
|
|
38
|
+
- ⚡ **Webhook Trigger**: Receive real-time events (`threads_mentions`, `threads_replies`) with automated Meta Hub challenge verification.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
### Community Nodes (Recommended)
|
|
45
|
+
1. Go to **Settings > Community Nodes** in your n8n instance.
|
|
46
|
+
2. Select **Install**.
|
|
47
|
+
3. Enter `@rizkifirmansyah/n8n-nodes-threads-api` in the **npm Package Name** field.
|
|
48
|
+
4. Agree to the risks and select **Install**.
|
|
49
|
+
|
|
50
|
+
### Manual Installation (Self-Hosted / Docker)
|
|
51
|
+
Inside your n8n root directory or custom nodes directory:
|
|
52
|
+
```bash
|
|
53
|
+
npm install @rizkifirmansyah/n8n-nodes-threads-api
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Credentials & Authentication
|
|
59
|
+
|
|
60
|
+
The node supports two authentication methods:
|
|
61
|
+
|
|
62
|
+
### 1. OAuth2 Authentication
|
|
63
|
+
Best for multi-user apps or standard OAuth authorization flows.
|
|
64
|
+
|
|
65
|
+
1. Create an App in the [Meta Developer Dashboard](https://developers.facebook.com/).
|
|
66
|
+
2. Add the **Threads API** use case.
|
|
67
|
+
3. Configure your OAuth redirect URI (found in the n8n credential setup).
|
|
68
|
+
4. Enter the **Client ID** and **Client Secret** into n8n.
|
|
69
|
+
5. Click **Connect my account** to authorize with your Threads profile.
|
|
70
|
+
|
|
71
|
+
### 2. User Access Token Authentication
|
|
72
|
+
Best for personal automation and bot accounts using Long-Lived User Tokens (valid for 60 days).
|
|
73
|
+
|
|
74
|
+
1. Generate a Threads User Access Token via the Meta Graph API Explorer or Token Exchange endpoint.
|
|
75
|
+
2. Paste the **Access Token** into the n8n **Threads API** credential.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Available Resources & Operations
|
|
80
|
+
|
|
81
|
+
### Post
|
|
82
|
+
| Operation | Description |
|
|
83
|
+
| :--- | :--- |
|
|
84
|
+
| **Create and Publish** | Creates media container (Text, Image, Video, Carousel) and immediately publishes it |
|
|
85
|
+
| **Create Media Container** | Creates a media container ID without publishing |
|
|
86
|
+
| **Publish Container** | Publishes a previously created media container using its `creation_id` |
|
|
87
|
+
| **Get** | Retrieves details of a specific post or media by ID |
|
|
88
|
+
| **Get Many** | Lists posts published by the user with pagination and date filters |
|
|
89
|
+
| **Delete** | Deletes a post by its ID |
|
|
90
|
+
|
|
91
|
+
### Reply
|
|
92
|
+
| Operation | Description |
|
|
93
|
+
| :--- | :--- |
|
|
94
|
+
| **Create** | Replies to a specific post or reply |
|
|
95
|
+
| **Get Many** | Retrieves direct replies made to a post |
|
|
96
|
+
| **Get Conversation** | Retrieves all replies in a conversation thread |
|
|
97
|
+
| **Manage (Hide/Unhide)** | Toggles visibility of a reply on your post (`hide=true/false`) |
|
|
98
|
+
|
|
99
|
+
### User
|
|
100
|
+
| Operation | Description |
|
|
101
|
+
| :--- | :--- |
|
|
102
|
+
| **Get Me** | Retrieves the authenticated user's profile info (`id`, `username`, `name`, `profile picture`, `bio`) |
|
|
103
|
+
| **Get Profile** | Retrieves profile details for a given Threads User ID |
|
|
104
|
+
| **Get Publishing Limit** | Retrieves current rate limit and quota usage (`/me/threads_publishing_limit`) |
|
|
105
|
+
|
|
106
|
+
### Insight
|
|
107
|
+
| Operation | Description |
|
|
108
|
+
| :--- | :--- |
|
|
109
|
+
| **Get Media Insights** | Retrieves post performance (`views`, `likes`, `replies`, `reposts`, `quotes`) |
|
|
110
|
+
| **Get User Insights** | Retrieves account-level metrics over time with optional date range (`since`/`until`) |
|
|
111
|
+
|
|
112
|
+
### Search
|
|
113
|
+
| Operation | Description |
|
|
114
|
+
| :--- | :--- |
|
|
115
|
+
| **Keyword Search** | Searches public Threads posts matching a keyword query |
|
|
116
|
+
|
|
117
|
+
### Threads Trigger (Webhook)
|
|
118
|
+
Listens for incoming webhooks from Meta:
|
|
119
|
+
- **Automatic Challenge Verification**: Responds to Meta `GET` challenge requests with `hub.challenge`.
|
|
120
|
+
- **Event Filtering**: Supports `All Events`, `threads_mentions`, and `threads_replies`.
|
|
121
|
+
- **Payload Extraction**: Cleanly separates changes or passes the full JSON payload.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Meta Threads API Requirements
|
|
126
|
+
|
|
127
|
+
- **Media URLs**: Any image or video URL passed to Threads API must be publicly accessible on the web.
|
|
128
|
+
- **Publishing Limits**: Meta enforces a standard quota of 250 posts per 24-hour window per user.
|
|
129
|
+
- **Scopes Required**:
|
|
130
|
+
- `threads_basic` (profile reading & general API access)
|
|
131
|
+
- `threads_content_publish` (posting content)
|
|
132
|
+
- `threads_read_replies` / `threads_manage_replies` (reply management)
|
|
133
|
+
- `threads_manage_insights` (analytics)
|
|
134
|
+
- `threads_keyword_search` (search)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Development & Contributing
|
|
139
|
+
|
|
140
|
+
To contribute or build locally:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Clone repository
|
|
144
|
+
git clone https://github.com/legenhand/n8n-nodes-threads.git
|
|
145
|
+
cd n8n-nodes-threads
|
|
146
|
+
|
|
147
|
+
# Install dependencies
|
|
148
|
+
npm install
|
|
149
|
+
|
|
150
|
+
# Build
|
|
151
|
+
npm run build
|
|
152
|
+
|
|
153
|
+
# Lint
|
|
154
|
+
npm run lint
|
|
155
|
+
|
|
156
|
+
# Start n8n in dev mode with live reload
|
|
157
|
+
npm run dev
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
[MIT](LICENSE) © [Rizki Firmansyah](https://github.com/legenhand)
|
|
165
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class ThreadsApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: "file:threads.svg";
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadsApi = void 0;
|
|
4
|
+
class ThreadsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'threadsApi';
|
|
7
|
+
this.displayName = 'Threads API';
|
|
8
|
+
this.documentationUrl = 'https://developers.facebook.com/documentation/threads';
|
|
9
|
+
this.icon = 'file:threads.svg';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Access Token',
|
|
13
|
+
name: 'accessToken',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: {
|
|
16
|
+
password: true,
|
|
17
|
+
},
|
|
18
|
+
default: '',
|
|
19
|
+
required: true,
|
|
20
|
+
description: 'Threads User Access Token or Long-Lived User Access Token',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
this.authenticate = {
|
|
24
|
+
type: 'generic',
|
|
25
|
+
properties: {
|
|
26
|
+
headers: {
|
|
27
|
+
Authorization: '=Bearer {{$credentials.accessToken}}',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
this.test = {
|
|
32
|
+
request: {
|
|
33
|
+
baseURL: 'https://graph.threads.net/v1.0',
|
|
34
|
+
url: '/me',
|
|
35
|
+
qs: {
|
|
36
|
+
fields: 'id,username,name',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.ThreadsApi = ThreadsApi;
|
|
43
|
+
//# sourceMappingURL=ThreadsApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreadsApi.credentials.js","sourceRoot":"","sources":["../../credentials/ThreadsApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,UAAU;IAAvB;QACC,SAAI,GAAG,YAAY,CAAC;QACpB,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,uDAAuD,CAAC;QAC3E,SAAI,GAAG,kBAA2B,CAAC;QAEnC,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,2DAA2D;aACxE;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,sCAAsC;iBACrD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,gCAAgC;gBACzC,GAAG,EAAE,KAAK;gBACV,EAAE,EAAE;oBACH,MAAM,EAAE,kBAAkB;iBAC1B;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAtCD,gCAsCC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class ThreadsOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
extends: string[];
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
icon: "file:threads.svg";
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
authenticate: IAuthenticateGeneric;
|
|
10
|
+
test: ICredentialTestRequest;
|
|
11
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadsOAuth2Api = void 0;
|
|
4
|
+
class ThreadsOAuth2Api {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'threadsOAuth2Api';
|
|
7
|
+
this.displayName = 'Threads OAuth2 API';
|
|
8
|
+
this.extends = ['oAuth2Api'];
|
|
9
|
+
this.documentationUrl = 'https://developers.facebook.com/documentation/threads';
|
|
10
|
+
this.icon = 'file:threads.svg';
|
|
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://threads.net/oauth/authorize',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
displayName: 'Access Token URL',
|
|
26
|
+
name: 'accessTokenUrl',
|
|
27
|
+
type: 'hidden',
|
|
28
|
+
default: 'https://graph.threads.net/oauth/access_token',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Scope',
|
|
32
|
+
name: 'scope',
|
|
33
|
+
type: 'hidden',
|
|
34
|
+
default: 'threads_basic,threads_content_publish,threads_read_replies,threads_manage_replies,threads_manage_insights,threads_keyword_search',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Auth URI Query Parameters',
|
|
38
|
+
name: 'authQueryParameters',
|
|
39
|
+
type: 'hidden',
|
|
40
|
+
default: 'response_type=code',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Authentication',
|
|
44
|
+
name: 'authentication',
|
|
45
|
+
type: 'hidden',
|
|
46
|
+
default: 'header',
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
this.authenticate = {
|
|
50
|
+
type: 'generic',
|
|
51
|
+
properties: {
|
|
52
|
+
headers: {
|
|
53
|
+
Authorization: '=Bearer {{$credentials.accessToken}}',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
this.test = {
|
|
58
|
+
request: {
|
|
59
|
+
baseURL: 'https://graph.threads.net/v1.0',
|
|
60
|
+
url: '/me',
|
|
61
|
+
qs: {
|
|
62
|
+
fields: 'id,username,name',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.ThreadsOAuth2Api = ThreadsOAuth2Api;
|
|
69
|
+
//# sourceMappingURL=ThreadsOAuth2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreadsOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/ThreadsOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,gBAAgB;IAA7B;QACC,SAAI,GAAG,kBAAkB,CAAC;QAC1B,gBAAW,GAAG,oBAAoB,CAAC;QACnC,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QACxB,qBAAgB,GAAG,uDAAuD,CAAC;QAC3E,SAAI,GAAG,kBAA2B,CAAC;QAEnC,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,qCAAqC;aAC9C;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,8CAA8C;aACvD;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,kIAAkI;aAC3I;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,oBAAoB;aAC7B;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ;aACjB;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,sCAAsC;iBACrD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,gCAAgC;gBACzC,GAAG,EAAE,KAAK;gBACV,EAAE,EAAE;oBACH,MAAM,EAAE,kBAAkB;iBAC1B;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAhED,4CAgEC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960">
|
|
2
|
+
<path d="M804.6 960H155.4C69.58 960 0 890.42 0 804.6V155.4C0 69.58 69.58 0 155.4 0h649.2C890.42 0 960 69.58 960 155.4v649.2c0 85.82-69.58 155.4-155.4 155.4z"/>
|
|
3
|
+
<path fill="#FFF" d="M404.63 392.13c-11.92-7.93-51.53-35.49-51.53-35.49 33.4-47.88 77.46-66.52 138.36-66.52 43.07 0 79.64 14.52 105.75 42 26.12 27.49 41.02 66.8 44.41 117.07 14.48 6.07 27.85 13.22 39.99 21.4 48.96 33 75.92 82.34 75.92 138.91 0 120.23-98.34 224.67-276.35 224.67-152.84 0-311.63-89.11-311.63-354.45 0-263.83 153.81-353.92 311.2-353.92 72.68 0 243.16 10.76 307.27 222.94l-60.12 15.63C678.33 213.2 574.4 189.14 479.11 189.14c-157.52 0-246.62 96.13-246.62 300.65 0 183.38 99.59 280.8 248.71 280.8 122.68 0 214.15-63.9 214.15-157.44 0-63.66-53.37-94.14-56.1-94.14-10.42 54.62-38.36 146.5-161.01 146.5-71.46 0-133.07-49.47-133.07-114.29 0-92.56 87.61-126.06 156.8-126.06 25.91 0 57.18 1.75 73.46 5.07 0-28.21-23.81-76.49-83.96-76.49-55.15-.01-69.14 17.92-86.84 38.39zm105.8 96.25c-90.13 0-101.79 38.51-101.79 62.7 0 38.86 46.07 51.74 70.65 51.74 45.06 0 91.35-12.52 98.63-107.31-22.85-5.14-39.88-7.13-67.49-7.13z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960">
|
|
2
|
+
<path d="M804.6 960H155.4C69.58 960 0 890.42 0 804.6V155.4C0 69.58 69.58 0 155.4 0h649.2C890.42 0 960 69.58 960 155.4v649.2c0 85.82-69.58 155.4-155.4 155.4z"/>
|
|
3
|
+
<path fill="#FFF" d="M404.63 392.13c-11.92-7.93-51.53-35.49-51.53-35.49 33.4-47.88 77.46-66.52 138.36-66.52 43.07 0 79.64 14.52 105.75 42 26.12 27.49 41.02 66.8 44.41 117.07 14.48 6.07 27.85 13.22 39.99 21.4 48.96 33 75.92 82.34 75.92 138.91 0 120.23-98.34 224.67-276.35 224.67-152.84 0-311.63-89.11-311.63-354.45 0-263.83 153.81-353.92 311.2-353.92 72.68 0 243.16 10.76 307.27 222.94l-60.12 15.63C678.33 213.2 574.4 189.14 479.11 189.14c-157.52 0-246.62 96.13-246.62 300.65 0 183.38 99.59 280.8 248.71 280.8 122.68 0 214.15-63.9 214.15-157.44 0-63.66-53.37-94.14-56.1-94.14-10.42 54.62-38.36 146.5-161.01 146.5-71.46 0-133.07-49.47-133.07-114.29 0-92.56 87.61-126.06 156.8-126.06 25.91 0 57.18 1.75 73.46 5.07 0-28.21-23.81-76.49-83.96-76.49-55.15-.01-69.14 17.92-86.84 38.39zm105.8 96.25c-90.13 0-101.79 38.51-101.79 62.7 0 38.86 46.07 51.74 70.65 51.74 45.06 0 91.35-12.52 98.63-107.31-22.85-5.14-39.88-7.13-67.49-7.13z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, IWebhookFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare const THREADS_API_BASE_URL = "https://graph.threads.net/v1.0";
|
|
3
|
+
export declare function threadsApiRequest(this: IExecuteFunctions | IWebhookFunctions | IHookFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject>;
|
|
4
|
+
export declare function threadsApiRequestAllItems(this: IExecuteFunctions, endpoint: string, qs?: IDataObject, limit?: number): Promise<IDataObject[]>;
|
|
5
|
+
export declare function waitForContainerReady(this: IExecuteFunctions, containerId: string, maxAttempts?: number, delayMs?: number): Promise<IDataObject>;
|
|
6
|
+
export declare function publishContainer(this: IExecuteFunctions, userId: string, containerId: string): Promise<IDataObject>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.THREADS_API_BASE_URL = void 0;
|
|
4
|
+
exports.threadsApiRequest = threadsApiRequest;
|
|
5
|
+
exports.threadsApiRequestAllItems = threadsApiRequestAllItems;
|
|
6
|
+
exports.waitForContainerReady = waitForContainerReady;
|
|
7
|
+
exports.publishContainer = publishContainer;
|
|
8
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
9
|
+
exports.THREADS_API_BASE_URL = 'https://graph.threads.net/v1.0';
|
|
10
|
+
async function threadsApiRequest(method, endpoint, body = {}, qs = {}) {
|
|
11
|
+
const authenticationMethod = this.getNodeParameter('authentication', 0, 'oAuth2');
|
|
12
|
+
const credentialType = authenticationMethod === 'oAuth2' ? 'threadsOAuth2Api' : 'threadsApi';
|
|
13
|
+
const options = {
|
|
14
|
+
method,
|
|
15
|
+
baseURL: exports.THREADS_API_BASE_URL,
|
|
16
|
+
url: endpoint,
|
|
17
|
+
qs,
|
|
18
|
+
json: true,
|
|
19
|
+
};
|
|
20
|
+
if (method === 'POST' || method === 'PUT' || method === 'PATCH') {
|
|
21
|
+
if (Object.keys(body).length > 0) {
|
|
22
|
+
options.body = body;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, credentialType, options);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function threadsApiRequestAllItems(endpoint, qs = {}, limit = 50) {
|
|
33
|
+
var _a;
|
|
34
|
+
const returnData = [];
|
|
35
|
+
let responseData;
|
|
36
|
+
const query = {
|
|
37
|
+
...qs,
|
|
38
|
+
limit: Math.min(limit, 100),
|
|
39
|
+
};
|
|
40
|
+
let nextUrl;
|
|
41
|
+
do {
|
|
42
|
+
if (nextUrl) {
|
|
43
|
+
const authenticationMethod = this.getNodeParameter('authentication', 0, 'oAuth2');
|
|
44
|
+
const credentialType = authenticationMethod === 'oAuth2' ? 'threadsOAuth2Api' : 'threadsApi';
|
|
45
|
+
try {
|
|
46
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, credentialType, {
|
|
47
|
+
method: 'GET',
|
|
48
|
+
url: nextUrl,
|
|
49
|
+
json: true,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
responseData = await threadsApiRequest.call(this, 'GET', endpoint, {}, query);
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(responseData.data)) {
|
|
60
|
+
for (const item of responseData.data) {
|
|
61
|
+
returnData.push(item);
|
|
62
|
+
if (limit > 0 && returnData.length >= limit) {
|
|
63
|
+
return returnData.slice(0, limit);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
nextUrl = (_a = responseData.paging) === null || _a === void 0 ? void 0 : _a.next;
|
|
71
|
+
} while (nextUrl && (limit === 0 || returnData.length < limit));
|
|
72
|
+
return returnData;
|
|
73
|
+
}
|
|
74
|
+
async function waitForContainerReady(containerId, maxAttempts = 30, delayMs = 2000) {
|
|
75
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
76
|
+
const statusResponse = await threadsApiRequest.call(this, 'GET', `/${containerId}`, {}, { fields: 'id,status,error_message' });
|
|
77
|
+
const status = statusResponse.status;
|
|
78
|
+
if (status === 'FINISHED') {
|
|
79
|
+
return statusResponse;
|
|
80
|
+
}
|
|
81
|
+
if (status === 'ERROR') {
|
|
82
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Media container ${containerId} processing failed: ${statusResponse.error_message || 'Unknown error'}`);
|
|
83
|
+
}
|
|
84
|
+
if (status === 'EXPIRED') {
|
|
85
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Media container ${containerId} has expired.`);
|
|
86
|
+
}
|
|
87
|
+
await (0, n8n_workflow_1.sleep)(delayMs);
|
|
88
|
+
}
|
|
89
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Media container ${containerId} was not ready within timeout period.`);
|
|
90
|
+
}
|
|
91
|
+
async function publishContainer(userId, containerId) {
|
|
92
|
+
return await threadsApiRequest.call(this, 'POST', `/${userId}/threads_publish`, {}, { creation_id: containerId });
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Threads/GenericFunctions.ts"],"names":[],"mappings":";;;AAgBA,8CAwCC;AAKD,8DAyDC;AAKD,sDA2CC;AAKD,4CAYC;AA9KD,+CAAuE;AAE1D,QAAA,oBAA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N,IAAI,MAAM,kBAAkB,EAC5B,EAAE,EACF,EAAE,WAAW,EAAE,WAAW,EAAE,CAC5B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.insightFields = exports.insightOperations = void 0;
|
|
4
|
+
exports.insightOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: ['insight'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Get Media Insights',
|
|
18
|
+
value: 'getMedia',
|
|
19
|
+
description: 'Get insights for a specific post/media',
|
|
20
|
+
action: 'Get media insights',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Get User Insights',
|
|
24
|
+
value: 'getUser',
|
|
25
|
+
description: 'Get insights for an authenticated user account',
|
|
26
|
+
action: 'Get user insights',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
default: 'getMedia',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
exports.insightFields = [
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Media ID',
|
|
35
|
+
name: 'mediaId',
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: '',
|
|
38
|
+
required: true,
|
|
39
|
+
displayOptions: {
|
|
40
|
+
show: {
|
|
41
|
+
resource: ['insight'],
|
|
42
|
+
operation: ['getMedia'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
description: 'The ID of the post/media to retrieve insights for',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Metrics',
|
|
49
|
+
name: 'mediaMetrics',
|
|
50
|
+
type: 'multiOptions',
|
|
51
|
+
options: [
|
|
52
|
+
{
|
|
53
|
+
name: 'Likes',
|
|
54
|
+
value: 'likes',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Quotes',
|
|
58
|
+
value: 'quotes',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Replies',
|
|
62
|
+
value: 'replies',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'Reposts',
|
|
66
|
+
value: 'reposts',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Views',
|
|
70
|
+
value: 'views',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
default: ['views', 'likes', 'replies', 'reposts', 'quotes'],
|
|
74
|
+
required: true,
|
|
75
|
+
displayOptions: {
|
|
76
|
+
show: {
|
|
77
|
+
resource: ['insight'],
|
|
78
|
+
operation: ['getMedia'],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
description: 'The metrics to retrieve for the post',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
displayName: 'User ID',
|
|
85
|
+
name: 'userId',
|
|
86
|
+
type: 'string',
|
|
87
|
+
default: 'me',
|
|
88
|
+
required: true,
|
|
89
|
+
displayOptions: {
|
|
90
|
+
show: {
|
|
91
|
+
resource: ['insight'],
|
|
92
|
+
operation: ['getUser'],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
description: 'The Threads User ID or "me" for authenticated user',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayName: 'Metrics',
|
|
99
|
+
name: 'userMetrics',
|
|
100
|
+
type: 'multiOptions',
|
|
101
|
+
options: [
|
|
102
|
+
{
|
|
103
|
+
name: 'Follower Demographics',
|
|
104
|
+
value: 'follower_demographics',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'Followers Count',
|
|
108
|
+
value: 'followers_count',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'Likes',
|
|
112
|
+
value: 'likes',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'Quotes',
|
|
116
|
+
value: 'quotes',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'Replies',
|
|
120
|
+
value: 'replies',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'Reposts',
|
|
124
|
+
value: 'reposts',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'Views',
|
|
128
|
+
value: 'views',
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
default: ['views', 'likes', 'replies', 'reposts', 'quotes', 'followers_count'],
|
|
132
|
+
required: true,
|
|
133
|
+
displayOptions: {
|
|
134
|
+
show: {
|
|
135
|
+
resource: ['insight'],
|
|
136
|
+
operation: ['getUser'],
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
description: 'The metrics to retrieve for the account',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
displayName: 'Options',
|
|
143
|
+
name: 'options',
|
|
144
|
+
type: 'collection',
|
|
145
|
+
placeholder: 'Add Option',
|
|
146
|
+
default: {},
|
|
147
|
+
displayOptions: {
|
|
148
|
+
show: {
|
|
149
|
+
resource: ['insight'],
|
|
150
|
+
operation: ['getUser'],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
options: [
|
|
154
|
+
{
|
|
155
|
+
displayName: 'Since',
|
|
156
|
+
name: 'since',
|
|
157
|
+
type: 'dateTime',
|
|
158
|
+
default: '',
|
|
159
|
+
description: 'Start of the reporting period',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
displayName: 'Until',
|
|
163
|
+
name: 'until',
|
|
164
|
+
type: 'dateTime',
|
|
165
|
+
default: '',
|
|
166
|
+
description: 'End of the reporting period',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
//# sourceMappingURL=InsightDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InsightDescription.js","sourceRoot":"","sources":["../../../nodes/Threads/InsightDescription.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAAsB;IACnD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;aACrB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,wCAAwC;gBACrD,MAAM,EAAE,oBAAoB;aAC5B;YACD;gBACC,IAAI,EAAE,mBAAmB;gBACzB,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,gDAAgD;gBAC7D,MAAM,EAAE,mBAAmB;aAC3B;SACD;QACD,OAAO,EAAE,UAAU;KACnB;CACD,CAAC;AAEW,QAAA,aAAa,GAAsB;IAI/C;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,UAAU,CAAC;aACvB;SACD;QACD,WAAW,EAAE,mDAAmD;KAChE;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;aACd;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;aACf;YACD;gBACC,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;aAChB;YACD;gBACC,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;aAChB;YACD;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