@pipedream/linkedin 0.0.3 → 0.1.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.
Files changed (25) hide show
  1. package/actions/analytics-finder-account-sample/analytics-finder-account-sample.mjs +1 -1
  2. package/actions/analytics-finder-campaign-sample/analytics-finder-campaign-sample.mjs +1 -1
  3. package/actions/create-comment/create-comment.mjs +1 -1
  4. package/actions/create-image-post-organization/create-image-post-organization.mjs +95 -0
  5. package/actions/create-image-post-user/create-image-post-user.mjs +94 -0
  6. package/actions/create-like-on-share/create-like-on-share.mjs +1 -1
  7. package/actions/create-text-post-organization/create-text-post-organization.mjs +15 -1
  8. package/actions/create-text-post-user/create-text-post-user.mjs +15 -1
  9. package/actions/delete-post/delete-post.mjs +1 -1
  10. package/actions/fetch-ad-account/fetch-ad-account.mjs +1 -1
  11. package/actions/get-current-member-profile/get-current-member-profile.mjs +1 -1
  12. package/actions/get-member-organization-access-control/get-member-organization-access-control.mjs +1 -1
  13. package/actions/get-member-profile/get-member-profile.mjs +1 -1
  14. package/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs +1 -1
  15. package/actions/get-organization-access-control/get-organization-access-control.mjs +1 -1
  16. package/actions/get-organization-administrators/get-organization-administrators.mjs +1 -1
  17. package/actions/query-analytics-finder/query-analytics-finder.mjs +1 -1
  18. package/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs +1 -1
  19. package/actions/retrieve-comments-shares/retrieve-comments-shares.mjs +1 -1
  20. package/actions/search-organization/search-organization.mjs +1 -1
  21. package/common/constants.mjs +3 -3
  22. package/package.json +3 -2
  23. package/actions/post-share/post-share.mjs +0 -53
  24. package/actions/share-content/share-content.mjs +0 -59
  25. package/actions/share-text-mentions/share-text-mentions.mjs +0 -52
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-analytics-finder-account-sample",
5
5
  name: "Query Analytics Finder Account Sample",
6
6
  description: "Sample query using analytics finder that gets analytics for a particular account for date range starting in a given year. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting#sample-request)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-analytics-finder-campaign-sample",
5
5
  name: "Query Analytics Finder Campaign Sample",
6
6
  description: "Sample query using analytics finder that gets analytics for a particular campaign in a date range starting in a given year. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting#analytics-finder)",
7
- version: "0.2.2",
7
+ version: "0.2.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-create-comment",
5
5
  name: "Create Comment",
6
6
  description: "Create a comment on a share or user generated content post. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/network-update-social-actions#create-comment)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -0,0 +1,95 @@
1
+ import linkedin from "../../linkedin.app.mjs";
2
+ import fs from "fs";
3
+ import FormData from "form-data";
4
+
5
+ export default {
6
+ key: "linkedin-create-image-post-organization",
7
+ name: "Create Image Post (Organization)",
8
+ description: "Create an image post on LinkedIn. [See the docs here](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/images-api?view=li-lms-2023-09&tabs=http#uploading-an-image)",
9
+ version: "0.0.1",
10
+ type: "action",
11
+ props: {
12
+ linkedin,
13
+ organizationId: {
14
+ propDefinition: [
15
+ linkedin,
16
+ "organizationId",
17
+ ],
18
+ },
19
+ filePath: {
20
+ type: "string",
21
+ label: "File Path",
22
+ description: "The path to the image file saved to the `/tmp` directory (e.g. `/tmp/image.png`). [See the documentation](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).",
23
+ },
24
+ text: {
25
+ propDefinition: [
26
+ linkedin,
27
+ "text",
28
+ ],
29
+ },
30
+ },
31
+ methods: {
32
+ initializeUpload({
33
+ data, ...args
34
+ }) {
35
+ data = {
36
+ ...data,
37
+ initializeUploadRequest: {
38
+ owner: `urn:li:organization:${this.organizationId}`,
39
+ },
40
+ };
41
+ return this.linkedin._makeRequest({
42
+ method: "POST",
43
+ path: "/images?action=initializeUpload",
44
+ data,
45
+ ...args,
46
+ });
47
+ },
48
+ uploadImage(url, data) {
49
+ return this.linkedin._makeRequest({
50
+ url,
51
+ method: "PUT",
52
+ data,
53
+ headers: {
54
+ ...this.linkedin._getHeaders(),
55
+ ...data.getHeaders(),
56
+ },
57
+ });
58
+ },
59
+ },
60
+ async run({ $ }) {
61
+ const {
62
+ value: {
63
+ uploadUrl, image,
64
+ },
65
+ } = await this.initializeUpload({
66
+ $,
67
+ });
68
+
69
+ const filePath = this.filePath.startsWith("/tmp/")
70
+ ? this.filePath
71
+ : `/tmp/${this.filePath}`;
72
+ const formData = new FormData();
73
+ formData.append("file", fs.createReadStream(filePath));
74
+
75
+ await this.uploadImage(uploadUrl, formData);
76
+
77
+ await this.linkedin.createPost({
78
+ data: {
79
+ author: this.organizationId,
80
+ commentary: this.text,
81
+ visibility: "PUBLIC",
82
+ content: {
83
+ media: {
84
+ id: image,
85
+ },
86
+ },
87
+ },
88
+ $,
89
+ });
90
+
91
+ $.export("$summary", "Successfully posted image.");
92
+
93
+ // nothing to return
94
+ },
95
+ };
@@ -0,0 +1,94 @@
1
+ import linkedin from "../../linkedin.app.mjs";
2
+ import fs from "fs";
3
+ import FormData from "form-data";
4
+
5
+ export default {
6
+ key: "linkedin-create-image-post-user",
7
+ name: "Create Image Post (User)",
8
+ description: "Create an image post on LinkedIn. [See the docs here](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/images-api?view=li-lms-2023-09&tabs=http#uploading-an-image)",
9
+ version: "0.0.1",
10
+ type: "action",
11
+ props: {
12
+ linkedin,
13
+ filePath: {
14
+ type: "string",
15
+ label: "File Path",
16
+ description: "The path to the image file saved to the `/tmp` directory (e.g. `/tmp/image.png`). [See the documentation](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory).",
17
+ },
18
+ text: {
19
+ propDefinition: [
20
+ linkedin,
21
+ "text",
22
+ ],
23
+ },
24
+ visibility: {
25
+ propDefinition: [
26
+ linkedin,
27
+ "visibility",
28
+ ],
29
+ },
30
+ },
31
+ methods: {
32
+ initializeUpload({
33
+ data, ...args
34
+ }) {
35
+ data = {
36
+ ...data,
37
+ initializeUploadRequest: {
38
+ owner: `urn:li:person:${this.linkedin.$auth.oauth_uid}`,
39
+ },
40
+ };
41
+ return this.linkedin._makeRequest({
42
+ method: "POST",
43
+ path: "/images?action=initializeUpload",
44
+ data,
45
+ ...args,
46
+ });
47
+ },
48
+ uploadImage(url, data) {
49
+ return this.linkedin._makeRequest({
50
+ url,
51
+ method: "PUT",
52
+ data,
53
+ headers: {
54
+ ...this.linkedin._getHeaders(),
55
+ ...data.getHeaders(),
56
+ },
57
+ });
58
+ },
59
+ },
60
+ async run({ $ }) {
61
+ const {
62
+ value: {
63
+ uploadUrl, image,
64
+ },
65
+ } = await this.initializeUpload({
66
+ $,
67
+ });
68
+
69
+ const filePath = this.filePath.startsWith("/tmp/")
70
+ ? this.filePath
71
+ : `/tmp/${this.filePath}`;
72
+ const formData = new FormData();
73
+ formData.append("file", fs.createReadStream(filePath));
74
+
75
+ await this.uploadImage(uploadUrl, formData);
76
+
77
+ await this.linkedin.createPost({
78
+ data: {
79
+ commentary: this.text,
80
+ visibility: this.visibility,
81
+ content: {
82
+ media: {
83
+ id: image,
84
+ },
85
+ },
86
+ },
87
+ $,
88
+ });
89
+
90
+ $.export("$summary", "Successfully posted image.");
91
+
92
+ // nothing to return
93
+ },
94
+ };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-create-like-on-share",
5
5
  name: "Create Like On Share",
6
6
  description: "Creates a like on a share. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/network-update-social-actions#create-a-like-on-a-share)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-create-text-post-organization",
5
5
  name: "Create a Simple Post (Organization)",
6
6
  description: "Create post on LinkedIn using text, URL or article. [See the docs](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/posts-api?view=li-lms-2022-11&tabs=http#create-organic-posts) for more information",
7
- version: "0.0.2",
7
+ version: "0.0.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -20,6 +20,12 @@ export default {
20
20
  "text",
21
21
  ],
22
22
  },
23
+ article: {
24
+ type: "string",
25
+ label: "Article URL",
26
+ description: "The URL of an article to share",
27
+ optional: true,
28
+ },
23
29
  },
24
30
  async run({ $ }) {
25
31
  const data = {
@@ -27,6 +33,14 @@ export default {
27
33
  commentary: this.text,
28
34
  visibility: "PUBLIC",
29
35
  };
36
+ if (this.article) {
37
+ data.content = {
38
+ article: {
39
+ source: this.article,
40
+ title: this.article,
41
+ },
42
+ };
43
+ }
30
44
  const response = await this.linkedin.createPost({
31
45
  $,
32
46
  data,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-create-text-post-user",
5
5
  name: "Create a Simple Post (User)",
6
6
  description: "Create post on LinkedIn using text, URL or article. [See the docs](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/posts-api?view=li-lms-2022-11&tabs=http#create-organic-posts) for more information",
7
- version: "0.0.2",
7
+ version: "0.0.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -20,12 +20,26 @@ export default {
20
20
  "text",
21
21
  ],
22
22
  },
23
+ article: {
24
+ type: "string",
25
+ label: "Article URL",
26
+ description: "The URL of an article to share",
27
+ optional: true,
28
+ },
23
29
  },
24
30
  async run({ $ }) {
25
31
  const data = {
26
32
  commentary: this.text,
27
33
  visibility: this.visibility,
28
34
  };
35
+ if (this.article) {
36
+ data.content = {
37
+ article: {
38
+ source: this.article,
39
+ title: this.article,
40
+ },
41
+ };
42
+ }
29
43
  const response = await this.linkedin.createPost({
30
44
  $,
31
45
  data,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-delete-post",
5
5
  name: "Delete Post",
6
6
  description: "Removes a post from user's wall. [See the docs](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api?tabs=http#delete-shares) for more information",
7
- version: "0.0.2",
7
+ version: "0.0.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-fetch-ad-account",
5
5
  name: "Fetch Ad Account",
6
6
  description: "Fetches an individual adAccount given its id. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-accounts#fetch-ad-account)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-get-current-member-profile",
5
5
  name: "Get Current Member Profile",
6
6
  description: "Gets the profile of the current authenticated member. [See the docs here](https://docs.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api#retrieve-current-members-profile)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-get-member-organization-access-control",
5
5
  name: "Get Member's Organization Access Control Information",
6
6
  description: "Gets the organization access control information of the current authenticated member. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-access-control?context=linkedin/compliance/context#find-a-members-organization-access-control-information)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-get-member-profile",
5
5
  name: "Get Member Profile",
6
6
  description: "Gets another member's profile, given its person id. [See the docs here](https://docs.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api#retrieve-other-members-profile)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-get-multiple-member-profiles",
5
5
  name: "Get Multiple Member Profiles",
6
6
  description: "Gets multiple member profiles at once. [See the docs here](https://docs.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api#retrieve-other-members-profile)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-get-organization-access-control",
5
5
  name: "Gets Organization Access Control",
6
6
  description: "Gets an organization's access control information, given the organization urn. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-access-control?context=linkedin/compliance/context#find-access-control-information)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-get-organization-administrators",
5
5
  name: "Get Organization Administrators",
6
6
  description: "Gets the administator members of an organization, given the organization urn. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-access-control?context=linkedin/compliance/context#find-organization-administrators)",
7
- version: "0.2.2",
7
+ version: "0.2.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -16,7 +16,7 @@ export default {
16
16
  key: "linkedin-query-analytics-finder",
17
17
  name: "Query Analytics Finder",
18
18
  description: "Queries the Analytics Finder to get analytics for the specified entity i.e company, account, campaign. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting#analytics-finder)",
19
- version: "0.2.0",
19
+ version: "0.2.2",
20
20
  type: "action",
21
21
  props: {
22
22
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-retrieve-comments-on-comments",
5
5
  name: "Retrieves Comments on Comments",
6
6
  description: "Retrieves comments on comments, given the parent comment urn. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/network-update-social-actions#retrieve-comments-on-comments)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-retrieve-comments-shares",
5
5
  name: "Retrieve Comments On Shares",
6
6
  description: "Retrieve comments on shares given the share urn. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/network-update-social-actions#retrieve-comments-on-shares)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "linkedin-search-organization",
5
5
  name: "Search Organization",
6
6
  description: "Searches for an organization by vanity name or email domain. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-lookup-api)",
7
- version: "0.1.2",
7
+ version: "0.1.4",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -1,10 +1,10 @@
1
1
  const VERSION_PATH = "rest";
2
2
  const BASE_URL = "https://api.linkedin.com/";
3
- const VERSION_HEADER = "202206";
3
+ const VERSION_HEADER = "202309";
4
4
 
5
5
  const VISIBILITIES = [
6
6
  {
7
- label: "Connections",
7
+ label: "Only my connections",
8
8
  value: "CONNECTIONS",
9
9
  },
10
10
  {
@@ -12,7 +12,7 @@ const VISIBILITIES = [
12
12
  value: "PUBLIC",
13
13
  },
14
14
  {
15
- label: "Logged in",
15
+ label: "Logged-in users only",
16
16
  value: "LOGGED_IN",
17
17
  },
18
18
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/linkedin",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "Pipedream Linkedin Components",
5
5
  "main": "linkedin.app.mjs",
6
6
  "keywords": [
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@pipedream/platform": "^1.2.1",
17
- "axios": "^1.2.3"
17
+ "axios": "^1.2.3",
18
+ "form-data": "^4.0.0"
18
19
  }
19
20
  }
@@ -1,53 +0,0 @@
1
- import linkedin from "../../linkedin.app.mjs";
2
-
3
- export default {
4
- key: "linkedin-post-share",
5
- name: "Post Share",
6
- description: "Posts a share, text, media, or rather sponsored content, in the context of a specific member or organization. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#post-shares)",
7
- version: "0.1.2",
8
- type: "action",
9
- props: {
10
- linkedin,
11
- organizationId: {
12
- propDefinition: [
13
- linkedin,
14
- "organizationId",
15
- ],
16
- optional: true,
17
- },
18
- text: {
19
- type: "string",
20
- label: "Share Text",
21
- description: "Text of the share.",
22
- },
23
- visibility: {
24
- propDefinition: [
25
- linkedin,
26
- "visibility",
27
- ],
28
- },
29
- shareContent: {
30
- type: "object",
31
- label: "Share Content",
32
- description: "Referenced content such as articles and images. See the Schema of this property in [Share Content](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#share-content).",
33
- optional: true,
34
- },
35
- },
36
- async run({ $ }) {
37
- const data = {
38
- author: this.organizationId,
39
- commentary: this.text,
40
- visibility: this.visibility,
41
- content: this.shareContent,
42
- };
43
-
44
- const response = await this.linkedin.createPost({
45
- $,
46
- data,
47
- });
48
-
49
- $.export("$summary", "Successfully posted message");
50
-
51
- return response;
52
- },
53
- };
@@ -1,59 +0,0 @@
1
- import linkedin from "../../linkedin.app.mjs";
2
-
3
- export default {
4
- key: "linkedin-share-content",
5
- name: "Share Content",
6
- description: "Shares a post with content, which represents external articles and media such as images referenced in a share. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#post-shares)",
7
- version: "0.1.2",
8
- type: "action",
9
- props: {
10
- linkedin,
11
- organizationId: {
12
- propDefinition: [
13
- linkedin,
14
- "organizationId",
15
- ],
16
- optional: true,
17
- },
18
- shareContent: {
19
- type: "object",
20
- label: "Share Content",
21
- description: "Referenced content such as articles and images. See the Schema of this property in [Share Content](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#share-content).",
22
- },
23
- distribution: {
24
- type: "object",
25
- label: "Distribution",
26
- description: "Distribution target for the share. Required to set the share as publicly visible. For sponsored content where the targeting is defined when it is sponsored, distribution should be null. See the Schema of this property in [Share Distribution Target](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#share-distribution-targets)",
27
- optional: true,
28
- },
29
- text: {
30
- type: "string",
31
- label: "Share Text",
32
- description: "Text of the share.",
33
- },
34
- visibility: {
35
- propDefinition: [
36
- linkedin,
37
- "visibility",
38
- ],
39
- },
40
- },
41
- async run({ $ }) {
42
- const data = {
43
- author: this.organizationId,
44
- content: this.shareContent,
45
- distribution: this.distribution,
46
- commentary: this.text,
47
- visibility: this.visibility,
48
- };
49
-
50
- const response = await this.linkedin.createPost({
51
- $,
52
- data,
53
- });
54
-
55
- $.export("$summary", "Successfully shared content");
56
-
57
- return response;
58
- },
59
- };
@@ -1,52 +0,0 @@
1
- import linkedin from "../../linkedin.app.mjs";
2
-
3
- export default {
4
- key: "linkedin-share-text-mentions",
5
- name: "Share Text And Mentions",
6
- description: "Shares a posts with text and mentions only. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#share-text-and-mentions)",
7
- version: "0.3.2",
8
- type: "action",
9
- props: {
10
- linkedin,
11
- organizationId: {
12
- propDefinition: [
13
- linkedin,
14
- "organizationId",
15
- ],
16
- optional: true,
17
- },
18
- shareText: {
19
- type: "string",
20
- label: "Share Text",
21
- description: "Text of the share.",
22
- },
23
- annotations: {
24
- type: "any",
25
- label: "Annotations",
26
- description: "Annotations of the shared text, which are mentions or tags of other Linkedin entities such as organizations or members, see the full schema in [Share Text and Mentions](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/posts-api?view=li-lms-2022-11&tabs=http#mentions-and-hashtags-using-posts-commentary)",
27
- optional: true,
28
- },
29
- visibility: {
30
- propDefinition: [
31
- linkedin,
32
- "visibility",
33
- ],
34
- },
35
- },
36
- async run({ $ }) {
37
- const data = {
38
- author: this.organizationId,
39
- commentary: `${this.shareText}${this.annotations}`,
40
- visibility: this.visibility,
41
- };
42
-
43
- const response = await this.linkedin.createPost({
44
- $,
45
- data,
46
- });
47
-
48
- $.export("$summary", "Successfully shared post");
49
-
50
- return response;
51
- },
52
- };