Skip to content

Commit d719bcf

Browse files
committed
[Components] linkup api - new components
1 parent a6d21f7 commit d719bcf

File tree

14 files changed

+968
-20
lines changed

14 files changed

+968
-20
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import app from "../../linkupapi.app.mjs";
2+
3+
export default {
4+
type: "action",
5+
key: "linkupapi-connect-to-profile",
6+
name: "Connect to Profile",
7+
description: "Send a connection request to a LinkedIn profile. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/Network/connect)",
8+
version: "0.0.1",
9+
props: {
10+
app,
11+
linkedinUrl: {
12+
propDefinition: [
13+
app,
14+
"linkedinUrl",
15+
],
16+
},
17+
loginToken: {
18+
propDefinition: [
19+
app,
20+
"loginToken",
21+
],
22+
},
23+
message: {
24+
type: "string",
25+
label: "Message",
26+
description: "Optional custom message to include with connection request",
27+
optional: true,
28+
},
29+
country: {
30+
propDefinition: [
31+
app,
32+
"country",
33+
],
34+
},
35+
},
36+
annotations: {
37+
readOnlyHint: false,
38+
destructiveHint: true,
39+
openWorldHint: true,
40+
idempotentHint: false,
41+
},
42+
async run({ $ }) {
43+
const {
44+
app,
45+
linkedinUrl,
46+
loginToken,
47+
message,
48+
country,
49+
} = this;
50+
51+
const response = await app.connectToProfile({
52+
$,
53+
data: {
54+
linkedin_url: linkedinUrl,
55+
login_token: loginToken,
56+
message_text: message,
57+
country,
58+
},
59+
});
60+
61+
$.export("$summary", "Successfully sent connection request");
62+
63+
return response;
64+
},
65+
};
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import app from "../../linkupapi.app.mjs";
2+
3+
export default {
4+
type: "action",
5+
key: "linkupapi-get-company-info",
6+
name: "Get Company Info",
7+
description: "Extract detailed information about a company from LinkedIn. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/Companies/company-info)",
8+
version: "0.0.1",
9+
props: {
10+
app,
11+
companyUrl: {
12+
type: "string",
13+
label: "Company URL",
14+
description: "LinkedIn company URLs. Eg. `https://www.linkedin.com/company/stripe/`",
15+
optional: true,
16+
},
17+
loginToken: {
18+
propDefinition: [
19+
app,
20+
"loginToken",
21+
],
22+
},
23+
country: {
24+
propDefinition: [
25+
app,
26+
"country",
27+
],
28+
},
29+
},
30+
annotations: {
31+
readOnlyHint: true,
32+
destructiveHint: false,
33+
openWorldHint: true,
34+
idempotentHint: true,
35+
},
36+
async run({ $ }) {
37+
const {
38+
app,
39+
companyUrl,
40+
loginToken,
41+
country,
42+
} = this;
43+
44+
const response = await app.getCompanyInfo({
45+
$,
46+
data: {
47+
company_url: companyUrl,
48+
login_token: loginToken,
49+
country,
50+
},
51+
});
52+
53+
$.export("$summary", "Successfully retrieved company information");
54+
return response;
55+
},
56+
};
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import app from "../../linkupapi.app.mjs";
3+
4+
export default {
5+
type: "action",
6+
key: "linkupapi-get-conversation-messages",
7+
name: "Get Conversation Messages",
8+
description: "Retrieve messages from a LinkedIn conversation. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/Messages/conversation)",
9+
version: "0.0.1",
10+
props: {
11+
app,
12+
loginToken: {
13+
propDefinition: [
14+
app,
15+
"loginToken",
16+
],
17+
},
18+
linkedinUrl: {
19+
propDefinition: [
20+
app,
21+
"linkedinUrl",
22+
],
23+
optional: true,
24+
description: "LinkedIn URL of the other party (required if **Conversation ID** is not provided)",
25+
},
26+
conversationId: {
27+
propDefinition: [
28+
app,
29+
"conversationId",
30+
({ loginToken }) => ({
31+
loginToken,
32+
}),
33+
],
34+
optional: true,
35+
description: "LinkedIn conversation ID (required if **LinkedIn URL** is not provided)",
36+
},
37+
totalResults: {
38+
type: "integer",
39+
label: "Total Results",
40+
description: "Number of messages to retrieve when not in pagination mode (default: 10)",
41+
optional: true,
42+
},
43+
startPage: {
44+
type: "integer",
45+
label: "Start Page",
46+
description: "First page to fetch when using pagination mode (default: 1)",
47+
optional: true,
48+
},
49+
endPage: {
50+
type: "integer",
51+
label: "End Page",
52+
description: "Last page to fetch when using pagination mode (default: same as start_page)",
53+
optional: true,
54+
},
55+
country: {
56+
propDefinition: [
57+
app,
58+
"country",
59+
],
60+
},
61+
},
62+
annotations: {
63+
readOnlyHint: true,
64+
destructiveHint: false,
65+
openWorldHint: true,
66+
idempotentHint: true,
67+
},
68+
async run({ $ }) {
69+
const {
70+
loginToken,
71+
linkedinUrl,
72+
conversationId,
73+
totalResults,
74+
country,
75+
} = this;
76+
77+
if (!linkedinUrl && !conversationId) {
78+
throw new ConfigurationError("Either **LinkedIn URL** or **Conversation ID** is required");
79+
}
80+
81+
const response = await this.app.getConversationMessages({
82+
$,
83+
data: {
84+
login_token: loginToken,
85+
linkedin_url: linkedinUrl,
86+
conversation_id: conversationId,
87+
country,
88+
total_results: totalResults,
89+
},
90+
});
91+
92+
$.export("$summary", "Successfully retrieved conversation messages");
93+
return response;
94+
},
95+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import app from "../../linkupapi.app.mjs";
2+
3+
export default {
4+
type: "action",
5+
key: "linkupapi-get-invitations-status",
6+
name: "Get Invitations Status",
7+
description: "Check the status of connection invitations for a LinkedIn profile. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/Network/get_invitations_status)",
8+
version: "0.0.1",
9+
props: {
10+
app,
11+
linkedinUrl: {
12+
propDefinition: [
13+
app,
14+
"linkedinUrl",
15+
],
16+
},
17+
loginToken: {
18+
propDefinition: [
19+
app,
20+
"loginToken",
21+
],
22+
},
23+
country: {
24+
propDefinition: [
25+
app,
26+
"country",
27+
],
28+
},
29+
},
30+
annotations: {
31+
readOnlyHint: true,
32+
destructiveHint: false,
33+
openWorldHint: true,
34+
idempotentHint: true,
35+
},
36+
async run({ $ }) {
37+
const {
38+
app,
39+
linkedinUrl,
40+
loginToken,
41+
country,
42+
} = this;
43+
44+
const response = await app.getInvitationsStatus({
45+
$,
46+
data: {
47+
linkedin_url: linkedinUrl,
48+
login_token: loginToken,
49+
country,
50+
},
51+
});
52+
53+
$.export("$summary", "Successfully retrieved invitation status");
54+
55+
return response;
56+
},
57+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import app from "../../linkupapi.app.mjs";
2+
3+
export default {
4+
type: "action",
5+
key: "linkupapi-get-profile-info",
6+
name: "Get Profile Info",
7+
description: "Extract information from a LinkedIn profile. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/Profile/profile-info)",
8+
version: "0.0.1",
9+
props: {
10+
app,
11+
linkedinUrl: {
12+
propDefinition: [
13+
app,
14+
"linkedinUrl",
15+
],
16+
},
17+
loginToken: {
18+
propDefinition: [
19+
app,
20+
"loginToken",
21+
],
22+
},
23+
country: {
24+
propDefinition: [
25+
app,
26+
"country",
27+
],
28+
},
29+
},
30+
annotations: {
31+
readOnlyHint: true,
32+
destructiveHint: false,
33+
openWorldHint: true,
34+
idempotentHint: true,
35+
},
36+
async run({ $ }) {
37+
const {
38+
app,
39+
linkedinUrl,
40+
loginToken,
41+
country,
42+
} = this;
43+
44+
const response = await app.getProfileInfo({
45+
$,
46+
data: {
47+
linkedin_url: linkedinUrl,
48+
login_token: loginToken,
49+
country,
50+
},
51+
});
52+
53+
$.export("$summary", "Successfully retrieved profile information");
54+
55+
return response;
56+
},
57+
};
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import app from "../../linkupapi.app.mjs";
2+
3+
export default {
4+
type: "action",
5+
key: "linkupapi-login",
6+
name: "Login",
7+
description: "Authenticate with LinkedIn credentials. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/authentication/login)",
8+
version: "0.0.1",
9+
props: {
10+
app,
11+
email: {
12+
propDefinition: [
13+
app,
14+
"email",
15+
],
16+
},
17+
password: {
18+
propDefinition: [
19+
app,
20+
"password",
21+
],
22+
},
23+
country: {
24+
propDefinition: [
25+
app,
26+
"country",
27+
],
28+
},
29+
},
30+
annotations: {
31+
readOnlyHint: false,
32+
destructiveHint: false,
33+
openWorldHint: true,
34+
},
35+
async run({ $ }) {
36+
const {
37+
app,
38+
email,
39+
password,
40+
country,
41+
} = this;
42+
43+
const response = await app.login({
44+
$,
45+
data: {
46+
email,
47+
password,
48+
country,
49+
},
50+
});
51+
52+
$.export("$summary", "Successfully authenticated with LinkedIn account");
53+
54+
return response;
55+
},
56+
};

0 commit comments

Comments
 (0)