@limetech/n8n-nodes-lime 0.2.0 → 0.2.2
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/dist/package.json +11 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/.eslintrc.js +0 -58
- package/.github/copilot-instructions.md +0 -20
- package/.github/workflows/publish.yml +0 -34
- package/credentials/LimeCrmApi.credentials.ts +0 -57
- package/credentials/LimeGoApi.credentials.ts +0 -31
- package/docker-compose.yml +0 -44
- package/nodes/lime-crm/GenericTypes.ts +0 -114
- package/nodes/lime-crm/LimeCrm.node.json +0 -18
- package/nodes/lime-crm/LimeCrmNode.node.ts +0 -154
- package/nodes/lime-crm/LimeCrmTrigger/LimeCrmTrigger.node.ts +0 -461
- package/nodes/lime-crm/LimeCrmTrigger.node.ts +0 -505
- package/nodes/lime-crm/lime-crm.svg +0 -1
- package/nodes/lime-crm/methods/getAllSortableFields.ts +0 -73
- package/nodes/lime-crm/methods/getLimeTypeProperties.ts +0 -48
- package/nodes/lime-crm/methods/getLimeTypeRelations.ts +0 -32
- package/nodes/lime-crm/methods/getLimeTypes.ts +0 -33
- package/nodes/lime-crm/methods/getRelatedTypeProperties.ts +0 -47
- package/nodes/lime-crm/methods/index.ts +0 -5
- package/nodes/lime-crm/resources/limeObject/commonFields.ts +0 -179
- package/nodes/lime-crm/resources/limeObject/index.ts +0 -64
- package/nodes/lime-crm/resources/limeObject/operations/common.operation.ts +0 -35
- package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +0 -234
- package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +0 -136
- package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +0 -124
- package/nodes/lime-crm/resources/limeObject/operations/getAll.operation.ts +0 -242
- package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +0 -242
- package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +0 -201
- package/nodes/lime-crm/resources/limeType/index.ts +0 -66
- package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +0 -105
- package/nodes/lime-crm/resources/limeType/operations/getRelations.operation.ts +0 -105
- package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +0 -58
- package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +0 -76
- package/nodes/lime-crm/resources/queryApi/index.ts +0 -42
- package/nodes/lime-crm/resources/queryApi/operations/executeQuery.operation.ts +0 -605
- package/nodes/lime-crm/transport/index.ts +0 -74
- package/nodes/lime-go/LimeGo.node.ts +0 -146
- package/nodes/lime-go/actions/organization/get.operation.ts +0 -42
- package/nodes/lime-go/actions/organization/getByExternalKey.operation.ts +0 -57
- package/nodes/lime-go/actions/organization/index.ts +0 -69
- package/nodes/lime-go/actions/organization/organizationFields.ts +0 -160
- package/nodes/lime-go/actions/organization/search.operation.ts +0 -73
- package/nodes/lime-go/actions/organization/update.operation.ts +0 -140
- package/nodes/lime-go/actions/person/createMail.operation.ts +0 -140
- package/nodes/lime-go/actions/person/get.operation.ts +0 -51
- package/nodes/lime-go/actions/person/index.ts +0 -69
- package/nodes/lime-go/actions/person/personFields.ts +0 -132
- package/nodes/lime-go/actions/person/search.operation.ts +0 -88
- package/nodes/lime-go/actions/person/update.operation.ts +0 -122
- package/nodes/lime-go/lime-go.svg +0 -1
- package/nodes/lime-go/transport/graphqlRequest.ts +0 -30
- package/tsconfig.json +0 -30
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { graphqlRequest } from '../../transport/graphqlRequest';
|
|
3
|
-
|
|
4
|
-
export const description: INodeProperties[] = [
|
|
5
|
-
{
|
|
6
|
-
displayName: 'Email Subject',
|
|
7
|
-
name: 'subject',
|
|
8
|
-
type: 'string',
|
|
9
|
-
default: '',
|
|
10
|
-
required: true,
|
|
11
|
-
description: 'Subject of the email',
|
|
12
|
-
displayOptions: {
|
|
13
|
-
show: {
|
|
14
|
-
resource: ['person'],
|
|
15
|
-
operation: ['createMail'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
displayName: 'Email Body',
|
|
21
|
-
name: 'body',
|
|
22
|
-
type: 'string',
|
|
23
|
-
typeOptions: {
|
|
24
|
-
rows: 4,
|
|
25
|
-
},
|
|
26
|
-
default: '',
|
|
27
|
-
required: true,
|
|
28
|
-
description: 'Body content of the email',
|
|
29
|
-
displayOptions: {
|
|
30
|
-
show: {
|
|
31
|
-
resource: ['person'],
|
|
32
|
-
operation: ['createMail'],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
displayName: 'Person Details',
|
|
38
|
-
name: 'personDetails',
|
|
39
|
-
type: 'collection',
|
|
40
|
-
placeholder: 'Add Person Details',
|
|
41
|
-
default: {},
|
|
42
|
-
options: [
|
|
43
|
-
{
|
|
44
|
-
displayName: 'First Name',
|
|
45
|
-
name: 'firstName',
|
|
46
|
-
type: 'string',
|
|
47
|
-
default: '',
|
|
48
|
-
description: 'First name of the person',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
displayName: 'Last Name',
|
|
52
|
-
name: 'lastName',
|
|
53
|
-
type: 'string',
|
|
54
|
-
default: '',
|
|
55
|
-
description: 'Last name of the person',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
required: true,
|
|
59
|
-
displayOptions: {
|
|
60
|
-
show: {
|
|
61
|
-
resource: ['person'],
|
|
62
|
-
operation: ['createMail'],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
displayName: 'Organization Details',
|
|
68
|
-
name: 'organizationDetails',
|
|
69
|
-
type: 'collection',
|
|
70
|
-
placeholder: 'Add Organization Details',
|
|
71
|
-
default: {},
|
|
72
|
-
options: [
|
|
73
|
-
{
|
|
74
|
-
displayName: 'Name',
|
|
75
|
-
name: 'name',
|
|
76
|
-
type: 'string',
|
|
77
|
-
default: '',
|
|
78
|
-
description: 'Name of the organization',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
displayName: 'City',
|
|
82
|
-
name: 'city',
|
|
83
|
-
type: 'string',
|
|
84
|
-
default: '',
|
|
85
|
-
description: 'City of the organization',
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
required: true,
|
|
89
|
-
displayOptions: {
|
|
90
|
-
show: {
|
|
91
|
-
resource: ['person'],
|
|
92
|
-
operation: ['createMail'],
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
];
|
|
97
|
-
|
|
98
|
-
export async function execute(this: IExecuteFunctions, { i }: { i: number }) {
|
|
99
|
-
const subject = this.getNodeParameter('subject', i) as string;
|
|
100
|
-
const body = this.getNodeParameter('body', i) as string;
|
|
101
|
-
const personDetails = this.getNodeParameter('personDetails', i) as {
|
|
102
|
-
firstName: string;
|
|
103
|
-
lastName: string;
|
|
104
|
-
};
|
|
105
|
-
const organizationDetails = this.getNodeParameter('organizationDetails', i) as {
|
|
106
|
-
name: string;
|
|
107
|
-
city: string;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const mutation = `
|
|
111
|
-
mutation ($input: CreateMailInput!) {
|
|
112
|
-
createMail(input: $input) {
|
|
113
|
-
mailId
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
const input = {
|
|
119
|
-
email: {
|
|
120
|
-
subject,
|
|
121
|
-
body,
|
|
122
|
-
},
|
|
123
|
-
person: {
|
|
124
|
-
firstName: personDetails.firstName,
|
|
125
|
-
lastName: personDetails.lastName,
|
|
126
|
-
},
|
|
127
|
-
organization: {
|
|
128
|
-
name: organizationDetails.name,
|
|
129
|
-
city: organizationDetails.city,
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const variables = { input };
|
|
134
|
-
const responseData = await graphqlRequest.call(this, mutation, variables);
|
|
135
|
-
|
|
136
|
-
return responseData.createMail;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Add an export to ensure TypeScript recognizes this as a module
|
|
140
|
-
export default {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { graphqlRequest } from '../../transport/graphqlRequest';
|
|
3
|
-
import { personFields } from './personFields';
|
|
4
|
-
|
|
5
|
-
export const description: INodeProperties[] = [
|
|
6
|
-
{
|
|
7
|
-
displayName: 'Person ID',
|
|
8
|
-
name: 'id',
|
|
9
|
-
type: 'string',
|
|
10
|
-
default: '',
|
|
11
|
-
required: true,
|
|
12
|
-
displayOptions: {
|
|
13
|
-
show: {
|
|
14
|
-
resource: ['person'],
|
|
15
|
-
operation: ['get'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
description: 'The ID of the person to retrieve',
|
|
19
|
-
},
|
|
20
|
-
...personFields,
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
export async function execute(this: IExecuteFunctions, { i }: { i: number }) {
|
|
24
|
-
const id = this.getNodeParameter('id', i) as string;
|
|
25
|
-
const returnFields = this.getNodeParameter('returnFields', i) as string[];
|
|
26
|
-
const includeEmployer = this.getNodeParameter('includeEmployer', i) as boolean;
|
|
27
|
-
|
|
28
|
-
let fieldsToReturn = [...returnFields];
|
|
29
|
-
|
|
30
|
-
// Add employer details if requested
|
|
31
|
-
if (includeEmployer) {
|
|
32
|
-
const employerFields = this.getNodeParameter('employerFields', i) as string[];
|
|
33
|
-
fieldsToReturn.push(`employer { ${employerFields.join(' ')} }`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const query = `
|
|
37
|
-
query ($id: ID!) {
|
|
38
|
-
person(id: $id) {
|
|
39
|
-
${fieldsToReturn.join('\n')}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
const variables = { id };
|
|
45
|
-
const responseData = await graphqlRequest.call(this, query, variables);
|
|
46
|
-
|
|
47
|
-
return responseData.person;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Add an export to ensure TypeScript recognizes this as a module
|
|
51
|
-
export default {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { INodeProperties } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
import * as get from './get.operation';
|
|
4
|
-
import * as search from './search.operation';
|
|
5
|
-
import * as update from './update.operation';
|
|
6
|
-
import * as createMail from './createMail.operation';
|
|
7
|
-
|
|
8
|
-
export const person = {
|
|
9
|
-
description: [
|
|
10
|
-
{
|
|
11
|
-
displayName: 'Operation',
|
|
12
|
-
name: 'operation',
|
|
13
|
-
type: 'options',
|
|
14
|
-
noDataExpression: true,
|
|
15
|
-
displayOptions: {
|
|
16
|
-
show: {
|
|
17
|
-
resource: ['person'],
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
options: [
|
|
21
|
-
{
|
|
22
|
-
name: 'Get',
|
|
23
|
-
value: 'get',
|
|
24
|
-
description: 'Get a specific person by ID',
|
|
25
|
-
action: 'Get a person by ID',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'Search',
|
|
29
|
-
value: 'search',
|
|
30
|
-
description: 'Search for persons',
|
|
31
|
-
action: 'Search persons',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'Update',
|
|
35
|
-
value: 'update',
|
|
36
|
-
description: 'Update a person',
|
|
37
|
-
action: 'Update a person',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'Create Mail',
|
|
41
|
-
value: 'createMail',
|
|
42
|
-
description: 'Add an email as a note',
|
|
43
|
-
action: 'Create mail note',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
default: 'get',
|
|
47
|
-
},
|
|
48
|
-
...get.description,
|
|
49
|
-
...search.description,
|
|
50
|
-
...update.description,
|
|
51
|
-
...createMail.description,
|
|
52
|
-
] as INodeProperties[],
|
|
53
|
-
execute: async function (this: any, { i }: { i: number }) {
|
|
54
|
-
const operation = this.getNodeParameter('operation', i) as string;
|
|
55
|
-
|
|
56
|
-
switch (operation) {
|
|
57
|
-
case 'get':
|
|
58
|
-
return await get.execute.call(this, { i });
|
|
59
|
-
case 'search':
|
|
60
|
-
return await search.execute.call(this, { i });
|
|
61
|
-
case 'update':
|
|
62
|
-
return await update.execute.call(this, { i });
|
|
63
|
-
case 'createMail':
|
|
64
|
-
return await createMail.execute.call(this, { i });
|
|
65
|
-
default:
|
|
66
|
-
throw new Error(`The operation "${operation}" is not supported!`);
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { INodeProperties } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
export const personFields: INodeProperties[] = [
|
|
4
|
-
{
|
|
5
|
-
displayName: 'Return Fields',
|
|
6
|
-
name: 'returnFields',
|
|
7
|
-
type: 'multiOptions',
|
|
8
|
-
options: [
|
|
9
|
-
{
|
|
10
|
-
name: 'ID',
|
|
11
|
-
value: 'id',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'Name',
|
|
15
|
-
value: 'name',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: 'Email',
|
|
19
|
-
value: 'email',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'Phone Number',
|
|
23
|
-
value: 'phoneNumber',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'Employer Name',
|
|
27
|
-
value: 'employerName',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Position',
|
|
31
|
-
value: 'position',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'Tags',
|
|
35
|
-
value: 'tags',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'Currently Employed',
|
|
39
|
-
value: 'currentlyEmployed',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'Email Consent',
|
|
43
|
-
value: 'emailConsent',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'Custom Fields',
|
|
47
|
-
value: 'customFields { title type value }',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
default: ['id', 'name', 'email'],
|
|
51
|
-
description: 'The fields to return',
|
|
52
|
-
displayOptions: {
|
|
53
|
-
show: {
|
|
54
|
-
resource: ['person'],
|
|
55
|
-
operation: ['get', 'search', 'update'],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
displayName: 'Include Employer Details',
|
|
61
|
-
name: 'includeEmployer',
|
|
62
|
-
type: 'boolean',
|
|
63
|
-
default: false,
|
|
64
|
-
description: 'Whether to include detailed employer information',
|
|
65
|
-
displayOptions: {
|
|
66
|
-
show: {
|
|
67
|
-
resource: ['person'],
|
|
68
|
-
operation: ['get', 'search'],
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
displayName: 'Employer Fields',
|
|
74
|
-
name: 'employerFields',
|
|
75
|
-
type: 'multiOptions',
|
|
76
|
-
options: [
|
|
77
|
-
{
|
|
78
|
-
name: 'ID',
|
|
79
|
-
value: 'id',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: 'Name',
|
|
83
|
-
value: 'name',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'City',
|
|
87
|
-
value: 'city',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'Email',
|
|
91
|
-
value: 'email',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'Phone Number',
|
|
95
|
-
value: 'phoneNumber',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: 'Organization Number',
|
|
99
|
-
value: 'organizationNumber',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: 'Tags',
|
|
103
|
-
value: 'tags',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: 'Temperature',
|
|
107
|
-
value: 'temperature',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'Customer Relation',
|
|
111
|
-
value: 'customerRelation',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: 'Responsible Coworker',
|
|
115
|
-
value: 'responsibleCoworker { id name email phoneNumber }',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: 'Custom Fields',
|
|
119
|
-
value: 'customFields { title type value }',
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
default: ['id', 'name'],
|
|
123
|
-
description: 'The employer fields to return',
|
|
124
|
-
displayOptions: {
|
|
125
|
-
show: {
|
|
126
|
-
resource: ['person'],
|
|
127
|
-
operation: ['get', 'search'],
|
|
128
|
-
includeEmployer: [true],
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
];
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { graphqlRequest } from '../../transport/graphqlRequest';
|
|
3
|
-
import { personFields } from './personFields';
|
|
4
|
-
|
|
5
|
-
export const description: INodeProperties[] = [
|
|
6
|
-
{
|
|
7
|
-
displayName: 'Search Query',
|
|
8
|
-
name: 'query',
|
|
9
|
-
type: 'string',
|
|
10
|
-
default: '',
|
|
11
|
-
placeholder: 'anna.johansson@lundalogik.se',
|
|
12
|
-
description: 'Searches in person name, email, or employer name',
|
|
13
|
-
displayOptions: {
|
|
14
|
-
show: {
|
|
15
|
-
resource: ['person'],
|
|
16
|
-
operation: ['search'],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
displayName: 'Limit',
|
|
22
|
-
name: 'limit',
|
|
23
|
-
type: 'number',
|
|
24
|
-
default: 10,
|
|
25
|
-
description: 'Max number of results to return (max: 20)',
|
|
26
|
-
typeOptions: {
|
|
27
|
-
minValue: 1,
|
|
28
|
-
maxValue: 20,
|
|
29
|
-
},
|
|
30
|
-
displayOptions: {
|
|
31
|
-
show: {
|
|
32
|
-
resource: ['person'],
|
|
33
|
-
operation: ['search'],
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
displayName: 'Offset',
|
|
39
|
-
name: 'offset',
|
|
40
|
-
type: 'number',
|
|
41
|
-
default: 0,
|
|
42
|
-
description: 'Number of results to skip',
|
|
43
|
-
displayOptions: {
|
|
44
|
-
show: {
|
|
45
|
-
resource: ['person'],
|
|
46
|
-
operation: ['search'],
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
...personFields,
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
export async function execute(this: IExecuteFunctions, { i }: { i: number }) {
|
|
54
|
-
const query = this.getNodeParameter('query', i) as string;
|
|
55
|
-
const limit = this.getNodeParameter('limit', i) as number;
|
|
56
|
-
const offset = this.getNodeParameter('offset', i) as number;
|
|
57
|
-
const returnFields = this.getNodeParameter('returnFields', i) as string[];
|
|
58
|
-
const includeEmployer = this.getNodeParameter('includeEmployer', i) as boolean;
|
|
59
|
-
|
|
60
|
-
let fieldsToReturn = [...returnFields];
|
|
61
|
-
|
|
62
|
-
// Add employer details if requested
|
|
63
|
-
if (includeEmployer) {
|
|
64
|
-
const employerFields = this.getNodeParameter('employerFields', i) as string[];
|
|
65
|
-
fieldsToReturn.push(`employer { ${employerFields.join(' ')} }`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const graphqlQuery = `
|
|
69
|
-
query ($query: String, $first: Int!, $offset: Int!) {
|
|
70
|
-
persons(query: $query, first: $first, offset: $offset) {
|
|
71
|
-
${fieldsToReturn.join('\n')}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
75
|
-
|
|
76
|
-
const variables = {
|
|
77
|
-
query,
|
|
78
|
-
first: limit,
|
|
79
|
-
offset,
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const responseData = await graphqlRequest.call(this, graphqlQuery, variables);
|
|
83
|
-
|
|
84
|
-
return responseData.persons;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Add an export to ensure TypeScript recognizes this as a module
|
|
88
|
-
export default {};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { graphqlRequest } from '../../transport/graphqlRequest';
|
|
3
|
-
import { personFields } from './personFields';
|
|
4
|
-
|
|
5
|
-
export const description: INodeProperties[] = [
|
|
6
|
-
{
|
|
7
|
-
displayName: 'Person ID',
|
|
8
|
-
name: 'id',
|
|
9
|
-
type: 'string',
|
|
10
|
-
default: '',
|
|
11
|
-
required: true,
|
|
12
|
-
description: 'ID of the person to update',
|
|
13
|
-
displayOptions: {
|
|
14
|
-
show: {
|
|
15
|
-
resource: ['person'],
|
|
16
|
-
operation: ['update'],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
displayName: 'Update Fields',
|
|
22
|
-
name: 'updateFields',
|
|
23
|
-
type: 'collection',
|
|
24
|
-
placeholder: 'Add Field',
|
|
25
|
-
default: {},
|
|
26
|
-
options: [
|
|
27
|
-
{
|
|
28
|
-
displayName: 'Email',
|
|
29
|
-
name: 'email',
|
|
30
|
-
type: 'string',
|
|
31
|
-
default: '',
|
|
32
|
-
description: 'Email address of the person',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
displayName: 'Email Consent',
|
|
36
|
-
name: 'emailConsent',
|
|
37
|
-
type: 'boolean',
|
|
38
|
-
default: false,
|
|
39
|
-
description: 'Whether the person has given consent to receive emails',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
displayName: 'Tags',
|
|
43
|
-
name: 'tags',
|
|
44
|
-
type: 'string',
|
|
45
|
-
default: '',
|
|
46
|
-
placeholder: 'tag1,tag2',
|
|
47
|
-
description: 'Comma-separated tags to add to the person',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
displayName: 'Remove Tags',
|
|
51
|
-
name: 'removeTags',
|
|
52
|
-
type: 'string',
|
|
53
|
-
default: '',
|
|
54
|
-
placeholder: 'tag1,tag2',
|
|
55
|
-
description: 'Comma-separated tags to remove from the person',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
displayOptions: {
|
|
59
|
-
show: {
|
|
60
|
-
resource: ['person'],
|
|
61
|
-
operation: ['update'],
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
...personFields,
|
|
66
|
-
];
|
|
67
|
-
|
|
68
|
-
export async function execute(this: IExecuteFunctions, { i }: { i: number }) {
|
|
69
|
-
const id = this.getNodeParameter('id', i) as string;
|
|
70
|
-
const updateFields = this.getNodeParameter('updateFields', i) as {
|
|
71
|
-
email?: string;
|
|
72
|
-
emailConsent?: boolean;
|
|
73
|
-
tags?: string;
|
|
74
|
-
removeTags?: string;
|
|
75
|
-
};
|
|
76
|
-
const returnFields = this.getNodeParameter('returnFields', i) as string[];
|
|
77
|
-
|
|
78
|
-
// Prepare input for GraphQL mutation
|
|
79
|
-
const input: Record<string, any> = {
|
|
80
|
-
id,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// Add optional fields if provided
|
|
84
|
-
if (updateFields.email !== undefined) {
|
|
85
|
-
input.email = updateFields.email;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (updateFields.emailConsent !== undefined) {
|
|
89
|
-
input.emailConsent = updateFields.emailConsent;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Handle tags
|
|
93
|
-
const tags: Record<string, any> = {};
|
|
94
|
-
if (updateFields.tags) {
|
|
95
|
-
tags.addTags = updateFields.tags.split(',').map(tag => tag.trim());
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (updateFields.removeTags) {
|
|
99
|
-
tags.removeTags = updateFields.removeTags.split(',').map(tag => tag.trim());
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (Object.keys(tags).length > 0) {
|
|
103
|
-
input.tags = tags;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Execute GraphQL mutation
|
|
107
|
-
const mutation = `
|
|
108
|
-
mutation ($input: UpdatePersonInput!) {
|
|
109
|
-
updatePerson(input: $input) {
|
|
110
|
-
${returnFields.join('\n')}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
`;
|
|
114
|
-
|
|
115
|
-
const variables = { input };
|
|
116
|
-
const responseData = await graphqlRequest.call(this, mutation, variables);
|
|
117
|
-
|
|
118
|
-
return responseData.updatePerson;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Add an export to ensure TypeScript recognizes this as a module
|
|
122
|
-
export default {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 1025 1025" xmlns="http://www.w3.org/2000/svg" xml:space="preserve"><clipPath id="a"><path d="M.356.03h1024v1024H.356z"/></clipPath><g clip-path="url(#a)"><path d="M92.755 480.888c0-257.059 208.718-465.779 465.779-465.779 257.102 0 465.822 208.72 465.822 465.779 0 133.713-55.806 271.139-193.404 385.355-166.779 138.45-390.389 157.35-736.149 134.525-102.653-6.785-117.502-24.319-64.469-63.444 166.694-123.047 62.421-217.167 62.421-456.436Z" style="fill:#bee034"/><clipPath id="b"><path d="M92.755 480.888c0-257.059 208.718-465.779 465.779-465.779 257.102 0 465.822 208.72 465.822 465.779 0 133.713-55.806 271.139-193.404 385.355-166.779 138.45-390.389 157.35-736.149 134.525-102.653-6.785-117.502-24.319-64.469-63.444 166.694-123.047 62.421-217.167 62.421-456.436Z"/></clipPath><g clip-path="url(#b)"><path d="M1091.82-224.97c797.25 0 797.25 2059 0 2059-797.243 0-628.543-457.19-628.543-1185.86 0-728.671-168.7-873.142 628.543-873.142Z" style="fill:#feb000;filter:blur(200px)"/></g><path d="m879.165 486.306 29.353 32.597c9.984 11.051 27.094 11.947 38.187 1.963 11.092-9.984 11.946-27.092 1.963-38.186l-72.575-80.51a27.05 27.05 0 0 0-20.095-8.916 27.028 27.028 0 0 0-20.054 8.916l-72.616 80.51c-9.983 11.094-9.088 28.202 2.005 38.186 11.051 9.984 28.159 9.088 38.143-1.963l29.311-32.553c-2.089 142.033-112.337 258.04-251.982 269.176-12.756 1.024-22.271 12.203-21.247 24.917.981 12.758 12.159 22.272 24.916 21.248 163.494-13.056 292.6-149.032 294.691-315.385ZM446.707 676.211c-35.071-20.267-79.954-8.235-100.221 26.836-20.223 35.072-8.192 79.955 26.879 100.222 35.071 20.224 79.955 8.192 100.222-26.837 20.224-35.071 8.192-79.997-26.88-100.221Z" style="fill:#fff"/></g></svg>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
export async function graphqlRequest(
|
|
4
|
-
this: IExecuteFunctions,
|
|
5
|
-
query: string,
|
|
6
|
-
variables?: object,
|
|
7
|
-
) {
|
|
8
|
-
const response = await this.helpers.requestWithAuthentication.call(
|
|
9
|
-
this,
|
|
10
|
-
'limeGoApi',
|
|
11
|
-
{
|
|
12
|
-
method: 'POST',
|
|
13
|
-
url: 'https://api.lime-go.com/v1/graphql',
|
|
14
|
-
headers: {
|
|
15
|
-
'Content-Type': 'application/json',
|
|
16
|
-
},
|
|
17
|
-
body: {
|
|
18
|
-
query,
|
|
19
|
-
variables,
|
|
20
|
-
},
|
|
21
|
-
json: true,
|
|
22
|
-
},
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
if (response.errors) {
|
|
26
|
-
throw new Error(`GraphQL request failed: ${JSON.stringify(response.errors)}`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return response.data;
|
|
30
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"target": "es2019",
|
|
7
|
-
"lib": ["es2019", "es2020", "es2022"],
|
|
8
|
-
"removeComments": true,
|
|
9
|
-
"useUnknownInCatchVariables": false,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"noImplicitAny": true,
|
|
12
|
-
"noImplicitReturns": true,
|
|
13
|
-
"noUnusedLocals": true,
|
|
14
|
-
"strictNullChecks": true,
|
|
15
|
-
"preserveConstEnums": true,
|
|
16
|
-
"esModuleInterop": true,
|
|
17
|
-
"resolveJsonModule": true,
|
|
18
|
-
"incremental": true,
|
|
19
|
-
"declaration": true,
|
|
20
|
-
"sourceMap": true,
|
|
21
|
-
"skipLibCheck": true,
|
|
22
|
-
"outDir": "./dist/",
|
|
23
|
-
},
|
|
24
|
-
"include": [
|
|
25
|
-
"credentials/**/*",
|
|
26
|
-
"nodes/**/*",
|
|
27
|
-
"nodes/**/*.json",
|
|
28
|
-
"package.json",
|
|
29
|
-
],
|
|
30
|
-
}
|