n8n-nodes-kapacity 0.1.5 → 0.1.6
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/README.md +11 -2
- package/dist/nodes/Kapacity/Kapacity.node.d.ts +1 -0
- package/dist/nodes/Kapacity/actions.js +21 -0
- package/dist/nodes/Kapacity/methods.d.ts +1 -0
- package/dist/nodes/Kapacity/methods.js +15 -0
- package/dist/nodes/Kapacity/resources/contract.d.ts +7 -2
- package/dist/nodes/Kapacity/resources/contract.js +44 -0
- package/dist/nodes/Kapacity/resources/reading.js +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,8 +31,8 @@ The package contains two nodes.
|
|
|
31
31
|
| Contact | Create, Create or Update (by e-mail), Delete, Get, Get Many, Move, Update |
|
|
32
32
|
| Row (your own CRM tables) | Create, Delete, Get, Get Many, Update |
|
|
33
33
|
| Table | Get Columns, Get Many |
|
|
34
|
-
| Contract | Send (from a template, for e-signature), Get (with its audit trail), Get Many |
|
|
35
|
-
| Contract Template | Get Many |
|
|
34
|
+
| Contract | Send (from a template, for e-signature, with other signers if you want), Get (with its audit trail and where each signer stands), Get Many (filter by status: Draft, Sent, Viewed, In Signing, Signed) |
|
|
35
|
+
| Contract Template | Get Many (with the roles that sign each template) |
|
|
36
36
|
| Appointment | Get Many |
|
|
37
37
|
| Appointment Type | Get Many |
|
|
38
38
|
| Form | Get Many |
|
|
@@ -50,6 +50,7 @@ What the node does for you, so you never write a request body:
|
|
|
50
50
|
- **Pagination.** **Return All** reads every page for you.
|
|
51
51
|
- **Contacts found by e-mail.** **Create or Update** updates the contact that has this e-mail, or creates it.
|
|
52
52
|
- **Setting to Mon Pipe.** **Move** hands a contact over from Setting to Mon Pipe (or back), as the Base menu of its record does: same contact, default status of the new base, automations of the new base.
|
|
53
|
+
- **Several signers.** **Contract, Send** takes other signers next to the contact (**Signers**: role, name, e-mail; 7 at most). The roles are listed from the chosen template; **No Role** makes the person sign at the end of the contract. Each signer gets their own signing link (in the output, under `signataires`). The contract is **In Signing** once someone has signed, and **Signed** when the last one has.
|
|
53
54
|
|
|
54
55
|
### Kapacity Trigger
|
|
55
56
|
|
|
@@ -102,6 +103,14 @@ The API has a monthly quota per workspace. Each call counts, so prefer the trigg
|
|
|
102
103
|
|
|
103
104
|
## Version history
|
|
104
105
|
|
|
106
|
+
### 0.1.6
|
|
107
|
+
|
|
108
|
+
Contract, Send: other signers next to the contact (role from the template, name, e-mail), each with their own signing link. Contract, Get Many: the **In Signing** status.
|
|
109
|
+
|
|
110
|
+
### 0.1.5
|
|
111
|
+
|
|
112
|
+
Credentials: a Base URL pasted with the API path (`https://kapacity.app/api/v1/w/<workspace>`) is brought back to the Kapacity address, so lists no longer stay empty without an error.
|
|
113
|
+
|
|
105
114
|
### 0.1.4
|
|
106
115
|
|
|
107
116
|
Contact, Move: hands a contact over from Setting to Mon Pipe, or back. A contact can be created with only an e-mail or only a phone.
|
|
@@ -12,6 +12,7 @@ export declare class Kapacity implements INodeType {
|
|
|
12
12
|
};
|
|
13
13
|
loadOptions: {
|
|
14
14
|
getContactStatuses(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
15
|
+
getContractTemplateRoles(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
15
16
|
getTableColumns(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
16
17
|
};
|
|
17
18
|
resourceMapping: {
|
|
@@ -177,6 +177,24 @@ function filterValue(columns, condition) {
|
|
|
177
177
|
}
|
|
178
178
|
return raw;
|
|
179
179
|
}
|
|
180
|
+
function signersOf(ctx, i) {
|
|
181
|
+
const lines = param(ctx, 'signers', i, {}).signer;
|
|
182
|
+
return (lines !== null && lines !== void 0 ? lines : []).map((line, n) => {
|
|
183
|
+
var _a, _b, _c;
|
|
184
|
+
const nom = String((_a = line.name) !== null && _a !== void 0 ? _a : '').trim();
|
|
185
|
+
if (!nom) {
|
|
186
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Signer ${n + 1}: the name is required`, { itemIndex: i });
|
|
187
|
+
}
|
|
188
|
+
const signer = { nom };
|
|
189
|
+
const role = String((_b = line.role) !== null && _b !== void 0 ? _b : '').trim();
|
|
190
|
+
if (role)
|
|
191
|
+
signer.role = role;
|
|
192
|
+
const email = String((_c = line.email) !== null && _c !== void 0 ? _c : '').trim();
|
|
193
|
+
if (email)
|
|
194
|
+
signer.email = email;
|
|
195
|
+
return signer;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
180
198
|
async function contract(ctx, operation, i) {
|
|
181
199
|
var _a, _b, _c;
|
|
182
200
|
switch (operation) {
|
|
@@ -194,6 +212,9 @@ async function contract(ctx, operation, i) {
|
|
|
194
212
|
body.envoyer_email = false;
|
|
195
213
|
if (more.emailTemplateId)
|
|
196
214
|
body.message_email_id = String(more.emailTemplateId).trim();
|
|
215
|
+
const signataires = signersOf(ctx, i);
|
|
216
|
+
if (signataires.length)
|
|
217
|
+
body.signataires = signataires;
|
|
197
218
|
const headers = more.idempotencyKey ? { 'Idempotency-Key': String(more.idempotencyKey) } : {};
|
|
198
219
|
const response = await transport_1.kapacityApiRequest.call(ctx, 'POST', '/contracts', automationsQs(more), body, headers);
|
|
199
220
|
const email = (_a = response.email) !== null && _a !== void 0 ? _a : {};
|
|
@@ -9,6 +9,7 @@ export declare const listSearch: {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const loadOptions: {
|
|
11
11
|
getContactStatuses(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
12
|
+
getContractTemplateRoles(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
12
13
|
getTableColumns(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
13
14
|
};
|
|
14
15
|
export declare const resourceMapping: {
|
|
@@ -84,6 +84,21 @@ exports.loadOptions = {
|
|
|
84
84
|
const status = (await columns_1.getColumns.call(this, base)).find((c) => c.id === 'status_id');
|
|
85
85
|
return ((_b = status === null || status === void 0 ? void 0 : status.options) !== null && _b !== void 0 ? _b : []).map((o) => ({ name: o.libelle, value: o.id }));
|
|
86
86
|
},
|
|
87
|
+
async getContractTemplateRoles() {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
const noRole = {
|
|
90
|
+
name: 'No Role',
|
|
91
|
+
value: '',
|
|
92
|
+
description: 'The person signs at the end of the contract',
|
|
93
|
+
};
|
|
94
|
+
const templateId = locatorValue(this, 'templateId').trim();
|
|
95
|
+
if (!templateId || templateId.startsWith('='))
|
|
96
|
+
return [noRole];
|
|
97
|
+
const response = await transport_1.kapacityApiRequest.call(this, 'GET', '/contract-templates');
|
|
98
|
+
const template = ((_a = response.modeles) !== null && _a !== void 0 ? _a : []).find((t) => String(t.id) === templateId);
|
|
99
|
+
const roles = ((_b = template === null || template === void 0 ? void 0 : template.roles) !== null && _b !== void 0 ? _b : []).filter((r) => r.id !== 'client' && r.signature_posee !== true);
|
|
100
|
+
return [noRole, ...roles.map((r) => { var _a; return ({ name: String((_a = r.libelle) !== null && _a !== void 0 ? _a : r.id), value: String(r.id) }); })];
|
|
101
|
+
},
|
|
87
102
|
async getTableColumns() {
|
|
88
103
|
const table = locatorValue(this, 'table');
|
|
89
104
|
if (!table)
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
-
export declare const CONTRACT_STATUSES: {
|
|
2
|
+
export declare const CONTRACT_STATUSES: ({
|
|
3
3
|
name: string;
|
|
4
4
|
value: string;
|
|
5
|
-
|
|
5
|
+
description?: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
description: string;
|
|
10
|
+
})[];
|
|
6
11
|
export declare const contractDescription: INodeProperties[];
|
|
@@ -8,6 +8,7 @@ exports.CONTRACT_STATUSES = [
|
|
|
8
8
|
{ name: 'Draft', value: 'brouillon' },
|
|
9
9
|
{ name: 'Sent', value: 'envoye' },
|
|
10
10
|
{ name: 'Viewed', value: 'vu' },
|
|
11
|
+
{ name: 'In Signing', value: 'en_cours', description: 'At least one signer has signed, not all of them yet' },
|
|
11
12
|
{ name: 'Signed', value: 'signe' },
|
|
12
13
|
];
|
|
13
14
|
exports.contractDescription = [
|
|
@@ -47,6 +48,49 @@ exports.contractDescription = [
|
|
|
47
48
|
description: 'The contract amount, written in the contract in place of {{montant}}',
|
|
48
49
|
displayOptions: { show: on('send') },
|
|
49
50
|
},
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Signers',
|
|
53
|
+
name: 'signers',
|
|
54
|
+
type: 'fixedCollection',
|
|
55
|
+
typeOptions: { multipleValues: true },
|
|
56
|
+
placeholder: 'Add Signer',
|
|
57
|
+
default: {},
|
|
58
|
+
description: 'Other people who sign the contract with the contact (7 at most). The contact always signs, as the Client. A role of the template that you do not give here is removed from this contract. Each signer gets their own signing link, by e-mail if they have an address.',
|
|
59
|
+
displayOptions: { show: on('send') },
|
|
60
|
+
options: [
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Signer',
|
|
63
|
+
name: 'signer',
|
|
64
|
+
values: [
|
|
65
|
+
{
|
|
66
|
+
displayName: 'Role Name or ID',
|
|
67
|
+
name: 'role',
|
|
68
|
+
type: 'options',
|
|
69
|
+
typeOptions: { loadOptionsMethod: 'getContractTemplateRoles', loadOptionsDependsOn: ['templateId.value'] },
|
|
70
|
+
default: '',
|
|
71
|
+
description: 'The role of the template this person signs as. Roles whose signature is already placed in the template are not listed. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Name',
|
|
75
|
+
name: 'name',
|
|
76
|
+
type: 'string',
|
|
77
|
+
default: '',
|
|
78
|
+
required: true,
|
|
79
|
+
placeholder: 'e.g. Marc Martin',
|
|
80
|
+
description: 'The full name of the person who signs',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'E-Mail',
|
|
84
|
+
name: 'email',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: '',
|
|
87
|
+
placeholder: 'e.g. marc@example.com',
|
|
88
|
+
description: 'Where Kapacity e-mails their signing link (not when Send E-Mail is off). Leave empty to send the link yourself: it is in the output, under signataires.',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
50
94
|
{
|
|
51
95
|
displayName: 'Additional Fields',
|
|
52
96
|
name: 'additionalFields',
|
|
@@ -28,7 +28,7 @@ exports.tableDescription = [
|
|
|
28
28
|
];
|
|
29
29
|
exports.contractTemplateDescription = [
|
|
30
30
|
operations('contractTemplate', [
|
|
31
|
-
getAll('contract templates', 'Retrieve the contract templates,
|
|
31
|
+
getAll('contract templates', 'Retrieve the contract templates, whether each one can be sent now, and the roles that sign it'),
|
|
32
32
|
]),
|
|
33
33
|
];
|
|
34
34
|
exports.appointmentDescription = [
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-kapacity",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "n8n nodes for Kapacity, the all-in-one sales CRM: contacts, CRM tables, contracts with e-signature, appointments, forms, payments and real-time webhooks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/kapacity-saas/n8n-nodes-kapacity#readme",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-kapacity",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "n8n nodes for Kapacity, the all-in-one sales CRM: contacts, CRM tables, contracts with e-signature, appointments, forms, payments and real-time webhooks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/kapacity-saas/n8n-nodes-kapacity#readme",
|