n8n-nodes-pachca 1.0.26 → 2.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 +1 -1
- package/README.md +190 -256
- package/dist/credentials/PachcaApi.credentials.d.ts +5 -1
- package/dist/credentials/PachcaApi.credentials.js +31 -34
- package/dist/credentials/PachcaApi.credentials.js.map +1 -0
- package/dist/credentials/pachca.dark.svg +3 -0
- package/dist/credentials/pachca.svg +3 -0
- package/dist/icons/pachca.dark.svg +3 -0
- package/dist/icons/pachca.svg +3 -0
- package/dist/nodes/Pachca/GenericFunctions.d.ts +89 -0
- package/dist/nodes/Pachca/GenericFunctions.js +896 -0
- package/dist/nodes/Pachca/GenericFunctions.js.map +1 -0
- package/dist/nodes/Pachca/Pachca.node.d.ts +3 -4
- package/dist/nodes/Pachca/Pachca.node.js +14 -4768
- package/dist/nodes/Pachca/Pachca.node.js.map +1 -0
- package/dist/nodes/Pachca/Pachca.node.json +24 -0
- package/dist/nodes/Pachca/PachcaTrigger.node.d.ts +12 -0
- package/dist/nodes/Pachca/PachcaTrigger.node.js +203 -0
- package/dist/nodes/Pachca/PachcaTrigger.node.js.map +1 -0
- package/dist/nodes/Pachca/PachcaTrigger.node.json +24 -0
- package/dist/nodes/Pachca/SharedRouter.d.ts +2 -0
- package/dist/nodes/Pachca/SharedRouter.js +986 -0
- package/dist/nodes/Pachca/SharedRouter.js.map +1 -0
- package/dist/nodes/Pachca/V1/BotDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/BotDescription.js +58 -0
- package/dist/nodes/Pachca/V1/BotDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/ChatDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/ChatDescription.js +305 -0
- package/dist/nodes/Pachca/V1/ChatDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/CustomFieldsDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/CustomFieldsDescription.js +86 -0
- package/dist/nodes/Pachca/V1/CustomFieldsDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/FileDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/FileDescription.js +111 -0
- package/dist/nodes/Pachca/V1/FileDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/FormDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/FormDescription.js +517 -0
- package/dist/nodes/Pachca/V1/FormDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/GroupTagDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/GroupTagDescription.js +181 -0
- package/dist/nodes/Pachca/V1/GroupTagDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/MessageDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/MessageDescription.js +502 -0
- package/dist/nodes/Pachca/V1/MessageDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/PachcaV1.node.d.ts +16 -0
- package/dist/nodes/Pachca/V1/PachcaV1.node.js +201 -0
- package/dist/nodes/Pachca/V1/PachcaV1.node.js.map +1 -0
- package/dist/nodes/Pachca/V1/ReactionsDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/ReactionsDescription.js +99 -0
- package/dist/nodes/Pachca/V1/ReactionsDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/StatusDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/StatusDescription.js +89 -0
- package/dist/nodes/Pachca/V1/StatusDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/TaskDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/TaskDescription.js +182 -0
- package/dist/nodes/Pachca/V1/TaskDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/ThreadDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/ThreadDescription.js +64 -0
- package/dist/nodes/Pachca/V1/ThreadDescription.js.map +1 -0
- package/dist/nodes/Pachca/V1/UserDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V1/UserDescription.js +367 -0
- package/dist/nodes/Pachca/V1/UserDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/BotDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/BotDescription.js +86 -0
- package/dist/nodes/Pachca/V2/BotDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/ChatDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/ChatDescription.js +354 -0
- package/dist/nodes/Pachca/V2/ChatDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/CustomPropertyDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/CustomPropertyDescription.js +42 -0
- package/dist/nodes/Pachca/V2/CustomPropertyDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/ExportDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/ExportDescription.js +111 -0
- package/dist/nodes/Pachca/V2/ExportDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/FileDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/FileDescription.js +77 -0
- package/dist/nodes/Pachca/V2/FileDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/FormDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/FormDescription.js +311 -0
- package/dist/nodes/Pachca/V2/FormDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/GroupTagDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/GroupTagDescription.js +216 -0
- package/dist/nodes/Pachca/V2/GroupTagDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/LinkPreviewDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/LinkPreviewDescription.js +42 -0
- package/dist/nodes/Pachca/V2/LinkPreviewDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/MemberDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/MemberDescription.js +427 -0
- package/dist/nodes/Pachca/V2/MemberDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/MessageDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/MessageDescription.js +589 -0
- package/dist/nodes/Pachca/V2/MessageDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/PachcaV2.node.d.ts +17 -0
- package/dist/nodes/Pachca/V2/PachcaV2.node.js +111 -0
- package/dist/nodes/Pachca/V2/PachcaV2.node.js.map +1 -0
- package/dist/nodes/Pachca/V2/ProfileDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/ProfileDescription.js +144 -0
- package/dist/nodes/Pachca/V2/ProfileDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/ReactionDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/ReactionDescription.js +136 -0
- package/dist/nodes/Pachca/V2/ReactionDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/ReadMemberDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/ReadMemberDescription.js +57 -0
- package/dist/nodes/Pachca/V2/ReadMemberDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/SearchDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/SearchDescription.js +323 -0
- package/dist/nodes/Pachca/V2/SearchDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/SecurityDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/SecurityDescription.js +160 -0
- package/dist/nodes/Pachca/V2/SecurityDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/TaskDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/TaskDescription.js +332 -0
- package/dist/nodes/Pachca/V2/TaskDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/ThreadDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/ThreadDescription.js +54 -0
- package/dist/nodes/Pachca/V2/ThreadDescription.js.map +1 -0
- package/dist/nodes/Pachca/V2/UserDescription.d.ts +3 -0
- package/dist/nodes/Pachca/V2/UserDescription.js +635 -0
- package/dist/nodes/Pachca/V2/UserDescription.js.map +1 -0
- package/dist/nodes/Pachca/pachca.dark.svg +3 -0
- package/dist/nodes/Pachca/pachca.svg +3 -0
- package/docs/CONTRIBUTORS.md +72 -0
- package/docs/DEVELOPMENT.md +136 -0
- package/examples/basic-usage.json +69 -0
- package/icons/pachca.dark.svg +3 -0
- package/icons/pachca.svg +3 -0
- package/index.js +1 -0
- package/package.json +46 -35
- package/dist/n8n-structure/credentials/PachcaApi.credentials.js +0 -73
- package/dist/n8n-structure/nodes/Pachca/Pachca.node.js +0 -4780
- package/dist/n8n-structure/nodes/Pachca/Pachca_dark_mark.png +0 -0
- package/dist/n8n-structure/nodes/Pachca/Pachca_white_mark.png +0 -0
- package/dist/n8n-structure/package.json +0 -70
- package/dist/nodes/Pachca/Pachca_dark_mark.png +0 -0
- package/dist/nodes/Pachca/Pachca_white_mark.png +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,346 +1,280 @@
|
|
|
1
|
-
# n8n
|
|
1
|
+
# n8n-nodes-pachca
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Community node for [n8n](https://n8n.io/) to interact with the [Pachca API](https://dev.pachca.com/).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- [Installation](#installation)
|
|
8
|
-
- [Configuration](#configuration)
|
|
9
|
-
- [Resources and Operations](#resources-and-operations)
|
|
10
|
-
- [Usage Examples](#usage-examples)
|
|
11
|
-
- [Troubleshooting](#troubleshooting)
|
|
12
|
-
- [Support](#support)
|
|
5
|
+
Auto-generated from the [OpenAPI spec](https://github.com/pachca/openapi) — always in sync with the latest API.
|
|
13
6
|
|
|
14
7
|
## Installation
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
In your n8n instance:
|
|
17
10
|
|
|
18
|
-
1.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```
|
|
11
|
+
1. Go to **Settings > Community Nodes**
|
|
12
|
+
2. Enter `n8n-nodes-pachca`
|
|
13
|
+
3. Click **Install**
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
tar -xzf pachca-node-v2.2.2.tar.gz -C /path/to/n8n/custom-nodes/
|
|
26
|
-
```
|
|
15
|
+
Or install via CLI:
|
|
27
16
|
|
|
28
|
-
3. Restart n8n:
|
|
29
17
|
```bash
|
|
30
|
-
|
|
18
|
+
npm install n8n-nodes-pachca
|
|
31
19
|
```
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
Or install from archive:
|
|
34
22
|
|
|
35
|
-
1. Clone the repository:
|
|
36
23
|
```bash
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
# Via npm (recommended)
|
|
25
|
+
wget https://github.com/pachca/openapi/releases/latest/download/n8n-nodes-pachca.tgz
|
|
26
|
+
cd ~/.n8n/nodes && npm install ./n8n-nodes-pachca.tgz
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```
|
|
28
|
+
# Or extract directly (Docker, no npm needed)
|
|
29
|
+
wget https://github.com/pachca/openapi/releases/latest/download/n8n-nodes-pachca.tgz
|
|
30
|
+
tar -xzf n8n-nodes-pachca.tgz -C ~/.n8n/nodes/
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm run build
|
|
32
|
+
# Restart n8n
|
|
49
33
|
```
|
|
50
34
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
## Nodes
|
|
36
|
+
|
|
37
|
+
### Pachca
|
|
38
|
+
|
|
39
|
+
Main node for interacting with the Pachca API. Supports 18 resources and 65+ operations:
|
|
40
|
+
|
|
41
|
+
| Resource | Operations |
|
|
42
|
+
|----------|-----------|
|
|
43
|
+
| Bot | Update, Get Many Events, Remove Events |
|
|
44
|
+
| Chat | Create, Get, Get Many, Update, Archive, Unarchive |
|
|
45
|
+
| Chat Export | Create, Get |
|
|
46
|
+
| Chat Member | Get Many, Create, Delete, Update, Leave, Add/Remove Group Tags |
|
|
47
|
+
| Custom Property | Get |
|
|
48
|
+
| File | Create (S3 two-stage upload) |
|
|
49
|
+
| Form | Create (visual builder, templates, or JSON) |
|
|
50
|
+
| Group Tag | Create, Get, Get Many, Update, Delete, Get Many Users |
|
|
51
|
+
| Link Preview | Create |
|
|
52
|
+
| Message | Create, Get, Get Many, Update, Delete, Pin, Unpin |
|
|
53
|
+
| Profile | Get Info, Get, Update/Delete Avatar, Get/Update/Delete Status |
|
|
54
|
+
| Reaction | Create, Delete, Get Many |
|
|
55
|
+
| Read Member | Get Many |
|
|
56
|
+
| Search | Chats, Messages, Users |
|
|
57
|
+
| Security | Get Many |
|
|
58
|
+
| Task | Create, Get, Get Many, Update, Delete |
|
|
59
|
+
| Thread | Create, Get |
|
|
60
|
+
| User | Create, Get, Get Many, Update, Delete, Update/Delete Avatar, Get/Update/Delete Status |
|
|
61
|
+
|
|
62
|
+
### Pachca Trigger
|
|
63
|
+
|
|
64
|
+
Webhook-based trigger that listens for 16 Pachca event types:
|
|
65
|
+
|
|
66
|
+
| Category | Events |
|
|
67
|
+
|----------|--------|
|
|
68
|
+
| Messages | new, updated, deleted |
|
|
69
|
+
| Reactions | new, deleted |
|
|
70
|
+
| Interactive | button pressed, form submitted, link shared |
|
|
71
|
+
| Chat members | added, removed |
|
|
72
|
+
| Users | invited, confirmed, activated, suspended, updated, deleted |
|
|
73
|
+
| Wildcard | all events |
|
|
74
|
+
|
|
75
|
+
Automatically registers webhooks via the Bot API when workflow is activated. Deactivation removes the webhook.
|
|
76
|
+
|
|
77
|
+
## Credentials
|
|
78
|
+
|
|
79
|
+
Create a **Pachca API** credential with:
|
|
80
|
+
|
|
81
|
+
| Field | Required | Description |
|
|
82
|
+
|-------|----------|-------------|
|
|
83
|
+
| **Base URL** | no | Default: `https://api.pachca.com/api/shared/v1`. Change only for on-premise. |
|
|
84
|
+
| **Access Token** | yes | Bot or personal API token |
|
|
85
|
+
| **Bot ID** | no | For automatic webhook registration in Trigger. Auto-detected from bot tokens. Set explicitly for admin tokens. |
|
|
86
|
+
| **Signing Secret** | no | For HMAC-SHA256 verification of incoming webhooks (`pachca-signature` header) |
|
|
87
|
+
| **Webhook Allowed IPs** | no | Comma-separated IPs allowed to send webhooks. Pachca sends from `37.200.70.177`. Empty = allow all. |
|
|
88
|
+
|
|
89
|
+
**Where to get tokens:**
|
|
90
|
+
|
|
91
|
+
- **Bot token** — Bot settings > API tab
|
|
92
|
+
- **Personal token** — Settings > Automations > API
|
|
55
93
|
|
|
56
|
-
|
|
94
|
+
Credentials are tested by calling `GET /oauth/token/info`.
|
|
57
95
|
|
|
58
|
-
|
|
96
|
+
## Key Features
|
|
59
97
|
|
|
60
|
-
|
|
61
|
-
2. Click **Add Credential**
|
|
62
|
-
3. Find **Pachca API** in the list
|
|
63
|
-
4. Fill in the fields:
|
|
64
|
-
- **Base URL**: `https://api.pachca.com/api/shared/v1`
|
|
65
|
-
- **Access Token**: Your Pachca API access token
|
|
98
|
+
### Pagination
|
|
66
99
|
|
|
67
|
-
|
|
100
|
+
All list operations (Get Many) support automatic cursor-based pagination:
|
|
68
101
|
|
|
69
|
-
|
|
102
|
+
- **Return All** = true — fetches all pages automatically
|
|
103
|
+
- **Return All** = false — returns up to **Limit** results (default: 50)
|
|
70
104
|
|
|
71
|
-
|
|
72
|
-
2. Go to **Settings** → **Integrations**
|
|
73
|
-
3. Create a new access token
|
|
74
|
-
4. Copy the token and paste it into the credentials settings
|
|
105
|
+
### Simplify
|
|
75
106
|
|
|
76
|
-
|
|
107
|
+
Toggle **Simplify** (on by default) to return only key fields from API responses. Turn off for full response.
|
|
77
108
|
|
|
78
|
-
|
|
109
|
+
- **Message** — id, entity_id, chat_id, content, user_id, created_at
|
|
110
|
+
- **Chat** — id, name, channel, public, members_count, created_at
|
|
111
|
+
- **User** — id, first_name, last_name, nickname, email, role, suspended
|
|
112
|
+
- **Task** — id, content, kind, status, priority, due_at, created_at
|
|
79
113
|
|
|
80
|
-
###
|
|
114
|
+
### Searchable Dropdowns
|
|
81
115
|
|
|
82
|
-
|
|
83
|
-
|-----------|-------------|--------|
|
|
84
|
-
| Get All | Get list of all users | GET |
|
|
85
|
-
| Get By ID | Get user by ID | GET |
|
|
86
|
-
| Create | Create new user | POST |
|
|
87
|
-
| Update | Update user data | PUT |
|
|
88
|
-
| Delete | Delete user | DELETE |
|
|
116
|
+
Chat ID and User ID fields support search by name — type to find instead of entering numeric IDs.
|
|
89
117
|
|
|
90
|
-
|
|
91
|
-
- First Name, Last Name, Email
|
|
92
|
-
- Nickname, Phone Number
|
|
93
|
-
- Department, Title, Role
|
|
94
|
-
- Suspended (deactivation)
|
|
95
|
-
- List Tags (comma-separated tags)
|
|
96
|
-
- Custom Properties (additional fields)
|
|
118
|
+
### Message Buttons
|
|
97
119
|
|
|
98
|
-
|
|
120
|
+
Create messages with interactive buttons via JSON:
|
|
99
121
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
122
|
+
```json
|
|
123
|
+
[[{"text": "Approve", "data": "approve"}, {"text": "Reject", "data": "reject"}]]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Button types: **URL** (opens link) and **Data** (sends `button_pressed` webhook event).
|
|
127
|
+
|
|
128
|
+
### Forms
|
|
129
|
+
|
|
130
|
+
Create modal forms with three builder modes:
|
|
131
|
+
|
|
132
|
+
- **Visual Builder** — add blocks (text input, select, radio, checkboxes, date/time, file upload)
|
|
133
|
+
- **Templates** — predefined forms (Feedback, Time Off, Survey, Bug Report)
|
|
134
|
+
- **JSON** — paste blocks from the visual playground
|
|
108
135
|
|
|
109
|
-
|
|
136
|
+
Forms require a `trigger_id` from a `button_pressed` webhook event (valid for 3 seconds).
|
|
110
137
|
|
|
111
|
-
|
|
112
|
-
|-----------|-------------|--------|
|
|
113
|
-
| Get All | Get list of chats | GET |
|
|
114
|
-
| Get By ID | Get chat by ID | GET |
|
|
115
|
-
| Create | Create new chat | POST |
|
|
116
|
-
| Update | Update chat | PUT |
|
|
117
|
-
| Archive | Archive chat | PUT |
|
|
118
|
-
| Unarchive | Unarchive chat | PUT |
|
|
138
|
+
### Avatar Upload
|
|
119
139
|
|
|
120
|
-
**
|
|
121
|
-
- Chat Name
|
|
122
|
-
- Channel (channel/direct switch)
|
|
123
|
-
- Public (public/private switch)
|
|
140
|
+
Upload avatar images for profiles and users via `multipart/form-data`. Uses binary data from a previous node (HTTP Request, Read Binary File). The **Input Binary Field** parameter (default: `data`) specifies which binary property contains the image.
|
|
124
141
|
|
|
125
|
-
###
|
|
142
|
+
### File Upload
|
|
126
143
|
|
|
127
|
-
|
|
128
|
-
|-----------|-------------|--------|
|
|
129
|
-
| Get All | Get all tags | GET |
|
|
130
|
-
| Get By ID | Get tag by ID | GET |
|
|
131
|
-
| Create | Create new tag | POST |
|
|
132
|
-
| Update | Update tag | PUT |
|
|
133
|
-
| Delete | Delete tag | DELETE |
|
|
134
|
-
| Add Tags | Add tags to chat | POST |
|
|
135
|
-
| Remove Tag | Remove tag from chat | DELETE |
|
|
144
|
+
Two-stage S3 upload with automatic retry. Sources: **URL** or **Binary Data** from previous workflow nodes.
|
|
136
145
|
|
|
137
|
-
###
|
|
146
|
+
### AI Tool Use
|
|
138
147
|
|
|
139
|
-
|
|
140
|
-
|-----------|-------------|--------|
|
|
141
|
-
| Upload | Upload file | POST |
|
|
142
|
-
| Get Upload Params | Get upload parameters | POST |
|
|
148
|
+
Both nodes have `usableAsTool: true` — they can be used as tools for AI Agent nodes in n8n.
|
|
143
149
|
|
|
144
|
-
|
|
145
|
-
- URL (file link)
|
|
146
|
-
- Binary (binary data from previous nodes)
|
|
150
|
+
### Error Handling
|
|
147
151
|
|
|
148
|
-
|
|
152
|
+
- **5xx/429 retry** — exponential backoff with jitter, respects `Retry-After` header (up to 5 attempts)
|
|
153
|
+
- **continueOnFail** — supported on all operations
|
|
149
154
|
|
|
150
|
-
|
|
151
|
-
|-----------|-------------|--------|
|
|
152
|
-
| Get Custom Properties | Get list of fields | GET |
|
|
155
|
+
## v1 Compatibility
|
|
153
156
|
|
|
154
|
-
|
|
157
|
+
Version 2 is fully backward compatible with v1. Existing v1 workflows continue to work without modification.
|
|
155
158
|
|
|
156
|
-
|
|
157
|
-
|-----------|-------------|--------|
|
|
158
|
-
| Create | Create task | POST |
|
|
159
|
+
The node uses the **VersionedNodeType** pattern with `defaultVersion: 2`:
|
|
159
160
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|-----------|-------------|--------|
|
|
164
|
-
| Update | Update bot settings | PUT |
|
|
161
|
+
- Existing nodes keep `typeVersion: 1` with v1 UI and parameter names
|
|
162
|
+
- New nodes get `typeVersion: 2` with cleaner naming and new resources
|
|
163
|
+
- A shared router translates v1 names to v2 at runtime
|
|
165
164
|
|
|
166
|
-
|
|
165
|
+
**Renamed resources:** `reactions` → `reaction`, `status` → `profile`, `customFields` → `customProperty`
|
|
167
166
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
| Delete Status | Delete status | DELETE |
|
|
174
|
-
|
|
175
|
-
### Thread
|
|
176
|
-
|
|
177
|
-
| Operation | Description | Method |
|
|
178
|
-
|-----------|-------------|--------|
|
|
179
|
-
| Create Thread | Create thread | POST |
|
|
180
|
-
| Get Thread | Get thread | GET |
|
|
181
|
-
|
|
182
|
-
### Reactions
|
|
183
|
-
|
|
184
|
-
| Operation | Description | Method |
|
|
185
|
-
|-----------|-------------|--------|
|
|
186
|
-
| Add Reaction | Add reaction | POST |
|
|
187
|
-
| Delete Reaction | Delete reaction | DELETE |
|
|
188
|
-
| Get Reactions | Get reactions | GET |
|
|
167
|
+
**Renamed operations:** `send` → `create`, `getById` → `get`, `addReaction` → `create`, etc.
|
|
168
|
+
|
|
169
|
+
**New v2 resources:** Chat Member, Custom Property, Read Member, Link Preview, Search, Chat Export, Security
|
|
170
|
+
|
|
171
|
+
To upgrade a v1 node: delete it, add a new Pachca node (defaults to v2), reconfigure with v2 names. API calls are identical.
|
|
189
172
|
|
|
190
173
|
## Usage Examples
|
|
191
174
|
|
|
192
|
-
###
|
|
175
|
+
### Send a message
|
|
193
176
|
|
|
194
|
-
|
|
195
|
-
{
|
|
196
|
-
"resource": "message",
|
|
197
|
-
"operation": "send",
|
|
198
|
-
"chatId": 12345,
|
|
199
|
-
"content": "Hello! This is an automated message from n8n."
|
|
200
|
-
}
|
|
201
|
-
```
|
|
177
|
+
Set **Resource** = Message, **Operation** = Create:
|
|
202
178
|
|
|
203
|
-
|
|
179
|
+
- **Entity ID** — chat ID (use searchable dropdown or enter number)
|
|
180
|
+
- **Content** — message text (supports Markdown)
|
|
204
181
|
|
|
205
|
-
|
|
206
|
-
{
|
|
207
|
-
"resource": "chat",
|
|
208
|
-
"operation": "create",
|
|
209
|
-
"chatName": "New project",
|
|
210
|
-
"channel": true,
|
|
211
|
-
"public": false
|
|
212
|
-
}
|
|
213
|
-
```
|
|
182
|
+
### Send a message with buttons
|
|
214
183
|
|
|
215
|
-
|
|
184
|
+
Set **Resource** = Message, **Operation** = Create, then in **Additional Fields** add **Buttons**:
|
|
216
185
|
|
|
217
186
|
```json
|
|
218
|
-
{
|
|
219
|
-
"resource": "user",
|
|
220
|
-
"operation": "update",
|
|
221
|
-
"userId": 123,
|
|
222
|
-
"firstName": "John",
|
|
223
|
-
"lastName": "Doe",
|
|
224
|
-
"department": "Engineering",
|
|
225
|
-
"title": "Senior Developer",
|
|
226
|
-
"role": "user",
|
|
227
|
-
"listTags": "Backend, Senior",
|
|
228
|
-
"customProperties": {
|
|
229
|
-
"property": [
|
|
230
|
-
{
|
|
231
|
-
"id": 1678,
|
|
232
|
-
"value": "New York"
|
|
233
|
-
}
|
|
234
|
-
]
|
|
235
|
-
}
|
|
236
|
-
}
|
|
187
|
+
[[{"text": "Approve", "data": "approve"}, {"text": "Reject", "data": "reject"}]]
|
|
237
188
|
```
|
|
238
189
|
|
|
239
|
-
|
|
190
|
+
When a user clicks a Data button, the Pachca Trigger node receives a `button_pressed` event with the button's `data` value.
|
|
240
191
|
|
|
241
|
-
|
|
242
|
-
{
|
|
243
|
-
"resource": "file",
|
|
244
|
-
"operation": "upload",
|
|
245
|
-
"fileSource": "url",
|
|
246
|
-
"fileUrl": "https://example.com/document.pdf",
|
|
247
|
-
"fileName": "document.pdf"
|
|
248
|
-
}
|
|
249
|
-
```
|
|
192
|
+
### Upload a file and attach to message
|
|
250
193
|
|
|
251
|
-
|
|
194
|
+
1. **Pachca** (File > Create) — upload file from URL or binary data, get `key` in response
|
|
195
|
+
2. **Pachca** (Message > Create) — send message with the file key in the `files` field
|
|
252
196
|
|
|
253
|
-
|
|
254
|
-
2. **Pachca: Create User** – creates the user in Pachca
|
|
255
|
-
3. **Pachca: Send Message** – sends a welcome message
|
|
256
|
-
4. **Pachca: Create Chat** – creates a personal chat
|
|
197
|
+
### Search and process results
|
|
257
198
|
|
|
258
|
-
|
|
199
|
+
Set **Resource** = Search, **Operation** = Get Many Messages:
|
|
259
200
|
|
|
260
|
-
|
|
201
|
+
- **Query** — search text
|
|
202
|
+
- **Return All** = false, **Limit** = 10
|
|
261
203
|
|
|
262
|
-
|
|
204
|
+
### Open a modal form
|
|
263
205
|
|
|
264
|
-
**
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
3. Check token permissions
|
|
206
|
+
1. **Pachca Trigger** — event `Button Pressed` (provides `trigger_id`)
|
|
207
|
+
2. **Pachca** (Form > Create) — set **Title**, **Trigger ID**, choose builder mode
|
|
208
|
+
3. **Pachca Trigger** — event `Form Submitted` (in a separate workflow)
|
|
268
209
|
|
|
269
|
-
###
|
|
210
|
+
### Bot echo workflow
|
|
270
211
|
|
|
271
|
-
**
|
|
212
|
+
1. **Pachca Trigger** — event `New Message`
|
|
213
|
+
2. **IF** — filter: `message.user_id` ≠ bot ID
|
|
214
|
+
3. **Pachca** (Message > Create) — echo the message back
|
|
272
215
|
|
|
273
|
-
|
|
274
|
-
1. Verify the resource ID
|
|
275
|
-
2. Ensure the token has access to the resource
|
|
276
|
-
3. Confirm the resource exists
|
|
216
|
+
## Troubleshooting
|
|
277
217
|
|
|
278
|
-
###
|
|
218
|
+
### 401 Unauthorized
|
|
279
219
|
|
|
280
|
-
**
|
|
220
|
+
Token is invalid or expired. Check **Access Token** in Credentials. For bot tokens: Bot settings > API tab. For personal tokens: Settings > Automations > API.
|
|
281
221
|
|
|
282
|
-
|
|
283
|
-
1. Check required fields
|
|
284
|
-
2. Verify data format
|
|
285
|
-
3. Check API limits (text length, file size)
|
|
222
|
+
### 403 Forbidden
|
|
286
223
|
|
|
287
|
-
|
|
224
|
+
Token lacks required scopes for this operation. Check available scopes in your token settings. Admin operations (managing users, tags, security log) require admin-level scopes.
|
|
288
225
|
|
|
289
|
-
|
|
226
|
+
### 429 Too Many Requests
|
|
290
227
|
|
|
291
|
-
**
|
|
292
|
-
1. Check that the file URL is accessible
|
|
293
|
-
2. Ensure the file does not exceed size limits
|
|
294
|
-
3. Check file format (supported types)
|
|
228
|
+
Rate limit exceeded (~4 req/sec for messages, ~50 req/sec for other operations). The node retries automatically with exponential backoff. For bulk operations, add a **Wait** node between steps.
|
|
295
229
|
|
|
296
|
-
###
|
|
230
|
+
### Webhook not received (Trigger)
|
|
297
231
|
|
|
298
|
-
**
|
|
232
|
+
1. **Bot not in chat** — bot only receives events from chats it's a member of
|
|
233
|
+
2. **Workflow not activated** — click **Activate** in the top right
|
|
234
|
+
3. **Bot ID missing** — set Bot ID in Credentials for auto-registration, or configure webhook URL manually in bot settings
|
|
235
|
+
4. **n8n not reachable** — Pachca can't send webhooks to `localhost`. Use a tunnel (ngrok, Cloudflare Tunnel) or deploy to a server with a public IP
|
|
299
236
|
|
|
300
|
-
|
|
301
|
-
1. Ensure files are copied to the correct directory
|
|
302
|
-
2. Restart n8n
|
|
303
|
-
3. Check n8n logs for loading errors
|
|
237
|
+
### Form not opening
|
|
304
238
|
|
|
305
|
-
|
|
239
|
+
`trigger_id` from a `button_pressed` event expires in **3 seconds**. Place the Form > Create node immediately after the Trigger, with no Wait nodes or long operations in between.
|
|
306
240
|
|
|
307
|
-
###
|
|
241
|
+
### Node not showing in n8n
|
|
308
242
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
243
|
+
1. Restart n8n after installing the package
|
|
244
|
+
2. Check n8n logs for loading errors
|
|
245
|
+
3. Verify the package is in the correct directory (`~/.n8n/nodes/` or `~/.n8n/custom/node_modules/`)
|
|
312
246
|
|
|
313
|
-
|
|
247
|
+
## Support
|
|
314
248
|
|
|
315
|
-
|
|
249
|
+
- **GitHub Issues** — [github.com/pachca/openapi/issues](https://github.com/pachca/openapi/issues)
|
|
250
|
+
- **Pachca API docs** — [dev.pachca.com](https://dev.pachca.com)
|
|
251
|
+
- **n8n Community** — [community.n8n.io](https://community.n8n.io)
|
|
316
252
|
|
|
317
|
-
|
|
318
|
-
2. Node version
|
|
319
|
-
3. Problem description
|
|
320
|
-
4. Error logs
|
|
321
|
-
5. Steps to reproduce
|
|
253
|
+
## Development
|
|
322
254
|
|
|
323
|
-
|
|
255
|
+
This node is auto-generated from the OpenAPI specification:
|
|
324
256
|
|
|
325
|
-
|
|
257
|
+
```bash
|
|
258
|
+
# Generate node files from OpenAPI
|
|
259
|
+
bun run integrations/n8n/scripts/generate-n8n.ts
|
|
326
260
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
3. Make your changes
|
|
330
|
-
4. Open a Pull Request
|
|
261
|
+
# Run tests
|
|
262
|
+
cd integrations/n8n && npx vitest run
|
|
331
263
|
|
|
332
|
-
|
|
264
|
+
# Type check
|
|
265
|
+
cd integrations/n8n && npx tsc --noEmit
|
|
333
266
|
|
|
334
|
-
|
|
267
|
+
# Build for distribution
|
|
268
|
+
cd integrations/n8n && npx n8n-node build
|
|
335
269
|
|
|
336
|
-
|
|
270
|
+
# Full CI check (from repo root)
|
|
271
|
+
npx turbo check
|
|
272
|
+
```
|
|
337
273
|
|
|
338
|
-
|
|
339
|
-
- Base functionality
|
|
340
|
-
- Support for all main Pachca API resources
|
|
341
|
-
- File upload
|
|
342
|
-
- User and chat management
|
|
274
|
+
See [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for architecture, local testing, and adding new endpoints.
|
|
343
275
|
|
|
344
|
-
|
|
276
|
+
See [docs/CONTRIBUTORS.md](docs/CONTRIBUTORS.md) for project structure and contribution guidelines.
|
|
277
|
+
|
|
278
|
+
## License
|
|
345
279
|
|
|
346
|
-
|
|
280
|
+
MIT
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export declare class PachcaApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
5
|
+
icon: {
|
|
6
|
+
readonly light: "file:pachca.svg";
|
|
7
|
+
readonly dark: "file:pachca.dark.svg";
|
|
8
|
+
};
|
|
5
9
|
documentationUrl: string;
|
|
6
10
|
properties: INodeProperties[];
|
|
7
11
|
authenticate: IAuthenticateGeneric;
|
|
@@ -5,53 +5,48 @@ class PachcaApi {
|
|
|
5
5
|
constructor() {
|
|
6
6
|
this.name = 'pachcaApi';
|
|
7
7
|
this.displayName = 'Pachca API';
|
|
8
|
-
this.
|
|
8
|
+
this.icon = { light: 'file:pachca.svg', dark: 'file:pachca.dark.svg' };
|
|
9
|
+
this.documentationUrl = 'https://dev.pachca.com/api/authorization';
|
|
9
10
|
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Base URL',
|
|
13
|
+
name: 'baseUrl',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: 'https://api.pachca.com/api/shared/v1',
|
|
16
|
+
description: 'Base URL of the Pachca API. Change only for on-premise installations or API proxies.',
|
|
17
|
+
},
|
|
10
18
|
{
|
|
11
19
|
displayName: 'Access Token',
|
|
12
20
|
name: 'accessToken',
|
|
13
21
|
type: 'string',
|
|
14
22
|
typeOptions: { password: true },
|
|
15
23
|
default: '',
|
|
16
|
-
description: 'Access token for Pachca API. Can be obtained in developer settings.',
|
|
17
24
|
},
|
|
18
25
|
{
|
|
19
|
-
displayName: '
|
|
20
|
-
name: '
|
|
21
|
-
type: '
|
|
22
|
-
default:
|
|
23
|
-
description: '
|
|
26
|
+
displayName: 'Bot ID',
|
|
27
|
+
name: 'botId',
|
|
28
|
+
type: 'number',
|
|
29
|
+
default: 0,
|
|
30
|
+
description: 'Bot ID for automatic webhook registration (found in bot settings). Leave empty to auto-detect from token. Only needed for Pachca Trigger node.',
|
|
31
|
+
hint: 'Only required when using a bot token with the Pachca Trigger node',
|
|
24
32
|
},
|
|
25
33
|
{
|
|
26
|
-
displayName: '
|
|
27
|
-
name: '
|
|
28
|
-
type: '
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
description: 'Bot token - access to core API methods',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'Admin Token',
|
|
37
|
-
value: 'admin',
|
|
38
|
-
description: 'Admin token - access to user and tag management',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'Owner Token',
|
|
42
|
-
value: 'owner',
|
|
43
|
-
description: 'Owner token - full access including export',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
default: 'bot',
|
|
47
|
-
description: 'Token type determines available API methods',
|
|
34
|
+
displayName: 'Webhook Signing Secret',
|
|
35
|
+
name: 'signingSecret',
|
|
36
|
+
type: 'string',
|
|
37
|
+
typeOptions: { password: true },
|
|
38
|
+
default: '',
|
|
39
|
+
description: 'Used to verify incoming webhook requests from Pachca. Found in bot settings under the Webhook section.',
|
|
40
|
+
hint: 'Only required when using the Pachca Trigger node',
|
|
48
41
|
},
|
|
49
42
|
{
|
|
50
|
-
displayName: '
|
|
51
|
-
name: '
|
|
52
|
-
type: '
|
|
43
|
+
displayName: 'Webhook Allowed IPs',
|
|
44
|
+
name: 'webhookAllowedIps',
|
|
45
|
+
type: 'string',
|
|
53
46
|
default: '',
|
|
54
|
-
description: '
|
|
47
|
+
description: 'Comma-separated list of IP addresses allowed to send webhooks. Pachca sends from 37.200.70.177. Leave empty to allow all.',
|
|
48
|
+
placeholder: '37.200.70.177',
|
|
49
|
+
hint: 'Only used with the Pachca Trigger node',
|
|
55
50
|
},
|
|
56
51
|
];
|
|
57
52
|
this.authenticate = {
|
|
@@ -65,9 +60,11 @@ class PachcaApi {
|
|
|
65
60
|
this.test = {
|
|
66
61
|
request: {
|
|
67
62
|
baseURL: '={{$credentials.baseUrl}}',
|
|
68
|
-
url: '/
|
|
63
|
+
url: '/oauth/token/info',
|
|
64
|
+
method: 'GET',
|
|
69
65
|
},
|
|
70
66
|
};
|
|
71
67
|
}
|
|
72
68
|
}
|
|
73
69
|
exports.PachcaApi = PachcaApi;
|
|
70
|
+
//# sourceMappingURL=PachcaApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PachcaApi.credentials.js","sourceRoot":"","sources":["../../credentials/PachcaApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,SAAS;IAAtB;QACC,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,YAAY,CAAC;QAC3B,SAAI,GAAG,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAW,CAAC;QAC3E,qBAAgB,GAAG,0CAA0C,CAAC;QAE9D,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,sCAAsC;gBAC/C,WAAW,EAAE,sFAAsF;aACnG;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,gJAAgJ;gBAC7J,IAAI,EAAE,mEAAmE;aACzE;YACD;gBACC,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,wGAAwG;gBACrH,IAAI,EAAE,kDAAkD;aACxD;YACD;gBACC,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,mBAAmB;gBACzB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,2HAA2H;gBACxI,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,wCAAwC;aAC9C;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,2BAA2B;gBACpC,GAAG,EAAE,mBAAmB;gBACxB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAjED,8BAiEC"}
|