n8n-nodes-pachca 1.0.27 → 2.0.1
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 +193 -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 -4772
- 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 +994 -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 -4784
- 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,283 @@
|
|
|
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 (Docker, custom n8n images):
|
|
34
22
|
|
|
35
|
-
1. Clone the repository:
|
|
36
23
|
```bash
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
# Download from GitHub Releases
|
|
25
|
+
# Find the latest n8n-nodes-pachca.tgz at:
|
|
26
|
+
# https://github.com/pachca/openapi/releases?q=n8n
|
|
27
|
+
wget https://github.com/pachca/openapi/releases/download/n8n-v2.0.1/n8n-nodes-pachca.tgz
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
npm install
|
|
44
|
-
```
|
|
29
|
+
# Via npm (recommended)
|
|
30
|
+
cd ~/.n8n/nodes && npm install ./n8n-nodes-pachca.tgz
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
npm run build
|
|
49
|
-
```
|
|
32
|
+
# Or extract directly (no npm needed)
|
|
33
|
+
tar -xzf n8n-nodes-pachca.tgz -C ~/.n8n/nodes/
|
|
50
34
|
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
docker restart n8n-container
|
|
35
|
+
# Restart n8n
|
|
54
36
|
```
|
|
55
37
|
|
|
56
|
-
##
|
|
38
|
+
## Nodes
|
|
39
|
+
|
|
40
|
+
### Pachca
|
|
57
41
|
|
|
58
|
-
|
|
42
|
+
Main node for interacting with the Pachca API. Supports 18 resources and 65+ operations:
|
|
59
43
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
44
|
+
| Resource | Operations |
|
|
45
|
+
|----------|-----------|
|
|
46
|
+
| Bot | Update, Get Many Events, Remove Events |
|
|
47
|
+
| Chat | Create, Get, Get Many, Update, Archive, Unarchive |
|
|
48
|
+
| Chat Export | Create, Get |
|
|
49
|
+
| Chat Member | Get Many, Create, Delete, Update, Leave, Add/Remove Group Tags |
|
|
50
|
+
| Custom Property | Get |
|
|
51
|
+
| File | Create (S3 two-stage upload) |
|
|
52
|
+
| Form | Create (visual builder, templates, or JSON) |
|
|
53
|
+
| Group Tag | Create, Get, Get Many, Update, Delete, Get Many Users |
|
|
54
|
+
| Link Preview | Create |
|
|
55
|
+
| Message | Create, Get, Get Many, Update, Delete, Pin, Unpin |
|
|
56
|
+
| Profile | Get Info, Get, Update/Delete Avatar, Get/Update/Delete Status |
|
|
57
|
+
| Reaction | Create, Delete, Get Many |
|
|
58
|
+
| Read Member | Get Many |
|
|
59
|
+
| Search | Chats, Messages, Users |
|
|
60
|
+
| Security | Get Many |
|
|
61
|
+
| Task | Create, Get, Get Many, Update, Delete |
|
|
62
|
+
| Thread | Create, Get |
|
|
63
|
+
| User | Create, Get, Get Many, Update, Delete, Update/Delete Avatar, Get/Update/Delete Status |
|
|
66
64
|
|
|
67
|
-
###
|
|
65
|
+
### Pachca Trigger
|
|
68
66
|
|
|
69
|
-
|
|
67
|
+
Webhook-based trigger that listens for 16 Pachca event types:
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
| Category | Events |
|
|
70
|
+
|----------|--------|
|
|
71
|
+
| Messages | new, updated, deleted |
|
|
72
|
+
| Reactions | new, deleted |
|
|
73
|
+
| Interactive | button pressed, form submitted, link shared |
|
|
74
|
+
| Chat members | added, removed |
|
|
75
|
+
| Users | invited, confirmed, activated, suspended, updated, deleted |
|
|
76
|
+
| Wildcard | all events |
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
Automatically registers webhooks via the Bot API when workflow is activated. Deactivation removes the webhook.
|
|
77
79
|
|
|
78
|
-
##
|
|
80
|
+
## Credentials
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
Create a **Pachca API** credential with:
|
|
81
83
|
|
|
82
|
-
|
|
|
83
|
-
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
84
|
+
| Field | Required | Description |
|
|
85
|
+
|-------|----------|-------------|
|
|
86
|
+
| **Base URL** | no | Default: `https://api.pachca.com/api/shared/v1`. Change only for on-premise. |
|
|
87
|
+
| **Access Token** | yes | Bot or personal API token |
|
|
88
|
+
| **Bot ID** | no | For automatic webhook registration in Trigger. Auto-detected from bot tokens. Set explicitly for admin tokens. |
|
|
89
|
+
| **Signing Secret** | no | For HMAC-SHA256 verification of incoming webhooks (`pachca-signature` header) |
|
|
90
|
+
| **Webhook Allowed IPs** | no | Comma-separated IPs allowed to send webhooks. Pachca sends from `37.200.70.177`. Empty = allow all. |
|
|
89
91
|
|
|
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)
|
|
92
|
+
**Where to get tokens:**
|
|
97
93
|
|
|
98
|
-
|
|
94
|
+
- **Bot token** — Bot settings > API tab
|
|
95
|
+
- **Personal token** — Settings > Automations > API
|
|
99
96
|
|
|
100
|
-
|
|
101
|
-
|-----------|-------------|--------|
|
|
102
|
-
| Send | Send message | POST |
|
|
103
|
-
| Get All By Chat | Get chat messages | GET |
|
|
104
|
-
| Get By ID | Get message by ID | GET |
|
|
105
|
-
| Update | Edit message | PUT |
|
|
106
|
-
| Delete | Delete message | DELETE |
|
|
107
|
-
| Get Read Members | Get list of readers | GET |
|
|
97
|
+
Credentials are tested by calling `GET /oauth/token/info`.
|
|
108
98
|
|
|
109
|
-
|
|
99
|
+
## Key Features
|
|
110
100
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
### Pagination
|
|
102
|
+
|
|
103
|
+
All list operations (Get Many) support automatic cursor-based pagination:
|
|
104
|
+
|
|
105
|
+
- **Return All** = true — fetches all pages automatically
|
|
106
|
+
- **Return All** = false — returns up to **Limit** results (default: 50)
|
|
107
|
+
|
|
108
|
+
### Simplify
|
|
109
|
+
|
|
110
|
+
Toggle **Simplify** (on by default) to return only key fields from API responses. Turn off for full response.
|
|
111
|
+
|
|
112
|
+
- **Message** — id, entity_id, chat_id, content, user_id, created_at
|
|
113
|
+
- **Chat** — id, name, channel, public, members_count, created_at
|
|
114
|
+
- **User** — id, first_name, last_name, nickname, email, role, suspended
|
|
115
|
+
- **Task** — id, content, kind, status, priority, due_at, created_at
|
|
116
|
+
|
|
117
|
+
### Searchable Dropdowns
|
|
118
|
+
|
|
119
|
+
Chat ID and User ID fields support search by name — type to find instead of entering numeric IDs.
|
|
120
|
+
|
|
121
|
+
### Message Buttons
|
|
122
|
+
|
|
123
|
+
Create messages with interactive buttons via JSON:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
[[{"text": "Approve", "data": "approve"}, {"text": "Reject", "data": "reject"}]]
|
|
127
|
+
```
|
|
119
128
|
|
|
120
|
-
**
|
|
121
|
-
- Chat Name
|
|
122
|
-
- Channel (channel/direct switch)
|
|
123
|
-
- Public (public/private switch)
|
|
129
|
+
Button types: **URL** (opens link) and **Data** (sends `button_pressed` webhook event).
|
|
124
130
|
|
|
125
|
-
###
|
|
131
|
+
### Forms
|
|
126
132
|
|
|
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 |
|
|
133
|
+
Create modal forms with three builder modes:
|
|
136
134
|
|
|
137
|
-
|
|
135
|
+
- **Visual Builder** — add blocks (text input, select, radio, checkboxes, date/time, file upload)
|
|
136
|
+
- **Templates** — predefined forms (Feedback, Time Off, Survey, Bug Report)
|
|
137
|
+
- **JSON** — paste blocks from the visual playground
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|-----------|-------------|--------|
|
|
141
|
-
| Upload | Upload file | POST |
|
|
142
|
-
| Get Upload Params | Get upload parameters | POST |
|
|
139
|
+
Forms require a `trigger_id` from a `button_pressed` webhook event (valid for 3 seconds).
|
|
143
140
|
|
|
144
|
-
|
|
145
|
-
- URL (file link)
|
|
146
|
-
- Binary (binary data from previous nodes)
|
|
141
|
+
### Avatar Upload
|
|
147
142
|
|
|
148
|
-
|
|
143
|
+
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.
|
|
149
144
|
|
|
150
|
-
|
|
151
|
-
|-----------|-------------|--------|
|
|
152
|
-
| Get Custom Properties | Get list of fields | GET |
|
|
145
|
+
### File Upload
|
|
153
146
|
|
|
154
|
-
|
|
147
|
+
Two-stage S3 upload with automatic retry. Sources: **URL** or **Binary Data** from previous workflow nodes.
|
|
155
148
|
|
|
156
|
-
|
|
157
|
-
|-----------|-------------|--------|
|
|
158
|
-
| Create | Create task | POST |
|
|
149
|
+
### AI Tool Use
|
|
159
150
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
| Operation | Description | Method |
|
|
163
|
-
|-----------|-------------|--------|
|
|
164
|
-
| Update | Update bot settings | PUT |
|
|
151
|
+
Both nodes have `usableAsTool: true` — they can be used as tools for AI Agent nodes in n8n.
|
|
165
152
|
|
|
166
|
-
###
|
|
153
|
+
### Error Handling
|
|
167
154
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
| Get Reactions | Get reactions | GET |
|
|
155
|
+
- **5xx/429 retry** — exponential backoff with jitter, respects `Retry-After` header (up to 5 attempts)
|
|
156
|
+
- **continueOnFail** — supported on all operations
|
|
157
|
+
|
|
158
|
+
## v1 Compatibility
|
|
159
|
+
|
|
160
|
+
Version 2 is fully backward compatible with v1. Existing v1 workflows continue to work without modification.
|
|
161
|
+
|
|
162
|
+
The node uses the **VersionedNodeType** pattern with `defaultVersion: 2`:
|
|
163
|
+
|
|
164
|
+
- Existing nodes keep `typeVersion: 1` with v1 UI and parameter names
|
|
165
|
+
- New nodes get `typeVersion: 2` with cleaner naming and new resources
|
|
166
|
+
- A shared router translates v1 names to v2 at runtime
|
|
167
|
+
|
|
168
|
+
**Renamed resources:** `reactions` → `reaction`, `status` → `profile`, `customFields` → `customProperty`
|
|
169
|
+
|
|
170
|
+
**Renamed operations:** `send` → `create`, `getById` → `get`, `addReaction` → `create`, etc.
|
|
171
|
+
|
|
172
|
+
**New v2 resources:** Chat Member, Custom Property, Read Member, Link Preview, Search, Chat Export, Security
|
|
173
|
+
|
|
174
|
+
To upgrade a v1 node: delete it, add a new Pachca node (defaults to v2), reconfigure with v2 names. API calls are identical.
|
|
189
175
|
|
|
190
176
|
## Usage Examples
|
|
191
177
|
|
|
192
|
-
###
|
|
178
|
+
### Send a message
|
|
193
179
|
|
|
194
|
-
|
|
195
|
-
{
|
|
196
|
-
"resource": "message",
|
|
197
|
-
"operation": "send",
|
|
198
|
-
"chatId": 12345,
|
|
199
|
-
"content": "Hello! This is an automated message from n8n."
|
|
200
|
-
}
|
|
201
|
-
```
|
|
180
|
+
Set **Resource** = Message, **Operation** = Create:
|
|
202
181
|
|
|
203
|
-
|
|
182
|
+
- **Entity ID** — chat ID (use searchable dropdown or enter number)
|
|
183
|
+
- **Content** — message text (supports Markdown)
|
|
204
184
|
|
|
205
|
-
|
|
206
|
-
{
|
|
207
|
-
"resource": "chat",
|
|
208
|
-
"operation": "create",
|
|
209
|
-
"chatName": "New project",
|
|
210
|
-
"channel": true,
|
|
211
|
-
"public": false
|
|
212
|
-
}
|
|
213
|
-
```
|
|
185
|
+
### Send a message with buttons
|
|
214
186
|
|
|
215
|
-
|
|
187
|
+
Set **Resource** = Message, **Operation** = Create, then in **Additional Fields** add **Buttons**:
|
|
216
188
|
|
|
217
189
|
```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
|
-
}
|
|
190
|
+
[[{"text": "Approve", "data": "approve"}, {"text": "Reject", "data": "reject"}]]
|
|
237
191
|
```
|
|
238
192
|
|
|
239
|
-
|
|
193
|
+
When a user clicks a Data button, the Pachca Trigger node receives a `button_pressed` event with the button's `data` value.
|
|
240
194
|
|
|
241
|
-
|
|
242
|
-
{
|
|
243
|
-
"resource": "file",
|
|
244
|
-
"operation": "upload",
|
|
245
|
-
"fileSource": "url",
|
|
246
|
-
"fileUrl": "https://example.com/document.pdf",
|
|
247
|
-
"fileName": "document.pdf"
|
|
248
|
-
}
|
|
249
|
-
```
|
|
195
|
+
### Upload a file and attach to message
|
|
250
196
|
|
|
251
|
-
|
|
197
|
+
1. **Pachca** (File > Create) — upload file from URL or binary data, get `key` in response
|
|
198
|
+
2. **Pachca** (Message > Create) — send message with the file key in the `files` field
|
|
252
199
|
|
|
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
|
|
200
|
+
### Search and process results
|
|
257
201
|
|
|
258
|
-
|
|
202
|
+
Set **Resource** = Search, **Operation** = Get Many Messages:
|
|
259
203
|
|
|
260
|
-
|
|
204
|
+
- **Query** — search text
|
|
205
|
+
- **Return All** = false, **Limit** = 10
|
|
261
206
|
|
|
262
|
-
|
|
207
|
+
### Open a modal form
|
|
263
208
|
|
|
264
|
-
**
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
3. Check token permissions
|
|
209
|
+
1. **Pachca Trigger** — event `Button Pressed` (provides `trigger_id`)
|
|
210
|
+
2. **Pachca** (Form > Create) — set **Title**, **Trigger ID**, choose builder mode
|
|
211
|
+
3. **Pachca Trigger** — event `Form Submitted` (in a separate workflow)
|
|
268
212
|
|
|
269
|
-
###
|
|
213
|
+
### Bot echo workflow
|
|
270
214
|
|
|
271
|
-
**
|
|
215
|
+
1. **Pachca Trigger** — event `New Message`
|
|
216
|
+
2. **IF** — filter: `message.user_id` ≠ bot ID
|
|
217
|
+
3. **Pachca** (Message > Create) — echo the message back
|
|
272
218
|
|
|
273
|
-
|
|
274
|
-
1. Verify the resource ID
|
|
275
|
-
2. Ensure the token has access to the resource
|
|
276
|
-
3. Confirm the resource exists
|
|
219
|
+
## Troubleshooting
|
|
277
220
|
|
|
278
|
-
###
|
|
221
|
+
### 401 Unauthorized
|
|
279
222
|
|
|
280
|
-
**
|
|
223
|
+
Token is invalid or expired. Check **Access Token** in Credentials. For bot tokens: Bot settings > API tab. For personal tokens: Settings > Automations > API.
|
|
281
224
|
|
|
282
|
-
|
|
283
|
-
1. Check required fields
|
|
284
|
-
2. Verify data format
|
|
285
|
-
3. Check API limits (text length, file size)
|
|
225
|
+
### 403 Forbidden
|
|
286
226
|
|
|
287
|
-
|
|
227
|
+
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
228
|
|
|
289
|
-
|
|
229
|
+
### 429 Too Many Requests
|
|
290
230
|
|
|
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)
|
|
231
|
+
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
232
|
|
|
296
|
-
###
|
|
233
|
+
### Webhook not received (Trigger)
|
|
297
234
|
|
|
298
|
-
**
|
|
235
|
+
1. **Bot not in chat** — bot only receives events from chats it's a member of
|
|
236
|
+
2. **Workflow not activated** — click **Activate** in the top right
|
|
237
|
+
3. **Bot ID missing** — set Bot ID in Credentials for auto-registration, or configure webhook URL manually in bot settings
|
|
238
|
+
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
239
|
|
|
300
|
-
|
|
301
|
-
1. Ensure files are copied to the correct directory
|
|
302
|
-
2. Restart n8n
|
|
303
|
-
3. Check n8n logs for loading errors
|
|
240
|
+
### Form not opening
|
|
304
241
|
|
|
305
|
-
|
|
242
|
+
`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
243
|
|
|
307
|
-
###
|
|
244
|
+
### Node not showing in n8n
|
|
308
245
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
246
|
+
1. Restart n8n after installing the package
|
|
247
|
+
2. Check n8n logs for loading errors
|
|
248
|
+
3. Verify the package is in the correct directory (`~/.n8n/nodes/` or `~/.n8n/custom/node_modules/`)
|
|
312
249
|
|
|
313
|
-
|
|
250
|
+
## Support
|
|
314
251
|
|
|
315
|
-
|
|
252
|
+
- **GitHub Issues** — [github.com/pachca/openapi/issues](https://github.com/pachca/openapi/issues)
|
|
253
|
+
- **Pachca API docs** — [dev.pachca.com](https://dev.pachca.com)
|
|
254
|
+
- **n8n Community** — [community.n8n.io](https://community.n8n.io)
|
|
316
255
|
|
|
317
|
-
|
|
318
|
-
2. Node version
|
|
319
|
-
3. Problem description
|
|
320
|
-
4. Error logs
|
|
321
|
-
5. Steps to reproduce
|
|
256
|
+
## Development
|
|
322
257
|
|
|
323
|
-
|
|
258
|
+
This node is auto-generated from the OpenAPI specification:
|
|
324
259
|
|
|
325
|
-
|
|
260
|
+
```bash
|
|
261
|
+
# Generate node files from OpenAPI
|
|
262
|
+
bun run integrations/n8n/scripts/generate-n8n.ts
|
|
326
263
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
3. Make your changes
|
|
330
|
-
4. Open a Pull Request
|
|
264
|
+
# Run tests
|
|
265
|
+
cd integrations/n8n && npx vitest run
|
|
331
266
|
|
|
332
|
-
|
|
267
|
+
# Type check
|
|
268
|
+
cd integrations/n8n && npx tsc --noEmit
|
|
333
269
|
|
|
334
|
-
|
|
270
|
+
# Build for distribution
|
|
271
|
+
cd integrations/n8n && npx n8n-node build
|
|
335
272
|
|
|
336
|
-
|
|
273
|
+
# Full CI check (from repo root)
|
|
274
|
+
npx turbo check
|
|
275
|
+
```
|
|
337
276
|
|
|
338
|
-
|
|
339
|
-
- Base functionality
|
|
340
|
-
- Support for all main Pachca API resources
|
|
341
|
-
- File upload
|
|
342
|
-
- User and chat management
|
|
277
|
+
See [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for architecture, local testing, and adding new endpoints.
|
|
343
278
|
|
|
344
|
-
|
|
279
|
+
See [docs/CONTRIBUTORS.md](docs/CONTRIBUTORS.md) for project structure and contribution guidelines.
|
|
280
|
+
|
|
281
|
+
## License
|
|
345
282
|
|
|
346
|
-
|
|
283
|
+
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
|