@pipedream/linkedin 2.0.0 → 2.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.
@@ -7,7 +7,7 @@ export default {
7
7
  key: "linkedin-create-image-post-organization",
8
8
  name: "Create Image Post (Organization)",
9
9
  description: "Create an image post on LinkedIn. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/images-api?view=li-lms-2023-09&tabs=http#uploading-an-image)",
10
- version: "1.0.9",
10
+ version: "1.1.0",
11
11
  annotations: {
12
12
  destructiveHint: false,
13
13
  openWorldHint: true,
@@ -91,7 +91,8 @@ export default {
91
91
 
92
92
  await this.uploadImage(uploadUrl, formData);
93
93
 
94
- await this.linkedin.createPost({
94
+ const response = await this.linkedin.createPost({
95
+ returnFullResponse: true,
95
96
  data: {
96
97
  author: `urn:li:organization:${this.organizationId}`,
97
98
  lifecycleState: "PUBLISHED",
@@ -109,8 +110,15 @@ export default {
109
110
  $,
110
111
  });
111
112
 
112
- $.export("$summary", "Successfully posted image.");
113
+ // LinkedIn returns the new post's URN in the `x-restli-id` response header, not in the body
114
+ const postId = response?.headers?.["x-restli-id"];
115
+ $.export("$summary", postId
116
+ ? `Successfully posted image with ID ${postId}`
117
+ : "Successfully posted image.");
113
118
 
114
- // nothing to return
119
+ return {
120
+ id: postId,
121
+ image,
122
+ };
115
123
  },
116
124
  };
@@ -7,7 +7,7 @@ export default {
7
7
  key: "linkedin-create-image-post-user",
8
8
  name: "Create Image Post (User)",
9
9
  description: "Create an image post on LinkedIn. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/images-api?view=li-lms-2023-09&tabs=http#uploading-an-image)",
10
- version: "1.0.9",
10
+ version: "1.1.0",
11
11
  annotations: {
12
12
  destructiveHint: false,
13
13
  openWorldHint: true,
@@ -95,7 +95,8 @@ export default {
95
95
  $,
96
96
  });
97
97
 
98
- await this.linkedin.createPost({
98
+ const response = await this.linkedin.createPost({
99
+ returnFullResponse: true,
99
100
  data: {
100
101
  author: `urn:li:person:${id}`,
101
102
  lifecycleState: "PUBLISHED",
@@ -113,8 +114,15 @@ export default {
113
114
  $,
114
115
  });
115
116
 
116
- $.export("$summary", "Successfully posted image.");
117
+ // LinkedIn returns the new post's URN in the `x-restli-id` response header, not in the body
118
+ const postId = response?.headers?.["x-restli-id"];
119
+ $.export("$summary", postId
120
+ ? `Successfully posted image with ID ${postId}`
121
+ : "Successfully posted image.");
117
122
 
118
- // nothing to return
123
+ return {
124
+ id: postId,
125
+ image,
126
+ };
119
127
  },
120
128
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/linkedin",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Pipedream Linkedin Components",
5
5
  "main": "linkedin.app.mjs",
6
6
  "keywords": [
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@pipedream/platform": "^3.2.5",
17
- "axios": "^1.16.1",
17
+ "axios": "^1.20.0",
18
18
  "form-data": "^4.0.4"
19
19
  }
20
20
  }