@pipedream/linkupapi 0.1.0 → 1.0.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.
- package/actions/connect-account/connect-account.mjs +84 -0
- package/actions/connect-to-profile/connect-to-profile.mjs +35 -33
- package/actions/create-comment/create-comment.mjs +55 -0
- package/actions/get-account-details/get-account-details.mjs +32 -0
- package/actions/get-company-info/get-company-info.mjs +18 -34
- package/actions/get-conversation-messages/get-conversation-messages.mjs +38 -48
- package/actions/get-invitations-status/get-invitations-status.mjs +37 -34
- package/actions/get-profile-info/get-profile-info.mjs +30 -26
- package/actions/list-accounts/list-accounts.mjs +51 -0
- package/actions/list-inbox/list-inbox.mjs +66 -0
- package/actions/search-companies/search-companies.mjs +29 -55
- package/actions/search-profiles/search-profiles.mjs +78 -79
- package/actions/send-message/send-message.mjs +26 -48
- package/actions/verify-code/verify-code.mjs +15 -29
- package/common/constants.mjs +29 -0
- package/linkupapi.app.mjs +144 -62
- package/package.json +1 -1
- package/actions/login/login.mjs +0 -56
- package/common/utils.mjs +0 -9
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import app from "../../linkupapi.app.mjs";
|
|
2
|
+
import { ACCOUNTS_MAX_PAGE_SIZE } from "../../common/constants.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "linkupapi-list-accounts",
|
|
6
|
+
name: "List Accounts",
|
|
7
|
+
description: "List the LinkupAPI accounts connected to your API key, each with its persistent `account_id` to use in other actions. [See the documentation](https://docs.linkupapi.com/api-reference/v2/accounts/list-accounts)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
annotations: {
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
openWorldHint: true,
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
app,
|
|
17
|
+
totalResults: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
app,
|
|
20
|
+
"totalResults",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const accounts = await this.app._paginate({
|
|
26
|
+
max: this.totalResults,
|
|
27
|
+
requestPage: ({
|
|
28
|
+
next, count,
|
|
29
|
+
}) => this.app.listAccounts({
|
|
30
|
+
$,
|
|
31
|
+
params: {
|
|
32
|
+
limit: Math.min(ACCOUNTS_MAX_PAGE_SIZE, count),
|
|
33
|
+
offset: next || 0,
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
getItems: (res) => res.data?.items,
|
|
37
|
+
getNext: (res) => {
|
|
38
|
+
const data = res.data || {};
|
|
39
|
+
const nextOffset = (data.offset || 0) + (data.items?.length || 0);
|
|
40
|
+
return nextOffset < (data.total || 0)
|
|
41
|
+
? nextOffset
|
|
42
|
+
: null;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
$.export("$summary", `Successfully retrieved ${accounts.length} account${accounts.length === 1
|
|
47
|
+
? ""
|
|
48
|
+
: "s"}`);
|
|
49
|
+
return accounts;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import app from "../../linkupapi.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "linkupapi-list-inbox",
|
|
5
|
+
name: "List Inbox",
|
|
6
|
+
description: "List conversations from the LinkedIn inbox, each with its `conversation_id` to use with **Get Conversation Messages**. [See the documentation](https://docs.linkupapi.com/api-reference/v2/messages/list-inbox)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
readOnlyHint: true,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
openWorldHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
app,
|
|
16
|
+
accountId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
app,
|
|
19
|
+
"accountId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
totalResults: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
app,
|
|
25
|
+
"totalResults",
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
category: {
|
|
29
|
+
type: "string",
|
|
30
|
+
label: "Category",
|
|
31
|
+
description: "Filter conversations by category.",
|
|
32
|
+
optional: true,
|
|
33
|
+
options: [
|
|
34
|
+
"INBOX",
|
|
35
|
+
"UNREAD",
|
|
36
|
+
"MY_CONNECTIONS",
|
|
37
|
+
"INMAIL",
|
|
38
|
+
"STARRED",
|
|
39
|
+
],
|
|
40
|
+
default: "INBOX",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
async run({ $ }) {
|
|
44
|
+
const conversations = await this.app._paginate({
|
|
45
|
+
max: this.totalResults,
|
|
46
|
+
requestPage: ({
|
|
47
|
+
next, count,
|
|
48
|
+
}) => this.app.listInbox({
|
|
49
|
+
$,
|
|
50
|
+
accountId: this.accountId,
|
|
51
|
+
params: {
|
|
52
|
+
count,
|
|
53
|
+
cursor: next,
|
|
54
|
+
category: this.category,
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
getItems: (res) => res.data?.conversations,
|
|
58
|
+
getNext: (res) => res.data?.next_cursor,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
$.export("$summary", `Successfully retrieved ${conversations.length} conversation${conversations.length === 1
|
|
62
|
+
? ""
|
|
63
|
+
: "s"}`);
|
|
64
|
+
return conversations;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import app from "../../linkupapi.app.mjs";
|
|
2
|
-
import utils from "../../common/utils.mjs";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
type: "action",
|
|
6
5
|
key: "linkupapi-search-companies",
|
|
7
6
|
name: "Search Companies",
|
|
8
|
-
description: "Search for
|
|
9
|
-
version: "0.0
|
|
7
|
+
description: "Search for LinkedIn companies. [See the documentation](https://docs.linkupapi.com/api-reference/v2/profiles/search-companies)",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
annotations: {
|
|
10
|
+
readOnlyHint: true,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
openWorldHint: true,
|
|
13
|
+
},
|
|
10
14
|
props: {
|
|
11
15
|
app,
|
|
12
|
-
|
|
16
|
+
accountId: {
|
|
13
17
|
propDefinition: [
|
|
14
18
|
app,
|
|
15
|
-
"
|
|
19
|
+
"accountId",
|
|
16
20
|
],
|
|
17
21
|
},
|
|
18
22
|
keyword: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
propDefinition: [
|
|
24
|
+
app,
|
|
25
|
+
"keyword",
|
|
26
|
+
],
|
|
27
|
+
description: "Free-text keyword to search companies by (e.g. company name or industry).",
|
|
23
28
|
},
|
|
24
29
|
location: {
|
|
25
|
-
description: "Geographic locations to filter companies",
|
|
26
30
|
propDefinition: [
|
|
27
31
|
app,
|
|
28
32
|
"location",
|
|
@@ -31,69 +35,39 @@ export default {
|
|
|
31
35
|
sector: {
|
|
32
36
|
type: "string[]",
|
|
33
37
|
label: "Sector",
|
|
34
|
-
description: "Industry
|
|
38
|
+
description: "Industry sectors to filter by, passed as an array of strings.",
|
|
35
39
|
optional: true,
|
|
36
40
|
},
|
|
37
41
|
companySize: {
|
|
38
|
-
type: "string",
|
|
42
|
+
type: "string[]",
|
|
39
43
|
label: "Company Size",
|
|
40
|
-
description: "
|
|
44
|
+
description: "Company size ranges to filter by, passed as an array of strings, e.g. `[\"11-50\", \"51-200\"]`.",
|
|
41
45
|
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
46
|
},
|
|
53
47
|
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
48
|
propDefinition: [
|
|
61
49
|
app,
|
|
62
|
-
"
|
|
50
|
+
"totalResults",
|
|
63
51
|
],
|
|
64
52
|
},
|
|
65
53
|
},
|
|
66
|
-
annotations: {
|
|
67
|
-
readOnlyHint: true,
|
|
68
|
-
destructiveHint: false,
|
|
69
|
-
openWorldHint: true,
|
|
70
|
-
idempotentHint: true,
|
|
71
|
-
},
|
|
72
54
|
async run({ $ }) {
|
|
73
|
-
const {
|
|
74
|
-
loginToken,
|
|
75
|
-
country,
|
|
76
|
-
keyword,
|
|
77
|
-
location,
|
|
78
|
-
sector,
|
|
79
|
-
companySize,
|
|
80
|
-
totalResults,
|
|
81
|
-
} = this;
|
|
82
|
-
|
|
83
55
|
const response = await this.app.searchCompanies({
|
|
84
56
|
$,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
total_results: totalResults,
|
|
57
|
+
accountId: this.accountId,
|
|
58
|
+
params: {
|
|
59
|
+
keyword: this.keyword,
|
|
60
|
+
location: this.location,
|
|
61
|
+
sector: this.sector,
|
|
62
|
+
company_size: this.companySize,
|
|
63
|
+
total_results: this.totalResults,
|
|
93
64
|
},
|
|
94
65
|
});
|
|
95
66
|
|
|
96
|
-
|
|
67
|
+
const count = response.data?.companies?.length || 0;
|
|
68
|
+
$.export("$summary", `Successfully retrieved ${count} compan${count === 1
|
|
69
|
+
? "y"
|
|
70
|
+
: "ies"}`);
|
|
97
71
|
return response;
|
|
98
72
|
},
|
|
99
73
|
};
|
|
@@ -1,144 +1,143 @@
|
|
|
1
1
|
import app from "../../linkupapi.app.mjs";
|
|
2
|
-
import utils from "../../common/utils.mjs";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
type: "action",
|
|
6
5
|
key: "linkupapi-search-profiles",
|
|
7
6
|
name: "Search Profiles",
|
|
8
|
-
description: "Search for LinkedIn
|
|
9
|
-
version: "0.0
|
|
7
|
+
description: "Search for LinkedIn people. [See the documentation](https://docs.linkupapi.com/api-reference/v2/profiles/search-people)",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
annotations: {
|
|
10
|
+
readOnlyHint: true,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
openWorldHint: true,
|
|
13
|
+
},
|
|
10
14
|
props: {
|
|
11
15
|
app,
|
|
12
|
-
|
|
16
|
+
accountId: {
|
|
13
17
|
propDefinition: [
|
|
14
18
|
app,
|
|
15
|
-
"
|
|
19
|
+
"accountId",
|
|
16
20
|
],
|
|
17
21
|
},
|
|
18
22
|
keyword: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
propDefinition: [
|
|
24
|
+
app,
|
|
25
|
+
"keyword",
|
|
26
|
+
],
|
|
27
|
+
description: "Free-text keyword to search people by (e.g. name, title, or company).",
|
|
23
28
|
},
|
|
24
29
|
firstName: {
|
|
25
30
|
type: "string",
|
|
26
31
|
label: "First Name",
|
|
27
|
-
description: "
|
|
32
|
+
description: "Filter by first name.",
|
|
28
33
|
optional: true,
|
|
29
34
|
},
|
|
30
35
|
lastName: {
|
|
31
36
|
type: "string",
|
|
32
37
|
label: "Last Name",
|
|
33
|
-
description: "
|
|
38
|
+
description: "Filter by last name.",
|
|
34
39
|
optional: true,
|
|
35
40
|
},
|
|
36
41
|
title: {
|
|
37
42
|
type: "string",
|
|
38
|
-
label: "
|
|
39
|
-
description: "
|
|
43
|
+
label: "Title",
|
|
44
|
+
description: "Filter by current job title.",
|
|
40
45
|
optional: true,
|
|
41
46
|
},
|
|
42
|
-
|
|
47
|
+
companyName: {
|
|
48
|
+
type: "string",
|
|
49
|
+
label: "Company Name",
|
|
50
|
+
description: "Filter by current company name.",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
location: {
|
|
43
54
|
propDefinition: [
|
|
44
55
|
app,
|
|
45
|
-
"
|
|
56
|
+
"location",
|
|
46
57
|
],
|
|
47
58
|
},
|
|
48
|
-
|
|
49
|
-
description: "Geographic locations to filter profiles",
|
|
59
|
+
companyUrl: {
|
|
50
60
|
propDefinition: [
|
|
51
61
|
app,
|
|
52
|
-
"
|
|
62
|
+
"companyUrl",
|
|
53
63
|
],
|
|
54
64
|
},
|
|
65
|
+
pastCompany: {
|
|
66
|
+
type: "string[]",
|
|
67
|
+
label: "Past Companies",
|
|
68
|
+
description: "Filter by past companies, passed as an array of LinkedIn company URLs.",
|
|
69
|
+
optional: true,
|
|
70
|
+
},
|
|
55
71
|
schoolUrl: {
|
|
56
72
|
type: "string[]",
|
|
57
73
|
label: "School URLs",
|
|
58
|
-
description: "LinkedIn school URLs",
|
|
74
|
+
description: "Filter by schools, passed as an array of LinkedIn school URLs.",
|
|
75
|
+
optional: true,
|
|
76
|
+
},
|
|
77
|
+
industry: {
|
|
78
|
+
type: "string[]",
|
|
79
|
+
label: "Industries",
|
|
80
|
+
description: "Filter by industries, passed as an array of strings.",
|
|
59
81
|
optional: true,
|
|
60
82
|
},
|
|
61
83
|
network: {
|
|
62
84
|
type: "string[]",
|
|
63
|
-
label: "Network
|
|
64
|
-
description: "Filter by
|
|
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
|
-
],
|
|
85
|
+
label: "Network",
|
|
86
|
+
description: "Filter by network degree, passed as an array (e.g. `[\"F\"]` for 1st, `[\"S\"]` for 2nd, `[\"O\"]` for 3rd+).",
|
|
79
87
|
optional: true,
|
|
80
88
|
},
|
|
81
|
-
|
|
82
|
-
type: "
|
|
83
|
-
label: "
|
|
84
|
-
description: "
|
|
89
|
+
connectionOf: {
|
|
90
|
+
type: "string",
|
|
91
|
+
label: "Connection Of",
|
|
92
|
+
description: "Return people who are connections of this profile (LinkedIn profile URN or public identifier).",
|
|
93
|
+
optional: true,
|
|
94
|
+
},
|
|
95
|
+
followerOf: {
|
|
96
|
+
type: "string",
|
|
97
|
+
label: "Follower Of",
|
|
98
|
+
description: "Return people who are followers of this profile (LinkedIn profile URN or public identifier).",
|
|
85
99
|
optional: true,
|
|
86
100
|
},
|
|
87
101
|
fetchInvitationState: {
|
|
88
102
|
type: "boolean",
|
|
89
103
|
label: "Fetch Invitation State",
|
|
90
|
-
description: "Whether to
|
|
104
|
+
description: "Whether to include each result's connection/invitation state.",
|
|
91
105
|
optional: true,
|
|
92
106
|
},
|
|
93
|
-
|
|
107
|
+
totalResults: {
|
|
94
108
|
propDefinition: [
|
|
95
109
|
app,
|
|
96
|
-
"
|
|
110
|
+
"totalResults",
|
|
97
111
|
],
|
|
98
112
|
},
|
|
99
113
|
},
|
|
100
|
-
annotations: {
|
|
101
|
-
readOnlyHint: true,
|
|
102
|
-
destructiveHint: false,
|
|
103
|
-
openWorldHint: true,
|
|
104
|
-
idempotentHint: true,
|
|
105
|
-
},
|
|
106
114
|
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({
|
|
115
|
+
const response = await this.app.searchProfiles({
|
|
124
116
|
$,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
117
|
+
accountId: this.accountId,
|
|
118
|
+
params: {
|
|
119
|
+
keyword: this.keyword,
|
|
120
|
+
first_name: this.firstName,
|
|
121
|
+
last_name: this.lastName,
|
|
122
|
+
title: this.title,
|
|
123
|
+
company_name: this.companyName,
|
|
124
|
+
location: this.location,
|
|
125
|
+
company_url: this.companyUrl,
|
|
126
|
+
past_company: this.pastCompany,
|
|
127
|
+
school_url: this.schoolUrl,
|
|
128
|
+
industry: this.industry,
|
|
129
|
+
network: this.network,
|
|
130
|
+
connection_of: this.connectionOf,
|
|
131
|
+
follower_of: this.followerOf,
|
|
132
|
+
fetch_invitation_state: this.fetchInvitationState,
|
|
133
|
+
total_results: this.totalResults,
|
|
138
134
|
},
|
|
139
135
|
});
|
|
140
136
|
|
|
141
|
-
|
|
137
|
+
const count = response.data?.results?.length || 0;
|
|
138
|
+
$.export("$summary", `Successfully retrieved ${count} profile${count === 1
|
|
139
|
+
? ""
|
|
140
|
+
: "s"}`);
|
|
142
141
|
return response;
|
|
143
142
|
},
|
|
144
143
|
};
|
|
@@ -4,20 +4,19 @@ export default {
|
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "linkupapi-send-message",
|
|
6
6
|
name: "Send Message",
|
|
7
|
-
description: "Send a message to a LinkedIn profile. [See the documentation](https://docs.linkupapi.com/api-reference/
|
|
8
|
-
version: "0.0
|
|
7
|
+
description: "Send a message to a LinkedIn profile. Make sure you are already connected to the recipient. [See the documentation](https://docs.linkupapi.com/api-reference/v2/messages/send)",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
annotations: {
|
|
10
|
+
readOnlyHint: false,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
openWorldHint: true,
|
|
13
|
+
},
|
|
9
14
|
props: {
|
|
10
15
|
app,
|
|
11
|
-
|
|
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: {
|
|
16
|
+
accountId: {
|
|
18
17
|
propDefinition: [
|
|
19
18
|
app,
|
|
20
|
-
"
|
|
19
|
+
"accountId",
|
|
21
20
|
],
|
|
22
21
|
},
|
|
23
22
|
linkedinUrl: {
|
|
@@ -25,6 +24,7 @@ export default {
|
|
|
25
24
|
app,
|
|
26
25
|
"linkedinUrl",
|
|
27
26
|
],
|
|
27
|
+
description: "LinkedIn profile URL of the recipient. Eg. `https://www.linkedin.com/in/john-doe/`.",
|
|
28
28
|
},
|
|
29
29
|
messageText: {
|
|
30
30
|
propDefinition: [
|
|
@@ -32,47 +32,25 @@ export default {
|
|
|
32
32
|
"messageText",
|
|
33
33
|
],
|
|
34
34
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
mediaLink: {
|
|
36
|
+
type: "string",
|
|
37
|
+
label: "Media Link",
|
|
38
|
+
description: "URL of a media attachment (image, document, etc.) to include with the message.",
|
|
39
|
+
optional: true,
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
|
-
annotations: {
|
|
43
|
-
readOnlyHint: false,
|
|
44
|
-
destructiveHint: true,
|
|
45
|
-
openWorldHint: true,
|
|
46
|
-
idempotentHint: false,
|
|
47
|
-
},
|
|
48
42
|
async run({ $ }) {
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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");
|
|
43
|
+
const response = await this.app.sendMessage({
|
|
44
|
+
$,
|
|
45
|
+
accountId: this.accountId,
|
|
46
|
+
params: {
|
|
47
|
+
profile_url: this.linkedinUrl,
|
|
48
|
+
message_text: this.messageText,
|
|
49
|
+
media_link: this.mediaLink,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
69
52
|
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
}
|
|
53
|
+
$.export("$summary", `Successfully sent message to ${this.linkedinUrl}`);
|
|
54
|
+
return response;
|
|
77
55
|
},
|
|
78
56
|
};
|
|
@@ -4,14 +4,19 @@ export default {
|
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "linkupapi-verify-code",
|
|
6
6
|
name: "Verify Code",
|
|
7
|
-
description: "
|
|
8
|
-
version: "0.0
|
|
7
|
+
description: "Submit a checkpoint/challenge verification code to complete authentication for a connected account. [See the documentation](https://docs.linkupapi.com/api-reference/v2/accounts/checkpoint)",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
annotations: {
|
|
10
|
+
readOnlyHint: false,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
openWorldHint: true,
|
|
13
|
+
},
|
|
9
14
|
props: {
|
|
10
15
|
app,
|
|
11
|
-
|
|
16
|
+
accountId: {
|
|
12
17
|
propDefinition: [
|
|
13
18
|
app,
|
|
14
|
-
"
|
|
19
|
+
"accountId",
|
|
15
20
|
],
|
|
16
21
|
},
|
|
17
22
|
code: {
|
|
@@ -19,39 +24,20 @@ export default {
|
|
|
19
24
|
app,
|
|
20
25
|
"code",
|
|
21
26
|
],
|
|
27
|
+
optional: true,
|
|
28
|
+
description: "Verification code received via email, SMS, or authenticator app. Required for a `code_challenge`; leave empty for an `app_challenge` (approve the login from the LinkedIn mobile app first).",
|
|
22
29
|
},
|
|
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
30
|
},
|
|
36
31
|
async run({ $ }) {
|
|
37
|
-
const {
|
|
38
|
-
app,
|
|
39
|
-
email,
|
|
40
|
-
code,
|
|
41
|
-
country,
|
|
42
|
-
} = this;
|
|
43
|
-
|
|
44
|
-
const response = await app.verify({
|
|
32
|
+
const response = await this.app.verifyCheckpoint({
|
|
45
33
|
$,
|
|
46
34
|
data: {
|
|
47
|
-
|
|
48
|
-
code,
|
|
49
|
-
country,
|
|
35
|
+
account_id: this.accountId,
|
|
36
|
+
code: this.code,
|
|
50
37
|
},
|
|
51
38
|
});
|
|
52
39
|
|
|
53
|
-
$.export("$summary",
|
|
54
|
-
|
|
40
|
+
$.export("$summary", `Successfully verified code for account ${this.accountId}`);
|
|
55
41
|
return response;
|
|
56
42
|
},
|
|
57
43
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const BASE_URL = "https://api.linkupapi.com/v2";
|
|
2
|
+
|
|
3
|
+
export const ENDPOINTS = {
|
|
4
|
+
LOGIN: "/login",
|
|
5
|
+
CHECKPOINT: "/checkpoint",
|
|
6
|
+
ACCOUNTS: "/accounts",
|
|
7
|
+
PROFILES: "/profiles",
|
|
8
|
+
MESSAGES: "/messages",
|
|
9
|
+
NETWORK: "/network",
|
|
10
|
+
CONTENT: "/content",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const ACTIONS = {
|
|
14
|
+
GET: "get",
|
|
15
|
+
SEARCH_PEOPLE: "search_people",
|
|
16
|
+
SEARCH_COMPANIES: "search_companies",
|
|
17
|
+
GET_COMPANY: "get_company",
|
|
18
|
+
INVITE: "invite",
|
|
19
|
+
LIST_INVITATIONS: "list_invitations",
|
|
20
|
+
SEND: "send",
|
|
21
|
+
GET_CONVERSATION: "get_conversation",
|
|
22
|
+
LIST_INBOX: "list_inbox",
|
|
23
|
+
COMMENT: "comment",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const DEFAULT_PLATFORM = "linkedin";
|
|
27
|
+
|
|
28
|
+
// Max accounts the List Accounts endpoint returns per page (GET /accounts `limit`).
|
|
29
|
+
export const ACCOUNTS_MAX_PAGE_SIZE = 500;
|