Skip to content

Commit a56f125

Browse files
committed
[Components] linkup api - new components
1 parent d20d528 commit a56f125

File tree

14 files changed

+964
-8
lines changed

14 files changed

+964
-8
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: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
country: {
44+
propDefinition: [
45+
app,
46+
"country",
47+
],
48+
},
49+
},
50+
annotations: {
51+
readOnlyHint: true,
52+
destructiveHint: false,
53+
openWorldHint: true,
54+
idempotentHint: true,
55+
},
56+
async run({ $ }) {
57+
const {
58+
loginToken,
59+
linkedinUrl,
60+
conversationId,
61+
totalResults,
62+
country,
63+
} = this;
64+
65+
if (!linkedinUrl && !conversationId) {
66+
throw new ConfigurationError("Either **LinkedIn URL** or **Conversation ID** is required");
67+
}
68+
69+
const response = await this.app.getConversationMessages({
70+
$,
71+
data: {
72+
login_token: loginToken,
73+
linkedin_url: linkedinUrl,
74+
conversation_id: conversationId,
75+
country,
76+
total_results: totalResults,
77+
},
78+
});
79+
80+
$.export("$summary", "Successfully retrieved conversation messages");
81+
return response;
82+
},
83+
};
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)