@pipedream/linkupapi 0.0.1 → 0.2.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.
@@ -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.2",
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
+ };
@@ -0,0 +1,61 @@
1
+ import linkupapi from "../../linkupapi.app.mjs";
2
+
3
+ export default {
4
+ key: "linkupapi-create-comment",
5
+ name: "Create Comment",
6
+ description: "Create a comment on a post. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/posts/comment)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
14
+ props: {
15
+ linkupapi,
16
+ postUrl: {
17
+ type: "string",
18
+ label: "Post URL",
19
+ description: "LinkedIn post URL to comment on (must contain a valid activity URN)",
20
+ },
21
+ message: {
22
+ type: "string",
23
+ label: "Message",
24
+ description: "Text content of the comment to post",
25
+ },
26
+ loginToken: {
27
+ propDefinition: [
28
+ linkupapi,
29
+ "loginToken",
30
+ ],
31
+ },
32
+ country: {
33
+ propDefinition: [
34
+ linkupapi,
35
+ "country",
36
+ ],
37
+ },
38
+ companyUrl: {
39
+ propDefinition: [
40
+ linkupapi,
41
+ "companyUrl",
42
+ ],
43
+ },
44
+ },
45
+ async run({ $ }) {
46
+ const response = await this.linkupapi.createComment({
47
+ $,
48
+ data: {
49
+ post_url: this.postUrl,
50
+ message: this.message,
51
+ login_token: this.loginToken,
52
+ country: this.country,
53
+ company_url: this.companyUrl,
54
+ },
55
+ });
56
+
57
+ $.export("$summary", "Successfully created comment");
58
+
59
+ return response;
60
+ },
61
+ };
@@ -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.2",
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
+ };
@@ -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.2",
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
+ };
@@ -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.2",
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
+ };
@@ -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.2",
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
+ };
@@ -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.2",
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,0 +1,99 @@
1
+ import app from "../../linkupapi.app.mjs";
2
+ import utils from "../../common/utils.mjs";
3
+
4
+ export default {
5
+ type: "action",
6
+ key: "linkupapi-search-companies",
7
+ name: "Search Companies",
8
+ description: "Search for companies on LinkedIn based on criteria. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/Companies/search)",
9
+ version: "0.0.2",
10
+ props: {
11
+ app,
12
+ loginToken: {
13
+ propDefinition: [
14
+ app,
15
+ "loginToken",
16
+ ],
17
+ },
18
+ keyword: {
19
+ type: "string",
20
+ label: "Keyword",
21
+ description: "Search keyword for company filtering",
22
+ optional: true,
23
+ },
24
+ location: {
25
+ description: "Geographic locations to filter companies",
26
+ propDefinition: [
27
+ app,
28
+ "location",
29
+ ],
30
+ },
31
+ sector: {
32
+ type: "string[]",
33
+ label: "Sector",
34
+ description: "Industry sector you can [find the label here](https://learn.microsoft.com/en-us/linkedin/shared/references/reference-tables/industry-codes-v2)",
35
+ optional: true,
36
+ },
37
+ companySize: {
38
+ type: "string",
39
+ label: "Company Size",
40
+ description: "Employee count range: 1-10 employees 11-50 employees 51-200 employees 201-500 employees 501-1000 employees 1001-5000 employees 5001-10000 employees 10001+ employees",
41
+ optional: true,
42
+ options: [
43
+ "1-10",
44
+ "11-50",
45
+ "51-200",
46
+ "201-500",
47
+ "501-1000",
48
+ "1001-5000",
49
+ "5001-10000",
50
+ "10001+",
51
+ ],
52
+ },
53
+ totalResults: {
54
+ type: "integer",
55
+ label: "Total Results",
56
+ description: "Number of companies to retrieve when not in pagination mode (default: 10)",
57
+ optional: true,
58
+ },
59
+ country: {
60
+ propDefinition: [
61
+ app,
62
+ "country",
63
+ ],
64
+ },
65
+ },
66
+ annotations: {
67
+ readOnlyHint: true,
68
+ destructiveHint: false,
69
+ openWorldHint: true,
70
+ idempotentHint: true,
71
+ },
72
+ async run({ $ }) {
73
+ const {
74
+ loginToken,
75
+ country,
76
+ keyword,
77
+ location,
78
+ sector,
79
+ companySize,
80
+ totalResults,
81
+ } = this;
82
+
83
+ const response = await this.app.searchCompanies({
84
+ $,
85
+ data: {
86
+ login_token: loginToken,
87
+ country,
88
+ keyword,
89
+ location: utils.getOptionalProp(location),
90
+ sector: utils.getOptionalProp(sector),
91
+ company_size: companySize,
92
+ total_results: totalResults,
93
+ },
94
+ });
95
+
96
+ $.export("$summary", "Successfully retrieved companies");
97
+ return response;
98
+ },
99
+ };
@@ -0,0 +1,144 @@
1
+ import app from "../../linkupapi.app.mjs";
2
+ import utils from "../../common/utils.mjs";
3
+
4
+ export default {
5
+ type: "action",
6
+ key: "linkupapi-search-profiles",
7
+ name: "Search Profiles",
8
+ description: "Search for LinkedIn profiles based on criteria. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/Profile/search)",
9
+ version: "0.0.2",
10
+ props: {
11
+ app,
12
+ loginToken: {
13
+ propDefinition: [
14
+ app,
15
+ "loginToken",
16
+ ],
17
+ },
18
+ keyword: {
19
+ type: "string",
20
+ label: "Keyword",
21
+ description: "Search keyword to find relevant profiles",
22
+ optional: true,
23
+ },
24
+ firstName: {
25
+ type: "string",
26
+ label: "First Name",
27
+ description: "First name parameter for advanced keyword search",
28
+ optional: true,
29
+ },
30
+ lastName: {
31
+ type: "string",
32
+ label: "Last Name",
33
+ description: "Last name parameter for advanced keyword search",
34
+ optional: true,
35
+ },
36
+ title: {
37
+ type: "string",
38
+ label: "Job Title",
39
+ description: "Job title parameter for advanced keyword search",
40
+ optional: true,
41
+ },
42
+ companyUrl: {
43
+ propDefinition: [
44
+ app,
45
+ "companyUrl",
46
+ ],
47
+ },
48
+ location: {
49
+ description: "Geographic locations to filter profiles",
50
+ propDefinition: [
51
+ app,
52
+ "location",
53
+ ],
54
+ },
55
+ schoolUrl: {
56
+ type: "string[]",
57
+ label: "School URLs",
58
+ description: "LinkedIn school URLs",
59
+ optional: true,
60
+ },
61
+ network: {
62
+ type: "string[]",
63
+ label: "Network Connection Level",
64
+ description: "Filter by connection level",
65
+ options: [
66
+ {
67
+ value: "F",
68
+ label: "First-degree connections (1st)",
69
+ },
70
+ {
71
+ value: "S",
72
+ label: "Second-degree connections (2nd)",
73
+ },
74
+ {
75
+ value: "O",
76
+ label: "Out-of-network connections (3rd+)",
77
+ },
78
+ ],
79
+ optional: true,
80
+ },
81
+ totalResults: {
82
+ type: "integer",
83
+ label: "Total Results",
84
+ description: "Number of profiles to retrieve (default: `10`)",
85
+ optional: true,
86
+ },
87
+ fetchInvitationState: {
88
+ type: "boolean",
89
+ label: "Fetch Invitation State",
90
+ description: "Whether to fetch the invitation/connection status for each profile",
91
+ optional: true,
92
+ },
93
+ country: {
94
+ propDefinition: [
95
+ app,
96
+ "country",
97
+ ],
98
+ },
99
+ },
100
+ annotations: {
101
+ readOnlyHint: true,
102
+ destructiveHint: false,
103
+ openWorldHint: true,
104
+ idempotentHint: true,
105
+ },
106
+ async run({ $ }) {
107
+ const {
108
+ app,
109
+ loginToken,
110
+ country,
111
+ keyword,
112
+ firstName,
113
+ lastName,
114
+ title,
115
+ companyUrl,
116
+ location,
117
+ schoolUrl,
118
+ network,
119
+ totalResults,
120
+ fetchInvitationState,
121
+ } = this;
122
+
123
+ const response = await app.searchProfiles({
124
+ $,
125
+ data: {
126
+ login_token: loginToken,
127
+ country,
128
+ keyword,
129
+ first_name: firstName,
130
+ last_name: lastName,
131
+ title,
132
+ company_url: utils.getOptionalProp(companyUrl),
133
+ location: utils.getOptionalProp(location),
134
+ school_url: utils.getOptionalProp(schoolUrl),
135
+ network: utils.getOptionalProp(network, ","),
136
+ fetch_invitation_state: fetchInvitationState,
137
+ total_results: totalResults,
138
+ },
139
+ });
140
+
141
+ $.export("$summary", "Successfully retrieved profiles");
142
+ return response;
143
+ },
144
+ };
@@ -0,0 +1,78 @@
1
+ import app from "../../linkupapi.app.mjs";
2
+
3
+ export default {
4
+ type: "action",
5
+ key: "linkupapi-send-message",
6
+ name: "Send Message",
7
+ description: "Send a message to a LinkedIn profile. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/Messages/send)",
8
+ version: "0.0.2",
9
+ props: {
10
+ app,
11
+ // eslint-disable-next-line pipedream/props-label, pipedream/props-description
12
+ info: {
13
+ type: "alert",
14
+ alertType: "info",
15
+ content: "Make sure you previously connected to the LinkedIn profile you want to send a message to.",
16
+ },
17
+ loginToken: {
18
+ propDefinition: [
19
+ app,
20
+ "loginToken",
21
+ ],
22
+ },
23
+ linkedinUrl: {
24
+ propDefinition: [
25
+ app,
26
+ "linkedinUrl",
27
+ ],
28
+ },
29
+ messageText: {
30
+ propDefinition: [
31
+ app,
32
+ "messageText",
33
+ ],
34
+ },
35
+ country: {
36
+ propDefinition: [
37
+ app,
38
+ "country",
39
+ ],
40
+ },
41
+ },
42
+ annotations: {
43
+ readOnlyHint: false,
44
+ destructiveHint: true,
45
+ openWorldHint: true,
46
+ idempotentHint: false,
47
+ },
48
+ async run({ $ }) {
49
+ const {
50
+ app,
51
+ linkedinUrl,
52
+ messageText,
53
+ loginToken,
54
+ country,
55
+ } = this;
56
+
57
+ try {
58
+ const response = await app.sendMessage({
59
+ $,
60
+ data: {
61
+ linkedin_url: linkedinUrl,
62
+ message_text: messageText,
63
+ login_token: loginToken,
64
+ country,
65
+ },
66
+ });
67
+
68
+ $.export("$summary", "Successfully sent message request");
69
+
70
+ return response;
71
+ } catch (error) {
72
+ if (error.response?.data?.data === "Invalid parameter") {
73
+ throw new Error("Invalid parameter. Make sure you previously connected to the LinkedIn profile you want to send a message to.");
74
+ }
75
+ throw error;
76
+ }
77
+ },
78
+ };
@@ -0,0 +1,57 @@
1
+ import app from "../../linkupapi.app.mjs";
2
+
3
+ export default {
4
+ type: "action",
5
+ key: "linkupapi-verify-code",
6
+ name: "Verify Code",
7
+ description: "Verify security code for LinkedIn authentication. [See the documentation](https://docs.linkupapi.com/api-reference/linkup/authentication/verify)",
8
+ version: "0.0.2",
9
+ props: {
10
+ app,
11
+ email: {
12
+ propDefinition: [
13
+ app,
14
+ "email",
15
+ ],
16
+ },
17
+ code: {
18
+ propDefinition: [
19
+ app,
20
+ "code",
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
+ idempotentHint: false,
35
+ },
36
+ async run({ $ }) {
37
+ const {
38
+ app,
39
+ email,
40
+ code,
41
+ country,
42
+ } = this;
43
+
44
+ const response = await app.verify({
45
+ $,
46
+ data: {
47
+ email,
48
+ code,
49
+ country,
50
+ },
51
+ });
52
+
53
+ $.export("$summary", "Successfully verified code for email");
54
+
55
+ return response;
56
+ },
57
+ };
@@ -0,0 +1,9 @@
1
+ function getOptionalProp(value, separator = ";") {
2
+ return Array.isArray(value) && value.length > 0
3
+ ? value.join(separator)
4
+ : undefined;
5
+ }
6
+
7
+ export default {
8
+ getOptionalProp,
9
+ };
package/linkupapi.app.mjs CHANGED
@@ -1,11 +1,205 @@
1
+ import { axios } from "@pipedream/platform";
2
+
1
3
  export default {
2
4
  type: "app",
3
5
  app: "linkupapi",
4
- propDefinitions: {},
6
+ propDefinitions: {
7
+ email: {
8
+ type: "string",
9
+ label: "Email",
10
+ description: "Email address for LinkedIn account",
11
+ },
12
+ password: {
13
+ type: "string",
14
+ label: "Password",
15
+ description: "Password for LinkedIn account",
16
+ secret: true,
17
+ },
18
+ country: {
19
+ type: "string",
20
+ label: "Country",
21
+ description: "Country code for proxy selection",
22
+ optional: true,
23
+ options: [
24
+ "US",
25
+ "UK",
26
+ "FR",
27
+ "DE",
28
+ "NL",
29
+ "IT",
30
+ "IL",
31
+ "CA",
32
+ "BR",
33
+ "ES",
34
+ "IN",
35
+ ],
36
+ },
37
+ loginToken: {
38
+ type: "string",
39
+ label: "Login Token",
40
+ description: "LinkedIn authentication token obtained from login/verify process",
41
+ secret: true,
42
+ },
43
+ code: {
44
+ type: "string",
45
+ label: "Verification Code",
46
+ description: "Verification code received via email",
47
+ },
48
+ linkedinUrl: {
49
+ type: "string",
50
+ label: "LinkedIn URL",
51
+ description: "LinkedIn profile or company URL. Eg. `https://www.linkedin.com/in/john-doe/` or `https://www.linkedin.com/company/stripe/`",
52
+ },
53
+ conversationId: {
54
+ type: "string",
55
+ label: "Conversation ID",
56
+ description: "LinkedIn conversation identifier",
57
+ async options({
58
+ prevContext, loginToken,
59
+ }) {
60
+ if (!loginToken || prevContext?.nextCursor === null) {
61
+ return [];
62
+ }
63
+ const {
64
+ data: {
65
+ conversations,
66
+ next_cursor,
67
+ },
68
+ } = await this.getConversations({
69
+ data: {
70
+ login_token: loginToken,
71
+ next_cursor: prevContext?.nextCursor,
72
+ },
73
+ });
74
+ return {
75
+ options: conversations.map(({
76
+ conversation_id: value,
77
+ last_message: { text },
78
+ participant: { name },
79
+ }) => ({
80
+ label: `${name || "Unknown"} - ${text?.substring(0, 50) || "No message"}`,
81
+ value,
82
+ })),
83
+ context: {
84
+ nextCursor: next_cursor,
85
+ },
86
+ };
87
+ },
88
+ },
89
+ messageText: {
90
+ type: "string",
91
+ label: "Message Text",
92
+ description: "Message content",
93
+ },
94
+ location: {
95
+ type: "string[]",
96
+ label: "Locations",
97
+ description: "Geographic locations to filter",
98
+ optional: true,
99
+ },
100
+ companyUrl: {
101
+ type: "string[]",
102
+ label: "Company URLs",
103
+ description: "LinkedIn company URLs. Eg. `https://www.linkedin.com/company/stripe/`",
104
+ optional: true,
105
+ },
106
+ },
5
107
  methods: {
6
- // this.$auth contains connected account data
7
- authKeys() {
8
- console.log(Object.keys(this.$auth));
108
+ getUrl(path) {
109
+ return `https://api.linkupapi.com/v1${path}`;
110
+ },
111
+ _getHeaders() {
112
+ return {
113
+ "x-api-key": this.$auth.api_key,
114
+ "Content-Type": "application/json",
115
+ };
116
+ },
117
+ _makeRequest({
118
+ $ = this, path, ...opts
119
+ } = {}) {
120
+ return axios($, {
121
+ ...opts,
122
+ url: this.getUrl(path),
123
+ headers: this._getHeaders(),
124
+ });
125
+ },
126
+ post(opts = {}) {
127
+ return this._makeRequest({
128
+ method: "POST",
129
+ ...opts,
130
+ });
131
+ },
132
+ login(opts = {}) {
133
+ return this.post({
134
+ path: "/auth/login",
135
+ ...opts,
136
+ });
137
+ },
138
+ verify(opts = {}) {
139
+ return this.post({
140
+ path: "/auth/verify",
141
+ ...opts,
142
+ });
143
+ },
144
+ getProfileInfo(opts = {}) {
145
+ return this.post({
146
+ path: "/profile/info",
147
+ ...opts,
148
+ });
149
+ },
150
+ searchProfiles(opts = {}) {
151
+ return this.post({
152
+ path: "/profile/search",
153
+ ...opts,
154
+ });
155
+ },
156
+ searchCompanies(opts = {}) {
157
+ return this.post({
158
+ path: "/companies/search",
159
+ ...opts,
160
+ });
161
+ },
162
+ getCompanyInfo(opts = {}) {
163
+ return this.post({
164
+ path: "/companies/info",
165
+ ...opts,
166
+ });
167
+ },
168
+ connectToProfile(opts = {}) {
169
+ return this.post({
170
+ path: "/network/connect",
171
+ ...opts,
172
+ });
173
+ },
174
+ getInvitationsStatus(opts = {}) {
175
+ return this.post({
176
+ path: "/network/invitations",
177
+ ...opts,
178
+ });
179
+ },
180
+ sendMessage(opts = {}) {
181
+ return this.post({
182
+ path: "/messages/send-message",
183
+ ...opts,
184
+ });
185
+ },
186
+ getConversationMessages(opts = {}) {
187
+ return this.post({
188
+ path: "/messages/conversation",
189
+ ...opts,
190
+ });
191
+ },
192
+ getConversations(opts = {}) {
193
+ return this.post({
194
+ path: "/messages/inbox",
195
+ ...opts,
196
+ });
197
+ },
198
+ createComment(opts = {}) {
199
+ return this.post({
200
+ path: "/posts/comment",
201
+ ...opts,
202
+ });
9
203
  },
10
204
  },
11
- };
205
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/linkupapi",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
4
  "description": "Pipedream LinkupAPI Components",
5
5
  "main": "linkupapi.app.mjs",
6
6
  "keywords": [
@@ -11,5 +11,8 @@
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "publishConfig": {
13
13
  "access": "public"
14
+ },
15
+ "dependencies": {
16
+ "@pipedream/platform": "^3.1.1"
14
17
  }
15
18
  }