@rjsebening/n8n-nodes-salessuite 0.0.5
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 +19 -0
- package/README.md +140 -0
- package/dist/credentials/SalesSuiteApi.credentials.d.ts +14 -0
- package/dist/credentials/SalesSuiteApi.credentials.js +43 -0
- package/dist/nodes/SalesSuite/SalesSuite.node.d.ts +37 -0
- package/dist/nodes/SalesSuite/SalesSuite.node.js +120 -0
- package/dist/nodes/SalesSuite/SalesSuite.node.json +18 -0
- package/dist/nodes/SalesSuite/actions/activity/activity.actions.d.ts +2 -0
- package/dist/nodes/SalesSuite/actions/activity/activity.actions.js +51 -0
- package/dist/nodes/SalesSuite/actions/activity/index.d.ts +3 -0
- package/dist/nodes/SalesSuite/actions/activity/index.js +108 -0
- package/dist/nodes/SalesSuite/actions/apiCall/apiCall.actions.d.ts +2 -0
- package/dist/nodes/SalesSuite/actions/apiCall/apiCall.actions.js +29 -0
- package/dist/nodes/SalesSuite/actions/apiCall/index.d.ts +3 -0
- package/dist/nodes/SalesSuite/actions/apiCall/index.js +99 -0
- package/dist/nodes/SalesSuite/actions/contact/contact.actions.d.ts +2 -0
- package/dist/nodes/SalesSuite/actions/contact/contact.actions.js +151 -0
- package/dist/nodes/SalesSuite/actions/contact/index.d.ts +3 -0
- package/dist/nodes/SalesSuite/actions/contact/index.js +307 -0
- package/dist/nodes/SalesSuite/actions/deal/deal.actions.d.ts +2 -0
- package/dist/nodes/SalesSuite/actions/deal/deal.actions.js +134 -0
- package/dist/nodes/SalesSuite/actions/deal/index.d.ts +3 -0
- package/dist/nodes/SalesSuite/actions/deal/index.js +353 -0
- package/dist/nodes/SalesSuite/actions/resource.selector.d.ts +2 -0
- package/dist/nodes/SalesSuite/actions/resource.selector.js +37 -0
- package/dist/nodes/SalesSuite/actions/router.d.ts +2 -0
- package/dist/nodes/SalesSuite/actions/router.js +25 -0
- package/dist/nodes/SalesSuite/actions/webhook/index.d.ts +3 -0
- package/dist/nodes/SalesSuite/actions/webhook/index.js +307 -0
- package/dist/nodes/SalesSuite/actions/webhook/webhook.actions.d.ts +2 -0
- package/dist/nodes/SalesSuite/actions/webhook/webhook.actions.js +103 -0
- package/dist/nodes/SalesSuite/helpers/apiclient.d.ts +8 -0
- package/dist/nodes/SalesSuite/helpers/apiclient.js +41 -0
- package/dist/nodes/SalesSuite/helpers/call-activity.d.ts +37 -0
- package/dist/nodes/SalesSuite/helpers/call-activity.js +51 -0
- package/dist/nodes/SalesSuite/helpers/fieldMapping.d.ts +46 -0
- package/dist/nodes/SalesSuite/helpers/fieldMapping.js +204 -0
- package/dist/nodes/SalesSuite/helpers/notes.d.ts +2 -0
- package/dist/nodes/SalesSuite/helpers/notes.js +21 -0
- package/dist/nodes/SalesSuite/helpers/property-definition.d.ts +38 -0
- package/dist/nodes/SalesSuite/helpers/property-definition.js +6 -0
- package/dist/nodes/SalesSuite/helpers/triggerHelper.d.ts +16 -0
- package/dist/nodes/SalesSuite/helpers/triggerHelper.js +57 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/callactivity.loadOptions.d.ts +3 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/callactivity.loadOptions.js +110 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/common.loadOptions.d.ts +5 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/common.loadOptions.js +91 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/contact.loadOptions.d.ts +2 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/contact.loadOptions.js +47 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/deal.loadOptions.d.ts +4 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/deal.loadOptions.js +47 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/index.d.ts +6 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/index.js +42 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/trigger.loadOptions.d.ts +7 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/trigger.loadOptions.js +68 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/webhook.loadOptions.d.ts +15 -0
- package/dist/nodes/SalesSuite/methods/loadOptions/webhook.loadOptions.js +63 -0
- package/dist/nodes/SalesSuite/methods/resourceMappers/canUsePropertyAsField.d.ts +2 -0
- package/dist/nodes/SalesSuite/methods/resourceMappers/canUsePropertyAsField.js +12 -0
- package/dist/nodes/SalesSuite/methods/resourceMappers/contact.resourceMapper.d.ts +3 -0
- package/dist/nodes/SalesSuite/methods/resourceMappers/contact.resourceMapper.js +81 -0
- package/dist/nodes/SalesSuite/methods/resourceMappers/deal.resourceMapper.d.ts +3 -0
- package/dist/nodes/SalesSuite/methods/resourceMappers/deal.resourceMapper.js +76 -0
- package/dist/nodes/SalesSuite/methods/resourceMappers/mapTypeToResourceMapper.d.ts +3 -0
- package/dist/nodes/SalesSuite/methods/resourceMappers/mapTypeToResourceMapper.js +35 -0
- package/dist/nodes/SalesSuite/salessuite-dark-icon.svg +1 -0
- package/dist/nodes/SalesSuite/salessuite-light-icon.svg +1 -0
- package/dist/nodes/SalesSuite/triggers/SalesSuiteTrigger.node.d.ts +25 -0
- package/dist/nodes/SalesSuite/triggers/SalesSuiteTrigger.node.js +184 -0
- package/dist/nodes/SalesSuite/triggers/SalesSuiteTrigger.node.json +18 -0
- package/dist/nodes/SalesSuite/triggers/trigger.instant.properties.d.ts +2 -0
- package/dist/nodes/SalesSuite/triggers/trigger.instant.properties.js +153 -0
- package/dist/package.json +70 -0
- package/package.json +70 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2026 n8n
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# n8n-nodes-salessuite
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### n8n Integration for **SalesSuite – the best CRM built on the Setter-Closer principle**
|
|
9
|
+
|
|
10
|
+
Automate your contact, deal, and activity workflows, react to real-time events, and keep your pipeline moving — **without manual work**.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## 🧭 Overview
|
|
14
|
+
|
|
15
|
+
This community node connects **SalesSuite (Setter-Closer CRM)** seamlessly with your n8n workflows.
|
|
16
|
+
From contact creation to deal management and real-time triggers — automate every key revenue process end-to-end.
|
|
17
|
+
|
|
18
|
+
## ⚙️ Key Capabilities
|
|
19
|
+
|
|
20
|
+
### 👤 Contacts
|
|
21
|
+
|
|
22
|
+
| Action | Description |
|
|
23
|
+
| ------------------------- | -------------------------------------------------------------------- |
|
|
24
|
+
| **Create Contact** | Add a new contact (standard create, no upsert logic). |
|
|
25
|
+
| **Find Contact by Email** | Retrieve contacts using their email address. |
|
|
26
|
+
| **Get Contact by ID** | Fetch a specific contact using its unique ID. |
|
|
27
|
+
| **List Contacts** | Browse contacts with pagination support. |
|
|
28
|
+
| **Search Contacts** | Perform text-based search across contacts. |
|
|
29
|
+
| **Update Contact** | Modify contact details by ID. |
|
|
30
|
+
| **Upsert Contact** | Search by email and update if found, otherwise create a new contact. |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### 💼 Deals
|
|
35
|
+
|
|
36
|
+
| Action | Description |
|
|
37
|
+
| ----------------------- | --------------------------------------------------------------------------- |
|
|
38
|
+
| **Create Deal** | Add a new deal to a selected pipeline and phase. |
|
|
39
|
+
| **Find Deal by ID** | Retrieve a deal using its ID. |
|
|
40
|
+
| **Find Deals by Email** | Get all deals connected to a contact’s email. |
|
|
41
|
+
| **List Deals** | View deals with pagination (optional filtering by pipeline). |
|
|
42
|
+
| **List Pipelines** | Retrieve available pipelines along with their phases. |
|
|
43
|
+
| **Update Deal** | Update deal properties and optionally move it to another phase or pipeline. |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### 📝 Activities
|
|
48
|
+
|
|
49
|
+
| Action | Description |
|
|
50
|
+
| ------------------------- | ---------------------------------------------- |
|
|
51
|
+
| **Create Note** | Add an internal note to a contact record. |
|
|
52
|
+
| **List Email Activities** | Retrieve email-related activity for a contact. |
|
|
53
|
+
| **List Call Activities** | Retrieve call activity linked to a contact. |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### 🔔 Webhooks
|
|
58
|
+
|
|
59
|
+
| Action | Description |
|
|
60
|
+
| ------------------ | -------------------------------------- |
|
|
61
|
+
| **List Webhooks** | View all active webhook subscriptions. |
|
|
62
|
+
| **Create Webhook** | Register a new webhook subscription. |
|
|
63
|
+
| **Update Webhook** | Modify an existing webhook. |
|
|
64
|
+
| **Delete Webhook** | Remove a webhook subscription. |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### ⚡ Real-Time Triggers
|
|
69
|
+
|
|
70
|
+
| Event | Description |
|
|
71
|
+
| ---------------------------- | ------------------------------------------- |
|
|
72
|
+
| **Contact Created** | Fires when a new contact is added. |
|
|
73
|
+
| **Contact Property Changed** | Fires when a contact field changes. |
|
|
74
|
+
| **Deal Created** | Fires when a new deal is created. |
|
|
75
|
+
| **Deal Property Changed** | Fires when a deal field changes. |
|
|
76
|
+
| **Deal Stage Changed** | Fires when a deal moves to another phase. |
|
|
77
|
+
| **Form Submitted** | Fires on form submission. |
|
|
78
|
+
| **Call Activity Created** | Fires when a new call activity is recorded. |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 🔐 Authentication
|
|
83
|
+
|
|
84
|
+
The node uses **API Key authentication**.
|
|
85
|
+
|
|
86
|
+
* Base endpoint: `https://api.salessuite.com/api/v1`
|
|
87
|
+
* Required header:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
x-api-key: <YOUR_API_KEY>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
A built-in credential test within n8n ensures your API key is valid before running workflows.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 📦 Installation
|
|
98
|
+
|
|
99
|
+
### Requirements
|
|
100
|
+
|
|
101
|
+
* n8n version **2.0.0 or higher**
|
|
102
|
+
* Active SalesSuite account with a valid API key
|
|
103
|
+
|
|
104
|
+
### Community Node Installation
|
|
105
|
+
|
|
106
|
+
1. Open n8n → **Settings → Community Nodes → Install**
|
|
107
|
+
2. Enter package name:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Option A — Scoped (recommended)
|
|
111
|
+
@rjsebening/n8n-nodes-salessuite
|
|
112
|
+
|
|
113
|
+
# Option B — Unscoped
|
|
114
|
+
n8n-nodes-salessuite
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
3. **Restart n8n** – the node will now appear in the list.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## 📬 About the Author
|
|
122
|
+
|
|
123
|
+
I’m **[Rezk Jörg Sebening](https://github.com/rjsebening)** – Automation & Systems Expert (DACH).
|
|
124
|
+
I build n8n nodes and process automation systems that help agencies, coaches, and service providers scale **without manual work**.
|
|
125
|
+
|
|
126
|
+
👉 Follow me on GitHub for new DACH integrations and automation templates.
|
|
127
|
+
|
|
128
|
+
## ⚖️ Legal Disclaimer
|
|
129
|
+
|
|
130
|
+
This community node is **not affiliated with SalesSuite** (no partnership, no sponsorship, no official endorsement).
|
|
131
|
+
It simply connects to publicly available API endpoints.
|
|
132
|
+
|
|
133
|
+
* Community developed & maintained
|
|
134
|
+
* For API-related issues → contact **SalesSuite Support**
|
|
135
|
+
* All trademarks & logos belong to their respective owners
|
|
136
|
+
|
|
137
|
+
## 📄 License
|
|
138
|
+
|
|
139
|
+
**MIT License**
|
|
140
|
+
Contributions and pull requests are welcome!
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialType, INodeProperties } from "n8n-workflow";
|
|
2
|
+
export declare class SalesSuiteApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
authenticate: IAuthenticateGeneric;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
test: {
|
|
9
|
+
request: {
|
|
10
|
+
method: "GET";
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SalesSuiteApi = void 0;
|
|
4
|
+
class SalesSuiteApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = "salesSuiteApi";
|
|
7
|
+
this.displayName = "SalesSuite API";
|
|
8
|
+
this.documentationUrl = "https://api.salessuite.com";
|
|
9
|
+
this.authenticate = {
|
|
10
|
+
type: "generic",
|
|
11
|
+
properties: {
|
|
12
|
+
headers: {
|
|
13
|
+
"x-api-key": "={{$credentials.apiKey}}",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
this.properties = [
|
|
18
|
+
{
|
|
19
|
+
displayName: "API Base URL",
|
|
20
|
+
name: "baseUrl",
|
|
21
|
+
type: "string",
|
|
22
|
+
default: "https://api.salessuite.com/api/v1",
|
|
23
|
+
placeholder: "https://api.salessuite.com/api/v1",
|
|
24
|
+
description: "Base URL of the SalesSuite Public API",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
displayName: "API Key",
|
|
28
|
+
name: "apiKey",
|
|
29
|
+
type: "string",
|
|
30
|
+
typeOptions: { password: true },
|
|
31
|
+
default: "",
|
|
32
|
+
description: "SalesSuite API Key",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
this.test = {
|
|
36
|
+
request: {
|
|
37
|
+
method: "GET",
|
|
38
|
+
url: "={{$credentials.baseUrl}}/pipelines",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.SalesSuiteApi = SalesSuiteApi;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
|
|
2
|
+
import { getContactResourceMapperFields, getContactResourceMapperFieldsForUpdate } from "./methods/resourceMappers/contact.resourceMapper";
|
|
3
|
+
import { getDealResourceMapperFields, getDealResourceMapperFieldsForUpdate } from "./methods/resourceMappers/deal.resourceMapper";
|
|
4
|
+
export declare class SalesSuite implements INodeType {
|
|
5
|
+
description: INodeTypeDescription;
|
|
6
|
+
methods: {
|
|
7
|
+
loadOptions: {
|
|
8
|
+
loadPhoneCallActivityTypes(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
9
|
+
loadCallResultTypes(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
10
|
+
getWebhookTriggers(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<{
|
|
11
|
+
name: string;
|
|
12
|
+
value: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}[]>;
|
|
15
|
+
getWebhooksAsOptions(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<{
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[]>;
|
|
19
|
+
getFormsAsOptions(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<{
|
|
20
|
+
name: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[]>;
|
|
23
|
+
getWebhookProperties(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
24
|
+
getDeals(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
25
|
+
getPipelines(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
26
|
+
getStagesByPipeline(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
27
|
+
getContacts(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
28
|
+
};
|
|
29
|
+
resourceMapping: {
|
|
30
|
+
getContactResourceMapperFields: typeof getContactResourceMapperFields;
|
|
31
|
+
getContactResourceMapperFieldsForUpdate: typeof getContactResourceMapperFieldsForUpdate;
|
|
32
|
+
getDealResourceMapperFields: typeof getDealResourceMapperFields;
|
|
33
|
+
getDealResourceMapperFieldsForUpdate: typeof getDealResourceMapperFieldsForUpdate;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
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.SalesSuite = void 0;
|
|
37
|
+
const activity_1 = require("./actions/activity");
|
|
38
|
+
const apiCall_1 = require("./actions/apiCall");
|
|
39
|
+
const contact_1 = require("./actions/contact");
|
|
40
|
+
const deal_1 = require("./actions/deal");
|
|
41
|
+
const resource_selector_1 = require("./actions/resource.selector");
|
|
42
|
+
const router_1 = require("./actions/router");
|
|
43
|
+
const webhook_1 = require("./actions/webhook");
|
|
44
|
+
const Loaders = __importStar(require("./methods/loadOptions"));
|
|
45
|
+
const contact_resourceMapper_1 = require("./methods/resourceMappers/contact.resourceMapper");
|
|
46
|
+
const deal_resourceMapper_1 = require("./methods/resourceMappers/deal.resourceMapper");
|
|
47
|
+
class SalesSuite {
|
|
48
|
+
constructor() {
|
|
49
|
+
this.description = {
|
|
50
|
+
displayName: "SalesSuite",
|
|
51
|
+
name: "salesSuite",
|
|
52
|
+
icon: {
|
|
53
|
+
light: "file:salessuite-light-icon.svg",
|
|
54
|
+
dark: "file:salessuite-dark-icon.svg",
|
|
55
|
+
},
|
|
56
|
+
group: ["transform"],
|
|
57
|
+
version: 1,
|
|
58
|
+
description: "Interact with the SalesSuite API (powered by agentur-systeme.de)",
|
|
59
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
60
|
+
defaults: {
|
|
61
|
+
name: "SalesSuite",
|
|
62
|
+
description: "Interact with the SalesSuite API (powered by agentur-systeme.de)",
|
|
63
|
+
},
|
|
64
|
+
inputs: [{ type: "main" }],
|
|
65
|
+
outputs: [{ type: "main" }],
|
|
66
|
+
credentials: [{ name: "salesSuiteApi", required: true }],
|
|
67
|
+
usableAsTool: true,
|
|
68
|
+
properties: [
|
|
69
|
+
resource_selector_1.resourceSelector,
|
|
70
|
+
...activity_1.activityOperations,
|
|
71
|
+
...activity_1.activityFields,
|
|
72
|
+
...apiCall_1.apiCallOperations,
|
|
73
|
+
...apiCall_1.apiCallFields,
|
|
74
|
+
...contact_1.contactOperations,
|
|
75
|
+
...contact_1.contactFields,
|
|
76
|
+
...deal_1.dealOperations,
|
|
77
|
+
...deal_1.dealFields,
|
|
78
|
+
...webhook_1.webhookOperations,
|
|
79
|
+
...webhook_1.webhookFields,
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
this.methods = {
|
|
83
|
+
loadOptions: {
|
|
84
|
+
...Loaders.commonLoaders,
|
|
85
|
+
...Loaders.contactLoaders,
|
|
86
|
+
...Loaders.dealLoaders,
|
|
87
|
+
...Loaders.webhookLoaders,
|
|
88
|
+
...Loaders.phoneCallLoaders,
|
|
89
|
+
},
|
|
90
|
+
resourceMapping: {
|
|
91
|
+
getContactResourceMapperFields: contact_resourceMapper_1.getContactResourceMapperFields,
|
|
92
|
+
getContactResourceMapperFieldsForUpdate: contact_resourceMapper_1.getContactResourceMapperFieldsForUpdate,
|
|
93
|
+
getDealResourceMapperFields: deal_resourceMapper_1.getDealResourceMapperFields,
|
|
94
|
+
getDealResourceMapperFieldsForUpdate: deal_resourceMapper_1.getDealResourceMapperFieldsForUpdate,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
async execute() {
|
|
99
|
+
const items = this.getInputData();
|
|
100
|
+
const returnData = [];
|
|
101
|
+
for (let i = 0; i < items.length; i++) {
|
|
102
|
+
const resource = this.getNodeParameter("resource", i);
|
|
103
|
+
const operation = this.getNodeParameter("operation", i);
|
|
104
|
+
const result = (await router_1.route.call(this, i, resource, operation));
|
|
105
|
+
if (Array.isArray(result)) {
|
|
106
|
+
for (const entry of result) {
|
|
107
|
+
returnData.push(entry);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else if (result && typeof result === "object") {
|
|
111
|
+
returnData.push(result);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
returnData.push({ result });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return [this.helpers.returnJsonArray(returnData)];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.SalesSuite = SalesSuite;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.salessuite",
|
|
3
|
+
"nodeVersion": "1.0.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Sales", "Communication"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/rjsebening/n8n-nodes-salessuite/blob/main/CREDENTIALS.md"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/rjsebening/n8n-nodes-salessuite/blob/main/README.md"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleActivity = handleActivity;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const apiclient_1 = require("../../helpers/apiclient");
|
|
6
|
+
const notes_1 = require("../../helpers/notes");
|
|
7
|
+
async function handleActivity(i, operation) {
|
|
8
|
+
switch (operation) {
|
|
9
|
+
case "createNote": {
|
|
10
|
+
const contactId = this.getNodeParameter("contactId", i);
|
|
11
|
+
const noteText = this.getNodeParameter("noteText", i, "");
|
|
12
|
+
const pinNote = this.getNodeParameter("pinNote", i, false);
|
|
13
|
+
const makeBold = this.getNodeParameter("makeBold", i, false);
|
|
14
|
+
const noteId = await (0, notes_1.createNoteWithOptionalPin)(this, contactId, noteText, pinNote, makeBold, "contact");
|
|
15
|
+
return {
|
|
16
|
+
parentType: "contact",
|
|
17
|
+
parentId: contactId,
|
|
18
|
+
noteId: noteId !== null && noteId !== void 0 ? noteId : null,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
case "listEmailActivities": {
|
|
22
|
+
const contactId = this.getNodeParameter("contactId", i);
|
|
23
|
+
const data = await (0, apiclient_1.ssRequest)(this, "POST", "/get-mail-activities", {
|
|
24
|
+
body: { contactId },
|
|
25
|
+
});
|
|
26
|
+
return { scope: "contact", parentId: contactId, activities: data !== null && data !== void 0 ? data : [] };
|
|
27
|
+
}
|
|
28
|
+
case "listPhoneCallActivities": {
|
|
29
|
+
const contactId = this.getNodeParameter("contactId", i);
|
|
30
|
+
const callTypeId = this.getNodeParameter("phoneCallActivityTypeId", i, "").trim();
|
|
31
|
+
const callResult = this.getNodeParameter("callResult", i, "").trim();
|
|
32
|
+
const body = { contactId };
|
|
33
|
+
if (callTypeId && callTypeId !== "any")
|
|
34
|
+
body.callTypeId = callTypeId;
|
|
35
|
+
if (callResult && callResult !== "any") {
|
|
36
|
+
try {
|
|
37
|
+
body.callResult = JSON.parse(callResult);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
body.callResult = callResult;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const data = await (0, apiclient_1.ssRequest)(this, "POST", "/get-call-activities", {
|
|
44
|
+
body: body,
|
|
45
|
+
});
|
|
46
|
+
return { scope: "contact", parentId: contactId, activities: data !== null && data !== void 0 ? data : [] };
|
|
47
|
+
}
|
|
48
|
+
default:
|
|
49
|
+
throw new n8n_workflow_1.ApplicationError(`Unsupported activity operation: ${operation}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.activityFields = exports.activityOperations = void 0;
|
|
4
|
+
exports.activityOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: "Operation",
|
|
7
|
+
name: "operation",
|
|
8
|
+
type: "options",
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: { show: { resource: ["activity"] } },
|
|
11
|
+
options: [
|
|
12
|
+
{
|
|
13
|
+
name: "Create Note",
|
|
14
|
+
value: "createNote",
|
|
15
|
+
action: "Create note on contact",
|
|
16
|
+
description: "Add an internal note to a contact",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "List Email Activities",
|
|
20
|
+
value: "listEmailActivities",
|
|
21
|
+
action: "List contact emails",
|
|
22
|
+
description: "Retrieve a history of emails for the selected contact",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "List Phone Call Activities",
|
|
26
|
+
value: "listPhoneCallActivities",
|
|
27
|
+
action: "List contact calls",
|
|
28
|
+
description: "Retrieve logged phone call activities related to the contact",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
default: "createNote",
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
exports.activityFields = [
|
|
35
|
+
{
|
|
36
|
+
displayName: "Contact Name or ID",
|
|
37
|
+
name: "contactId",
|
|
38
|
+
type: "options",
|
|
39
|
+
typeOptions: { loadOptionsMethod: "getContacts" },
|
|
40
|
+
required: true,
|
|
41
|
+
default: "",
|
|
42
|
+
displayOptions: {
|
|
43
|
+
show: {
|
|
44
|
+
resource: ["activity"],
|
|
45
|
+
operation: [
|
|
46
|
+
"createNote",
|
|
47
|
+
"listEmailActivities",
|
|
48
|
+
"listPhoneCallActivities",
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
description: 'Choose the contact. Choose from the list, or specify an ID using an expression. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: "Note Text",
|
|
56
|
+
name: "noteText",
|
|
57
|
+
type: "string",
|
|
58
|
+
typeOptions: { rows: 4 },
|
|
59
|
+
default: "",
|
|
60
|
+
displayOptions: {
|
|
61
|
+
show: { resource: ["activity"], operation: ["createNote"] },
|
|
62
|
+
},
|
|
63
|
+
description: "Plain text note",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
displayName: "Pin Note?",
|
|
67
|
+
name: "pinNote",
|
|
68
|
+
type: "boolean",
|
|
69
|
+
default: false,
|
|
70
|
+
displayOptions: {
|
|
71
|
+
show: { resource: ["activity"], operation: ["createNote"] },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: "Bold Text?",
|
|
76
|
+
name: "makeBold",
|
|
77
|
+
type: "boolean",
|
|
78
|
+
default: false,
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: { resource: ["activity"], operation: ["createNote"] },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
displayName: "Call Type Name or ID",
|
|
85
|
+
name: "phoneCallActivityTypeId",
|
|
86
|
+
type: "options",
|
|
87
|
+
typeOptions: { loadOptionsMethod: "loadPhoneCallActivityTypes" },
|
|
88
|
+
default: "any",
|
|
89
|
+
displayOptions: {
|
|
90
|
+
show: { resource: ["activity"], operation: ["listPhoneCallActivities"] },
|
|
91
|
+
},
|
|
92
|
+
description: 'Optional filter by call type. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: "Call Result Name or ID",
|
|
96
|
+
name: "callResult",
|
|
97
|
+
type: "options",
|
|
98
|
+
typeOptions: {
|
|
99
|
+
loadOptionsMethod: "loadCallResultTypes",
|
|
100
|
+
loadOptionsDependsOn: ["phoneCallActivityTypeId"],
|
|
101
|
+
},
|
|
102
|
+
default: "any",
|
|
103
|
+
displayOptions: {
|
|
104
|
+
show: { resource: ["activity"], operation: ["listPhoneCallActivities"] },
|
|
105
|
+
},
|
|
106
|
+
description: 'Optional filter by call result. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
107
|
+
},
|
|
108
|
+
];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleApiCall = handleApiCall;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const apiclient_1 = require("../../helpers/apiclient");
|
|
6
|
+
async function handleApiCall(i, operation) {
|
|
7
|
+
var _a;
|
|
8
|
+
switch (operation) {
|
|
9
|
+
case "makeRequest": {
|
|
10
|
+
const method = this.getNodeParameter("httpMethod", i);
|
|
11
|
+
const endpoint = this.getNodeParameter("endpoint", i);
|
|
12
|
+
const queryParams = (_a = this.getNodeParameter("queryParameters", i)) === null || _a === void 0 ? void 0 : _a.parameter;
|
|
13
|
+
const qs = {};
|
|
14
|
+
for (const param of queryParams !== null && queryParams !== void 0 ? queryParams : []) {
|
|
15
|
+
if (param.name && param.value !== undefined) {
|
|
16
|
+
qs[param.name] = param.value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
let body;
|
|
20
|
+
if (["POST", "PUT", "PATCH"].includes(method)) {
|
|
21
|
+
const rawBody = this.getNodeParameter("requestBody", i, {});
|
|
22
|
+
body = typeof rawBody === "string" ? JSON.parse(rawBody) : rawBody;
|
|
23
|
+
}
|
|
24
|
+
return (0, apiclient_1.ssRequest)(this, method, endpoint, { qs, body });
|
|
25
|
+
}
|
|
26
|
+
default:
|
|
27
|
+
throw new n8n_workflow_1.ApplicationError(`Unsupported operation: ${operation}`);
|
|
28
|
+
}
|
|
29
|
+
}
|