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.
Files changed (135) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +190 -256
  3. package/dist/credentials/PachcaApi.credentials.d.ts +5 -1
  4. package/dist/credentials/PachcaApi.credentials.js +31 -34
  5. package/dist/credentials/PachcaApi.credentials.js.map +1 -0
  6. package/dist/credentials/pachca.dark.svg +3 -0
  7. package/dist/credentials/pachca.svg +3 -0
  8. package/dist/icons/pachca.dark.svg +3 -0
  9. package/dist/icons/pachca.svg +3 -0
  10. package/dist/nodes/Pachca/GenericFunctions.d.ts +89 -0
  11. package/dist/nodes/Pachca/GenericFunctions.js +896 -0
  12. package/dist/nodes/Pachca/GenericFunctions.js.map +1 -0
  13. package/dist/nodes/Pachca/Pachca.node.d.ts +3 -4
  14. package/dist/nodes/Pachca/Pachca.node.js +14 -4768
  15. package/dist/nodes/Pachca/Pachca.node.js.map +1 -0
  16. package/dist/nodes/Pachca/Pachca.node.json +24 -0
  17. package/dist/nodes/Pachca/PachcaTrigger.node.d.ts +12 -0
  18. package/dist/nodes/Pachca/PachcaTrigger.node.js +203 -0
  19. package/dist/nodes/Pachca/PachcaTrigger.node.js.map +1 -0
  20. package/dist/nodes/Pachca/PachcaTrigger.node.json +24 -0
  21. package/dist/nodes/Pachca/SharedRouter.d.ts +2 -0
  22. package/dist/nodes/Pachca/SharedRouter.js +986 -0
  23. package/dist/nodes/Pachca/SharedRouter.js.map +1 -0
  24. package/dist/nodes/Pachca/V1/BotDescription.d.ts +3 -0
  25. package/dist/nodes/Pachca/V1/BotDescription.js +58 -0
  26. package/dist/nodes/Pachca/V1/BotDescription.js.map +1 -0
  27. package/dist/nodes/Pachca/V1/ChatDescription.d.ts +3 -0
  28. package/dist/nodes/Pachca/V1/ChatDescription.js +305 -0
  29. package/dist/nodes/Pachca/V1/ChatDescription.js.map +1 -0
  30. package/dist/nodes/Pachca/V1/CustomFieldsDescription.d.ts +3 -0
  31. package/dist/nodes/Pachca/V1/CustomFieldsDescription.js +86 -0
  32. package/dist/nodes/Pachca/V1/CustomFieldsDescription.js.map +1 -0
  33. package/dist/nodes/Pachca/V1/FileDescription.d.ts +3 -0
  34. package/dist/nodes/Pachca/V1/FileDescription.js +111 -0
  35. package/dist/nodes/Pachca/V1/FileDescription.js.map +1 -0
  36. package/dist/nodes/Pachca/V1/FormDescription.d.ts +3 -0
  37. package/dist/nodes/Pachca/V1/FormDescription.js +517 -0
  38. package/dist/nodes/Pachca/V1/FormDescription.js.map +1 -0
  39. package/dist/nodes/Pachca/V1/GroupTagDescription.d.ts +3 -0
  40. package/dist/nodes/Pachca/V1/GroupTagDescription.js +181 -0
  41. package/dist/nodes/Pachca/V1/GroupTagDescription.js.map +1 -0
  42. package/dist/nodes/Pachca/V1/MessageDescription.d.ts +3 -0
  43. package/dist/nodes/Pachca/V1/MessageDescription.js +502 -0
  44. package/dist/nodes/Pachca/V1/MessageDescription.js.map +1 -0
  45. package/dist/nodes/Pachca/V1/PachcaV1.node.d.ts +16 -0
  46. package/dist/nodes/Pachca/V1/PachcaV1.node.js +201 -0
  47. package/dist/nodes/Pachca/V1/PachcaV1.node.js.map +1 -0
  48. package/dist/nodes/Pachca/V1/ReactionsDescription.d.ts +3 -0
  49. package/dist/nodes/Pachca/V1/ReactionsDescription.js +99 -0
  50. package/dist/nodes/Pachca/V1/ReactionsDescription.js.map +1 -0
  51. package/dist/nodes/Pachca/V1/StatusDescription.d.ts +3 -0
  52. package/dist/nodes/Pachca/V1/StatusDescription.js +89 -0
  53. package/dist/nodes/Pachca/V1/StatusDescription.js.map +1 -0
  54. package/dist/nodes/Pachca/V1/TaskDescription.d.ts +3 -0
  55. package/dist/nodes/Pachca/V1/TaskDescription.js +182 -0
  56. package/dist/nodes/Pachca/V1/TaskDescription.js.map +1 -0
  57. package/dist/nodes/Pachca/V1/ThreadDescription.d.ts +3 -0
  58. package/dist/nodes/Pachca/V1/ThreadDescription.js +64 -0
  59. package/dist/nodes/Pachca/V1/ThreadDescription.js.map +1 -0
  60. package/dist/nodes/Pachca/V1/UserDescription.d.ts +3 -0
  61. package/dist/nodes/Pachca/V1/UserDescription.js +367 -0
  62. package/dist/nodes/Pachca/V1/UserDescription.js.map +1 -0
  63. package/dist/nodes/Pachca/V2/BotDescription.d.ts +3 -0
  64. package/dist/nodes/Pachca/V2/BotDescription.js +86 -0
  65. package/dist/nodes/Pachca/V2/BotDescription.js.map +1 -0
  66. package/dist/nodes/Pachca/V2/ChatDescription.d.ts +3 -0
  67. package/dist/nodes/Pachca/V2/ChatDescription.js +354 -0
  68. package/dist/nodes/Pachca/V2/ChatDescription.js.map +1 -0
  69. package/dist/nodes/Pachca/V2/CustomPropertyDescription.d.ts +3 -0
  70. package/dist/nodes/Pachca/V2/CustomPropertyDescription.js +42 -0
  71. package/dist/nodes/Pachca/V2/CustomPropertyDescription.js.map +1 -0
  72. package/dist/nodes/Pachca/V2/ExportDescription.d.ts +3 -0
  73. package/dist/nodes/Pachca/V2/ExportDescription.js +111 -0
  74. package/dist/nodes/Pachca/V2/ExportDescription.js.map +1 -0
  75. package/dist/nodes/Pachca/V2/FileDescription.d.ts +3 -0
  76. package/dist/nodes/Pachca/V2/FileDescription.js +77 -0
  77. package/dist/nodes/Pachca/V2/FileDescription.js.map +1 -0
  78. package/dist/nodes/Pachca/V2/FormDescription.d.ts +3 -0
  79. package/dist/nodes/Pachca/V2/FormDescription.js +311 -0
  80. package/dist/nodes/Pachca/V2/FormDescription.js.map +1 -0
  81. package/dist/nodes/Pachca/V2/GroupTagDescription.d.ts +3 -0
  82. package/dist/nodes/Pachca/V2/GroupTagDescription.js +216 -0
  83. package/dist/nodes/Pachca/V2/GroupTagDescription.js.map +1 -0
  84. package/dist/nodes/Pachca/V2/LinkPreviewDescription.d.ts +3 -0
  85. package/dist/nodes/Pachca/V2/LinkPreviewDescription.js +42 -0
  86. package/dist/nodes/Pachca/V2/LinkPreviewDescription.js.map +1 -0
  87. package/dist/nodes/Pachca/V2/MemberDescription.d.ts +3 -0
  88. package/dist/nodes/Pachca/V2/MemberDescription.js +427 -0
  89. package/dist/nodes/Pachca/V2/MemberDescription.js.map +1 -0
  90. package/dist/nodes/Pachca/V2/MessageDescription.d.ts +3 -0
  91. package/dist/nodes/Pachca/V2/MessageDescription.js +589 -0
  92. package/dist/nodes/Pachca/V2/MessageDescription.js.map +1 -0
  93. package/dist/nodes/Pachca/V2/PachcaV2.node.d.ts +17 -0
  94. package/dist/nodes/Pachca/V2/PachcaV2.node.js +111 -0
  95. package/dist/nodes/Pachca/V2/PachcaV2.node.js.map +1 -0
  96. package/dist/nodes/Pachca/V2/ProfileDescription.d.ts +3 -0
  97. package/dist/nodes/Pachca/V2/ProfileDescription.js +144 -0
  98. package/dist/nodes/Pachca/V2/ProfileDescription.js.map +1 -0
  99. package/dist/nodes/Pachca/V2/ReactionDescription.d.ts +3 -0
  100. package/dist/nodes/Pachca/V2/ReactionDescription.js +136 -0
  101. package/dist/nodes/Pachca/V2/ReactionDescription.js.map +1 -0
  102. package/dist/nodes/Pachca/V2/ReadMemberDescription.d.ts +3 -0
  103. package/dist/nodes/Pachca/V2/ReadMemberDescription.js +57 -0
  104. package/dist/nodes/Pachca/V2/ReadMemberDescription.js.map +1 -0
  105. package/dist/nodes/Pachca/V2/SearchDescription.d.ts +3 -0
  106. package/dist/nodes/Pachca/V2/SearchDescription.js +323 -0
  107. package/dist/nodes/Pachca/V2/SearchDescription.js.map +1 -0
  108. package/dist/nodes/Pachca/V2/SecurityDescription.d.ts +3 -0
  109. package/dist/nodes/Pachca/V2/SecurityDescription.js +160 -0
  110. package/dist/nodes/Pachca/V2/SecurityDescription.js.map +1 -0
  111. package/dist/nodes/Pachca/V2/TaskDescription.d.ts +3 -0
  112. package/dist/nodes/Pachca/V2/TaskDescription.js +332 -0
  113. package/dist/nodes/Pachca/V2/TaskDescription.js.map +1 -0
  114. package/dist/nodes/Pachca/V2/ThreadDescription.d.ts +3 -0
  115. package/dist/nodes/Pachca/V2/ThreadDescription.js +54 -0
  116. package/dist/nodes/Pachca/V2/ThreadDescription.js.map +1 -0
  117. package/dist/nodes/Pachca/V2/UserDescription.d.ts +3 -0
  118. package/dist/nodes/Pachca/V2/UserDescription.js +635 -0
  119. package/dist/nodes/Pachca/V2/UserDescription.js.map +1 -0
  120. package/dist/nodes/Pachca/pachca.dark.svg +3 -0
  121. package/dist/nodes/Pachca/pachca.svg +3 -0
  122. package/docs/CONTRIBUTORS.md +72 -0
  123. package/docs/DEVELOPMENT.md +136 -0
  124. package/examples/basic-usage.json +69 -0
  125. package/icons/pachca.dark.svg +3 -0
  126. package/icons/pachca.svg +3 -0
  127. package/index.js +1 -0
  128. package/package.json +46 -35
  129. package/dist/n8n-structure/credentials/PachcaApi.credentials.js +0 -73
  130. package/dist/n8n-structure/nodes/Pachca/Pachca.node.js +0 -4780
  131. package/dist/n8n-structure/nodes/Pachca/Pachca_dark_mark.png +0 -0
  132. package/dist/n8n-structure/nodes/Pachca/Pachca_white_mark.png +0 -0
  133. package/dist/n8n-structure/package.json +0 -70
  134. package/dist/nodes/Pachca/Pachca_dark_mark.png +0 -0
  135. package/dist/nodes/Pachca/Pachca_white_mark.png +0 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 n8n-nodes-pachca
3
+ Copyright (c) 2025 Pachca
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,346 +1,280 @@
1
- # n8n Pachca Node
1
+ # n8n-nodes-pachca
2
2
 
3
- Custom n8n node for integration with the Pachca messenger API. Automate work with users, messages, chats, files, and other Pachca resources.
3
+ Community node for [n8n](https://n8n.io/) to interact with the [Pachca API](https://dev.pachca.com/).
4
4
 
5
- ## Table of Contents
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
- ### Automatic installation
9
+ In your n8n instance:
17
10
 
18
- 1. Download the node archive:
19
- ```bash
20
- wget https://github.com/pachca/n8n-nodes-pachca/releases/latest/download/pachca-node-v2.2.2.tar.gz
21
- ```
11
+ 1. Go to **Settings > Community Nodes**
12
+ 2. Enter `n8n-nodes-pachca`
13
+ 3. Click **Install**
22
14
 
23
- 2. Extract to the custom nodes directory:
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
- docker restart n8n-container
18
+ npm install n8n-nodes-pachca
31
19
  ```
32
20
 
33
- ### Manual installation
21
+ Or install from archive:
34
22
 
35
- 1. Clone the repository:
36
23
  ```bash
37
- git clone https://github.com/pachca/n8n-nodes-pachca.git
38
- cd n8n-nodes-pachca
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
- 2. Install dependencies:
42
- ```bash
43
- npm install
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
- 3. Build the project:
47
- ```bash
48
- npm run build
32
+ # Restart n8n
49
33
  ```
50
34
 
51
- 4. Restart n8n:
52
- ```bash
53
- docker restart n8n-container
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
- ## Configuration
94
+ Credentials are tested by calling `GET /oauth/token/info`.
57
95
 
58
- ### 1. Creating credentials
96
+ ## Key Features
59
97
 
60
- 1. In n8n go to **Settings** → **Credentials**
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
- ### 2. Obtaining an access token
100
+ All list operations (Get Many) support automatic cursor-based pagination:
68
101
 
69
- To get an access token:
102
+ - **Return All** = true — fetches all pages automatically
103
+ - **Return All** = false — returns up to **Limit** results (default: 50)
70
104
 
71
- 1. Log in to the Pachca web app
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
- > **Important**: The token must have the required permissions for the operations you plan to perform.
107
+ Toggle **Simplify** (on by default) to return only key fields from API responses. Turn off for full response.
77
108
 
78
- ## Resources and Operations
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
- ### User
114
+ ### Searchable Dropdowns
81
115
 
82
- | Operation | Description | Method |
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
- **Update parameters:**
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
- ### Message
120
+ Create messages with interactive buttons via JSON:
99
121
 
100
- | Operation | Description | Method |
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 |
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
- ### Chat
136
+ Forms require a `trigger_id` from a `button_pressed` webhook event (valid for 3 seconds).
110
137
 
111
- | Operation | Description | Method |
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
- **Create parameters:**
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
- ### Group Tag
142
+ ### File Upload
126
143
 
127
- | Operation | Description | Method |
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
- ### File
146
+ ### AI Tool Use
138
147
 
139
- | Operation | Description | Method |
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
- **Supported file sources:**
145
- - URL (file link)
146
- - Binary (binary data from previous nodes)
150
+ ### Error Handling
147
151
 
148
- ### Custom Fields
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
- | Operation | Description | Method |
151
- |-----------|-------------|--------|
152
- | Get Custom Properties | Get list of fields | GET |
155
+ ## v1 Compatibility
153
156
 
154
- ### Task
157
+ Version 2 is fully backward compatible with v1. Existing v1 workflows continue to work without modification.
155
158
 
156
- | Operation | Description | Method |
157
- |-----------|-------------|--------|
158
- | Create | Create task | POST |
159
+ The node uses the **VersionedNodeType** pattern with `defaultVersion: 2`:
159
160
 
160
- ### Bot
161
-
162
- | Operation | Description | Method |
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
- ### Status
165
+ **Renamed resources:** `reactions` → `reaction`, `status` → `profile`, `customFields` → `customProperty`
167
166
 
168
- | Operation | Description | Method |
169
- |-----------|-------------|--------|
170
- | Get Profile | Get profile | GET |
171
- | Get Status | Get status | GET |
172
- | Update Status | Update status | PUT |
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
- ### 1. Send a message to a chat
175
+ ### Send a message
193
176
 
194
- ```json
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
- ### 2. Create a chat with settings
179
+ - **Entity ID** chat ID (use searchable dropdown or enter number)
180
+ - **Content** — message text (supports Markdown)
204
181
 
205
- ```json
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
- ### 3. Update a user
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
- ### 4. Upload a file
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
- ```json
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
- ### 5. Workflow: New user notification
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
- 1. **Webhook** receives new user data
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
- ## Troubleshooting
199
+ Set **Resource** = Search, **Operation** = Get Many Messages:
259
200
 
260
- ### "Invalid URL" error
201
+ - **Query** search text
202
+ - **Return All** = false, **Limit** = 10
261
203
 
262
- **Problem**: API requests fail due to incorrect URL.
204
+ ### Open a modal form
263
205
 
264
- **Solution**:
265
- 1. Check Base URL in credentials: `https://api.pachca.com/api/shared/v1`
266
- 2. Ensure the access token is valid
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
- ### "Request failed with status code 404"
210
+ ### Bot echo workflow
270
211
 
271
- **Problem**: Resource not found.
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
- **Solution**:
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
- ### "Request failed with status code 400"
218
+ ### 401 Unauthorized
279
219
 
280
- **Problem**: Invalid request parameters.
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
- **Solution**:
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
- ### Files not uploading
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
- **Problem**: Error when uploading files.
226
+ ### 429 Too Many Requests
290
227
 
291
- **Solution**:
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
- ### Node not showing in the list
230
+ ### Webhook not received (Trigger)
297
231
 
298
- **Problem**: Custom node does not appear in n8n.
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
- **Solution**:
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
- ## Support
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
- ### Getting help
241
+ ### Node not showing in n8n
308
242
 
309
- - **GitHub Issues**: [Create an issue](https://github.com/pachca/n8n-nodes-pachca/issues)
310
- - **Pachca API documentation**: [api.pachca.com](https://api.pachca.com)
311
- - **n8n Community**: [community.n8n.io](https://community.n8n.io)
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
- ### Reporting bugs
247
+ ## Support
314
248
 
315
- When reporting a bug please include:
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
- 1. n8n version
318
- 2. Node version
319
- 3. Problem description
320
- 4. Error logs
321
- 5. Steps to reproduce
253
+ ## Development
322
254
 
323
- ### Contributing
255
+ This node is auto-generated from the OpenAPI specification:
324
256
 
325
- We welcome contributions:
257
+ ```bash
258
+ # Generate node files from OpenAPI
259
+ bun run integrations/n8n/scripts/generate-n8n.ts
326
260
 
327
- 1. Fork the repository
328
- 2. Create a feature branch
329
- 3. Make your changes
330
- 4. Open a Pull Request
261
+ # Run tests
262
+ cd integrations/n8n && npx vitest run
331
263
 
332
- ## License
264
+ # Type check
265
+ cd integrations/n8n && npx tsc --noEmit
333
266
 
334
- MIT License – see the [LICENSE](LICENSE) file for details.
267
+ # Build for distribution
268
+ cd integrations/n8n && npx n8n-node build
335
269
 
336
- ## Versions
270
+ # Full CI check (from repo root)
271
+ npx turbo check
272
+ ```
337
273
 
338
- ### v1.0.0
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
- **Made with ❤️ for the n8n and Pachca community**
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.documentationUrl = 'https://crm.pachca.com/dev/getting-started/requests-and-responses/';
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: 'Base URL',
20
- name: 'baseUrl',
21
- type: 'string',
22
- default: 'https://api.pachca.com/api/shared/v1',
23
- description: 'Base URL for Pachca API',
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: 'Token Type',
27
- name: 'tokenType',
28
- type: 'options',
29
- options: [
30
- {
31
- name: 'Bot Token',
32
- value: 'bot',
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: 'User ID',
51
- name: 'userId',
52
- type: 'number',
43
+ displayName: 'Webhook Allowed IPs',
44
+ name: 'webhookAllowedIps',
45
+ type: 'string',
53
46
  default: '',
54
- description: 'User/bot ID that owns the token (optional)',
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: '/profile',
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"}