n8n-nodes-newar 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +232 -0
- package/dist/credentials/NewarApi.credentials.d.ts +10 -0
- package/dist/credentials/NewarApi.credentials.js +63 -0
- package/dist/credentials/NewarApi.credentials.js.map +1 -0
- package/dist/icons/newar.dark.svg +3 -0
- package/dist/icons/newar.svg +3 -0
- package/dist/nodes/Newar/Newar.node.d.ts +11 -0
- package/dist/nodes/Newar/Newar.node.js +151 -0
- package/dist/nodes/Newar/Newar.node.js.map +1 -0
- package/dist/nodes/Newar/Newar.node.json +19 -0
- package/dist/nodes/Newar/actions/common.d.ts +40 -0
- package/dist/nodes/Newar/actions/common.js +328 -0
- package/dist/nodes/Newar/actions/common.js.map +1 -0
- package/dist/nodes/Newar/actions/customField/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/customField/index.js +50 -0
- package/dist/nodes/Newar/actions/customField/index.js.map +1 -0
- package/dist/nodes/Newar/actions/customFields.d.ts +5 -0
- package/dist/nodes/Newar/actions/customFields.js +53 -0
- package/dist/nodes/Newar/actions/customFields.js.map +1 -0
- package/dist/nodes/Newar/actions/deal/create.d.ts +4 -0
- package/dist/nodes/Newar/actions/deal/create.js +39 -0
- package/dist/nodes/Newar/actions/deal/create.js.map +1 -0
- package/dist/nodes/Newar/actions/deal/delete.d.ts +3 -0
- package/dist/nodes/Newar/actions/deal/delete.js +26 -0
- package/dist/nodes/Newar/actions/deal/delete.js.map +1 -0
- package/dist/nodes/Newar/actions/deal/fields.d.ts +7 -0
- package/dist/nodes/Newar/actions/deal/fields.js +182 -0
- package/dist/nodes/Newar/actions/deal/fields.js.map +1 -0
- package/dist/nodes/Newar/actions/deal/get.d.ts +3 -0
- package/dist/nodes/Newar/actions/deal/get.js +22 -0
- package/dist/nodes/Newar/actions/deal/get.js.map +1 -0
- package/dist/nodes/Newar/actions/deal/getAll.d.ts +4 -0
- package/dist/nodes/Newar/actions/deal/getAll.js +102 -0
- package/dist/nodes/Newar/actions/deal/getAll.js.map +1 -0
- package/dist/nodes/Newar/actions/deal/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/deal/index.js +105 -0
- package/dist/nodes/Newar/actions/deal/index.js.map +1 -0
- package/dist/nodes/Newar/actions/deal/search.d.ts +4 -0
- package/dist/nodes/Newar/actions/deal/search.js +69 -0
- package/dist/nodes/Newar/actions/deal/search.js.map +1 -0
- package/dist/nodes/Newar/actions/deal/update.d.ts +4 -0
- package/dist/nodes/Newar/actions/deal/update.js +42 -0
- package/dist/nodes/Newar/actions/deal/update.js.map +1 -0
- package/dist/nodes/Newar/actions/lead/create.d.ts +4 -0
- package/dist/nodes/Newar/actions/lead/create.js +41 -0
- package/dist/nodes/Newar/actions/lead/create.js.map +1 -0
- package/dist/nodes/Newar/actions/lead/delete.d.ts +3 -0
- package/dist/nodes/Newar/actions/lead/delete.js +26 -0
- package/dist/nodes/Newar/actions/lead/delete.js.map +1 -0
- package/dist/nodes/Newar/actions/lead/fields.d.ts +6 -0
- package/dist/nodes/Newar/actions/lead/fields.js +231 -0
- package/dist/nodes/Newar/actions/lead/fields.js.map +1 -0
- package/dist/nodes/Newar/actions/lead/get.d.ts +3 -0
- package/dist/nodes/Newar/actions/lead/get.js +22 -0
- package/dist/nodes/Newar/actions/lead/get.js.map +1 -0
- package/dist/nodes/Newar/actions/lead/getAll.d.ts +4 -0
- package/dist/nodes/Newar/actions/lead/getAll.js +102 -0
- package/dist/nodes/Newar/actions/lead/getAll.js.map +1 -0
- package/dist/nodes/Newar/actions/lead/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/lead/index.js +105 -0
- package/dist/nodes/Newar/actions/lead/index.js.map +1 -0
- package/dist/nodes/Newar/actions/lead/search.d.ts +3 -0
- package/dist/nodes/Newar/actions/lead/search.js +37 -0
- package/dist/nodes/Newar/actions/lead/search.js.map +1 -0
- package/dist/nodes/Newar/actions/lead/update.d.ts +4 -0
- package/dist/nodes/Newar/actions/lead/update.js +36 -0
- package/dist/nodes/Newar/actions/lead/update.js.map +1 -0
- package/dist/nodes/Newar/actions/lossReason/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/lossReason/index.js +38 -0
- package/dist/nodes/Newar/actions/lossReason/index.js.map +1 -0
- package/dist/nodes/Newar/actions/note/create.d.ts +4 -0
- package/dist/nodes/Newar/actions/note/create.js +68 -0
- package/dist/nodes/Newar/actions/note/create.js.map +1 -0
- package/dist/nodes/Newar/actions/note/get.d.ts +3 -0
- package/dist/nodes/Newar/actions/note/get.js +20 -0
- package/dist/nodes/Newar/actions/note/get.js.map +1 -0
- package/dist/nodes/Newar/actions/note/getAll.d.ts +4 -0
- package/dist/nodes/Newar/actions/note/getAll.js +46 -0
- package/dist/nodes/Newar/actions/note/getAll.js.map +1 -0
- package/dist/nodes/Newar/actions/note/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/note/index.js +78 -0
- package/dist/nodes/Newar/actions/note/index.js.map +1 -0
- package/dist/nodes/Newar/actions/pipeline/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/pipeline/index.js +57 -0
- package/dist/nodes/Newar/actions/pipeline/index.js.map +1 -0
- package/dist/nodes/Newar/actions/router.d.ts +6 -0
- package/dist/nodes/Newar/actions/router.js +147 -0
- package/dist/nodes/Newar/actions/router.js.map +1 -0
- package/dist/nodes/Newar/actions/search/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/search/index.js +75 -0
- package/dist/nodes/Newar/actions/search/index.js.map +1 -0
- package/dist/nodes/Newar/actions/search/term.d.ts +3 -0
- package/dist/nodes/Newar/actions/search/term.js +30 -0
- package/dist/nodes/Newar/actions/search/term.js.map +1 -0
- package/dist/nodes/Newar/actions/stage/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/stage/index.js +77 -0
- package/dist/nodes/Newar/actions/stage/index.js.map +1 -0
- package/dist/nodes/Newar/actions/tag/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/tag/index.js +154 -0
- package/dist/nodes/Newar/actions/tag/index.js.map +1 -0
- package/dist/nodes/Newar/actions/task/create.d.ts +4 -0
- package/dist/nodes/Newar/actions/task/create.js +44 -0
- package/dist/nodes/Newar/actions/task/create.js.map +1 -0
- package/dist/nodes/Newar/actions/task/delete.d.ts +3 -0
- package/dist/nodes/Newar/actions/task/delete.js +20 -0
- package/dist/nodes/Newar/actions/task/delete.js.map +1 -0
- package/dist/nodes/Newar/actions/task/fields.d.ts +9 -0
- package/dist/nodes/Newar/actions/task/fields.js +143 -0
- package/dist/nodes/Newar/actions/task/fields.js.map +1 -0
- package/dist/nodes/Newar/actions/task/get.d.ts +3 -0
- package/dist/nodes/Newar/actions/task/get.js +22 -0
- package/dist/nodes/Newar/actions/task/get.js.map +1 -0
- package/dist/nodes/Newar/actions/task/getAll.d.ts +4 -0
- package/dist/nodes/Newar/actions/task/getAll.js +113 -0
- package/dist/nodes/Newar/actions/task/getAll.js.map +1 -0
- package/dist/nodes/Newar/actions/task/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/task/index.js +96 -0
- package/dist/nodes/Newar/actions/task/index.js.map +1 -0
- package/dist/nodes/Newar/actions/task/update.d.ts +4 -0
- package/dist/nodes/Newar/actions/task/update.js +31 -0
- package/dist/nodes/Newar/actions/task/update.js.map +1 -0
- package/dist/nodes/Newar/actions/user/index.d.ts +4 -0
- package/dist/nodes/Newar/actions/user/index.js +66 -0
- package/dist/nodes/Newar/actions/user/index.js.map +1 -0
- package/dist/nodes/Newar/helpers/customFields.d.ts +28 -0
- package/dist/nodes/Newar/helpers/customFields.js +131 -0
- package/dist/nodes/Newar/helpers/customFields.js.map +1 -0
- package/dist/nodes/Newar/helpers/dates.d.ts +4 -0
- package/dist/nodes/Newar/helpers/dates.js +134 -0
- package/dist/nodes/Newar/helpers/dates.js.map +1 -0
- package/dist/nodes/Newar/helpers/errors.d.ts +34 -0
- package/dist/nodes/Newar/helpers/errors.js +323 -0
- package/dist/nodes/Newar/helpers/errors.js.map +1 -0
- package/dist/nodes/Newar/helpers/fields.d.ts +26 -0
- package/dist/nodes/Newar/helpers/fields.js +141 -0
- package/dist/nodes/Newar/helpers/fields.js.map +1 -0
- package/dist/nodes/Newar/helpers/idempotency.d.ts +16 -0
- package/dist/nodes/Newar/helpers/idempotency.js +42 -0
- package/dist/nodes/Newar/helpers/idempotency.js.map +1 -0
- package/dist/nodes/Newar/helpers/output.d.ts +7 -0
- package/dist/nodes/Newar/helpers/output.js +131 -0
- package/dist/nodes/Newar/helpers/output.js.map +1 -0
- package/dist/nodes/Newar/helpers/pagination.d.ts +23 -0
- package/dist/nodes/Newar/helpers/pagination.js +43 -0
- package/dist/nodes/Newar/helpers/pagination.js.map +1 -0
- package/dist/nodes/Newar/methods/index.d.ts +3 -0
- package/dist/nodes/Newar/methods/index.js +40 -0
- package/dist/nodes/Newar/methods/index.js.map +1 -0
- package/dist/nodes/Newar/methods/listSearch.d.ts +9 -0
- package/dist/nodes/Newar/methods/listSearch.js +142 -0
- package/dist/nodes/Newar/methods/listSearch.js.map +1 -0
- package/dist/nodes/Newar/methods/loadOptions.d.ts +7 -0
- package/dist/nodes/Newar/methods/loadOptions.js +61 -0
- package/dist/nodes/Newar/methods/loadOptions.js.map +1 -0
- package/dist/nodes/Newar/methods/resourceMapping.d.ts +3 -0
- package/dist/nodes/Newar/methods/resourceMapping.js +26 -0
- package/dist/nodes/Newar/methods/resourceMapping.js.map +1 -0
- package/dist/nodes/Newar/methods/shared.d.ts +11 -0
- package/dist/nodes/Newar/methods/shared.js +65 -0
- package/dist/nodes/Newar/methods/shared.js.map +1 -0
- package/dist/nodes/Newar/transport/index.d.ts +36 -0
- package/dist/nodes/Newar/transport/index.js +114 -0
- package/dist/nodes/Newar/transport/index.js.map +1 -0
- package/dist/nodes/NewarTrigger/NewarTrigger.node.d.ts +14 -0
- package/dist/nodes/NewarTrigger/NewarTrigger.node.js +295 -0
- package/dist/nodes/NewarTrigger/NewarTrigger.node.js.map +1 -0
- package/dist/nodes/NewarTrigger/NewarTrigger.node.json +19 -0
- package/dist/nodes/NewarTrigger/polling.d.ts +38 -0
- package/dist/nodes/NewarTrigger/polling.js +211 -0
- package/dist/nodes/NewarTrigger/polling.js.map +1 -0
- package/dist/package.json +68 -0
- package/package.json +68 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Newar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# n8n-nodes-newar
|
|
2
|
+
|
|
3
|
+
This is an [n8n](https://n8n.io/) community node package for **[Newar](https://newar.com.br)**, a CRM for sales teams. It lets your workflows create, read, update, search and delete Newar leads, deals, tasks, notes and tags, and start workflows when something changes in Newar.
|
|
4
|
+
|
|
5
|
+
The package contains two nodes:
|
|
6
|
+
|
|
7
|
+
- **Newar**: 34 operations on 11 resources. It also works as a tool for the n8n AI Agent.
|
|
8
|
+
- **Newar Trigger**: starts a workflow when leads, deals, tasks or notes are created or change.
|
|
9
|
+
|
|
10
|
+
Everything goes through the [Newar public API](https://app.newar.com.br/api-docs), with the same rules, history and automations as the Newar app.
|
|
11
|
+
|
|
12
|
+
[Installation](#installation) ·
|
|
13
|
+
[Credentials](#credentials) ·
|
|
14
|
+
[Operations](#operations) ·
|
|
15
|
+
[Newar Trigger](#newar-trigger) ·
|
|
16
|
+
[Idempotency](#idempotency-no-duplicate-records) ·
|
|
17
|
+
[Rate limits](#rate-limits) ·
|
|
18
|
+
[Errors](#errors) ·
|
|
19
|
+
[Examples](#examples) ·
|
|
20
|
+
[Compatibility](#compatibility) ·
|
|
21
|
+
[Resources](#resources)
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
Follow the [community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) of n8n.
|
|
26
|
+
|
|
27
|
+
**From the n8n editor** (self-hosted, owner or admin):
|
|
28
|
+
|
|
29
|
+
1. Go to **Settings > Community Nodes**.
|
|
30
|
+
2. Select **Install**.
|
|
31
|
+
3. Enter `n8n-nodes-newar`, accept the risks, and select **Install**.
|
|
32
|
+
|
|
33
|
+
**With npm** (queue mode, or when you manage packages by hand):
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
cd ~/.n8n/nodes
|
|
37
|
+
npm install n8n-nodes-newar
|
|
38
|
+
# then restart n8n
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
In Docker, run these commands inside the container (`docker exec -it n8n sh`).
|
|
42
|
+
|
|
43
|
+
> Until n8n verifies this package, n8n 3.x only loads it when `N8N_UNVERIFIED_PACKAGES_ENABLED=true`.
|
|
44
|
+
|
|
45
|
+
## Credentials
|
|
46
|
+
|
|
47
|
+
The nodes use one credential, **Newar API**:
|
|
48
|
+
|
|
49
|
+
| Field | What to enter |
|
|
50
|
+
|---|---|
|
|
51
|
+
| **API Token** | A token created in Newar under **Settings > API**. Newar shows it only once. |
|
|
52
|
+
| **Base URL** | Leave the default, `https://api.newar.com.br/functions/v1/api`. Change it only to test against another environment. |
|
|
53
|
+
|
|
54
|
+
Newar has two kinds of token:
|
|
55
|
+
|
|
56
|
+
| Prefix | Scope | Can |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `nw_r_` | Read-only | Get, Get Many, Search, and the trigger |
|
|
59
|
+
| `nw_rw_` | Read and write | Everything, including Create, Update and Delete |
|
|
60
|
+
|
|
61
|
+
The token acts as the Newar user who created it, with that user's role: leads and lead notes need the **Leads** permission, deals and deal notes need **Pipeline**, tasks need **Tasks**. If the user loses a permission or leaves the workspace, the token loses it too. Revoke tokens in **Settings > API**.
|
|
62
|
+
|
|
63
|
+
When you save the credential, n8n tests it with `GET /v1/me`. The **User > Get Current** operation returns the same information: the user, the workspace, the token scope and the role permissions.
|
|
64
|
+
|
|
65
|
+
Use a read-only token for workflows that only read, and for AI agents that should not change data.
|
|
66
|
+
|
|
67
|
+
## Operations
|
|
68
|
+
|
|
69
|
+
| Resource | Operations |
|
|
70
|
+
|---|---|
|
|
71
|
+
| **Lead** (the contact, the person) | Create, Delete, Get, Get Many, Search, Update |
|
|
72
|
+
| **Deal** (an opportunity of a lead) | Create, Delete, Get, Get Many, Search, Update |
|
|
73
|
+
| **Task** | Create, Delete, Get, Get Many, Update |
|
|
74
|
+
| **Note** | Create, Get, Get Many |
|
|
75
|
+
| **Tag** | Create, Delete, Get Many, Update (rename) |
|
|
76
|
+
| **Pipeline** | Get, Get Many (each pipeline comes with its stages) |
|
|
77
|
+
| **Stage** | Get, Get Many (all stages, or the stages of one pipeline) |
|
|
78
|
+
| **User** | Get, Get Many, Get Current (the user and permissions of the token) |
|
|
79
|
+
| **Custom Field** | Get Many (lead or deal fields, with keys, types and options) |
|
|
80
|
+
| **Loss Reason** | Get Many |
|
|
81
|
+
| **Search** | Search Records (leads, deals and tasks at once) |
|
|
82
|
+
|
|
83
|
+
Notes on how they behave:
|
|
84
|
+
|
|
85
|
+
- **Create** has the same effects as the app. A new lead enters the first open stage of the first pipeline (or the stage you pick), gets its primary deal when the workspace creates one automatically, and triggers the "lead captured" automations. Newar does not merge duplicates: use **Lead > Search** by email or phone first if you don't want a second lead.
|
|
86
|
+
- **Update** only changes the fields you add under **Update Fields**. A field you add and leave empty is cleared when Newar allows it (email, phone, company, owner, next step, due dates, observations). On a lead, **Tags** replaces the whole list, and an empty list removes every tag. Moving a lead to a stage also moves its primary deal.
|
|
87
|
+
- **Deal > Update** wins (`Won`), loses (`Lost`, with an optional loss reason and comment) or reopens (`Open`) a deal. A won or lost deal only moves to another stage together with **Status: Open**. A lead's **primary deal** (`is_primary`) mirrors the lead: change its title, value, owner and next step with **Lead > Update**.
|
|
88
|
+
- **Delete** is reversible in Newar: the record leaves lists and searches, Newar's support can restore it, and the node returns `{ "id": "...", "deleted": true }`. Deleting a lead also deletes its deals. A lead's primary deal can't be deleted on its own. Only tags that no record uses can be deleted.
|
|
89
|
+
- **Get Many** has **Return All** (reads every page, 500 per request, keeping your filters and sort on every page) and **Limit** (default 50). Leads, deals and tasks have filters (owner, pipeline, stage, tag, status, type, due dates, `Updated Since`/`Updated Before`, up to 100 IDs) and a **Sort** option.
|
|
90
|
+
- **Search** (lead and deal) ignores accents and case, needs at least 2 characters, and adds a `result_score` from 0 to 1 to each result. **Search > Search Records** looks at leads, deals and tasks like the app's search bar and needs at least 3 characters.
|
|
91
|
+
- **Output**: Get, Get Many and Search of leads, deals and tasks return a **Simplified** record by default (the 10 most useful fields). Choose **Raw** for every field, including custom fields and UTM data, or **Selected Fields** to pick them (the ID is always included).
|
|
92
|
+
|
|
93
|
+
### Picking records
|
|
94
|
+
|
|
95
|
+
Fields that point at one record (Lead, Deal, Task, Note, Tag, Pipeline, Stage, User) let you choose **From List** or enter the ID (**By ID**). In the list, typing 2 or more characters searches leads and deals by name, email, phone or title; otherwise it shows the most recently updated records. Newar IDs are UUIDs, and the node checks them before calling Newar.
|
|
96
|
+
|
|
97
|
+
Dropdowns inside **Additional Fields**, **Update Fields** and **Filters** (owner, pipeline, stage, tags, loss reason, the deal of a task) load from Newar. The stage list follows the pipeline you picked in the same node.
|
|
98
|
+
|
|
99
|
+
### Custom fields
|
|
100
|
+
|
|
101
|
+
Lead and deal **Create** and **Update** have a **Custom Fields** section filled from your Newar workspace (**Settings > Fields**):
|
|
102
|
+
|
|
103
|
+
| Newar type | Input in n8n | Sent as |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| Text | Text | Text |
|
|
106
|
+
| Number | Number | Number |
|
|
107
|
+
| Date | Date picker | `YYYY-MM-DD` (only the date is used) |
|
|
108
|
+
| Select | Dropdown with the field's options | The option label, as written in Newar |
|
|
109
|
+
| Boolean | Toggle | `true` or `false` |
|
|
110
|
+
|
|
111
|
+
On **Create**, every field is listed and empty ones are skipped. On **Update**, add only the fields you want to change; a field you add and leave empty is cleared. Newar checks each value against the field type and answers with the field name when one is wrong. **Custom Field > Get Many** lists the keys, types and options.
|
|
112
|
+
|
|
113
|
+
### Dates and time zones
|
|
114
|
+
|
|
115
|
+
Date-time values without a time zone (such as those from the date picker) are read in the workflow's time zone and sent to Newar in UTC. Values with an offset or `Z` keep their instant. Date-only fields (next step due date, date custom fields) keep the date as written, so a time zone never shifts the day.
|
|
116
|
+
|
|
117
|
+
## Newar Trigger
|
|
118
|
+
|
|
119
|
+
Newar has no webhooks yet, so the trigger checks Newar on the schedule you set in **Poll Times** (every minute by default) and sends each change once.
|
|
120
|
+
|
|
121
|
+
| Event | Starts the workflow when |
|
|
122
|
+
|---|---|
|
|
123
|
+
| **Lead Created** | A lead is created, in the app, by a form, by an integration or by the API |
|
|
124
|
+
| **Lead Updated** | A lead changes after it was created, including changes Newar makes on its own, such as automations |
|
|
125
|
+
| **Deal Created** | A deal is created |
|
|
126
|
+
| **Deal Updated** | A deal changes after it was created, including changes Newar makes on its own |
|
|
127
|
+
| **Deal Stage Changed** | A deal enters another stage (`stage_entered_at` changes) |
|
|
128
|
+
| **Deal Won** | A deal is marked as won (`closed_at`) |
|
|
129
|
+
| **Deal Lost** | A deal is marked as lost (`closed_at`) |
|
|
130
|
+
| **Task Created** | A task is created |
|
|
131
|
+
| **Task Completed** | A task is marked as done (`completed_at`) |
|
|
132
|
+
| **Note Created** | A note is added to a lead or a deal |
|
|
133
|
+
|
|
134
|
+
**Filters** narrow the events: owner, pipeline, stage and tag for leads; lead, owner, pipeline and stage for deals (with **Deal Stage Changed**, a stage filter means "entered this stage"); lead, assignee and task type for tasks; lead for notes. Filters run in Newar, so they don't cost extra requests.
|
|
135
|
+
|
|
136
|
+
How it works:
|
|
137
|
+
|
|
138
|
+
- **Activation.** The first check after you activate the workflow only records the time. Changes made before activation are not sent.
|
|
139
|
+
- **Each check** asks Newar for records changed since the last one it saw, oldest first, and reads 2 minutes back to catch records saved by slow transactions. It remembers what it sent, so nothing is sent twice. When nothing changed, a check costs one request.
|
|
140
|
+
- **Catching up.** If the workflow was off or n8n was down, the next checks send what changed in the meantime, reading up to 10 pages (5,000 records) per check.
|
|
141
|
+
- **Fetch Test Event** returns the most recent record that matches the event and the filters, and doesn't change what the trigger remembers.
|
|
142
|
+
- The output is the full record, as **Get** with **Output: Raw** returns it.
|
|
143
|
+
|
|
144
|
+
Limits of polling:
|
|
145
|
+
|
|
146
|
+
- **Deleted records are not reported.** The API does not expose deletions yet.
|
|
147
|
+
- A check only sees the current state of a record. If a deal is won and reopened between two checks, **Deal Won** doesn't fire; if a lead changes several times between two checks, **Lead Updated** fires once, with the latest data.
|
|
148
|
+
- Notes can't be filtered by date in the API, so **Note Created** reads the newest notes and stops at the last check. If more notes are created between two checks than it can read (10 pages of 100), it sends the newest and logs a warning.
|
|
149
|
+
- Every check uses the token's hourly budget (see [Rate limits](#rate-limits)). A trigger that checks every minute uses 60 requests per hour when nothing changes.
|
|
150
|
+
|
|
151
|
+
## Idempotency (no duplicate records)
|
|
152
|
+
|
|
153
|
+
Every **Create** (lead, deal, task, note, tag) sends an `Idempotency-Key` header. When Newar receives the same key again from the same token within 24 hours, it returns the response of the first request (with the header `Idempotent-Replayed: true`) instead of creating a second record, and no automation fires twice.
|
|
154
|
+
|
|
155
|
+
- **Default key.** Leave **Options > Idempotency Key** empty and the node derives a key from the n8n instance, workflow, execution, node, run, item and endpoint (not from the data). When n8n retries a failed node (**Retry On Fail**), the key is the same, so a create that reached Newar before the failure is not duplicated. If a field uses an expression that changes on every try (such as the current time), the retry is refused with *"This idempotency key was already used with different data"* instead of creating a second record: the first try already created it. A new execution, another run of the node in a loop, or an AI agent calling the tool again gets a new key.
|
|
156
|
+
- **Your own key.** Set **Options > Idempotency Key** to a value that identifies the record in the source system, such as `{{ $json.orderId }}`. The same value then creates the record once, across executions and workflows, for 24 hours. This also covers **Retry** on a failed execution in the executions list, which starts a new execution. The node prefixes the key with the endpoint (`lead:`, `deal:`, ...), so the same external ID can protect both a Create Lead and a Create Deal. Values with spaces, accents or over 255 characters are hashed into a valid key.
|
|
157
|
+
- The same key with **different data** fails with *"This idempotency key was already used with different data"*: use a key that is unique per record. A create that failed (for example, a validation error) does not use up its key.
|
|
158
|
+
|
|
159
|
+
Updates and deletes don't need a key: repeating them has the same result.
|
|
160
|
+
|
|
161
|
+
## Rate limits
|
|
162
|
+
|
|
163
|
+
Each token can make **6,000 requests per hour**, in a fixed window that resets at the top of the hour. Every page of a Get Many, every lookup in a dropdown and every trigger check counts.
|
|
164
|
+
|
|
165
|
+
- When the limit is reached, the node **fails right away** with the time the limit resets. It doesn't wait, because the wait can be close to an hour. The error is declared as rate-limited, so recent n8n versions can back off polling triggers on their own.
|
|
166
|
+
- Keep heavy workflows under the limit: lower **Limit**, use filters and **Updated Since** instead of reading everything, spread large batches (for example with **Loop Over Items** and **Wait**), and give busy workflows their own token.
|
|
167
|
+
- When Newar is briefly busy it answers `503` with a `Retry-After` of 1 to 60 seconds. Turn on **Retry On Fail** in the node settings, with **Wait Between Tries** of at least that long. Creates are safe to retry (see [Idempotency](#idempotency-no-duplicate-records)).
|
|
168
|
+
|
|
169
|
+
## Errors
|
|
170
|
+
|
|
171
|
+
Newar answers errors with a stable code and a Portuguese message. The node shows an English message for each code and keeps Newar's message in the error description.
|
|
172
|
+
|
|
173
|
+
| Code | Message in n8n |
|
|
174
|
+
|---|---|
|
|
175
|
+
| `unauthorized` | Newar rejected the API token |
|
|
176
|
+
| `read_only_token` | This Newar token is read-only |
|
|
177
|
+
| `forbidden` | Your Newar user is not allowed to do this |
|
|
178
|
+
| `not_found` | The lead (deal, task, ...) was not found in Newar |
|
|
179
|
+
| `validation_error` | Newar rejected the value of *field, field* (with each problem in the description) |
|
|
180
|
+
| `conflict` | Newar refused the change because of the record's current state |
|
|
181
|
+
| `plan_limit_reached` | The Newar plan limit was reached |
|
|
182
|
+
| `tag_in_use` | The tag is still in use |
|
|
183
|
+
| `task_deal_invalid` | The deal doesn't belong to the task's lead |
|
|
184
|
+
| `idempotency_key_reused` | This idempotency key was already used with different data |
|
|
185
|
+
| `rate_limit_exceeded` | The Newar API rate limit was reached (with the reset time) |
|
|
186
|
+
| `temporarily_unavailable` | Newar is temporarily unavailable (with the wait Newar asked for) |
|
|
187
|
+
| `bad_request` | Newar could not read the request |
|
|
188
|
+
| `internal_error` | Newar had an internal problem |
|
|
189
|
+
|
|
190
|
+
With **Continue On Fail** (node setting **On Error: Continue**), a failed item becomes `{ "error": "...", "description": "...", "httpCode": "404" }` and the node goes on with the next item.
|
|
191
|
+
|
|
192
|
+
## Examples
|
|
193
|
+
|
|
194
|
+
- **Capture leads from a form.** *Form Trigger* > *Newar: Lead > Create*, with **Name**, **Email** and **Phone** mapped from the form, the lead source in **Additional Fields > Source**, and **Options > Idempotency Key** set to the submission ID, so a resubmitted form doesn't create a second lead.
|
|
195
|
+
- **Celebrate won deals.** *Newar Trigger* (**Deal Won**, filtered by pipeline) > *Newar: Lead > Get* with the deal's `lead_id` > a message to your team chat.
|
|
196
|
+
- **Follow up automatically.** *Newar Trigger* (**Deal Stage Changed**, filtered by the "Proposal sent" stage) > *Newar: Task > Create* for the deal's lead, with a **Due Date** of `{{ $now.plus(2, 'days') }}` and **Additional Fields > Deal** set to the deal's `id`.
|
|
197
|
+
- **Sync to a spreadsheet.** *Schedule Trigger* > *Newar: Lead > Get Many* with **Return All**, **Filters > Updated Since** `{{ $now.minus(1, 'hour') }}` and **Output: Raw** > *Google Sheets: Append or Update Row* keyed by `id`.
|
|
198
|
+
|
|
199
|
+
## Using the node as an AI tool
|
|
200
|
+
|
|
201
|
+
The **Newar** node can be connected to the n8n **AI Agent** as a tool. The default **Simplified** output keeps answers small for the model; use **Selected Fields** to control exactly what the agent sees. Consider a read-only token for agents that should only look things up.
|
|
202
|
+
|
|
203
|
+
## Compatibility
|
|
204
|
+
|
|
205
|
+
- n8n **1.85.0 or later** (the first release whose `n8n-workflow` exports `NodeConnectionTypes`).
|
|
206
|
+
- Built with `@n8n/node-cli` 0.49 and type-checked against `n8n-workflow` 2.40. Installed the way n8n installs community packages and run end to end on n8n 2.40.6 against the Newar production API (every resource, idempotent creates, read-only token and reused-key errors, and the trigger's poll cycle), and on n8n 1.85.0 and 2.40.6 against a mock of the API (retries, errors, dropdowns, custom fields and the credential test).
|
|
207
|
+
- Newar API v1.1 or later for `Idempotency-Key` and the `read_only_token` code. On older API versions, creates still work, and a write with a read-only token is still explained correctly.
|
|
208
|
+
- No runtime dependencies. The package passes the n8n community node linter in strict mode (the rules n8n Cloud requires).
|
|
209
|
+
|
|
210
|
+
## Development
|
|
211
|
+
|
|
212
|
+
```sh
|
|
213
|
+
npm install
|
|
214
|
+
npm run lint # n8n community node rules (strict)
|
|
215
|
+
npm run build # compile to dist/
|
|
216
|
+
npm test # unit tests (Vitest)
|
|
217
|
+
npm run typecheck # type-check the tests
|
|
218
|
+
npm run dev # run n8n locally with the nodes loaded
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Releases are published to npm with provenance by the **Publish** GitHub Actions workflow when a version tag (for example `0.1.0`) is pushed. See `.github/workflows/publish.yml`.
|
|
222
|
+
|
|
223
|
+
## Resources
|
|
224
|
+
|
|
225
|
+
- [Newar API documentation](https://app.newar.com.br/api-docs) (inside the Newar app)
|
|
226
|
+
- [Newar OpenAPI specification](https://api.newar.com.br/functions/v1/api/v1/openapi.json)
|
|
227
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
228
|
+
- [Issues and feature requests](https://github.com/yanffernandes/n8n-nodes-newar/issues)
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
[MIT](LICENSE.md)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class NewarApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NewarApi = void 0;
|
|
4
|
+
class NewarApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'newarApi';
|
|
7
|
+
this.displayName = 'Newar API';
|
|
8
|
+
this.icon = { light: 'file:../icons/newar.svg', dark: 'file:../icons/newar.dark.svg' };
|
|
9
|
+
this.documentationUrl = 'https://github.com/yanffernandes/n8n-nodes-newar#credentials';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Token',
|
|
13
|
+
name: 'apiToken',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
required: true,
|
|
17
|
+
default: '',
|
|
18
|
+
hint: 'Create it in Newar under Settings > API. Read-only tokens start with nw_r_, read-write tokens with nw_rw_.',
|
|
19
|
+
description: 'The token acts as the Newar user who created it, with the same permissions. Creating, updating and deleting need a read-write token.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Base URL',
|
|
23
|
+
name: 'baseUrl',
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: 'https://api.newar.com.br/functions/v1/api',
|
|
26
|
+
description: 'Address of the Newar API. Change it only to test against another environment.',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
this.authenticate = {
|
|
30
|
+
type: 'generic',
|
|
31
|
+
properties: {
|
|
32
|
+
headers: {
|
|
33
|
+
Authorization: '=Bearer {{$credentials.apiToken.trim()}}',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
this.test = {
|
|
38
|
+
request: {
|
|
39
|
+
baseURL: '={{($credentials.baseUrl || "https://api.newar.com.br/functions/v1/api").replace(/\\/+$/, "")}}',
|
|
40
|
+
url: '/v1/me',
|
|
41
|
+
method: 'GET',
|
|
42
|
+
},
|
|
43
|
+
rules: [
|
|
44
|
+
{
|
|
45
|
+
type: 'responseCode',
|
|
46
|
+
properties: {
|
|
47
|
+
value: 401,
|
|
48
|
+
message: 'Newar rejected the token. Check that it was copied whole, or create a new one in Newar under Settings > API.',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'responseCode',
|
|
53
|
+
properties: {
|
|
54
|
+
value: 429,
|
|
55
|
+
message: 'This token used its 6,000 requests of the hour. Try again after the top of the hour.',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.NewarApi = NewarApi;
|
|
63
|
+
//# sourceMappingURL=NewarApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewarApi.credentials.js","sourceRoot":"","sources":["../../credentials/NewarApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,QAAQ;IAArB;QACC,SAAI,GAAG,UAAU,CAAC;QAElB,gBAAW,GAAG,WAAW,CAAC;QAE1B,SAAI,GAAS,EAAE,KAAK,EAAE,yBAAyB,EAAE,IAAI,EAAE,8BAA8B,EAAE,CAAC;QAExF,qBAAgB,GAAG,8DAA8D,CAAC;QAElF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,4GAA4G;gBAClH,WAAW,EACV,sIAAsI;aACvI;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2CAA2C;gBACpD,WAAW,EAAE,+EAA+E;aAC5F;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,0CAA0C;iBACzD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EACN,iGAAiG;gBAClG,GAAG,EAAE,QAAQ;gBACb,MAAM,EAAE,KAAK;aACb;YACD,KAAK,EAAE;gBACN;oBACC,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACX,KAAK,EAAE,GAAG;wBACV,OAAO,EACN,8GAA8G;qBAC/G;iBACD;gBACD;oBACC,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACX,KAAK,EAAE,GAAG;wBACV,OAAO,EACN,sFAAsF;qBACvF;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAjED,4BAiEC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { listSearch, loadOptions, resourceMapping } from './methods';
|
|
3
|
+
export declare class Newar implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
listSearch: typeof listSearch;
|
|
7
|
+
loadOptions: typeof loadOptions;
|
|
8
|
+
resourceMapping: typeof resourceMapping;
|
|
9
|
+
};
|
|
10
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Newar = void 0;
|
|
37
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
+
const customField = __importStar(require("./actions/customField"));
|
|
39
|
+
const deal = __importStar(require("./actions/deal"));
|
|
40
|
+
const lead = __importStar(require("./actions/lead"));
|
|
41
|
+
const lossReason = __importStar(require("./actions/lossReason"));
|
|
42
|
+
const note = __importStar(require("./actions/note"));
|
|
43
|
+
const pipeline = __importStar(require("./actions/pipeline"));
|
|
44
|
+
const router_1 = require("./actions/router");
|
|
45
|
+
const search = __importStar(require("./actions/search"));
|
|
46
|
+
const stage = __importStar(require("./actions/stage"));
|
|
47
|
+
const tag = __importStar(require("./actions/tag"));
|
|
48
|
+
const task = __importStar(require("./actions/task"));
|
|
49
|
+
const user = __importStar(require("./actions/user"));
|
|
50
|
+
const methods_1 = require("./methods");
|
|
51
|
+
class Newar {
|
|
52
|
+
constructor() {
|
|
53
|
+
this.description = {
|
|
54
|
+
displayName: 'Newar',
|
|
55
|
+
name: 'newar',
|
|
56
|
+
icon: { light: 'file:../../icons/newar.svg', dark: 'file:../../icons/newar.dark.svg' },
|
|
57
|
+
group: ['transform'],
|
|
58
|
+
version: 1,
|
|
59
|
+
subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
|
|
60
|
+
description: 'Manage leads, deals, tasks, notes and tags in the Newar CRM',
|
|
61
|
+
defaults: {
|
|
62
|
+
name: 'Newar',
|
|
63
|
+
},
|
|
64
|
+
usableAsTool: true,
|
|
65
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
66
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
67
|
+
credentials: [
|
|
68
|
+
{
|
|
69
|
+
name: 'newarApi',
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
properties: [
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Resource',
|
|
76
|
+
name: 'resource',
|
|
77
|
+
type: 'options',
|
|
78
|
+
noDataExpression: true,
|
|
79
|
+
options: [
|
|
80
|
+
{
|
|
81
|
+
name: 'Custom Field',
|
|
82
|
+
value: 'customField',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Deal',
|
|
86
|
+
value: 'deal',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'Lead',
|
|
90
|
+
value: 'lead',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'Loss Reason',
|
|
94
|
+
value: 'lossReason',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'Note',
|
|
98
|
+
value: 'note',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'Pipeline',
|
|
102
|
+
value: 'pipeline',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'Search',
|
|
106
|
+
value: 'search',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'Stage',
|
|
110
|
+
value: 'stage',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'Tag',
|
|
114
|
+
value: 'tag',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'Task',
|
|
118
|
+
value: 'task',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'User',
|
|
122
|
+
value: 'user',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
default: 'lead',
|
|
126
|
+
},
|
|
127
|
+
...customField.description,
|
|
128
|
+
...deal.description,
|
|
129
|
+
...lead.description,
|
|
130
|
+
...lossReason.description,
|
|
131
|
+
...note.description,
|
|
132
|
+
...pipeline.description,
|
|
133
|
+
...search.description,
|
|
134
|
+
...stage.description,
|
|
135
|
+
...tag.description,
|
|
136
|
+
...task.description,
|
|
137
|
+
...user.description,
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
this.methods = {
|
|
141
|
+
listSearch: methods_1.listSearch,
|
|
142
|
+
loadOptions: methods_1.loadOptions,
|
|
143
|
+
resourceMapping: methods_1.resourceMapping,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
async execute() {
|
|
147
|
+
return await router_1.router.call(this);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.Newar = Newar;
|
|
151
|
+
//# sourceMappingURL=Newar.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Newar.node.js","sourceRoot":"","sources":["../../../nodes/Newar/Newar.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,+CAAmD;AAEnD,mEAAqD;AACrD,qDAAuC;AACvC,qDAAuC;AACvC,iEAAmD;AACnD,qDAAuC;AACvC,6DAA+C;AAC/C,6CAA0C;AAC1C,yDAA2C;AAC3C,uDAAyC;AACzC,mDAAqC;AACrC,qDAAuC;AACvC,qDAAuC;AACvC,uCAAqE;AAErE,MAAa,KAAK;IAAlB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,OAAO;YACpB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,EAAE,KAAK,EAAE,4BAA4B,EAAE,IAAI,EAAE,iCAAiC,EAAE;YACtF,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,gEAAgE;YAC1E,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE;gBACT,IAAI,EAAE,OAAO;aACb;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,cAAc;4BACpB,KAAK,EAAE,aAAa;yBACpB;wBACD;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;yBACb;wBACD;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;yBACb;wBACD;4BACC,IAAI,EAAE,aAAa;4BACnB,KAAK,EAAE,YAAY;yBACnB;wBACD;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;yBACb;wBACD;4BACC,IAAI,EAAE,UAAU;4BAChB,KAAK,EAAE,UAAU;yBACjB;wBACD;4BACC,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,QAAQ;yBACf;wBACD;4BACC,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,OAAO;yBACd;wBACD;4BACC,IAAI,EAAE,KAAK;4BACX,KAAK,EAAE,KAAK;yBACZ;wBACD;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;yBACb;wBACD;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;yBACb;qBACD;oBACD,OAAO,EAAE,MAAM;iBACf;gBACD,GAAG,WAAW,CAAC,WAAW;gBAC1B,GAAG,IAAI,CAAC,WAAW;gBACnB,GAAG,IAAI,CAAC,WAAW;gBACnB,GAAG,UAAU,CAAC,WAAW;gBACzB,GAAG,IAAI,CAAC,WAAW;gBACnB,GAAG,QAAQ,CAAC,WAAW;gBACvB,GAAG,MAAM,CAAC,WAAW;gBACrB,GAAG,KAAK,CAAC,WAAW;gBACpB,GAAG,GAAG,CAAC,WAAW;gBAClB,GAAG,IAAI,CAAC,WAAW;gBACnB,GAAG,IAAI,CAAC,WAAW;aACnB;SACD,CAAC;QAEF,YAAO,GAAG;YACT,UAAU,EAAV,oBAAU;YACV,WAAW,EAAX,qBAAW;YACX,eAAe,EAAf,yBAAe;SACf,CAAC;IAKH,CAAC;IAHA,KAAK,CAAC,OAAO;QACZ,OAAO,MAAM,eAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACD;AAlGD,sBAkGC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-newar.newar",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Sales"],
|
|
6
|
+
"alias": ["CRM", "Lead", "Deal", "Pipeline", "Task"],
|
|
7
|
+
"resources": {
|
|
8
|
+
"credentialDocumentation": [
|
|
9
|
+
{
|
|
10
|
+
"url": "https://github.com/yanffernandes/n8n-nodes-newar#credentials"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"primaryDocumentation": [
|
|
14
|
+
{
|
|
15
|
+
"url": "https://github.com/yanffernandes/n8n-nodes-newar#readme"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IDataObject, IDisplayOptions, IExecuteFunctions, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import type { IdempotencySource } from '../helpers/idempotency';
|
|
3
|
+
import { type OutputEntity } from '../helpers/output';
|
|
4
|
+
export interface ExecutionContext {
|
|
5
|
+
timeZone: string;
|
|
6
|
+
idempotency: Omit<IdempotencySource, 'itemIndex'>;
|
|
7
|
+
}
|
|
8
|
+
export type OperationResult = IDataObject | IDataObject[];
|
|
9
|
+
export type OperationHandler = (this: IExecuteFunctions, itemIndex: number, context: ExecutionContext) => Promise<OperationResult>;
|
|
10
|
+
export declare const UUID_REGEX = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
|
|
11
|
+
export declare function updateDisplayOptions(displayOptions: IDisplayOptions, properties: INodeProperties[]): INodeProperties[];
|
|
12
|
+
interface LocatorOptions {
|
|
13
|
+
displayName: string;
|
|
14
|
+
name: string;
|
|
15
|
+
searchListMethod: string;
|
|
16
|
+
description: string;
|
|
17
|
+
noun: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function recordLocator(options: LocatorOptions): INodeProperties;
|
|
21
|
+
export declare function returnAllProperty(): INodeProperties;
|
|
22
|
+
export declare function limitProperty(maxValue: number): INodeProperties;
|
|
23
|
+
export declare function idempotencyOptions(noun: string): INodeProperties;
|
|
24
|
+
export declare function outputProperties(entity: OutputEntity): INodeProperties[];
|
|
25
|
+
export declare function shapeRecords(ctx: IExecuteFunctions, itemIndex: number, entity: OutputEntity, records: IDataObject[]): IDataObject[];
|
|
26
|
+
export declare function getRecordId(ctx: IExecuteFunctions, parameterName: string, itemIndex: number, label: string): string;
|
|
27
|
+
export declare function getRequiredText(ctx: IExecuteFunctions, parameterName: string, itemIndex: number, label: string): string;
|
|
28
|
+
export declare function getCollection(ctx: IExecuteFunctions, parameterName: string, itemIndex: number): IDataObject;
|
|
29
|
+
export declare function createRecord(this: IExecuteFunctions, itemIndex: number, context: ExecutionContext, path: string, body: IDataObject): Promise<IDataObject>;
|
|
30
|
+
export declare function getRecord(this: IExecuteFunctions, itemIndex: number, path: string): Promise<IDataObject>;
|
|
31
|
+
export declare function deleteRecord(this: IExecuteFunctions, itemIndex: number, path: string): Promise<IDataObject>;
|
|
32
|
+
export declare function updateRecord(this: IExecuteFunctions, itemIndex: number, path: string, body: IDataObject): Promise<IDataObject>;
|
|
33
|
+
export declare function applyLimit(ctx: IExecuteFunctions, itemIndex: number, records: IDataObject[]): IDataObject[];
|
|
34
|
+
export declare function sortProperty(fields: INodePropertyOptions[], defaultField: string): INodeProperties;
|
|
35
|
+
export declare function readSort(ctx: IExecuteFunctions, itemIndex: number): IDataObject;
|
|
36
|
+
export declare function readPaging(ctx: IExecuteFunctions, itemIndex: number): {
|
|
37
|
+
returnAll: boolean;
|
|
38
|
+
limit: number;
|
|
39
|
+
};
|
|
40
|
+
export {};
|