@limetech/n8n-nodes-lime 0.3.2 → 0.3.4
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/.github/workflows/mark-stale.yml +21 -0
- package/CHANGELOG.md +54 -0
- package/Dockerfile +2 -2
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +10 -1
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +10 -1
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +1 -1
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +10 -1
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +10 -1
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +1 -1
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +10 -1
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +1 -1
- package/dist/nodes/fortnox/transport/index.js +5 -0
- package/dist/nodes/fortnox/transport/index.js.map +1 -1
- package/dist/nodes/lime-crm/commons/webhook.d.ts +1 -0
- package/dist/nodes/lime-crm/commons/webhook.js +1 -0
- package/dist/nodes/lime-crm/commons/webhook.js.map +1 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +18 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +1 -1
- package/dist/nodes/lime-crm/transport/commons.d.ts +1 -1
- package/dist/nodes/lime-crm/transport/commons.js +1 -0
- package/dist/nodes/lime-crm/transport/commons.js.map +1 -1
- package/dist/nodes/lime-crm/transport/limeobjects.d.ts +5 -5
- package/dist/nodes/lime-crm/transport/limeobjects.js +106 -22
- package/dist/nodes/lime-crm/transport/limeobjects.js.map +1 -1
- package/dist/nodes/lime-crm/transport/limetypes.js +17 -2
- package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -1
- package/dist/nodes/lime-crm/transport/webhooks.js +11 -1
- package/dist/nodes/lime-crm/transport/webhooks.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/nodes/fortnox/resources/customers/operations/delete.operation.ts +11 -1
- package/nodes/fortnox/resources/customers/operations/get.operation.ts +11 -1
- package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +1 -1
- package/nodes/fortnox/resources/customers/operations/update.operation.ts +11 -1
- package/nodes/fortnox/resources/invoice/operations/get.operation.ts +11 -1
- package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +1 -1
- package/nodes/fortnox/resources/invoice/operations/update.operation.ts +11 -1
- package/nodes/fortnox/transport/index.ts +5 -0
- package/nodes/lime-crm/commons/webhook.ts +2 -0
- package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +19 -6
- package/nodes/lime-crm/transport/commons.ts +2 -1
- package/nodes/lime-crm/transport/limeobjects.ts +141 -29
- package/nodes/lime-crm/transport/limetypes.ts +19 -2
- package/nodes/lime-crm/transport/webhooks.ts +12 -1
- package/package.json +1 -1
- package/dist/credentials/LimeGoApi.credentials.d.ts +0 -15
- package/dist/credentials/LimeGoApi.credentials.js +0 -32
- package/dist/credentials/LimeGoApi.credentials.js.map +0 -1
- package/dist/nodes/LimeCrm/GenericTypes.d.ts +0 -80
- package/dist/nodes/LimeCrm/GenericTypes.js +0 -7
- package/dist/nodes/LimeCrm/GenericTypes.js.map +0 -1
- package/dist/nodes/LimeCrm/LimeCrmNode.node.d.ts +0 -17
- package/dist/nodes/LimeCrm/LimeCrmNode.node.js +0 -114
- package/dist/nodes/LimeCrm/LimeCrmNode.node.js.map +0 -1
- package/dist/nodes/LimeCrm/LimeCrmTrigger/LimeCrmTrigger.node.d.ts +0 -17
- package/dist/nodes/LimeCrm/LimeCrmTrigger/LimeCrmTrigger.node.js +0 -408
- package/dist/nodes/LimeCrm/LimeCrmTrigger/LimeCrmTrigger.node.js.map +0 -1
- package/dist/nodes/LimeCrm/LimeCrmTrigger.node.d.ts +0 -17
- package/dist/nodes/LimeCrm/LimeCrmTrigger.node.js +0 -439
- package/dist/nodes/LimeCrm/LimeCrmTrigger.node.js.map +0 -1
- package/dist/nodes/LimeCrm/lime-crm.svg +0 -1
- package/dist/nodes/LimeCrm/methods/getAllSortableFields.d.ts +0 -7
- package/dist/nodes/LimeCrm/methods/getAllSortableFields.js +0 -53
- package/dist/nodes/LimeCrm/methods/getAllSortableFields.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/getLimeTypeProperties.d.ts +0 -3
- package/dist/nodes/LimeCrm/methods/getLimeTypeProperties.js +0 -40
- package/dist/nodes/LimeCrm/methods/getLimeTypeProperties.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/getLimeTypeRelations.d.ts +0 -7
- package/dist/nodes/LimeCrm/methods/getLimeTypeRelations.js +0 -30
- package/dist/nodes/LimeCrm/methods/getLimeTypeRelations.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/getLimeTypes.d.ts +0 -3
- package/dist/nodes/LimeCrm/methods/getLimeTypes.js +0 -33
- package/dist/nodes/LimeCrm/methods/getLimeTypes.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/getRelatedTypeProperties.d.ts +0 -7
- package/dist/nodes/LimeCrm/methods/getRelatedTypeProperties.js +0 -39
- package/dist/nodes/LimeCrm/methods/getRelatedTypeProperties.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/index.d.ts +0 -5
- package/dist/nodes/LimeCrm/methods/index.js +0 -14
- package/dist/nodes/LimeCrm/methods/index.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/commonFields.d.ts +0 -4
- package/dist/nodes/LimeCrm/resources/limeObject/commonFields.js +0 -165
- package/dist/nodes/LimeCrm/resources/limeObject/commonFields.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/index.d.ts +0 -6
- package/dist/nodes/LimeCrm/resources/limeObject/index.js +0 -79
- package/dist/nodes/LimeCrm/resources/limeObject/index.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/common.operation.d.ts +0 -2
- package/dist/nodes/LimeCrm/resources/limeObject/operations/common.operation.js +0 -36
- package/dist/nodes/LimeCrm/resources/limeObject/operations/common.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/create.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/create.operation.js +0 -234
- package/dist/nodes/LimeCrm/resources/limeObject/operations/create.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/delete.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/delete.operation.js +0 -136
- package/dist/nodes/LimeCrm/resources/limeObject/operations/delete.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/get.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/get.operation.js +0 -125
- package/dist/nodes/LimeCrm/resources/limeObject/operations/get.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/getAll.operation.d.ts +0 -3
- package/dist/nodes/LimeCrm/resources/limeObject/operations/getAll.operation.js +0 -212
- package/dist/nodes/LimeCrm/resources/limeObject/operations/getAll.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/search.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/search.operation.js +0 -232
- package/dist/nodes/LimeCrm/resources/limeObject/operations/search.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/update.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/update.operation.js +0 -186
- package/dist/nodes/LimeCrm/resources/limeObject/operations/update.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/index.d.ts +0 -6
- package/dist/nodes/LimeCrm/resources/limeType/index.js +0 -81
- package/dist/nodes/LimeCrm/resources/limeType/index.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/operations/getProperties.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeType/operations/getProperties.operation.js +0 -112
- package/dist/nodes/LimeCrm/resources/limeType/operations/getProperties.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/operations/getRelations.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeType/operations/getRelations.operation.js +0 -112
- package/dist/nodes/LimeCrm/resources/limeType/operations/getRelations.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/operations/getType.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeType/operations/getType.operation.js +0 -70
- package/dist/nodes/LimeCrm/resources/limeType/operations/getType.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/operations/listTypes.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeType/operations/listTypes.operation.js +0 -86
- package/dist/nodes/LimeCrm/resources/limeType/operations/listTypes.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/queryApi/index.d.ts +0 -6
- package/dist/nodes/LimeCrm/resources/queryApi/index.js +0 -57
- package/dist/nodes/LimeCrm/resources/queryApi/index.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/queryApi/operations/executeQuery.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/queryApi/operations/executeQuery.operation.js +0 -559
- package/dist/nodes/LimeCrm/resources/queryApi/operations/executeQuery.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/transport/index.d.ts +0 -2
- package/dist/nodes/LimeCrm/transport/index.js +0 -50
- package/dist/nodes/LimeCrm/transport/index.js.map +0 -1
- package/dist/nodes/LimeGo/LimeGo.node.d.ts +0 -8
- package/dist/nodes/LimeGo/LimeGo.node.js +0 -123
- package/dist/nodes/LimeGo/LimeGo.node.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/get.operation.d.ts +0 -5
- package/dist/nodes/LimeGo/actions/organization/get.operation.js +0 -39
- package/dist/nodes/LimeGo/actions/organization/get.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/getByExternalKey.operation.d.ts +0 -5
- package/dist/nodes/LimeGo/actions/organization/getByExternalKey.operation.js +0 -54
- package/dist/nodes/LimeGo/actions/organization/getByExternalKey.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/index.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/organization/index.js +0 -92
- package/dist/nodes/LimeGo/actions/organization/index.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/organizationFields.d.ts +0 -2
- package/dist/nodes/LimeGo/actions/organization/organizationFields.js +0 -162
- package/dist/nodes/LimeGo/actions/organization/organizationFields.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/search.operation.d.ts +0 -5
- package/dist/nodes/LimeGo/actions/organization/search.operation.js +0 -70
- package/dist/nodes/LimeGo/actions/organization/search.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/update.operation.d.ts +0 -5
- package/dist/nodes/LimeGo/actions/organization/update.operation.js +0 -125
- package/dist/nodes/LimeGo/actions/organization/update.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/createMail.operation.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/createMail.operation.js +0 -130
- package/dist/nodes/LimeGo/actions/person/createMail.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/get.operation.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/get.operation.js +0 -45
- package/dist/nodes/LimeGo/actions/person/get.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/index.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/index.js +0 -92
- package/dist/nodes/LimeGo/actions/person/index.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/personFields.d.ts +0 -2
- package/dist/nodes/LimeGo/actions/person/personFields.js +0 -134
- package/dist/nodes/LimeGo/actions/person/personFields.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/search.operation.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/search.operation.js +0 -81
- package/dist/nodes/LimeGo/actions/person/search.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/update.operation.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/update.operation.js +0 -104
- package/dist/nodes/LimeGo/actions/person/update.operation.js.map +0 -1
- package/dist/nodes/LimeGo/lime-go.svg +0 -1
- package/dist/nodes/LimeGo/transport/graphqlRequest.d.ts +0 -2
- package/dist/nodes/LimeGo/transport/graphqlRequest.js +0 -23
- package/dist/nodes/LimeGo/transport/graphqlRequest.js.map +0 -1
|
@@ -38,8 +38,18 @@ export async function execute(
|
|
|
38
38
|
) as string;
|
|
39
39
|
|
|
40
40
|
const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
|
|
41
|
-
|
|
41
|
+
const response = await apiRequest<CustomerResponse>(this, {
|
|
42
42
|
method: 'GET',
|
|
43
43
|
endpoint,
|
|
44
44
|
});
|
|
45
|
+
|
|
46
|
+
if (response.success) return response;
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
...response,
|
|
50
|
+
metadata: {
|
|
51
|
+
...response.metadata,
|
|
52
|
+
id: customerNumber,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
45
55
|
}
|
|
@@ -270,9 +270,19 @@ export async function execute(
|
|
|
270
270
|
|
|
271
271
|
const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
|
|
272
272
|
|
|
273
|
-
|
|
273
|
+
const response = await apiRequest<CustomerResponse>(this, {
|
|
274
274
|
method: 'PUT',
|
|
275
275
|
endpoint: endpoint,
|
|
276
276
|
body: body,
|
|
277
277
|
});
|
|
278
|
+
|
|
279
|
+
if (response.success) return response;
|
|
280
|
+
|
|
281
|
+
return {
|
|
282
|
+
...response,
|
|
283
|
+
metadata: {
|
|
284
|
+
...response.metadata,
|
|
285
|
+
id: customerNumber,
|
|
286
|
+
},
|
|
287
|
+
};
|
|
278
288
|
}
|
|
@@ -38,8 +38,18 @@ export async function execute(
|
|
|
38
38
|
|
|
39
39
|
const endpoint = `invoices/${encodeURIComponent(documentNumber)}`;
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const response = await apiRequest<GetInvoiceResponse>(this, {
|
|
42
42
|
method: 'GET',
|
|
43
43
|
endpoint: endpoint,
|
|
44
44
|
});
|
|
45
|
+
|
|
46
|
+
if (response.success) return response;
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
...response,
|
|
50
|
+
metadata: {
|
|
51
|
+
...response.metadata,
|
|
52
|
+
id: documentNumber,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
45
55
|
}
|
|
@@ -66,9 +66,19 @@ export async function execute(
|
|
|
66
66
|
|
|
67
67
|
const endpoint = `invoices/${encodeURIComponent(documentNumber)}`;
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
const response = await apiRequest<CreateInvoiceResponse>(this, {
|
|
70
70
|
method: 'PUT',
|
|
71
71
|
endpoint: endpoint,
|
|
72
72
|
body: body,
|
|
73
73
|
});
|
|
74
|
+
|
|
75
|
+
if (response.success) return response;
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
...response,
|
|
79
|
+
metadata: {
|
|
80
|
+
...response.metadata,
|
|
81
|
+
id: documentNumber,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
74
84
|
}
|
|
@@ -14,6 +14,7 @@ export interface Webhook {
|
|
|
14
14
|
events: string[];
|
|
15
15
|
url?: string;
|
|
16
16
|
context: WebhookContext;
|
|
17
|
+
name: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
function _getEvents(hookData: WebhookFunctions): string[] {
|
|
@@ -46,5 +47,6 @@ export function getWebhook(hookData: WebhookFunctions): Webhook {
|
|
|
46
47
|
events: _getEvents(hookData),
|
|
47
48
|
url: hookData.getNodeWebhookUrl('default'),
|
|
48
49
|
context: context,
|
|
50
|
+
name: hookData.getNodeParameter('name') as string,
|
|
49
51
|
};
|
|
50
52
|
}
|
|
@@ -27,8 +27,6 @@ export const properties: INodeProperties[] = [
|
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
// Search parameters
|
|
32
30
|
{
|
|
33
31
|
displayName: 'Search Term',
|
|
34
32
|
name: 'searchTerm',
|
|
@@ -42,8 +40,6 @@ export const properties: INodeProperties[] = [
|
|
|
42
40
|
},
|
|
43
41
|
},
|
|
44
42
|
},
|
|
45
|
-
|
|
46
|
-
// Search fields
|
|
47
43
|
{
|
|
48
44
|
displayName: 'Search Fields',
|
|
49
45
|
name: 'searchField',
|
|
@@ -62,7 +58,6 @@ export const properties: INodeProperties[] = [
|
|
|
62
58
|
},
|
|
63
59
|
},
|
|
64
60
|
},
|
|
65
|
-
|
|
66
61
|
{
|
|
67
62
|
displayName: 'Limit',
|
|
68
63
|
name: 'limit',
|
|
@@ -79,6 +74,22 @@ export const properties: INodeProperties[] = [
|
|
|
79
74
|
},
|
|
80
75
|
},
|
|
81
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: ['search'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
82
93
|
];
|
|
83
94
|
|
|
84
95
|
export async function execute(this: IExecuteFunctions, i: number) {
|
|
@@ -86,6 +97,7 @@ export async function execute(this: IExecuteFunctions, i: number) {
|
|
|
86
97
|
const searchTerm = this.getNodeParameter('searchTerm', i, '') as string;
|
|
87
98
|
const searchField = this.getNodeParameter('searchField', i) as string;
|
|
88
99
|
const limit = this.getNodeParameter('limit', i, 50);
|
|
100
|
+
const offset = this.getNodeParameter('offset', i, 0) as number;
|
|
89
101
|
const options = this.getNodeParameter('options', i, {});
|
|
90
102
|
|
|
91
103
|
return await searchLimeObject(
|
|
@@ -93,7 +105,8 @@ export async function execute(this: IExecuteFunctions, i: number) {
|
|
|
93
105
|
limeType,
|
|
94
106
|
searchField,
|
|
95
107
|
searchTerm,
|
|
96
|
-
limit
|
|
108
|
+
limit,
|
|
109
|
+
offset,
|
|
97
110
|
(options.sortField as string) || null
|
|
98
111
|
);
|
|
99
112
|
}
|
|
@@ -15,7 +15,7 @@ export async function callLimeApi<T>(
|
|
|
15
15
|
nodeContext: IAllExecuteFunctions,
|
|
16
16
|
method: HTTPMethod,
|
|
17
17
|
url: string,
|
|
18
|
-
options?:
|
|
18
|
+
options?: Record<string, unknown>
|
|
19
19
|
): Promise<NodeResponse<T>> {
|
|
20
20
|
try {
|
|
21
21
|
const response: T =
|
|
@@ -39,6 +39,7 @@ export async function callLimeApi<T>(
|
|
|
39
39
|
success: false,
|
|
40
40
|
error: error instanceof Error ? error.message : String(error),
|
|
41
41
|
status: error?.cause?.status,
|
|
42
|
+
metadata: options,
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { callLimeApi } from './commons';
|
|
2
|
-
import { IAllExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
import { IAllExecuteFunctions, IDataObject } from 'n8n-workflow';
|
|
3
3
|
import { NodeResponse } from '../../nodeResponse';
|
|
4
4
|
|
|
5
5
|
const LIMEOBJECT_URL = '/api/v1/limeobject/';
|
|
@@ -12,66 +12,172 @@ interface SearchLimeobjectApiResponse {
|
|
|
12
12
|
|
|
13
13
|
export async function createLimeObject(
|
|
14
14
|
nodeContext: IAllExecuteFunctions,
|
|
15
|
-
|
|
15
|
+
limeType: string,
|
|
16
16
|
data: object
|
|
17
17
|
): Promise<NodeResponse<unknown>> {
|
|
18
|
-
const url = `${LIMEOBJECT_URL}${
|
|
19
|
-
|
|
18
|
+
const url = `${LIMEOBJECT_URL}${limeType}/`;
|
|
19
|
+
const response = await callLimeApi(nodeContext, 'POST', url, {
|
|
20
20
|
body: data,
|
|
21
21
|
});
|
|
22
|
+
if (response.success) return response;
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
...response,
|
|
26
|
+
metadata: {
|
|
27
|
+
...response.metadata,
|
|
28
|
+
limeType: limeType,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
export async function deleteLimeObject(
|
|
25
34
|
nodeContext: IAllExecuteFunctions,
|
|
26
|
-
|
|
35
|
+
limeType: string,
|
|
27
36
|
id: string
|
|
28
37
|
): Promise<NodeResponse<void>> {
|
|
29
|
-
const url = `${LIMEOBJECT_URL}${
|
|
30
|
-
|
|
38
|
+
const url = `${LIMEOBJECT_URL}${limeType}/${id}/`;
|
|
39
|
+
const response: NodeResponse<void> = await callLimeApi(
|
|
40
|
+
nodeContext,
|
|
41
|
+
'DELETE',
|
|
42
|
+
url
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
if (response.success) return response;
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
...response,
|
|
49
|
+
metadata: {
|
|
50
|
+
...response.metadata,
|
|
51
|
+
limeType: limeType,
|
|
52
|
+
id: id,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
31
55
|
}
|
|
32
56
|
|
|
33
57
|
export async function getLimeObject(
|
|
34
58
|
nodeContext: IAllExecuteFunctions,
|
|
35
|
-
|
|
59
|
+
limeType: string,
|
|
36
60
|
id: string
|
|
37
61
|
): Promise<NodeResponse<unknown>> {
|
|
38
|
-
const url = `${LIMEOBJECT_URL}${
|
|
39
|
-
|
|
62
|
+
const url = `${LIMEOBJECT_URL}${limeType}/${id}/`;
|
|
63
|
+
const response = await callLimeApi(nodeContext, 'GET', url);
|
|
64
|
+
|
|
65
|
+
if (response.success) return response;
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
...response,
|
|
69
|
+
metadata: {
|
|
70
|
+
...response.metadata,
|
|
71
|
+
limeType: limeType,
|
|
72
|
+
id: id,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
40
75
|
}
|
|
41
76
|
|
|
42
77
|
export async function updateLimeObject(
|
|
43
78
|
nodeContext: IAllExecuteFunctions,
|
|
44
|
-
|
|
79
|
+
limeType: string,
|
|
45
80
|
id: string,
|
|
46
81
|
data: object
|
|
47
82
|
): Promise<NodeResponse<unknown>> {
|
|
48
|
-
const url = `${LIMEOBJECT_URL}${
|
|
49
|
-
|
|
83
|
+
const url = `${LIMEOBJECT_URL}${limeType}/${id}/`;
|
|
84
|
+
const response = await callLimeApi(nodeContext, 'PUT', url, {
|
|
50
85
|
body: data,
|
|
51
86
|
});
|
|
87
|
+
|
|
88
|
+
if (response.success) return response;
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
...response,
|
|
92
|
+
metadata: {
|
|
93
|
+
...response.metadata,
|
|
94
|
+
limeType: limeType,
|
|
95
|
+
id: id,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function _searchLimeObjectWithLimit(
|
|
101
|
+
nodeContext: IAllExecuteFunctions,
|
|
102
|
+
url: string,
|
|
103
|
+
limit: number,
|
|
104
|
+
offset: number,
|
|
105
|
+
qs: IDataObject
|
|
106
|
+
): Promise<NodeResponse<SearchLimeobjectApiResponse>> {
|
|
107
|
+
const returnData = [];
|
|
108
|
+
let hasMoreData = true;
|
|
109
|
+
let currentOffset = Math.max(0, offset);
|
|
110
|
+
const pageLimit = 50;
|
|
111
|
+
|
|
112
|
+
while (hasMoreData) {
|
|
113
|
+
qs._limit = Math.min(limit, pageLimit);
|
|
114
|
+
qs._offset = currentOffset;
|
|
115
|
+
|
|
116
|
+
const response = await callLimeApi<SearchLimeobjectApiResponse>(
|
|
117
|
+
nodeContext,
|
|
118
|
+
'GET',
|
|
119
|
+
url,
|
|
120
|
+
{
|
|
121
|
+
qs: qs,
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
if (!response.success) return response;
|
|
125
|
+
|
|
126
|
+
const items = response.data._embedded?.limeobjects || [];
|
|
127
|
+
|
|
128
|
+
if (items.length === 0) {
|
|
129
|
+
hasMoreData = false;
|
|
130
|
+
} else {
|
|
131
|
+
returnData.push(...items);
|
|
132
|
+
currentOffset += items.length;
|
|
133
|
+
limit -= items.length;
|
|
134
|
+
|
|
135
|
+
if (limit <= 0) {
|
|
136
|
+
hasMoreData = false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
success: true,
|
|
142
|
+
data: { _embedded: { limeobjects: returnData } },
|
|
143
|
+
};
|
|
52
144
|
}
|
|
53
145
|
|
|
54
146
|
export async function searchLimeObject(
|
|
55
147
|
nodeContext: IAllExecuteFunctions,
|
|
56
|
-
|
|
148
|
+
limeType: string,
|
|
57
149
|
searchField: string,
|
|
58
150
|
searchTerm: string,
|
|
59
|
-
limit: number
|
|
151
|
+
limit: number,
|
|
152
|
+
offset: number,
|
|
60
153
|
sortField: string | null
|
|
61
154
|
): Promise<NodeResponse<Array<object>>> {
|
|
62
|
-
const url = `${LIMEOBJECT_URL}${
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
155
|
+
const url = `${LIMEOBJECT_URL}${limeType}/`;
|
|
156
|
+
const qs: IDataObject = {
|
|
157
|
+
...(searchField && searchTerm && { [searchField]: searchTerm }),
|
|
158
|
+
...(offset != null && offset > 0 && { _offset: offset }),
|
|
159
|
+
...(sortField != null && { _sort: sortField }),
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
let response;
|
|
163
|
+
if (limit) {
|
|
164
|
+
response = await _searchLimeObjectWithLimit(
|
|
165
|
+
nodeContext,
|
|
166
|
+
url,
|
|
167
|
+
limit,
|
|
168
|
+
offset,
|
|
169
|
+
qs
|
|
170
|
+
);
|
|
171
|
+
} else {
|
|
172
|
+
response = await callLimeApi<SearchLimeobjectApiResponse>(
|
|
173
|
+
nodeContext,
|
|
174
|
+
'GET',
|
|
175
|
+
url,
|
|
176
|
+
{
|
|
177
|
+
qs: qs,
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
75
181
|
|
|
76
182
|
if (response.success) {
|
|
77
183
|
return {
|
|
@@ -79,5 +185,11 @@ export async function searchLimeObject(
|
|
|
79
185
|
data: response.data?._embedded.limeobjects ?? [],
|
|
80
186
|
};
|
|
81
187
|
}
|
|
82
|
-
return
|
|
188
|
+
return {
|
|
189
|
+
...response,
|
|
190
|
+
metadata: {
|
|
191
|
+
...response.metadata,
|
|
192
|
+
limeType: limeType,
|
|
193
|
+
},
|
|
194
|
+
};
|
|
83
195
|
}
|
|
@@ -39,7 +39,17 @@ export async function getLimeType(
|
|
|
39
39
|
limeType: string
|
|
40
40
|
): Promise<NodeResponse<LimeType>> {
|
|
41
41
|
const url = `${LIMETYPE_URL}${limeType}/`;
|
|
42
|
-
|
|
42
|
+
const response = await callLimeApi<LimeType>(nodeContext, 'GET', url);
|
|
43
|
+
|
|
44
|
+
if (response.success) return response;
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
...response,
|
|
48
|
+
metadata: {
|
|
49
|
+
...response.metadata,
|
|
50
|
+
limetype: limeType,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
export async function getProperties(
|
|
@@ -64,5 +74,12 @@ export async function getProperties(
|
|
|
64
74
|
data: response.data?._embedded.properties ?? [],
|
|
65
75
|
};
|
|
66
76
|
}
|
|
67
|
-
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
...response,
|
|
80
|
+
metadata: {
|
|
81
|
+
...response.metadata,
|
|
82
|
+
limetype: limeType,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
68
85
|
}
|
|
@@ -45,6 +45,7 @@ export async function createSubscription(
|
|
|
45
45
|
body: {
|
|
46
46
|
events: webhook.events,
|
|
47
47
|
target_url: webhook.url,
|
|
48
|
+
name: webhook.name,
|
|
48
49
|
},
|
|
49
50
|
});
|
|
50
51
|
}
|
|
@@ -53,9 +54,19 @@ export async function deleteSubscription(
|
|
|
53
54
|
nodeContext: IAllExecuteFunctions,
|
|
54
55
|
webhook: Webhook
|
|
55
56
|
): Promise<NodeResponse<void>> {
|
|
56
|
-
|
|
57
|
+
const response: NodeResponse<void> = await callLimeApi(
|
|
57
58
|
nodeContext,
|
|
58
59
|
'DELETE',
|
|
59
60
|
`${SUBSCRIPTION_URL}${webhook.data.webhookId}/`
|
|
60
61
|
);
|
|
62
|
+
|
|
63
|
+
if (response.success) return response;
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
...response,
|
|
67
|
+
metadata: {
|
|
68
|
+
...response.metadata,
|
|
69
|
+
id: webhook.data.webhookId,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
61
72
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
export declare class LimeGoApi implements ICredentialType {
|
|
3
|
-
name: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
documentationUrl: string;
|
|
6
|
-
properties: INodeProperties[];
|
|
7
|
-
authenticate: {
|
|
8
|
-
type: "generic";
|
|
9
|
-
properties: {
|
|
10
|
-
headers: {
|
|
11
|
-
Authorization: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LimeGoApi = void 0;
|
|
4
|
-
class LimeGoApi {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.name = 'limeGoApi';
|
|
7
|
-
this.displayName = 'Lime Go API';
|
|
8
|
-
this.documentationUrl = 'https://api.lime-go.com/docs';
|
|
9
|
-
this.properties = [
|
|
10
|
-
{
|
|
11
|
-
displayName: 'API Key',
|
|
12
|
-
name: 'apiKey',
|
|
13
|
-
type: 'string',
|
|
14
|
-
typeOptions: {
|
|
15
|
-
password: true,
|
|
16
|
-
},
|
|
17
|
-
default: '',
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
this.authenticate = {
|
|
22
|
-
type: 'generic',
|
|
23
|
-
properties: {
|
|
24
|
-
headers: {
|
|
25
|
-
Authorization: '=go-api:{{$credentials.apiKey}}',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.LimeGoApi = LimeGoApi;
|
|
32
|
-
//# sourceMappingURL=LimeGoApi.credentials.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LimeGoApi.credentials.js","sourceRoot":"","sources":["../../credentials/LimeGoApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,SAAS;IAAtB;QACI,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,8BAA8B,CAAC;QAClD,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACjB;SACJ,CAAC;QAEF,iBAAY,GAAG;YACX,IAAI,EAAE,SAAsB;YAC5B,UAAU,EAAE;gBACR,OAAO,EAAE;oBACL,aAAa,EAAE,iCAAiC;iBACnD;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AAzBD,8BAyBC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { IDataObject } from 'n8n-workflow';
|
|
2
|
-
export interface IOperationParams {
|
|
3
|
-
operation: string;
|
|
4
|
-
i: number;
|
|
5
|
-
}
|
|
6
|
-
export interface ILimeCrmResponse {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}
|
|
9
|
-
export interface ILimeTypeObject {
|
|
10
|
-
id?: number | string;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}
|
|
13
|
-
export interface IWebhookObject {
|
|
14
|
-
name: string;
|
|
15
|
-
events: string[];
|
|
16
|
-
target_url: string;
|
|
17
|
-
enabled: boolean;
|
|
18
|
-
headers?: Array<{
|
|
19
|
-
name: string;
|
|
20
|
-
value: string;
|
|
21
|
-
secret_value?: string;
|
|
22
|
-
type: string;
|
|
23
|
-
}>;
|
|
24
|
-
secret?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface IWebhookEventData {
|
|
27
|
-
event: string;
|
|
28
|
-
body: {
|
|
29
|
-
id: string;
|
|
30
|
-
values: IDataObject;
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
};
|
|
33
|
-
[key: string]: any;
|
|
34
|
-
}
|
|
35
|
-
export interface ILimeTypeResponse {
|
|
36
|
-
_embedded?: {
|
|
37
|
-
properties?: ILimeTypeProperty[];
|
|
38
|
-
};
|
|
39
|
-
_links?: {
|
|
40
|
-
limetypes?: ILimeTypeLink[];
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export interface ILimeTypeLink {
|
|
44
|
-
name: string;
|
|
45
|
-
href: string;
|
|
46
|
-
}
|
|
47
|
-
export interface ILimeTypeProperty {
|
|
48
|
-
id: string;
|
|
49
|
-
name: string;
|
|
50
|
-
localizedname: string;
|
|
51
|
-
propertytype: string;
|
|
52
|
-
readonly: boolean;
|
|
53
|
-
required: boolean;
|
|
54
|
-
[key: string]: any;
|
|
55
|
-
}
|
|
56
|
-
export interface ILimeObjectResponse {
|
|
57
|
-
_embedded?: {
|
|
58
|
-
limeobjects?: ILimeObject[];
|
|
59
|
-
};
|
|
60
|
-
_links?: {
|
|
61
|
-
next?: {
|
|
62
|
-
href: string;
|
|
63
|
-
};
|
|
64
|
-
self?: {
|
|
65
|
-
href: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export interface ILimeObject {
|
|
70
|
-
id: string;
|
|
71
|
-
[key: string]: any;
|
|
72
|
-
}
|
|
73
|
-
export interface IQueryParams {
|
|
74
|
-
_limit?: number;
|
|
75
|
-
_offset?: number;
|
|
76
|
-
_sort?: string;
|
|
77
|
-
[key: string]: any;
|
|
78
|
-
}
|
|
79
|
-
export declare class GenericTypes {
|
|
80
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTypes.js","sourceRoot":"","sources":["../../../nodes/LimeCrm/GenericTypes.ts"],"names":[],"mappings":";;;AAiHA,MAAa,YAAY;CAAI;AAA7B,oCAA6B"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
-
import { getLimeTypes, getLimeTypeProperties, getLimeTypeRelations, getRelatedTypeProperties, getAllSortableFields } from './methods';
|
|
3
|
-
import { LimeCrmTrigger } from './LimeCrmTrigger/LimeCrmTrigger.node';
|
|
4
|
-
export declare class LimeCrmNode implements INodeType {
|
|
5
|
-
description: INodeTypeDescription;
|
|
6
|
-
methods: {
|
|
7
|
-
loadOptions: {
|
|
8
|
-
getLimeTypes: typeof getLimeTypes;
|
|
9
|
-
getLimeTypeProperties: typeof getLimeTypeProperties;
|
|
10
|
-
getLimeTypeRelations: typeof getLimeTypeRelations;
|
|
11
|
-
getRelatedTypeProperties: typeof getRelatedTypeProperties;
|
|
12
|
-
getAllSortableFields: typeof getAllSortableFields;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
16
|
-
}
|
|
17
|
-
export { LimeCrmTrigger };
|