@virtuoussoftware/n8n-nodes-virtuous-crm 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 +19 -0
- package/README.md +45 -0
- package/dist/credentials/VirtuousCrmApi.credentials.d.ts +10 -0
- package/dist/credentials/VirtuousCrmApi.credentials.js +39 -0
- package/dist/credentials/VirtuousCrmApi.credentials.js.map +1 -0
- package/dist/icons/virtuous-logo-mark.svg +1 -0
- package/dist/nodes/VirtuousCrm/VirtuousCrm.node.d.ts +5 -0
- package/dist/nodes/VirtuousCrm/VirtuousCrm.node.js +86 -0
- package/dist/nodes/VirtuousCrm/VirtuousCrm.node.js.map +1 -0
- package/dist/nodes/VirtuousCrm/VirtuousCrm.node.json +18 -0
- package/dist/nodes/VirtuousCrm/resources/contactTransaction/create.d.ts +12 -0
- package/dist/nodes/VirtuousCrm/resources/contactTransaction/create.js +742 -0
- package/dist/nodes/VirtuousCrm/resources/contactTransaction/create.js.map +1 -0
- package/dist/nodes/VirtuousCrm/resources/contactTransaction/index.d.ts +2 -0
- package/dist/nodes/VirtuousCrm/resources/contactTransaction/index.js +28 -0
- package/dist/nodes/VirtuousCrm/resources/contactTransaction/index.js.map +1 -0
- package/dist/nodes/VirtuousCrm/resources/giftTransaction/create.d.ts +12 -0
- package/dist/nodes/VirtuousCrm/resources/giftTransaction/create.js +1999 -0
- package/dist/nodes/VirtuousCrm/resources/giftTransaction/create.js.map +1 -0
- package/dist/nodes/VirtuousCrm/resources/giftTransaction/index.d.ts +2 -0
- package/dist/nodes/VirtuousCrm/resources/giftTransaction/index.js +28 -0
- package/dist/nodes/VirtuousCrm/resources/giftTransaction/index.js.map +1 -0
- package/dist/nodes/VirtuousCrm/shared/crmTransport.d.ts +2 -0
- package/dist/nodes/VirtuousCrm/shared/crmTransport.js +14 -0
- package/dist/nodes/VirtuousCrm/shared/crmTransport.js.map +1 -0
- package/dist/package.json +58 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +0 -0
- package/package.json +58 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2022 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,45 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# n8n-nodes-virtuous-crm
|
|
4
|
+
|
|
5
|
+
This is an n8n community node. It lets you use the [Virtuous CRM API](https://docs.virtuoussoftware.com/) in your n8n workflows.
|
|
6
|
+
|
|
7
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Operations](#operations)
|
|
13
|
+
- [Credentials](#credentials)
|
|
14
|
+
- [Compatibility](#compatibility)
|
|
15
|
+
- [Usage](#usage)
|
|
16
|
+
- [Resources](#resources)
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
21
|
+
|
|
22
|
+
## Operations
|
|
23
|
+
|
|
24
|
+
This node presently supports operations to create Contact and Gift Transactions:
|
|
25
|
+
- [Create Contact Transaction](https://docs.virtuoussoftware.com/#0b27a920-243c-4f02-a5c3-6e522b926431)
|
|
26
|
+
- [Create Gift Transaction](https://docs.virtuoussoftware.com/#e4a6a1e3-71a4-44f9-bd7c-9466996befac)
|
|
27
|
+
|
|
28
|
+
## Credentials
|
|
29
|
+
|
|
30
|
+
An API Key is required to interact with the Virtuous node. Refer to the documentation for API Keys [here](https://docs.virtuoussoftware.com/#authentication)
|
|
31
|
+
|
|
32
|
+
## Compatibility
|
|
33
|
+
|
|
34
|
+
Tested locally against n8n 1.115.3
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
The Contact and Gift Transactions allow users to send data to Virtuous CRM+ to create or update Contacts or Gifts. The creation of records is asynchronous and requires user input on CRM+, so responses will be limited only to headers and status codes. See resources for more information
|
|
39
|
+
|
|
40
|
+
## Resources
|
|
41
|
+
|
|
42
|
+
* [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
43
|
+
* [Virtuous CRM API Documentation](https://docs.virtuoussoftware.com/)
|
|
44
|
+
* [Gifts Integration Best Practices](https://support.virtuous.org/hc/en-us/articles/21329138310285-Gifts-Integration-Best-Practices)
|
|
45
|
+
* [Contacts Integration Best Practices](https://support.virtuous.org/hc/en-us/articles/21152926831501-Contacts-Integration-Best-Practices)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class VirtuousCrmApi 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,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VirtuousCrmApi = void 0;
|
|
4
|
+
class VirtuousCrmApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'virtuousCrmApi';
|
|
7
|
+
this.displayName = 'Virtuous CRM API';
|
|
8
|
+
this.icon = { light: 'file:../icons/virtuous-logo-mark.svg', dark: 'file:../icons/virtuous-logo-mark.svg' };
|
|
9
|
+
this.documentationUrl = 'https://docs.virtuoussoftware.com/#authentication';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Key',
|
|
13
|
+
name: 'apiKey',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
default: '',
|
|
17
|
+
description: 'Your Virtuous CRM API Key',
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
this.authenticate = {
|
|
22
|
+
type: 'generic',
|
|
23
|
+
properties: {
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: '=Bearer {{$credentials?.apiKey}}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
this.test = {
|
|
30
|
+
request: {
|
|
31
|
+
baseURL: 'https://api.virtuoussoftware.com',
|
|
32
|
+
url: '/api/Organization',
|
|
33
|
+
method: 'GET',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.VirtuousCrmApi = VirtuousCrmApi;
|
|
39
|
+
//# sourceMappingURL=VirtuousCrmApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtuousCrmApi.credentials.js","sourceRoot":"","sources":["../../credentials/VirtuousCrmApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,cAAc;IAA3B;QACC,SAAI,GAAG,gBAAgB,CAAC;QAExB,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,SAAI,GAAS,EAAE,KAAK,EAAE,sCAAsC,EAAE,IAAI,EAAE,sCAAsC,EAAE,CAAC;QAE7G,qBAAgB,GAAG,mDAAmD,CAAC;QAEvE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,2BAA2B;gBACxC,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,kCAAkC;iBACjD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,kCAAkC;gBAC3C,GAAG,EAAE,mBAAmB;gBACxB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AArCD,wCAqCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg height="27" viewBox="0 0 28 27" width="28" xmlns="http://www.w3.org/2000/svg"><path d="m3 2c11.5729374 9.434699 12.957048 5.81929297 12.957048 17.4598931v9.3682319c-11.57293741-9.4359075-12.957048-5.8209043-12.957048-17.4598931zm27.9186992 0v9.3682319c0 11.6389888-1.3845135 8.0239856-12.9582569 17.4598931v-9.3682319c0-11.64060013 1.3849165-8.0251941 12.9582569-17.4598931z" fill="#00a3e3" transform="translate(-3 -2)"/></svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeExecutionData, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class VirtuousCrm implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VirtuousCrm = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const contactTransaction_1 = require("./resources/contactTransaction");
|
|
6
|
+
const giftTransaction_1 = require("./resources/giftTransaction");
|
|
7
|
+
const create_1 = require("./resources/contactTransaction/create");
|
|
8
|
+
const create_2 = require("./resources/giftTransaction/create");
|
|
9
|
+
class VirtuousCrm {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Virtuous CRM',
|
|
13
|
+
name: 'virtuousCrm',
|
|
14
|
+
subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
|
|
15
|
+
icon: { light: 'file:../../icons/virtuous-logo-mark.svg', dark: 'file:../../icons/virtuous-logo-mark.svg' },
|
|
16
|
+
group: ['input'],
|
|
17
|
+
version: 1,
|
|
18
|
+
description: 'Interact with the Virtuous CRM API',
|
|
19
|
+
codex: {
|
|
20
|
+
alias: ['CRM', 'Virtuous'],
|
|
21
|
+
categories: ['AI'],
|
|
22
|
+
subcategories: {
|
|
23
|
+
AI: ['Tools'],
|
|
24
|
+
Tools: ['CRM']
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
usableAsTool: true,
|
|
28
|
+
defaults: {
|
|
29
|
+
name: 'Virtuous CRM Api Endpoints',
|
|
30
|
+
},
|
|
31
|
+
inputs: ["main"],
|
|
32
|
+
outputs: ["main"],
|
|
33
|
+
credentials: [
|
|
34
|
+
{
|
|
35
|
+
name: 'virtuousCrmApi',
|
|
36
|
+
required: true
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
properties: [
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Resource',
|
|
42
|
+
name: 'resource',
|
|
43
|
+
type: 'options',
|
|
44
|
+
options: [
|
|
45
|
+
{
|
|
46
|
+
name: 'Contact',
|
|
47
|
+
value: 'contact'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Gift',
|
|
51
|
+
value: 'gift',
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
noDataExpression: true,
|
|
55
|
+
default: 'contact',
|
|
56
|
+
},
|
|
57
|
+
...contactTransaction_1.ContactDescription,
|
|
58
|
+
...giftTransaction_1.GiftDescription
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async execute() {
|
|
63
|
+
const items = this.getInputData();
|
|
64
|
+
const results = [];
|
|
65
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
66
|
+
const resource = this.getNodeParameter('resource', itemIndex);
|
|
67
|
+
const operation = this.getNodeParameter('operation', itemIndex);
|
|
68
|
+
let result;
|
|
69
|
+
if (resource === 'contact' && operation === 'singleContactTransaction') {
|
|
70
|
+
result = await create_1.contactTransactionCreateDescription.execute.call(this, itemIndex);
|
|
71
|
+
}
|
|
72
|
+
else if (resource === 'gift' && operation === 'singleGiftTransaction') {
|
|
73
|
+
result = await create_2.giftTransactionCreateDescription.execute.call(this, itemIndex);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" with operation "${operation}" is not supported. Please check your node configuration.`);
|
|
77
|
+
}
|
|
78
|
+
results.push({
|
|
79
|
+
json: result,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return [results];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.VirtuousCrm = VirtuousCrm;
|
|
86
|
+
//# sourceMappingURL=VirtuousCrm.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtuousCrm.node.js","sourceRoot":"","sources":["../../../nodes/VirtuousCrm/VirtuousCrm.node.ts"],"names":[],"mappings":";;;AAAA,+CAAkK;AAClK,uEAAoE;AACpE,iEAA8D;AAC9D,kEAA4F;AAC5F,+DAAsF;AAEtF,MAAa,WAAW;IAAxB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE,gEAAgE;YAC1E,IAAI,EAAE,EAAE,KAAK,EAAE,yCAAyC,EAAE,IAAI,EAAE,yCAAyC,EAAE;YAC3G,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,oCAAoC;YACjD,KAAK,EAAE;gBACN,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC;gBAC1B,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,OAAO,CAAC;oBACb,KAAK,EAAE,CAAC,KAAK,CAAC;iBACd;aACD;YACD,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE;gBACT,IAAI,EAAE,4BAA4B;aAClC;YACD,MAAM,EAAE,QAAyB;YACjC,OAAO,EAAE,QAAyB;YAClC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,gBAAgB;oBACtB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,SAAS;4BACf,KAAK,EAAE,SAAS;yBAChB;wBACD;4BACC,I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A6EC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.virtuous-crm",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Development", "Utility"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://docs.virtuoussoftware.com/#authentication"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://docs.virtuoussoftware.com/"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const contactTransactionCreateDescription: {
|
|
3
|
+
description: {
|
|
4
|
+
properties: INodeProperties[];
|
|
5
|
+
};
|
|
6
|
+
cleanFieldsForApi(rawFields: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}): {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
execute(this: IExecuteFunctions, itemIndex: number): Promise<any>;
|
|
12
|
+
};
|