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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const properties = [
|
|
7
|
+
(0, common_1.recordLocator)({
|
|
8
|
+
displayName: 'Lead',
|
|
9
|
+
name: 'leadId',
|
|
10
|
+
searchListMethod: 'searchLeads',
|
|
11
|
+
noun: 'lead',
|
|
12
|
+
description: 'The lead to delete',
|
|
13
|
+
}),
|
|
14
|
+
{
|
|
15
|
+
displayName: "Deleting a lead also deletes its deals. Newar keeps deleted records, and Newar's support can restore them.",
|
|
16
|
+
name: 'deleteNotice',
|
|
17
|
+
type: 'notice',
|
|
18
|
+
default: '',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
exports.description = (0, common_1.updateDisplayOptions)({ show: { resource: ['lead'], operation: ['delete'] } }, properties);
|
|
22
|
+
async function execute(itemIndex) {
|
|
23
|
+
const id = (0, common_1.getRecordId)(this, 'leadId', itemIndex, 'Lead');
|
|
24
|
+
return await common_1.deleteRecord.call(this, itemIndex, `/v1/leads/${id}`);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../nodes/Newar/actions/lead/delete.ts"],"names":[],"mappings":";;;AA0BA,0BAGC;AA3BD,sCAA2F;AAE3F,MAAM,UAAU,GAAsB;IACrC,IAAA,sBAAa,EAAC;QACb,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,aAAa;QAC/B,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,oBAAoB;KACjC,CAAC;IACF;QACC,WAAW,EACV,4GAA4G;QAC7G,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;KACX;CACD,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC9C,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EACvD,UAAU,CACV,CAAC;AAEK,KAAK,UAAU,OAAO,CAA0B,SAAiB;IACvE,MAAM,EAAE,GAAG,IAAA,oBAAW,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1D,OAAO,MAAM,qBAAY,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import type { BodyField, QueryField } from '../../helpers/fields';
|
|
3
|
+
export declare const LEAD_BODY_FIELDS: BodyField[];
|
|
4
|
+
export declare const LEAD_FILTERS: QueryField[];
|
|
5
|
+
export declare const leadCreateFields: INodeProperties[];
|
|
6
|
+
export declare const leadUpdateFields: INodeProperties[];
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.leadUpdateFields = exports.leadCreateFields = exports.LEAD_FILTERS = exports.LEAD_BODY_FIELDS = void 0;
|
|
4
|
+
exports.LEAD_BODY_FIELDS = [
|
|
5
|
+
{ param: 'company', api: 'company', kind: 'nullableText', label: 'Company' },
|
|
6
|
+
{ param: 'email', api: 'email', kind: 'nullableText', label: 'Email' },
|
|
7
|
+
{ param: 'name', api: 'name', kind: 'text', label: 'Name' },
|
|
8
|
+
{ param: 'nextStep', api: 'next_step', kind: 'nullableText', label: 'Next Step' },
|
|
9
|
+
{ param: 'nextStepDue', api: 'next_step_due', kind: 'date', label: 'Next Step Due Date' },
|
|
10
|
+
{ param: 'observations', api: 'observations', kind: 'nullableText', label: 'Observations' },
|
|
11
|
+
{ param: 'ownerId', api: 'owner_id', kind: 'nullableId', label: 'Owner' },
|
|
12
|
+
{ param: 'phone', api: 'phone', kind: 'nullableText', label: 'Phone' },
|
|
13
|
+
{ param: 'pipelineId', api: 'pipeline_id', kind: 'id', label: 'Pipeline' },
|
|
14
|
+
{ param: 'source', api: 'source', kind: 'text', label: 'Source' },
|
|
15
|
+
{ param: 'stageId', api: 'stage_id', kind: 'id', label: 'Stage' },
|
|
16
|
+
{ param: 'tagIds', api: 'tag_ids', kind: 'idList', label: 'Tags' },
|
|
17
|
+
{
|
|
18
|
+
param: 'valueEstimate',
|
|
19
|
+
api: 'value_estimate',
|
|
20
|
+
kind: 'nullableNumber',
|
|
21
|
+
label: 'Value Estimate',
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
exports.LEAD_FILTERS = [
|
|
25
|
+
{ param: 'ids', api: 'ids', kind: 'idCsv', label: 'IDs' },
|
|
26
|
+
{ param: 'ownerId', api: 'owner_id', kind: 'id', label: 'Owner' },
|
|
27
|
+
{ param: 'pipelineId', api: 'pipeline_id', kind: 'id', label: 'Pipeline' },
|
|
28
|
+
{ param: 'source', api: 'source', kind: 'text', label: 'Source' },
|
|
29
|
+
{ param: 'stageId', api: 'stage_id', kind: 'id', label: 'Stage' },
|
|
30
|
+
{ param: 'tagId', api: 'tag_id', kind: 'id', label: 'Tag' },
|
|
31
|
+
{ param: 'updatedSince', api: 'updated_since', kind: 'dateTime', label: 'Updated Since' },
|
|
32
|
+
{ param: 'updatedUntil', api: 'updated_until', kind: 'dateTime', label: 'Updated Before' },
|
|
33
|
+
];
|
|
34
|
+
exports.leadCreateFields = [
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Company',
|
|
37
|
+
name: 'company',
|
|
38
|
+
type: 'string',
|
|
39
|
+
default: '',
|
|
40
|
+
placeholder: 'e.g. Sunrise School',
|
|
41
|
+
description: 'Company or institution of the lead',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Email',
|
|
45
|
+
name: 'email',
|
|
46
|
+
type: 'string',
|
|
47
|
+
default: '',
|
|
48
|
+
placeholder: 'name@email.com',
|
|
49
|
+
description: 'Primary email address',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Next Step',
|
|
53
|
+
name: 'nextStep',
|
|
54
|
+
type: 'string',
|
|
55
|
+
default: '',
|
|
56
|
+
placeholder: 'e.g. Send the revised proposal',
|
|
57
|
+
description: 'What should happen next with the lead',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
displayName: 'Next Step Due Date',
|
|
61
|
+
name: 'nextStepDue',
|
|
62
|
+
type: 'dateTime',
|
|
63
|
+
default: '',
|
|
64
|
+
description: 'When the next step is due. Only the date is used.',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Observations',
|
|
68
|
+
name: 'observations',
|
|
69
|
+
type: 'string',
|
|
70
|
+
typeOptions: { rows: 4 },
|
|
71
|
+
default: '',
|
|
72
|
+
description: 'Free-text notes about the lead',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Owner Name or ID',
|
|
76
|
+
name: 'ownerId',
|
|
77
|
+
type: 'options',
|
|
78
|
+
typeOptions: { loadOptionsMethod: 'getUsers' },
|
|
79
|
+
default: '',
|
|
80
|
+
description: 'User responsible for the lead. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Phone',
|
|
84
|
+
name: 'phone',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: '',
|
|
87
|
+
placeholder: 'e.g. 5511999990000',
|
|
88
|
+
description: 'Primary phone number, with country and area code',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Pipeline Name or ID',
|
|
92
|
+
name: 'pipelineId',
|
|
93
|
+
type: 'options',
|
|
94
|
+
typeOptions: { loadOptionsMethod: 'getPipelines' },
|
|
95
|
+
default: '',
|
|
96
|
+
description: 'Pipeline the lead enters. Without a stage, the lead starts in its first open stage. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
displayName: 'Source',
|
|
100
|
+
name: 'source',
|
|
101
|
+
type: 'string',
|
|
102
|
+
default: '',
|
|
103
|
+
placeholder: 'e.g. website',
|
|
104
|
+
description: "Where the lead came from. Newar uses 'api' when empty.",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Stage Name or ID',
|
|
108
|
+
name: 'stageId',
|
|
109
|
+
type: 'options',
|
|
110
|
+
typeOptions: {
|
|
111
|
+
loadOptionsMethod: 'getStages',
|
|
112
|
+
loadOptionsDependsOn: ['additionalFields.pipelineId'],
|
|
113
|
+
},
|
|
114
|
+
default: '',
|
|
115
|
+
description: 'Stage the lead enters. Without it, the lead starts in the first open stage of the first pipeline. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Tag Names or IDs',
|
|
119
|
+
name: 'tagIds',
|
|
120
|
+
type: 'multiOptions',
|
|
121
|
+
typeOptions: { loadOptionsMethod: 'getLeadTags' },
|
|
122
|
+
default: [],
|
|
123
|
+
description: 'Tags to add to the lead. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Value Estimate',
|
|
127
|
+
name: 'valueEstimate',
|
|
128
|
+
type: 'number',
|
|
129
|
+
typeOptions: { minValue: 0, numberPrecision: 2 },
|
|
130
|
+
default: 0,
|
|
131
|
+
description: 'Estimated value of the lead, in BRL',
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
exports.leadUpdateFields = [
|
|
135
|
+
{
|
|
136
|
+
displayName: 'Company',
|
|
137
|
+
name: 'company',
|
|
138
|
+
type: 'string',
|
|
139
|
+
default: '',
|
|
140
|
+
placeholder: 'e.g. Sunrise School',
|
|
141
|
+
description: 'Company or institution of the lead. Leave empty to clear it.',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
displayName: 'Email',
|
|
145
|
+
name: 'email',
|
|
146
|
+
type: 'string',
|
|
147
|
+
default: '',
|
|
148
|
+
placeholder: 'name@email.com',
|
|
149
|
+
description: 'Primary email address. Leave empty to clear it.',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Name',
|
|
153
|
+
name: 'name',
|
|
154
|
+
type: 'string',
|
|
155
|
+
default: '',
|
|
156
|
+
placeholder: 'e.g. Nathan Smith',
|
|
157
|
+
description: "The lead's full name",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
displayName: 'Next Step',
|
|
161
|
+
name: 'nextStep',
|
|
162
|
+
type: 'string',
|
|
163
|
+
default: '',
|
|
164
|
+
placeholder: 'e.g. Send the revised proposal',
|
|
165
|
+
description: 'What should happen next with the lead. Leave empty to clear it.',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
displayName: 'Next Step Due Date',
|
|
169
|
+
name: 'nextStepDue',
|
|
170
|
+
type: 'dateTime',
|
|
171
|
+
default: '',
|
|
172
|
+
description: 'When the next step is due. Only the date is used. Leave empty to clear it.',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
displayName: 'Observations',
|
|
176
|
+
name: 'observations',
|
|
177
|
+
type: 'string',
|
|
178
|
+
typeOptions: { rows: 4 },
|
|
179
|
+
default: '',
|
|
180
|
+
description: 'Free-text notes about the lead. Leave empty to clear them.',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
displayName: 'Owner Name or ID',
|
|
184
|
+
name: 'ownerId',
|
|
185
|
+
type: 'options',
|
|
186
|
+
typeOptions: { loadOptionsMethod: 'getUsers' },
|
|
187
|
+
default: '',
|
|
188
|
+
description: 'User responsible for the lead. Leave empty to remove the owner. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
displayName: 'Phone',
|
|
192
|
+
name: 'phone',
|
|
193
|
+
type: 'string',
|
|
194
|
+
default: '',
|
|
195
|
+
placeholder: 'e.g. 5511999990000',
|
|
196
|
+
description: 'Primary phone number, with country and area code. Leave empty to clear it.',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
displayName: 'Source',
|
|
200
|
+
name: 'source',
|
|
201
|
+
type: 'string',
|
|
202
|
+
default: '',
|
|
203
|
+
placeholder: 'e.g. website',
|
|
204
|
+
description: 'Where the lead came from',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
displayName: 'Stage Name or ID',
|
|
208
|
+
name: 'stageId',
|
|
209
|
+
type: 'options',
|
|
210
|
+
typeOptions: { loadOptionsMethod: 'getStages' },
|
|
211
|
+
default: '',
|
|
212
|
+
description: 'Moves the lead, and its primary deal, to this stage. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
displayName: 'Tag Names or IDs',
|
|
216
|
+
name: 'tagIds',
|
|
217
|
+
type: 'multiOptions',
|
|
218
|
+
typeOptions: { loadOptionsMethod: 'getLeadTags' },
|
|
219
|
+
default: [],
|
|
220
|
+
description: 'Replaces all of the lead\'s tags. Leave empty to remove every tag. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
displayName: 'Value Estimate',
|
|
224
|
+
name: 'valueEstimate',
|
|
225
|
+
type: 'number',
|
|
226
|
+
typeOptions: { minValue: 0, numberPrecision: 2 },
|
|
227
|
+
default: 0,
|
|
228
|
+
description: 'Estimated value of the lead, in BRL. To clear it, use an expression that returns null.',
|
|
229
|
+
},
|
|
230
|
+
];
|
|
231
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../nodes/Newar/actions/lead/fields.ts"],"names":[],"mappings":";;;AAMa,QAAA,gBAAgB,GAAgB;IAC5C,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE;IAC5E,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE;IACtE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3D,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE;IACjF,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,EAAE;IACzF,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAC3F,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE;IACzE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE;IACtE,E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,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,0BAA0B;KACvC;IACD;QACC,WAAW,EAAE,kBAAkB;QAC/B,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,EAAE,iBAAiB,EAAE,WAAW,EAAE;QAC/C,OAAO,EAAE,EAAE;QACX,WAAW,EACV,sKAAsK;KACvK;IACD;QACC,WAAW,EAAE,kBAAkB;QAC/B,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,EAAE,iBAAiB,EAAE,aAAa,EAAE;QACjD,OAAO,EAAE,EAAE;QACX,WAAW,EACV,kLAAkL;KACnL;IACD;QACC,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE;QAChD,OAAO,EAAE,CAAC;QACV,WAAW,EACV,wFAAwF;KACzF;CACD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const properties = [
|
|
7
|
+
(0, common_1.recordLocator)({
|
|
8
|
+
displayName: 'Lead',
|
|
9
|
+
name: 'leadId',
|
|
10
|
+
searchListMethod: 'searchLeads',
|
|
11
|
+
noun: 'lead',
|
|
12
|
+
description: 'The lead to retrieve',
|
|
13
|
+
}),
|
|
14
|
+
...(0, common_1.outputProperties)('lead'),
|
|
15
|
+
];
|
|
16
|
+
exports.description = (0, common_1.updateDisplayOptions)({ show: { resource: ['lead'], operation: ['get'] } }, properties);
|
|
17
|
+
async function execute(itemIndex) {
|
|
18
|
+
const id = (0, common_1.getRecordId)(this, 'leadId', itemIndex, 'Lead');
|
|
19
|
+
const lead = await common_1.getRecord.call(this, itemIndex, `/v1/leads/${id}`);
|
|
20
|
+
return (0, common_1.shapeRecords)(this, itemIndex, 'lead', [lead])[0];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../nodes/Newar/actions/lead/get.ts"],"names":[],"mappings":";;;AA2BA,0BAIC;AA7BD,sCAOmB;AAEnB,MAAM,UAAU,GAAsB;IACrC,IAAA,sBAAa,EAAC;QACb,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,aAAa;QAC/B,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,sBAAsB;KACnC,CAAC;IACF,GAAG,IAAA,yBAAgB,EAAC,MAAM,CAAC;CAC3B,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC9C,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EACpD,UAAU,CACV,CAAC;AAEK,KAAK,UAAU,OAAO,CAA0B,SAAiB;IACvE,MAAM,EAAE,GAAG,IAAA,oBAAW,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,MAAM,kBAAS,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC;IACtE,OAAO,IAAA,qBAAY,EAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import { type ExecutionContext } from '../common';
|
|
3
|
+
export declare const description: INodeProperties[];
|
|
4
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number, context: ExecutionContext): Promise<IDataObject[]>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const fields_1 = require("../../helpers/fields");
|
|
6
|
+
const transport_1 = require("../../transport");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const fields_2 = require("./fields");
|
|
9
|
+
const properties = [
|
|
10
|
+
(0, common_1.returnAllProperty)(),
|
|
11
|
+
(0, common_1.limitProperty)(1000),
|
|
12
|
+
{
|
|
13
|
+
displayName: 'Filters',
|
|
14
|
+
name: 'filters',
|
|
15
|
+
type: 'collection',
|
|
16
|
+
placeholder: 'Add Filter',
|
|
17
|
+
default: {},
|
|
18
|
+
options: [
|
|
19
|
+
{
|
|
20
|
+
displayName: 'IDs',
|
|
21
|
+
name: 'ids',
|
|
22
|
+
type: 'string',
|
|
23
|
+
default: '',
|
|
24
|
+
placeholder: 'e.g. 0f8d3c2a-6b1e-4f7a-9c5d-2e4b8a1f6c3d,7a2b9c4d-1e3f-4a5b-8c6d-9e0f1a2b3c4d',
|
|
25
|
+
description: 'Only these leads. Up to 100 IDs, separated by commas.',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Owner Name or ID',
|
|
29
|
+
name: 'ownerId',
|
|
30
|
+
type: 'options',
|
|
31
|
+
typeOptions: { loadOptionsMethod: 'getUsers' },
|
|
32
|
+
default: '',
|
|
33
|
+
description: 'Only leads of this owner. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Pipeline Name or ID',
|
|
37
|
+
name: 'pipelineId',
|
|
38
|
+
type: 'options',
|
|
39
|
+
typeOptions: { loadOptionsMethod: 'getPipelines' },
|
|
40
|
+
default: '',
|
|
41
|
+
description: 'Only leads in stages of this pipeline. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Source',
|
|
45
|
+
name: 'source',
|
|
46
|
+
type: 'string',
|
|
47
|
+
default: '',
|
|
48
|
+
placeholder: 'e.g. website',
|
|
49
|
+
description: 'Only leads from this source',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Stage Name or ID',
|
|
53
|
+
name: 'stageId',
|
|
54
|
+
type: 'options',
|
|
55
|
+
typeOptions: {
|
|
56
|
+
loadOptionsMethod: 'getStages',
|
|
57
|
+
loadOptionsDependsOn: ['filters.pipelineId'],
|
|
58
|
+
},
|
|
59
|
+
default: '',
|
|
60
|
+
description: 'Only leads in this stage. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Tag Name or ID',
|
|
64
|
+
name: 'tagId',
|
|
65
|
+
type: 'options',
|
|
66
|
+
typeOptions: { loadOptionsMethod: 'getLeadTags' },
|
|
67
|
+
default: '',
|
|
68
|
+
description: 'Only leads with this tag. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: 'Updated Before',
|
|
72
|
+
name: 'updatedUntil',
|
|
73
|
+
type: 'dateTime',
|
|
74
|
+
default: '',
|
|
75
|
+
description: 'Only leads last changed before this moment',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Updated Since',
|
|
79
|
+
name: 'updatedSince',
|
|
80
|
+
type: 'dateTime',
|
|
81
|
+
default: '',
|
|
82
|
+
description: 'Only leads changed at or after this moment',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
(0, common_1.sortProperty)([
|
|
87
|
+
{ name: 'Created At', value: 'created_at' },
|
|
88
|
+
{ name: 'Name', value: 'name' },
|
|
89
|
+
{ name: 'Updated At', value: 'updated_at' },
|
|
90
|
+
], 'created_at'),
|
|
91
|
+
...(0, common_1.outputProperties)('lead'),
|
|
92
|
+
];
|
|
93
|
+
exports.description = (0, common_1.updateDisplayOptions)({ show: { resource: ['lead'], operation: ['getAll'] } }, properties);
|
|
94
|
+
async function execute(itemIndex, context) {
|
|
95
|
+
const qs = {
|
|
96
|
+
...(0, fields_1.buildQuery)((0, common_1.getCollection)(this, 'filters', itemIndex), fields_2.LEAD_FILTERS, context.timeZone),
|
|
97
|
+
...(0, common_1.readSort)(this, itemIndex),
|
|
98
|
+
};
|
|
99
|
+
const leads = await transport_1.newarApiRequestAllItems.call(this, { path: '/v1/leads', qs, itemIndex }, (0, common_1.readPaging)(this, itemIndex));
|
|
100
|
+
return (0, common_1.shapeRecords)(this, itemIndex, 'lead', leads);
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=getAll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAll.js","sourceRoot":"","sources":["../../../../../nodes/Newar/actions/lead/getAll.ts"],"names":[],"mappings":";;;AAoHA,0BAeC;AAjID,iDAAkD;AAClD,+CAA0D;AAC1D,sCAWmB;AACnB,qCAAwC;AAExC,MAAM,UAAU,GAAsB;IACrC,IAAA,0BAAiB,GAAE;IACnB,IAAA,sBAAa,EAAC,IAAI,CAAC;IACnB;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,KAAK;gBAClB,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,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
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.description = exports.handlers = void 0;
|
|
37
|
+
const create = __importStar(require("./create"));
|
|
38
|
+
const remove = __importStar(require("./delete"));
|
|
39
|
+
const get = __importStar(require("./get"));
|
|
40
|
+
const getAll = __importStar(require("./getAll"));
|
|
41
|
+
const search = __importStar(require("./search"));
|
|
42
|
+
const update = __importStar(require("./update"));
|
|
43
|
+
exports.handlers = {
|
|
44
|
+
create: create.execute,
|
|
45
|
+
delete: remove.execute,
|
|
46
|
+
get: get.execute,
|
|
47
|
+
getAll: getAll.execute,
|
|
48
|
+
search: search.execute,
|
|
49
|
+
update: update.execute,
|
|
50
|
+
};
|
|
51
|
+
exports.description = [
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Operation',
|
|
54
|
+
name: 'operation',
|
|
55
|
+
type: 'options',
|
|
56
|
+
noDataExpression: true,
|
|
57
|
+
displayOptions: { show: { resource: ['lead'] } },
|
|
58
|
+
options: [
|
|
59
|
+
{
|
|
60
|
+
name: 'Create',
|
|
61
|
+
value: 'create',
|
|
62
|
+
description: 'Create a new lead, with the same automations as the Newar app',
|
|
63
|
+
action: 'Create lead',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'Delete',
|
|
67
|
+
value: 'delete',
|
|
68
|
+
description: 'Delete a lead and its deals',
|
|
69
|
+
action: 'Delete lead',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Get',
|
|
73
|
+
value: 'get',
|
|
74
|
+
description: 'Retrieve a lead',
|
|
75
|
+
action: 'Get lead',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Get Many',
|
|
79
|
+
value: 'getAll',
|
|
80
|
+
description: 'Retrieve a list of leads, with filters',
|
|
81
|
+
action: 'Get many leads',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'Search',
|
|
85
|
+
value: 'search',
|
|
86
|
+
description: 'Find leads by name, company, email or phone',
|
|
87
|
+
action: 'Search leads',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Update',
|
|
91
|
+
value: 'update',
|
|
92
|
+
description: 'Change fields, stage, owner, tags or custom fields of a lead',
|
|
93
|
+
action: 'Update lead',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
default: 'create',
|
|
97
|
+
},
|
|
98
|
+
...create.description,
|
|
99
|
+
...remove.description,
|
|
100
|
+
...get.description,
|
|
101
|
+
...getAll.description,
|
|
102
|
+
...search.description,
|
|
103
|
+
...update.description,
|
|
104
|
+
];
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Newar/actions/lead/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,iDAAmC;AACnC,iDAAmC;AACnC,2CAA6B;AAC7B,iDAAmC;AACnC,iDAAmC;AACnC,iDAAmC;AAEtB,QAAA,QAAQ,GAAqC;IACzD,MAAM,EAAE,MAAM,CAAC,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC,OAAO;IACtB,GAAG,EAAE,GAAG,CAAC,OAAO;IAChB,MAAM,EAAE,MAAM,CAAC,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC,OAAO;CACtB,CAAC;AAEW,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;QAChD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,+DAA+D;gBAC5E,MAAM,EAAE,aAAa;aACrB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,6BAA6B;gBAC1C,MAAM,EAAE,aAAa;aACrB;YACD;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,iBAAiB;gBAC9B,MAAM,EAAE,UAAU;aAClB;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,wCAAwC;gBACrD,MAAM,EAAE,gBAAgB;aACxB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,6CAA6C;gBAC1D,MAAM,EAAE,cAAc;aACtB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,8DAA8D;gBAC3E,MAAM,EAAE,aAAa;aACrB;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;IACD,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,GAAG,CAAC,WAAW;IAClB,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,MAAM,CAAC,WAAW;CACrB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const output_1 = require("../../helpers/output");
|
|
6
|
+
const transport_1 = require("../../transport");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const term_1 = require("../search/term");
|
|
9
|
+
const properties = [
|
|
10
|
+
(0, term_1.searchTermProperty)('Text to look for in names, companies, emails and phones', 2),
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Exact Match',
|
|
13
|
+
name: 'exactMatch',
|
|
14
|
+
type: 'boolean',
|
|
15
|
+
default: false,
|
|
16
|
+
description: 'Whether to only return leads where a field is exactly the search term',
|
|
17
|
+
},
|
|
18
|
+
(0, common_1.returnAllProperty)(),
|
|
19
|
+
(0, common_1.limitProperty)(1000),
|
|
20
|
+
...(0, common_1.outputProperties)('lead'),
|
|
21
|
+
];
|
|
22
|
+
exports.description = (0, common_1.updateDisplayOptions)({ show: { resource: ['lead'], operation: ['search'] } }, properties);
|
|
23
|
+
async function execute(itemIndex) {
|
|
24
|
+
const term = (0, term_1.readSearchTerm)(this, itemIndex, 2);
|
|
25
|
+
const exactMatch = this.getNodeParameter('exactMatch', itemIndex, false);
|
|
26
|
+
const hits = await transport_1.newarApiRequestAllItems.call(this, {
|
|
27
|
+
path: '/v1/leads/search',
|
|
28
|
+
qs: { term, ...(exactMatch ? { exact_match: 'true' } : {}) },
|
|
29
|
+
itemIndex,
|
|
30
|
+
maxPageSize: transport_1.SEARCH_PAGE_SIZE,
|
|
31
|
+
itemsAt: 'data.items',
|
|
32
|
+
}, (0, common_1.readPaging)(this, itemIndex));
|
|
33
|
+
const mode = this.getNodeParameter('output', itemIndex, 'simplified');
|
|
34
|
+
const fields = mode === 'fields' ? this.getNodeParameter('fields', itemIndex, []) : [];
|
|
35
|
+
return hits.map((hit) => (0, output_1.flattenSearchHit)(hit, (lead) => (0, output_1.applyOutput)(lead, 'lead', mode, fields)));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../nodes/Newar/actions/lead/search.ts"],"names":[],"mappings":";;;AAgCA,0BAoBC;AAlDD,iDAAsF;AACtF,+CAA4E;AAC5E,sCAMmB;AACnB,yCAAoE;AAEpE,MAAM,UAAU,GAAsB;IACrC,IAAA,yBAAkB,EAAC,yDAAyD,EAAE,CAAC,CAAC;IAChF;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,uEAAuE;KACpF;IACD,IAAA,0BAAiB,GAAE;IACnB,IAAA,sBAAa,EAAC,IAAI,CAAC;IACnB,GAAG,IAAA,yBAAgB,EAAC,MAAM,CAAC;CAC3B,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC9C,EAAE,IA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ctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import { type ExecutionContext } from '../common';
|
|
3
|
+
export declare const description: INodeProperties[];
|
|
4
|
+
export declare function execute(this: IExecuteFunctions, itemIndex: number, context: ExecutionContext): Promise<IDataObject>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const fields_1 = require("../../helpers/fields");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const customFields_1 = require("../customFields");
|
|
8
|
+
const fields_2 = require("./fields");
|
|
9
|
+
const properties = [
|
|
10
|
+
(0, common_1.recordLocator)({
|
|
11
|
+
displayName: 'Lead',
|
|
12
|
+
name: 'leadId',
|
|
13
|
+
searchListMethod: 'searchLeads',
|
|
14
|
+
noun: 'lead',
|
|
15
|
+
description: 'The lead to update',
|
|
16
|
+
}),
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Update Fields',
|
|
19
|
+
name: 'updateFields',
|
|
20
|
+
type: 'collection',
|
|
21
|
+
placeholder: 'Add Field',
|
|
22
|
+
default: {},
|
|
23
|
+
options: fields_2.leadUpdateFields,
|
|
24
|
+
},
|
|
25
|
+
(0, customFields_1.customFieldsProperty)('lead', 'update'),
|
|
26
|
+
];
|
|
27
|
+
exports.description = (0, common_1.updateDisplayOptions)({ show: { resource: ['lead'], operation: ['update'] } }, properties);
|
|
28
|
+
async function execute(itemIndex, context) {
|
|
29
|
+
const id = (0, common_1.getRecordId)(this, 'leadId', itemIndex, 'Lead');
|
|
30
|
+
const body = (0, fields_1.buildBody)((0, common_1.getCollection)(this, 'updateFields', itemIndex), fields_2.LEAD_BODY_FIELDS, 'update', context.timeZone);
|
|
31
|
+
const customFields = (0, customFields_1.readCustomFields)(this, 'lead', 'update', itemIndex, context.timeZone);
|
|
32
|
+
if (customFields)
|
|
33
|
+
body.custom_fields = customFields;
|
|
34
|
+
return await common_1.updateRecord.call(this, itemIndex, `/v1/leads/${id}`, body);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../nodes/Newar/actions/lead/update.ts"],"names":[],"mappings":";;;AAsCA,0BAeC;AAnDD,iDAAiD;AACjD,sCAOmB;AACnB,kDAAyE;AACzE,qCAA8D;AAE9D,MAAM,UAAU,GAAsB;IACrC,IAAA,sBAAa,EAAC;QACb,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,aAAa;QAC/B,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,oBAAoB;KACjC,CAAC;IACF;QACC,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,yBAAgB;KACzB;IACD,IAAA,mCAAoB,EAAC,MAAM,EAAE,QAAQ,CAAC;CACtC,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC9C,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EACvD,UAAU,CACV,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB,EACjB,OAAyB;IAEzB,MAAM,EAAE,GAAG,IAAA,oBAAW,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,IAAA,kBAAS,EACrB,IAAA,sBAAa,EAAC,IAAI,EAAE,cAAc,EAAE,SAAS,CAAC,EAC9C,yBAAgB,EAChB,QAAQ,EACR,OAAO,CAAC,QAAQ,CAChB,CAAC;IACF,MAAM,YAAY,GAAG,IAAA,+BAAgB,EAAC,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