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/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..a76906b998863 --- /dev/null +++ b/components/linkedin/actions/get-profile-picture-fields/get-profile-picture-fields.mjs @@ -0,0 +1,52 @@ +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({ $ }) { + let projection = "id,profilePicture(displayImage~digitalmediaAsset:playableStreams"; + + if (this.includeOriginalImage) { + projection += ",originalImage~digitalmediaAsset:playableStreams"; + } + + projection += ")"; + + const response = await this.getProfilePictureFields({ + $, + params: { + projection: `(${projection})`, + }, + }); + + 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; + }, +}; 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 49c470d37ffb2..643554bdf23b2 100644 --- a/components/linkedin/package.json +++ b/components/linkedin/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/linkedin", - "version": "1.0.1", + "version": "1.1.0", "description": "Pipedream Linkedin Components", "main": "linkedin.app.mjs", "keywords": [ 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: