From 2cba8cdb0d5da75f7468bd8d91646d35ef52fe87 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 30 Jun 2025 19:01:41 -0300 Subject: [PATCH 1/6] pnpm --- pnpm-lock.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ca0a6e13fd61f..4319bbedd13b2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29612,22 +29612,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731) + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} From 6c27687138f4042504b0bfc872333349cc9e2fe9 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 1 Jul 2025 15:26:40 -0300 Subject: [PATCH 2/6] LinkedIn action improvements --- ...get-member-organization-access-control.mjs | 27 ++++++------------- .../get-organization-access-control.mjs | 20 ++++++++------ .../get-organization-administrators.mjs | 20 +++++++------- components/linkedin/linkedin.app.mjs | 9 +++++-- components/linkedin/package.json | 4 +-- pnpm-lock.yaml | 4 +-- 6 files changed, 40 insertions(+), 44 deletions(-) diff --git a/components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs b/components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs index cb6bc3bea1c9b..7796d175a4510 100644 --- a/components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs +++ b/components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs @@ -3,8 +3,8 @@ import linkedin from "../../linkedin.app.mjs"; export default { key: "linkedin-get-member-organization-access-control", name: "Get Member's Organization Access Control Information", - 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)", - version: "0.1.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)", + version: "1.0.0", type: "action", props: { linkedin, @@ -28,32 +28,21 @@ export default { }, }, async run({ $ }) { - const count = 50; - const results = []; - const params = { q: "roleAssignee", role: this.role, state: this.state, start: 0, - count, + count: 1, }; - let done = false; - do { - const { elements } = await this.linkedin.getAccessControl({ - $, - params, - }); - results.push(...elements); - params.start += count; - if (elements?.length < count) { - done = true; - } - } while (results.length < this.max && !done); + const { data: { elements } } = await this.linkedin.getAccessControl({ + $, + params, + }); $.export("$summary", "Successfully retrieved access control information"); - return results; + return elements[0]; }, }; diff --git a/components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs b/components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs index 801fc8e4cd9d0..79f889ae338ee 100644 --- a/components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs +++ b/components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs @@ -3,15 +3,17 @@ import linkedin from "../../linkedin.app.mjs"; export default { key: "linkedin-get-organization-access-control", name: "Gets Organization Access Control", - 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)", - version: "0.1.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)", + version: "0.2.0", type: "action", props: { linkedin, - organizationUrn: { - type: "string", - label: "Organization Urn", - description: "The organizational entity for which the access control information is being retrieved. Must be in URN format urn:li:organization:{id}.", + organizationId: { + propDefinition: [ + linkedin, + "organizationId", + ], + description: "The ID of the organization for which the access control information is being retrieved", }, max: { propDefinition: [ @@ -25,12 +27,14 @@ export default { const count = 50; const results = []; - const params = `q=organization&organization=${this.organizationUrn.replace(/:/g, "%3A")}&count=${count}`; + const organizationUrn = `urn:li:organization:${this.organizationId}`; + + const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`; let done = false; do { const { data: { elements } } = await this.linkedin.getAccessControl({ - params: params + `&start=${start}`, + strParams: params + `&start=${start}`, }); results.push(...elements); diff --git a/components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs b/components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs index 9aa724a6de6fb..5829bf93a85db 100644 --- a/components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs +++ b/components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs @@ -3,21 +3,17 @@ import linkedin from "../../linkedin.app.mjs"; export default { key: "linkedin-get-organization-administrators", name: "Get Organization Administrators", - 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)", - version: "0.2.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)", + version: "0.3.0", type: "action", props: { linkedin, - organizationUrn: { - type: "string", - label: "Organization", - description: "The organizational entity for which administrators are being retrieved. Must be in URN format urn:li:organization:{id}.", - }, - max: { + organizationId: { propDefinition: [ linkedin, - "max", + "organizationId", ], + description: "The ID of the organization for which administrators are being retrieved", }, }, async run({ $ }) { @@ -25,12 +21,14 @@ export default { const count = 50; const results = []; - const params = `q=organization&organization=${this.organizationUrn.replace(/:/g, "%3A")}&role=ADMINISTRATOR&state=APPROVED&count=${count}`; + const organizationUrn = `urn:li:organization:${this.organizationId}`; + + const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&role=ADMINISTRATOR&state=APPROVED&count=${count}`; let done = false; do { const { data: { elements } } = await this.linkedin.getAccessControl({ - params: params + `&start=${start}`, + strParams: params + `&start=${start}`, }); results.push(...elements); diff --git a/components/linkedin/linkedin.app.mjs b/components/linkedin/linkedin.app.mjs index 6ed668aac5448..97600b1564976 100644 --- a/components/linkedin/linkedin.app.mjs +++ b/components/linkedin/linkedin.app.mjs @@ -234,9 +234,14 @@ export default { ...args, }); }, - async getAccessControl({ params }) { + async getAccessControl({ + strParams, ...args + }) { return this._makeRequestAxios({ - path: `/organizationAcls?${params}`, + path: `/organizationAcls${strParams + ? `?${strParams}` + : ""}`, + ...args, }); }, async queryAnaltyics(query, args = {} ) { diff --git a/components/linkedin/package.json b/components/linkedin/package.json index 1c07baa557c79..6777e8c24ee76 100644 --- a/components/linkedin/package.json +++ b/components/linkedin/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/linkedin", - "version": "0.2.0", + "version": "0.3.0", "description": "Pipedream Linkedin Components", "main": "linkedin.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.3", + "@pipedream/platform": "^3.1.0", "axios": "^1.2.3", "form-data": "^4.0.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4319bbedd13b2..2ea4a6f7a294b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7551,8 +7551,8 @@ importers: components/linkedin: dependencies: '@pipedream/platform': - specifier: ^3.0.3 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 axios: specifier: ^1.2.3 version: 1.7.7 From 9dd9e990ea3bf4bc5057dc71e46b3e99d24f73b2 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 1 Jul 2025 16:36:21 -0300 Subject: [PATCH 3/6] Adding 'get profile picture fields' action --- .../get-profile-picture-fields.mjs | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs diff --git a/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs b/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs new file mode 100644 index 0000000000000..51b6e5f628b63 --- /dev/null +++ b/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs @@ -0,0 +1,49 @@ +import linkedin from "../../linkedin.app.mjs"; +import constants from "../../common/constants.mjs"; + +export default { + key: "linkedin-get-profile-picture-fields", + name: "Get Profile Picture Fields", + 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)", + version: "0.0.1", + type: "action", + props: { + linkedin, + includeOriginalImage: { + type: "boolean", + label: "Include Original Image", + description: "Whether to include the original image data in the response (requires special permissions)", + optional: true, + default: false, + }, + }, + methods: { + getProfilePictureFields(args) { + return this.linkedin._makeRequest({ + url: `${constants.BASE_URL}v2/me`, + ...args, + }); + }, + }, + async run({ $ }) { + // Build the projection parameter based on user preferences + let projection = "id,profilePicture(displayImage~digitalmediaAsset:playableStreams"; + + if (this.includeOriginalImage) { + projection += ",originalImage~digitalmediaAsset:playableStreams"; + } + + projection += ")"; + + const response = await this.getProfilePictureFields({ + $, + params: { + projection: `(${projection})`, + }, + }); + + $.export("$summary", "Successfully retrieved profile picture fields"); + + return response; + }, +}; From 6c9abaeb60e7989319f53a86b197e5aab57d1bd4 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 1 Jul 2025 16:50:49 -0300 Subject: [PATCH 4/6] Improvement --- .../get-profile-picture-fields.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs b/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs index 51b6e5f628b63..caedc44e10ec3 100644 --- a/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs +++ b/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs @@ -42,7 +42,11 @@ export default { }, }); - $.export("$summary", "Successfully retrieved profile picture fields"); + if (response.profilePicture) { + $.export("$summary", "Successfully retrieved profile picture fields"); + } else { + $.export("$summary", "Profile retrieved, but no profile picture found for this account"); + } return response; }, From c1731fcb2ee237951bdca1bb29a260efddd7286a Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Wed, 2 Jul 2025 14:35:11 -0300 Subject: [PATCH 5/6] removing comment --- .../get-profile-picture-fields/get-profile-picture-fields.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs b/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs index caedc44e10ec3..a76906b998863 100644 --- a/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs +++ b/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs @@ -26,7 +26,6 @@ export default { }, }, async run({ $ }) { - // Build the projection parameter based on user preferences let projection = "id,profilePicture(displayImage~digitalmediaAsset:playableStreams"; if (this.includeOriginalImage) { From 973c26be257d00ba69fecadaf5260fb3b99767c6 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Wed, 2 Jul 2025 14:37:41 -0300 Subject: [PATCH 6/6] pnpm --- pnpm-lock.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9186356110cd7..f40dbec8a2919 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5971,8 +5971,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/hana: - specifiers: {} + components/hana: {} components/handwrytten: {} @@ -36520,6 +36519,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: