@pipedream/linkedin 1.0.0 → 1.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.
@@ -6,7 +6,7 @@ export default {
6
6
  key: "linkedin-create-image-post-organization",
7
7
  name: "Create Image Post (Organization)",
8
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: "1.0.0",
9
+ version: "1.0.1",
10
10
  type: "action",
11
11
  props: {
12
12
  linkedin,
@@ -27,6 +27,12 @@ export default {
27
27
  "text",
28
28
  ],
29
29
  },
30
+ syncDir: {
31
+ type: "dir",
32
+ accessMode: "read",
33
+ sync: true,
34
+ optional: true,
35
+ },
30
36
  },
31
37
  methods: {
32
38
  initializeUpload({
@@ -6,7 +6,7 @@ export default {
6
6
  key: "linkedin-create-image-post-user",
7
7
  name: "Create Image Post (User)",
8
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: "1.0.0",
9
+ version: "1.0.1",
10
10
  type: "action",
11
11
  props: {
12
12
  linkedin,
@@ -27,6 +27,12 @@ export default {
27
27
  "visibility",
28
28
  ],
29
29
  },
30
+ syncDir: {
31
+ type: "dir",
32
+ accessMode: "read",
33
+ sync: true,
34
+ optional: true,
35
+ },
30
36
  },
31
37
  methods: {
32
38
  initializeUpload({
@@ -3,8 +3,8 @@ import linkedin from "../../linkedin.app.mjs";
3
3
  export default {
4
4
  key: "linkedin-get-member-organization-access-control",
5
5
  name: "Get Member's Organization Access Control Information",
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.6",
6
+ description: "Gets the organization access control information of the current authenticated member. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-a-members-organization-access-control-information)",
7
+ version: "1.0.0",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
@@ -28,32 +28,21 @@ export default {
28
28
  },
29
29
  },
30
30
  async run({ $ }) {
31
- const count = 50;
32
- const results = [];
33
-
34
31
  const params = {
35
32
  q: "roleAssignee",
36
33
  role: this.role,
37
34
  state: this.state,
38
35
  start: 0,
39
- count,
36
+ count: 1,
40
37
  };
41
38
 
42
- let done = false;
43
- do {
44
- const { elements } = await this.linkedin.getAccessControl({
45
- $,
46
- params,
47
- });
48
- results.push(...elements);
49
- params.start += count;
50
- if (elements?.length < count) {
51
- done = true;
52
- }
53
- } while (results.length < this.max && !done);
39
+ const { data: { elements } } = await this.linkedin.getAccessControl({
40
+ $,
41
+ params,
42
+ });
54
43
 
55
44
  $.export("$summary", "Successfully retrieved access control information");
56
45
 
57
- return results;
46
+ return elements[0];
58
47
  },
59
48
  };
@@ -3,15 +3,17 @@ import linkedin from "../../linkedin.app.mjs";
3
3
  export default {
4
4
  key: "linkedin-get-organization-access-control",
5
5
  name: "Gets Organization Access Control",
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.6",
6
+ description: "Gets a selected organization's access control information. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control)",
7
+ version: "0.2.0",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
11
- organizationUrn: {
12
- type: "string",
13
- label: "Organization Urn",
14
- description: "The organizational entity for which the access control information is being retrieved. Must be in URN format urn:li:organization:{id}.",
11
+ organizationId: {
12
+ propDefinition: [
13
+ linkedin,
14
+ "organizationId",
15
+ ],
16
+ description: "The ID of the organization for which the access control information is being retrieved",
15
17
  },
16
18
  max: {
17
19
  propDefinition: [
@@ -25,12 +27,14 @@ export default {
25
27
  const count = 50;
26
28
  const results = [];
27
29
 
28
- const params = `q=organization&organization=${this.organizationUrn.replace(/:/g, "%3A")}&count=${count}`;
30
+ const organizationUrn = `urn:li:organization:${this.organizationId}`;
31
+
32
+ const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`;
29
33
 
30
34
  let done = false;
31
35
  do {
32
36
  const { data: { elements } } = await this.linkedin.getAccessControl({
33
- params: params + `&start=${start}`,
37
+ strParams: params + `&start=${start}`,
34
38
  });
35
39
 
36
40
  results.push(...elements);
@@ -3,21 +3,17 @@ import linkedin from "../../linkedin.app.mjs";
3
3
  export default {
4
4
  key: "linkedin-get-organization-administrators",
5
5
  name: "Get Organization Administrators",
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.6",
6
+ description: "Gets the administrator members of a selected organization. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-administrators)",
7
+ version: "0.3.0",
8
8
  type: "action",
9
9
  props: {
10
10
  linkedin,
11
- organizationUrn: {
12
- type: "string",
13
- label: "Organization",
14
- description: "The organizational entity for which administrators are being retrieved. Must be in URN format urn:li:organization:{id}.",
15
- },
16
- max: {
11
+ organizationId: {
17
12
  propDefinition: [
18
13
  linkedin,
19
- "max",
14
+ "organizationId",
20
15
  ],
16
+ description: "The ID of the organization for which administrators are being retrieved",
21
17
  },
22
18
  },
23
19
  async run({ $ }) {
@@ -25,12 +21,14 @@ export default {
25
21
  const count = 50;
26
22
  const results = [];
27
23
 
28
- const params = `q=organization&organization=${this.organizationUrn.replace(/:/g, "%3A")}&role=ADMINISTRATOR&state=APPROVED&count=${count}`;
24
+ const organizationUrn = `urn:li:organization:${this.organizationId}`;
25
+
26
+ const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&role=ADMINISTRATOR&state=APPROVED&count=${count}`;
29
27
 
30
28
  let done = false;
31
29
  do {
32
30
  const { data: { elements } } = await this.linkedin.getAccessControl({
33
- params: params + `&start=${start}`,
31
+ strParams: params + `&start=${start}`,
34
32
  });
35
33
 
36
34
  results.push(...elements);
@@ -0,0 +1,52 @@
1
+ import linkedin from "../../linkedin.app.mjs";
2
+ import constants from "../../common/constants.mjs";
3
+
4
+ export default {
5
+ key: "linkedin-get-profile-picture-fields",
6
+ name: "Get Profile Picture Fields",
7
+ description: "Gets the authenticated user's profile picture data including display image and metadata. [See the documentation](https://learn.microsoft.com/en-us/linkedin/shared/references/v2/profile/profile-picture)",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ linkedin,
12
+ includeOriginalImage: {
13
+ type: "boolean",
14
+ label: "Include Original Image",
15
+ description: "Whether to include the original image data in the response (requires special permissions)",
16
+ optional: true,
17
+ default: false,
18
+ },
19
+ },
20
+ methods: {
21
+ getProfilePictureFields(args) {
22
+ return this.linkedin._makeRequest({
23
+ url: `${constants.BASE_URL}v2/me`,
24
+ ...args,
25
+ });
26
+ },
27
+ },
28
+ async run({ $ }) {
29
+ let projection = "id,profilePicture(displayImage~digitalmediaAsset:playableStreams";
30
+
31
+ if (this.includeOriginalImage) {
32
+ projection += ",originalImage~digitalmediaAsset:playableStreams";
33
+ }
34
+
35
+ projection += ")";
36
+
37
+ const response = await this.getProfilePictureFields({
38
+ $,
39
+ params: {
40
+ projection: `(${projection})`,
41
+ },
42
+ });
43
+
44
+ if (response.profilePicture) {
45
+ $.export("$summary", "Successfully retrieved profile picture fields");
46
+ } else {
47
+ $.export("$summary", "Profile retrieved, but no profile picture found for this account");
48
+ }
49
+
50
+ return response;
51
+ },
52
+ };
package/linkedin.app.mjs CHANGED
@@ -234,9 +234,14 @@ export default {
234
234
  ...args,
235
235
  });
236
236
  },
237
- async getAccessControl({ params }) {
237
+ async getAccessControl({
238
+ strParams, ...args
239
+ }) {
238
240
  return this._makeRequestAxios({
239
- path: `/organizationAcls?${params}`,
241
+ path: `/organizationAcls${strParams
242
+ ? `?${strParams}`
243
+ : ""}`,
244
+ ...args,
240
245
  });
241
246
  },
242
247
  async queryAnaltyics(query, args = {} ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/linkedin",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Pipedream Linkedin Components",
5
5
  "main": "linkedin.app.mjs",
6
6
  "keywords": [