@limetech/n8n-nodes-lime 0.4.0 → 0.5.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/.prettierignore +3 -1
- package/CHANGELOG.md +93 -0
- package/README.md +1 -8
- package/credentials/LimeCrmApi.credentials.ts +6 -6
- package/docker-compose.yml +9 -3
- package/nodes/fortnox/Fortnox.node.ts +3 -3
- package/nodes/fortnox/FortnoxTrigger.node.ts +2 -2
- package/nodes/lime-crm/LimeCrmNode.node.ts +54 -67
- package/nodes/lime-crm/LimeCrmTrigger.node.ts +17 -24
- package/nodes/lime-crm/commons/constants.ts +2 -3
- package/nodes/lime-crm/commons/files.ts +162 -0
- package/nodes/lime-crm/commons/index.ts +4 -4
- package/nodes/lime-crm/commons/webhook.ts +15 -3
- package/nodes/lime-crm/methods/getLimetypeProperties.ts +67 -0
- package/nodes/lime-crm/methods/getLimetypes.ts +21 -0
- package/nodes/lime-crm/methods/index.ts +6 -2
- package/nodes/lime-crm/model.ts +22 -0
- package/nodes/lime-crm/resources/data/index.ts +80 -0
- package/nodes/lime-crm/resources/{limeObject/operations/create.operation.ts → data/operations/createSingleObject.ts} +53 -30
- package/nodes/lime-crm/resources/{limeObject/operations/delete.operation.ts → data/operations/deleteSingleObject.ts} +15 -15
- package/nodes/lime-crm/resources/data/operations/getManyObjects.ts +356 -0
- package/nodes/lime-crm/resources/data/operations/getSingleFile.ts +138 -0
- package/nodes/lime-crm/resources/data/operations/getSingleObject.ts +83 -0
- package/nodes/lime-crm/resources/{limeObject/operations/update.operation.ts → data/operations/updateSingleObject.operation.ts} +51 -23
- package/nodes/lime-crm/resources/erpConnector/index.ts +3 -3
- package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +14 -14
- package/nodes/lime-crm/resources/erpConnector/transform.ts +3 -3
- package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +2 -2
- package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +8 -8
- package/nodes/lime-crm/resources/metadata/index.ts +57 -0
- package/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.ts +18 -0
- package/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.ts +130 -0
- package/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.ts +36 -0
- package/nodes/lime-crm/transport/commons.ts +14 -2
- package/nodes/lime-crm/transport/files.ts +155 -0
- package/nodes/lime-crm/transport/index.ts +14 -7
- package/nodes/lime-crm/transport/limeQuery.ts +2 -4
- package/nodes/lime-crm/transport/limeobjects.ts +79 -44
- package/nodes/lime-crm/transport/limetypes.ts +80 -24
- package/package.json +4 -3
- package/restore_script/README +42 -0
- package/restore_script/api_key_download.txt +0 -0
- package/restore_script/api_key_upload.txt +0 -0
- package/restore_script/cli.py +73 -0
- package/restore_script/download.py +73 -0
- package/restore_script/main.py +19 -0
- package/restore_script/poetry.lock +162 -0
- package/restore_script/pyproject.toml +15 -0
- package/restore_script/transfer.py +41 -0
- package/restore_script/upload.py +66 -0
- package/restore_script/utils.py +42 -0
- package/tests/transform.spec.ts +6 -6
- package/nodes/lime-crm/commons/limetype.ts +0 -11
- package/nodes/lime-crm/methods/getLimeTypeProperties.ts +0 -27
- package/nodes/lime-crm/methods/getLimeTypes.ts +0 -23
- package/nodes/lime-crm/resources/limeObject/index.ts +0 -64
- package/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.ts +0 -112
- package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +0 -54
- package/nodes/lime-crm/resources/limeQuery/index.ts +0 -40
- package/nodes/lime-crm/resources/limeQuery/operations/query.operation.ts +0 -222
- package/nodes/lime-crm/resources/limeType/index.ts +0 -58
- package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +0 -42
- package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +0 -36
- package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +0 -18
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IExecuteFunctions,
|
|
3
|
-
INodeProperties,
|
|
4
|
-
NodePropertyTypes,
|
|
5
|
-
} from 'n8n-workflow';
|
|
6
|
-
|
|
7
|
-
import * as create from './operations/create.operation';
|
|
8
|
-
import * as get from './operations/get.operation';
|
|
9
|
-
import * as update from './operations/update.operation';
|
|
10
|
-
import * as delete_ from './operations/delete.operation';
|
|
11
|
-
import * as fetchMany from './operations/fetchMany.operation';
|
|
12
|
-
|
|
13
|
-
import { LIMEOBJECT_RESOURCE } from '../../commons';
|
|
14
|
-
|
|
15
|
-
export const limeObjectFields: INodeProperties[] = [
|
|
16
|
-
{
|
|
17
|
-
displayName: 'Operation',
|
|
18
|
-
name: 'operation',
|
|
19
|
-
type: 'options' as NodePropertyTypes,
|
|
20
|
-
noDataExpression: true,
|
|
21
|
-
displayOptions: {
|
|
22
|
-
show: {
|
|
23
|
-
resource: [LIMEOBJECT_RESOURCE],
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
options: [
|
|
27
|
-
create.description,
|
|
28
|
-
get.description,
|
|
29
|
-
update.description,
|
|
30
|
-
delete_.description,
|
|
31
|
-
fetchMany.description,
|
|
32
|
-
],
|
|
33
|
-
default: 'fetchMany',
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
...create.properties,
|
|
37
|
-
...get.properties,
|
|
38
|
-
...update.properties,
|
|
39
|
-
...delete_.properties,
|
|
40
|
-
...fetchMany.properties,
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
export async function limeObjectOperations(
|
|
44
|
-
this: IExecuteFunctions,
|
|
45
|
-
{ operation, i }: { operation: string; i: number }
|
|
46
|
-
) {
|
|
47
|
-
if (operation === 'create') {
|
|
48
|
-
return await create.execute.call(this, i);
|
|
49
|
-
}
|
|
50
|
-
if (operation === 'get') {
|
|
51
|
-
return await get.execute.call(this, i);
|
|
52
|
-
}
|
|
53
|
-
if (operation === 'update') {
|
|
54
|
-
return await update.execute.call(this, i);
|
|
55
|
-
}
|
|
56
|
-
if (operation === 'delete') {
|
|
57
|
-
return await delete_.execute.call(this, i);
|
|
58
|
-
}
|
|
59
|
-
if (operation === 'fetchMany') {
|
|
60
|
-
return await fetchMany.execute.call(this, i);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { fetchManyLimeObjects } from '../../../transport';
|
|
3
|
-
import { LIMEOBJECT_RESOURCE } from '../../../commons';
|
|
4
|
-
|
|
5
|
-
export const description = {
|
|
6
|
-
name: 'Fetch many',
|
|
7
|
-
value: 'fetchMany',
|
|
8
|
-
description: 'Fetch many Lime objects',
|
|
9
|
-
action: 'Fetch many objects',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const properties: INodeProperties[] = [
|
|
13
|
-
{
|
|
14
|
-
displayName: 'Lime Type',
|
|
15
|
-
name: 'limeType',
|
|
16
|
-
type: 'options',
|
|
17
|
-
typeOptions: {
|
|
18
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
19
|
-
},
|
|
20
|
-
required: true,
|
|
21
|
-
default: '',
|
|
22
|
-
description: 'The type of entity to search for',
|
|
23
|
-
displayOptions: {
|
|
24
|
-
show: {
|
|
25
|
-
resource: [LIMEOBJECT_RESOURCE],
|
|
26
|
-
operation: ['fetchMany'],
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
displayName: 'Search Term',
|
|
32
|
-
name: 'searchTerm',
|
|
33
|
-
type: 'string',
|
|
34
|
-
default: '',
|
|
35
|
-
description: 'Term to search for',
|
|
36
|
-
displayOptions: {
|
|
37
|
-
show: {
|
|
38
|
-
resource: [LIMEOBJECT_RESOURCE],
|
|
39
|
-
operation: ['fetchMany'],
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
displayName: 'Search Fields',
|
|
45
|
-
name: 'searchField',
|
|
46
|
-
type: 'options',
|
|
47
|
-
typeOptions: {
|
|
48
|
-
loadOptionsMethod: 'getLimeTypeProperties',
|
|
49
|
-
loadOptionsDependsOn: ['limeType'],
|
|
50
|
-
},
|
|
51
|
-
default: [],
|
|
52
|
-
description:
|
|
53
|
-
'Fields to search in. If none selected, searches across all searchable fields',
|
|
54
|
-
displayOptions: {
|
|
55
|
-
show: {
|
|
56
|
-
resource: [LIMEOBJECT_RESOURCE],
|
|
57
|
-
operation: ['fetchMany'],
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
displayName: 'Limit',
|
|
63
|
-
name: 'limit',
|
|
64
|
-
type: 'number',
|
|
65
|
-
default: 50,
|
|
66
|
-
description: 'Max number of results to return',
|
|
67
|
-
typeOptions: {
|
|
68
|
-
minValue: 1,
|
|
69
|
-
},
|
|
70
|
-
displayOptions: {
|
|
71
|
-
show: {
|
|
72
|
-
resource: [LIMEOBJECT_RESOURCE],
|
|
73
|
-
operation: ['fetchMany'],
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
displayName: 'Offset',
|
|
79
|
-
name: 'offset',
|
|
80
|
-
type: 'number',
|
|
81
|
-
default: 0,
|
|
82
|
-
description: 'Offset to first object to return',
|
|
83
|
-
typeOptions: {
|
|
84
|
-
minValue: 0,
|
|
85
|
-
},
|
|
86
|
-
displayOptions: {
|
|
87
|
-
show: {
|
|
88
|
-
resource: [LIMEOBJECT_RESOURCE],
|
|
89
|
-
operation: ['fetchMany'],
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
];
|
|
94
|
-
|
|
95
|
-
export async function execute(this: IExecuteFunctions, i: number) {
|
|
96
|
-
const limeType = this.getNodeParameter('limeType', i) as string;
|
|
97
|
-
const searchTerm = this.getNodeParameter('searchTerm', i, '') as string;
|
|
98
|
-
const searchField = this.getNodeParameter('searchField', i) as string;
|
|
99
|
-
const limit = this.getNodeParameter('limit', i, 50);
|
|
100
|
-
const offset = this.getNodeParameter('offset', i, 0) as number;
|
|
101
|
-
const options = this.getNodeParameter('options', i, {});
|
|
102
|
-
|
|
103
|
-
return await fetchManyLimeObjects(
|
|
104
|
-
this,
|
|
105
|
-
limeType,
|
|
106
|
-
searchField,
|
|
107
|
-
searchTerm,
|
|
108
|
-
limit,
|
|
109
|
-
offset,
|
|
110
|
-
(options.sortField as string) || null
|
|
111
|
-
);
|
|
112
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
import { getLimeObject } from '../../../transport';
|
|
4
|
-
import { LIMEOBJECT_RESOURCE } from '../../../commons';
|
|
5
|
-
|
|
6
|
-
export const description = {
|
|
7
|
-
name: 'Get Object',
|
|
8
|
-
value: 'get',
|
|
9
|
-
description: 'Get a single object by ID',
|
|
10
|
-
action: 'Get an object',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const properties: INodeProperties[] = [
|
|
14
|
-
// Limetype selection
|
|
15
|
-
{
|
|
16
|
-
displayName: 'Lime Type',
|
|
17
|
-
name: 'limeType',
|
|
18
|
-
type: 'options',
|
|
19
|
-
typeOptions: {
|
|
20
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
21
|
-
},
|
|
22
|
-
required: true,
|
|
23
|
-
default: '',
|
|
24
|
-
description: 'The type of entity to retrieve',
|
|
25
|
-
displayOptions: {
|
|
26
|
-
show: {
|
|
27
|
-
resource: [LIMEOBJECT_RESOURCE],
|
|
28
|
-
operation: ['get'],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
// Object ID
|
|
34
|
-
{
|
|
35
|
-
displayName: 'Object ID',
|
|
36
|
-
name: 'objectId',
|
|
37
|
-
type: 'string',
|
|
38
|
-
required: true,
|
|
39
|
-
default: '',
|
|
40
|
-
description: 'The ID of the object to retrieve',
|
|
41
|
-
displayOptions: {
|
|
42
|
-
show: {
|
|
43
|
-
resource: [LIMEOBJECT_RESOURCE],
|
|
44
|
-
operation: ['get'],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
export async function execute(this: IExecuteFunctions, i: number) {
|
|
51
|
-
const limeType = this.getNodeParameter('limeType', i) as string;
|
|
52
|
-
const objectId = this.getNodeParameter('objectId', i) as string;
|
|
53
|
-
return getLimeObject(this, limeType, objectId);
|
|
54
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IExecuteFunctions,
|
|
3
|
-
INodeProperties,
|
|
4
|
-
NodePropertyTypes,
|
|
5
|
-
} from 'n8n-workflow';
|
|
6
|
-
|
|
7
|
-
import * as query from './operations/query.operation';
|
|
8
|
-
import { LIME_QUERY_RESOURCE } from '../../commons';
|
|
9
|
-
|
|
10
|
-
export const queryFields: INodeProperties[] = [
|
|
11
|
-
{
|
|
12
|
-
displayName: 'Operation',
|
|
13
|
-
name: 'operation',
|
|
14
|
-
type: 'options' as NodePropertyTypes,
|
|
15
|
-
noDataExpression: true,
|
|
16
|
-
displayOptions: {
|
|
17
|
-
show: {
|
|
18
|
-
resource: [LIME_QUERY_RESOURCE],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
options: [
|
|
22
|
-
{
|
|
23
|
-
...query.description,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
default: 'query',
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
...query.properties,
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
export async function queryOperations(
|
|
33
|
-
this: IExecuteFunctions,
|
|
34
|
-
{ operation, i }: { operation: string; i: number }
|
|
35
|
-
) {
|
|
36
|
-
if (operation === 'query') {
|
|
37
|
-
return await query.execute.call(this, i);
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
import { queryLimeObjects } from '../../../transport';
|
|
4
|
-
import { LIME_QUERY_RESOURCE } from '../../../commons';
|
|
5
|
-
|
|
6
|
-
export const description = {
|
|
7
|
-
name: 'Query',
|
|
8
|
-
value: 'query',
|
|
9
|
-
description: 'Query objects with Lime Query API',
|
|
10
|
-
action: 'Query objects',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
interface OrderByCollection {
|
|
14
|
-
orderByFields: {
|
|
15
|
-
propertyName: string;
|
|
16
|
-
sortDirection: 'ASC' | 'DESC';
|
|
17
|
-
}[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface ActiveObjectCollection {
|
|
21
|
-
activeObjectFields: {
|
|
22
|
-
limetype: string;
|
|
23
|
-
id: number;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const properties: INodeProperties[] = [
|
|
28
|
-
{
|
|
29
|
-
displayName: 'Lime Type',
|
|
30
|
-
name: 'limeType',
|
|
31
|
-
type: 'options',
|
|
32
|
-
typeOptions: {
|
|
33
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
34
|
-
},
|
|
35
|
-
required: true,
|
|
36
|
-
default: '',
|
|
37
|
-
description: 'The type of entity to query',
|
|
38
|
-
displayOptions: {
|
|
39
|
-
show: {
|
|
40
|
-
resource: [LIME_QUERY_RESOURCE],
|
|
41
|
-
operation: ['query'],
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
displayName: 'Response Format (JSON)',
|
|
47
|
-
name: 'responseFormat',
|
|
48
|
-
type: 'json',
|
|
49
|
-
required: true,
|
|
50
|
-
default: '{}',
|
|
51
|
-
description: 'Information that should be included in the response',
|
|
52
|
-
displayOptions: {
|
|
53
|
-
show: {
|
|
54
|
-
resource: [LIME_QUERY_RESOURCE],
|
|
55
|
-
operation: ['query'],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
displayName: 'Filter (JSON)',
|
|
61
|
-
name: 'filter',
|
|
62
|
-
type: 'json',
|
|
63
|
-
default: '{}',
|
|
64
|
-
description: "The filter DSL defining the query's conditions",
|
|
65
|
-
displayOptions: {
|
|
66
|
-
show: {
|
|
67
|
-
resource: [LIME_QUERY_RESOURCE],
|
|
68
|
-
operation: ['query'],
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
displayName: 'Limit',
|
|
74
|
-
name: 'limit',
|
|
75
|
-
type: 'number',
|
|
76
|
-
default: null,
|
|
77
|
-
description: 'The maximum number of records to return',
|
|
78
|
-
displayOptions: {
|
|
79
|
-
show: {
|
|
80
|
-
resource: [LIME_QUERY_RESOURCE],
|
|
81
|
-
operation: ['query'],
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
displayName: 'Order By',
|
|
87
|
-
name: 'orderBy',
|
|
88
|
-
type: 'fixedCollection',
|
|
89
|
-
typeOptions: {
|
|
90
|
-
multipleValues: true,
|
|
91
|
-
},
|
|
92
|
-
default: {},
|
|
93
|
-
description:
|
|
94
|
-
'The list of properties by which to order the query results',
|
|
95
|
-
displayOptions: {
|
|
96
|
-
show: {
|
|
97
|
-
resource: [LIME_QUERY_RESOURCE],
|
|
98
|
-
operation: ['query'],
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
options: [
|
|
102
|
-
{
|
|
103
|
-
name: 'orderByFields',
|
|
104
|
-
displayName: 'Order By Fields',
|
|
105
|
-
values: [
|
|
106
|
-
{
|
|
107
|
-
displayName: 'Property Name',
|
|
108
|
-
name: 'propertyName',
|
|
109
|
-
type: 'string',
|
|
110
|
-
description: 'Name of the property to order by',
|
|
111
|
-
default: '',
|
|
112
|
-
required: true,
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
displayName: 'Sort Direction',
|
|
116
|
-
name: 'sortDirection',
|
|
117
|
-
type: 'options',
|
|
118
|
-
default: 'ASC',
|
|
119
|
-
description: 'Ordering direction',
|
|
120
|
-
options: [
|
|
121
|
-
{ name: 'ASC', value: 'ASC' },
|
|
122
|
-
{ name: 'DESC', value: 'DESC' },
|
|
123
|
-
],
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
displayName: 'Offset',
|
|
131
|
-
name: 'offset',
|
|
132
|
-
type: 'number',
|
|
133
|
-
default: null,
|
|
134
|
-
description:
|
|
135
|
-
'The offset from which to start returning records. This operation requires the `Order By` field to be set',
|
|
136
|
-
displayOptions: {
|
|
137
|
-
show: {
|
|
138
|
-
resource: [LIME_QUERY_RESOURCE],
|
|
139
|
-
operation: ['query'],
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
displayName: 'Active Object',
|
|
145
|
-
name: 'activeObject',
|
|
146
|
-
type: 'fixedCollection',
|
|
147
|
-
default: {},
|
|
148
|
-
description:
|
|
149
|
-
"A dict with keys 'limetype' and 'id' representing the active object in the context of the query",
|
|
150
|
-
displayOptions: {
|
|
151
|
-
show: {
|
|
152
|
-
resource: [LIME_QUERY_RESOURCE],
|
|
153
|
-
operation: ['query'],
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
options: [
|
|
157
|
-
{
|
|
158
|
-
name: 'activeObjectFields',
|
|
159
|
-
displayName: 'Active Object Fields',
|
|
160
|
-
values: [
|
|
161
|
-
{
|
|
162
|
-
displayName: 'Lime Type',
|
|
163
|
-
name: 'limetype',
|
|
164
|
-
type: 'options',
|
|
165
|
-
description: 'Name of the limetype',
|
|
166
|
-
default: '',
|
|
167
|
-
typeOptions: {
|
|
168
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
169
|
-
},
|
|
170
|
-
required: true,
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
displayName: 'Lime Object ID',
|
|
174
|
-
name: 'id',
|
|
175
|
-
type: 'number',
|
|
176
|
-
default: 0,
|
|
177
|
-
description:
|
|
178
|
-
'ID representing the object in the context of the query',
|
|
179
|
-
required: true,
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
];
|
|
186
|
-
|
|
187
|
-
export async function execute(this: IExecuteFunctions, i: number) {
|
|
188
|
-
const limeType = this.getNodeParameter('limeType', i) as string;
|
|
189
|
-
const responseFormat = this.getNodeParameter('responseFormat', i) as string;
|
|
190
|
-
const filter = this.getNodeParameter('filter', i) as string;
|
|
191
|
-
const limit = this.getNodeParameter('limit', i) as number;
|
|
192
|
-
const offset = this.getNodeParameter('offset', i) as number;
|
|
193
|
-
const orderByCollection = this.getNodeParameter(
|
|
194
|
-
'orderBy',
|
|
195
|
-
i
|
|
196
|
-
) as OrderByCollection;
|
|
197
|
-
const activeObjectCollection = this.getNodeParameter(
|
|
198
|
-
'activeObject',
|
|
199
|
-
i
|
|
200
|
-
) as ActiveObjectCollection;
|
|
201
|
-
|
|
202
|
-
const orderBy =
|
|
203
|
-
orderByCollection.orderByFields &&
|
|
204
|
-
orderByCollection.orderByFields.map((field) => ({
|
|
205
|
-
[field.propertyName]: field.sortDirection,
|
|
206
|
-
}));
|
|
207
|
-
|
|
208
|
-
const q = JSON.stringify({
|
|
209
|
-
limetype: limeType,
|
|
210
|
-
responseFormat: JSON.parse(responseFormat),
|
|
211
|
-
filter: JSON.parse(filter),
|
|
212
|
-
limit: limit,
|
|
213
|
-
offset: offset,
|
|
214
|
-
orderBy: orderBy,
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
const activeObject = JSON.stringify(
|
|
218
|
-
activeObjectCollection.activeObjectFields
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
return queryLimeObjects(this, q, activeObject);
|
|
222
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IExecuteFunctions,
|
|
3
|
-
INodeProperties,
|
|
4
|
-
NodePropertyTypes,
|
|
5
|
-
} from 'n8n-workflow';
|
|
6
|
-
|
|
7
|
-
import * as getType from './operations/getType.operation';
|
|
8
|
-
import * as listTypes from './operations/listTypes.operation';
|
|
9
|
-
import * as getProperties from './operations/getProperties.operation';
|
|
10
|
-
import { LIMETYPE_RESOURCE } from '../../commons';
|
|
11
|
-
|
|
12
|
-
export const limeTypeFields: INodeProperties[] = [
|
|
13
|
-
{
|
|
14
|
-
displayName: 'Operation',
|
|
15
|
-
name: 'operation',
|
|
16
|
-
type: 'options' as NodePropertyTypes,
|
|
17
|
-
noDataExpression: true,
|
|
18
|
-
displayOptions: {
|
|
19
|
-
show: {
|
|
20
|
-
resource: [LIMETYPE_RESOURCE],
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
options: [
|
|
24
|
-
{
|
|
25
|
-
...listTypes.description,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
...getType.description,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
...getProperties.description,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
default: 'listTypes',
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
// Operation-specific fields
|
|
38
|
-
...getType.properties,
|
|
39
|
-
...getProperties.properties,
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
// Operations router
|
|
43
|
-
export async function limeTypeOperations(
|
|
44
|
-
this: IExecuteFunctions,
|
|
45
|
-
{ operation, i }: { operation: string; i: number }
|
|
46
|
-
) {
|
|
47
|
-
if (operation === 'listTypes') {
|
|
48
|
-
return await listTypes.execute.call(this);
|
|
49
|
-
}
|
|
50
|
-
if (operation === 'getType') {
|
|
51
|
-
return await getType.execute.call(this, i);
|
|
52
|
-
}
|
|
53
|
-
if (operation === 'getProperties') {
|
|
54
|
-
return await getProperties.execute.call(this, i);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
import { getProperties } from '../../../transport';
|
|
4
|
-
import { LIMETYPE_RESOURCE, LimeTypeProperty } from '../../../commons';
|
|
5
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
6
|
-
|
|
7
|
-
export const description = {
|
|
8
|
-
name: 'Get Properties',
|
|
9
|
-
value: 'getProperties',
|
|
10
|
-
description: 'Get all properties for a specific entity type',
|
|
11
|
-
action: 'Get entity type properties',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const properties: INodeProperties[] = [
|
|
15
|
-
// Limetype selection
|
|
16
|
-
{
|
|
17
|
-
displayName: 'Type Name',
|
|
18
|
-
name: 'limeType',
|
|
19
|
-
type: 'options',
|
|
20
|
-
typeOptions: {
|
|
21
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
22
|
-
},
|
|
23
|
-
required: true,
|
|
24
|
-
default: '',
|
|
25
|
-
description: 'The name of the entity type to get properties for',
|
|
26
|
-
displayOptions: {
|
|
27
|
-
show: {
|
|
28
|
-
resource: [LIMETYPE_RESOURCE],
|
|
29
|
-
operation: ['getProperties'],
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
export async function execute(
|
|
36
|
-
this: IExecuteFunctions,
|
|
37
|
-
i: number
|
|
38
|
-
): Promise<NodeResponse<LimeTypeProperty[]>> {
|
|
39
|
-
const limeType = this.getNodeParameter('limeType', i) as string;
|
|
40
|
-
|
|
41
|
-
return getProperties(this, limeType);
|
|
42
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { getLimeType } from '../../../transport/limetypes';
|
|
3
|
-
import { LIMETYPE_RESOURCE } from '../../../commons';
|
|
4
|
-
|
|
5
|
-
export const description = {
|
|
6
|
-
name: 'Get Type',
|
|
7
|
-
value: 'getType',
|
|
8
|
-
description: 'Get details about a specific entity type',
|
|
9
|
-
action: 'Get entity type details',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const properties: INodeProperties[] = [
|
|
13
|
-
{
|
|
14
|
-
displayName: 'Type Name',
|
|
15
|
-
name: 'limeType',
|
|
16
|
-
type: 'options',
|
|
17
|
-
typeOptions: {
|
|
18
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
19
|
-
},
|
|
20
|
-
required: true,
|
|
21
|
-
default: '',
|
|
22
|
-
description: 'The name of the entity type to get details for',
|
|
23
|
-
displayOptions: {
|
|
24
|
-
show: {
|
|
25
|
-
resource: [LIMETYPE_RESOURCE],
|
|
26
|
-
operation: ['getType'],
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
export async function execute(this: IExecuteFunctions, i: number) {
|
|
33
|
-
const limeType = this.getNodeParameter('limeType', i) as string;
|
|
34
|
-
|
|
35
|
-
return getLimeType(this, limeType);
|
|
36
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
import { getLimeTypesFromApi } from '../../../transport';
|
|
4
|
-
import { LimeType } from '../../../commons';
|
|
5
|
-
import { NodeResponse } from '../../../../nodeResponse';
|
|
6
|
-
|
|
7
|
-
export const description = {
|
|
8
|
-
name: 'List Types',
|
|
9
|
-
value: 'listTypes',
|
|
10
|
-
description: 'Get a list of all available entity types',
|
|
11
|
-
action: 'List all entity types',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export async function execute(
|
|
15
|
-
this: IExecuteFunctions
|
|
16
|
-
): Promise<NodeResponse<LimeType[]>> {
|
|
17
|
-
return await getLimeTypesFromApi(this);
|
|
18
|
-
}
|