n8n-nodes-linq 4.0.0 → 4.0.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.
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export declare class LinqApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
5
5
|
documentationUrl: string;
|
|
6
6
|
properties: INodeProperties[];
|
|
7
|
-
authenticate:
|
|
8
|
-
|
|
9
|
-
readonly properties: {
|
|
10
|
-
readonly headers: {
|
|
11
|
-
readonly Authorization: "Bearer {{$credentials.integrationToken}}";
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
15
9
|
}
|
|
@@ -31,9 +31,16 @@ class LinqApi {
|
|
|
31
31
|
type: 'generic',
|
|
32
32
|
properties: {
|
|
33
33
|
headers: {
|
|
34
|
-
Authorization: 'Bearer {{$credentials.integrationToken}}',
|
|
34
|
+
Authorization: '=Bearer {{$credentials.integrationToken}}',
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
|
+
test = {
|
|
39
|
+
request: {
|
|
40
|
+
baseURL: 'https://api.linqapp.com/api/partner',
|
|
41
|
+
url: '/v3/phonenumbers',
|
|
42
|
+
method: 'GET',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
38
45
|
}
|
|
39
46
|
exports.LinqApi = LinqApi;
|
|
@@ -606,6 +606,15 @@ async function uploadAttachment(context, url) {
|
|
|
606
606
|
});
|
|
607
607
|
return uploadConfig.id;
|
|
608
608
|
}
|
|
609
|
+
function isValidUrl(urlString) {
|
|
610
|
+
try {
|
|
611
|
+
const url = new URL(urlString);
|
|
612
|
+
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
613
|
+
}
|
|
614
|
+
catch {
|
|
615
|
+
return false;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
609
618
|
async function createParts(context, text, attachmentUrlsString) {
|
|
610
619
|
const parts = [];
|
|
611
620
|
if (text) {
|
|
@@ -615,7 +624,13 @@ async function createParts(context, text, attachmentUrlsString) {
|
|
|
615
624
|
const urls = attachmentUrlsString
|
|
616
625
|
.split(',')
|
|
617
626
|
.map(u => u.trim())
|
|
618
|
-
.filter(Boolean)
|
|
627
|
+
.filter(Boolean)
|
|
628
|
+
.filter(u => {
|
|
629
|
+
if (!isValidUrl(u)) {
|
|
630
|
+
throw new n8n_workflow_1.ApplicationError(`Invalid attachment URL: "${u}". URLs must be valid HTTP/HTTPS URLs.`);
|
|
631
|
+
}
|
|
632
|
+
return true;
|
|
633
|
+
});
|
|
619
634
|
// Upload attachments in batches to limit concurrency and avoid OOM
|
|
620
635
|
const CONCURRENCY_LIMIT = 3;
|
|
621
636
|
const attachmentIds = [];
|