diff --git a/components/linkedin/actions/create-comment/create-comment.mjs b/components/linkedin/actions/create-comment/create-comment.mjs index 3a685d9dff3d9..77be4e702568f 100644 --- a/components/linkedin/actions/create-comment/create-comment.mjs +++ b/components/linkedin/actions/create-comment/create-comment.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-create-comment", name: "Create Comment", 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)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs b/components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs index 96da3bf512ed2..872ce078b37c4 100644 --- a/components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs +++ b/components/linkedin/actions/create-image-post-organization/create-image-post-organization.mjs @@ -7,7 +7,7 @@ export default { key: "linkedin-create-image-post-organization", name: "Create Image Post (Organization)", 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)", - version: "1.0.8", + version: "1.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/create-image-post-user/create-image-post-user.mjs b/components/linkedin/actions/create-image-post-user/create-image-post-user.mjs index c3d75268bf6af..26a07985d887f 100644 --- a/components/linkedin/actions/create-image-post-user/create-image-post-user.mjs +++ b/components/linkedin/actions/create-image-post-user/create-image-post-user.mjs @@ -7,7 +7,7 @@ export default { key: "linkedin-create-image-post-user", name: "Create Image Post (User)", 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)", - version: "1.0.8", + version: "1.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/create-like-on-share/create-like-on-share.mjs b/components/linkedin/actions/create-like-on-share/create-like-on-share.mjs index 55272728e0693..a6e625d8f27bd 100644 --- a/components/linkedin/actions/create-like-on-share/create-like-on-share.mjs +++ b/components/linkedin/actions/create-like-on-share/create-like-on-share.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-create-like-on-share", name: "Create Like On Share", 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)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs b/components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs index b042df221d873..88576f9c01bba 100644 --- a/components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs +++ b/components/linkedin/actions/create-text-post-organization/create-text-post-organization.mjs @@ -5,7 +5,7 @@ export default { key: "linkedin-create-text-post-organization", name: "Create a Simple Post (Organization)", description: "Create post on LinkedIn using text, URL or article. [See the documentation](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", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/create-text-post-user/create-text-post-user.mjs b/components/linkedin/actions/create-text-post-user/create-text-post-user.mjs index fd3e599bfc6fe..1d2e7ae084fde 100644 --- a/components/linkedin/actions/create-text-post-user/create-text-post-user.mjs +++ b/components/linkedin/actions/create-text-post-user/create-text-post-user.mjs @@ -5,7 +5,7 @@ export default { key: "linkedin-create-text-post-user", name: "Create a Simple Post (User)", description: "Create post on LinkedIn using text, URL or article. [See the documentation](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", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/delete-post/delete-post.mjs b/components/linkedin/actions/delete-post/delete-post.mjs index 53e281125420b..d3fdf5deb99bf 100644 --- a/components/linkedin/actions/delete-post/delete-post.mjs +++ b/components/linkedin/actions/delete-post/delete-post.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-delete-post", name: "Delete Post", description: "Removes a post from user's wall. [See the documentation](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api?tabs=http#delete-shares) for more information", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs b/components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs index 0d773f8802a7b..ca0dc2dc9ba1e 100644 --- a/components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs +++ b/components/linkedin/actions/fetch-ad-account/fetch-ad-account.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-fetch-ad-account", name: "Fetch Ad Account", 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)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs b/components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs index 7d84f413bc765..ca900d28f7806 100644 --- a/components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs +++ b/components/linkedin/actions/get-current-member-profile/get-current-member-profile.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-get-current-member-profile", name: "Get Current Member Profile", 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)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/get-member-profile/get-member-profile.mjs b/components/linkedin/actions/get-member-profile/get-member-profile.mjs index 306c15a297be9..cdf7336917db3 100644 --- a/components/linkedin/actions/get-member-profile/get-member-profile.mjs +++ b/components/linkedin/actions/get-member-profile/get-member-profile.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-get-member-profile", name: "Get Member Profile", 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)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs b/components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs index 50884aa6a9945..41e8240cf8fee 100644 --- a/components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs +++ b/components/linkedin/actions/get-multiple-member-profiles/get-multiple-member-profiles.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-get-multiple-member-profiles", name: "Get Multiple Member Profiles", 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)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/get-org-member-access/get-org-member-access.mjs b/components/linkedin/actions/get-org-member-access/get-org-member-access.mjs index c2c962ccf0a40..2aab22175c98e 100644 --- a/components/linkedin/actions/get-org-member-access/get-org-member-access.mjs +++ b/components/linkedin/actions/get-org-member-access/get-org-member-access.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-get-org-member-access", name: "Get Member's Organization Access Control Information", 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.7", + version: "1.0.8", annotations: { destructiveHint: false, openWorldHint: true, 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 659a6bfa85d3a..9a6ccee306a75 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 @@ -4,7 +4,7 @@ export default { key: "linkedin-get-organization-access-control", name: "Gets Organization Access Control", 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.6", + version: "0.2.7", annotations: { destructiveHint: false, openWorldHint: true, 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 55048bd02ce38..efc70da661916 100644 --- a/components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs +++ b/components/linkedin/actions/get-organization-administrators/get-organization-administrators.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-get-organization-administrators", name: "Get Organization Administrators", 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.6", + version: "0.3.7", annotations: { destructiveHint: false, openWorldHint: true, 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 435f3b9376cdc..c5b323ac3f386 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 @@ -5,7 +5,7 @@ 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.7", + version: "0.0.8", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/actions/list-ad-account-id-options/list-ad-account-id-options.mjs b/components/linkedin/actions/list-ad-account-id-options/list-ad-account-id-options.mjs index d26e1949d5ac0..1a98ebb009c0a 100644 --- a/components/linkedin/actions/list-ad-account-id-options/list-ad-account-id-options.mjs +++ b/components/linkedin/actions/list-ad-account-id-options/list-ad-account-id-options.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-list-ad-account-id-options", name: "List Ad Account Id Options", description: "Retrieves available options for the Ad Account Id field.", - version: "0.0.2", + version: "0.0.3", type: "action", annotations: { destructiveHint: false, diff --git a/components/linkedin/actions/list-campaign-id-options/list-campaign-id-options.mjs b/components/linkedin/actions/list-campaign-id-options/list-campaign-id-options.mjs index 3101c965066a0..235a6e1aada87 100644 --- a/components/linkedin/actions/list-campaign-id-options/list-campaign-id-options.mjs +++ b/components/linkedin/actions/list-campaign-id-options/list-campaign-id-options.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-list-campaign-id-options", name: "List Campaign Id Options", description: "Retrieves available options for the Campaign Id field.", - version: "0.0.2", + version: "0.0.3", type: "action", annotations: { destructiveHint: false, diff --git a/components/linkedin/actions/list-organization-id-options/list-organization-id-options.mjs b/components/linkedin/actions/list-organization-id-options/list-organization-id-options.mjs index 1ad29b0aaa83d..4751e4c8e1bbd 100644 --- a/components/linkedin/actions/list-organization-id-options/list-organization-id-options.mjs +++ b/components/linkedin/actions/list-organization-id-options/list-organization-id-options.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-list-organization-id-options", name: "List Organization Id Options", description: "Retrieves available options for the Organization Id field.", - version: "0.0.2", + version: "0.0.3", type: "action", annotations: { destructiveHint: false, diff --git a/components/linkedin/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs b/components/linkedin/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs index b5176b4335ca8..194a08b49f5cd 100644 --- a/components/linkedin/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs +++ b/components/linkedin/actions/retrieve-comments-on-comments/retrieve-comments-on-comments.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-retrieve-comments-on-comments", name: "Retrieves Comments on Comments", description: "Retrieves comments on comments, given the parent comment urn. [See the documentation](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/network-update-social-actions#retrieve-comments-on-comments)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs b/components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs index db5608279d05a..402903bf81f88 100644 --- a/components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs +++ b/components/linkedin/actions/retrieve-comments-shares/retrieve-comments-shares.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-retrieve-comments-shares", name: "Retrieve Comments On Shares", 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)", - version: "0.1.13", + version: "0.1.14", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/linkedin/actions/search-organization/search-organization.mjs b/components/linkedin/actions/search-organization/search-organization.mjs index 216c2d2a12aff..ea891fdf821a4 100644 --- a/components/linkedin/actions/search-organization/search-organization.mjs +++ b/components/linkedin/actions/search-organization/search-organization.mjs @@ -4,7 +4,7 @@ export default { key: "linkedin-search-organization", name: "Search Organization", 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)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/linkedin/common/constants.mjs b/components/linkedin/common/constants.mjs index 72cadf97fd824..59df99b2231f4 100644 --- a/components/linkedin/common/constants.mjs +++ b/components/linkedin/common/constants.mjs @@ -1,6 +1,7 @@ const VERSION_PATH = "rest"; const BASE_URL = "https://api.linkedin.com/"; const VERSION_HEADER = "202606"; +const RESTLI_PROTOCOL_VERSION = "2.0.0"; const VISIBILITIES = [ { @@ -86,6 +87,7 @@ export default { VERSION_PATH, BASE_URL, VERSION_HEADER, + RESTLI_PROTOCOL_VERSION, VISIBILITIES, TYPES, TIME_GRANULARITY_OPTIONS, diff --git a/components/linkedin/linkedin.app.mjs b/components/linkedin/linkedin.app.mjs index b8bbc3e943471..004b5f4a71fe2 100644 --- a/components/linkedin/linkedin.app.mjs +++ b/components/linkedin/linkedin.app.mjs @@ -16,20 +16,63 @@ export default { type: "string", label: "Organization Id", description: "ID of the organization that will author the post", - async options({ page }) { - const { elements } = await this.getOrganizations(page); + async options({ + page, + prevContext, + }) { + // Track the next organization page across calls so a page whose + // options are all filtered out (e.g. all 403) doesn't stop pagination. + let currentPage = prevContext?.nextPage ?? page ?? 0; const responseArray = []; - for (const item of elements) { - const orgId = item.organization.split(":")[3]; - const orgData = await this.getOrganization(orgId); + while (true) { + const { elements } = await this.getOrganizations(currentPage); - responseArray.push({ - label: orgData.localizedName, - value: orgId, - }); + // The API reports no more pages, stop paginating. + if (!elements?.length) { + return { + options: responseArray, + context: { + nextPage: currentPage, + }, + }; + } + + for (const item of elements) { + const orgId = item.organization?.split(":")[3]; + if (!orgId) { + continue; + } + + try { + const orgData = await this.getOrganization(orgId); + if (orgData?.localizedName) { + responseArray.push({ + label: orgData.localizedName, + value: orgId, + }); + } + } catch (error) { + if (error.response?.status !== 403) { + throw error; + } + console.log(`Skipping organization ${orgId}: ${error.message}`); + } + } + + currentPage += 1; + + // Only surface a page once it yields at least one accessible option; + // otherwise keep requesting subsequent pages. + if (responseArray.length) { + return { + options: responseArray, + context: { + nextPage: currentPage, + }, + }; + } } - return responseArray; }, }, adAccountId: { @@ -132,6 +175,7 @@ export default { "Authorization": `Bearer ${this.$auth.oauth_access_token}`, "Content-Type": "application/json", "Linkedin-Version": constants.VERSION_HEADER, + "X-Restli-Protocol-Version": constants.RESTLI_PROTOCOL_VERSION, }; }, async _makeRequest({ @@ -148,6 +192,7 @@ export default { async _makeRequestAxios({ url, path, ...otherConfig }) { + delete otherConfig.$; const BASE_URL = constants.BASE_URL; return axios({ @@ -166,7 +211,7 @@ export default { async getOrganizations(page) { return this._makeRequest({ method: "GET", - path: `/organizationAcls?q=roleAssignee&count=5&start=${page * 5}`, + path: `/organizationAcls?q=roleAssignee&state=APPROVED&count=5&start=${page * 5}`, }); }, async getOrganization(organizationId) { diff --git a/components/linkedin/package.json b/components/linkedin/package.json index 949eddb9f43fb..f6b45200394e3 100644 --- a/components/linkedin/package.json +++ b/components/linkedin/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/linkedin", - "version": "1.3.1", + "version": "1.3.2", "description": "Pipedream Linkedin Components", "main": "linkedin.app.mjs", "keywords": [ diff --git a/components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs b/components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs index c784ce5e845bf..4da7a16265442 100644 --- a/components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs +++ b/components/linkedin/sources/new-organization-post-created/new-organization-post-created.mjs @@ -9,7 +9,7 @@ export default { name: "New Organization Post Created", description: "Emit new event when a new post is created by the organization. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/posts-api?view=li-lms-2024-09&tabs=curl#find-posts-by-authors).", type: "source", - version: "0.0.6", + version: "0.0.7", dedupe: "unique", props: { ...common.props,