@@ -2,7 +2,7 @@ import { Operation } from './core';
22import { buildLinkedApiHttpClient } from './core/linked-api-http-client' ;
33import type { TMappedResponse } from './mappers/base-mapper.abstract' ;
44import {
5- AcceptConnectionRequest ,
5+ AcceptInvitation ,
66 CheckConnectionStatus ,
77 CommentOnPost ,
88 CreatePost ,
@@ -11,7 +11,7 @@ import {
1111 FetchJob ,
1212 FetchPerson ,
1313 FetchPost ,
14- IgnoreConnectionRequest ,
14+ IgnoreInvitation ,
1515 ManageConversation ,
1616 NvFetchCompany ,
1717 NvFetchPerson ,
@@ -23,8 +23,8 @@ import {
2323 NvSyncInbox ,
2424 ReactToPost ,
2525 RemoveConnection ,
26- RetrieveConnectionRequests ,
2726 RetrieveConnections ,
27+ RetrieveInvitations ,
2828 RetrievePendingRequests ,
2929 RetrievePerformance ,
3030 RetrieveSSI ,
@@ -111,9 +111,9 @@ class LinkedApi {
111111 this . sendConnectionRequest = new SendConnectionRequest ( this . httpClient ) ;
112112 this . withdrawConnectionRequest = new WithdrawConnectionRequest ( this . httpClient ) ;
113113 this . retrievePendingRequests = new RetrievePendingRequests ( this . httpClient ) ;
114- this . retrieveConnectionRequests = new RetrieveConnectionRequests ( this . httpClient ) ;
115- this . acceptConnectionRequest = new AcceptConnectionRequest ( this . httpClient ) ;
116- this . ignoreConnectionRequest = new IgnoreConnectionRequest ( this . httpClient ) ;
114+ this . retrieveInvitations = new RetrieveInvitations ( this . httpClient ) ;
115+ this . acceptInvitation = new AcceptInvitation ( this . httpClient ) ;
116+ this . ignoreInvitation = new IgnoreInvitation ( this . httpClient ) ;
117117 this . retrieveConnections = new RetrieveConnections ( this . httpClient ) ;
118118 this . removeConnection = new RemoveConnection ( this . httpClient ) ;
119119 this . searchCompanies = new SearchCompanies ( this . httpClient ) ;
@@ -148,9 +148,9 @@ class LinkedApi {
148148 this . sendConnectionRequest ,
149149 this . withdrawConnectionRequest ,
150150 this . retrievePendingRequests ,
151- this . retrieveConnectionRequests ,
152- this . acceptConnectionRequest ,
153- this . ignoreConnectionRequest ,
151+ this . retrieveInvitations ,
152+ this . acceptInvitation ,
153+ this . ignoreInvitation ,
154154 this . retrieveConnections ,
155155 this . removeConnection ,
156156 this . searchCompanies ,
@@ -1025,7 +1025,7 @@ class LinkedApi {
10251025 * @param params - Parameters including the person's URL and optional connection message
10261026 * @returns Promise resolving to the connection request action
10271027 *
1028- * @see {@link https://linkedapi.io/docs/working-with-connection-requests / Working with Connection Requests Documentation }
1028+ * @see {@link https://linkedapi.io/docs/working-with-invitations / Working with Invitations Documentation }
10291029 * @see {@link https://linkedapi.io/docs/action-st-send-connection-request/ st.sendConnectionRequest Action Documentation }
10301030 *
10311031 * @example
@@ -1076,7 +1076,7 @@ class LinkedApi {
10761076 * @param params - Parameters including the person's URL
10771077 * @returns Promise resolving to the withdrawal action
10781078 *
1079- * @see {@link https://linkedapi.io/docs/working-with-connection-requests / Working with Connection Requests Documentation }
1079+ * @see {@link https://linkedapi.io/docs/working-with-invitations / Working with Invitations Documentation }
10801080 * @see {@link https://linkedapi.io/docs/action-st-withdraw-connection-request/ st.withdrawConnectionRequest Action Documentation }
10811081 *
10821082 * @example
@@ -1099,7 +1099,7 @@ class LinkedApi {
10991099 *
11001100 * @returns Promise resolving to an object containing an array of pending requests
11011101 *
1102- * @see {@link https://linkedapi.io/docs/working-with-connection-requests / Working with Connection Requests Documentation }
1102+ * @see {@link https://linkedapi.io/docs/working-with-invitations / Working with Invitations Documentation }
11031103 * @see {@link https://linkedapi.io/docs/action-st-retrieve-pending-requests/ st.retrievePendingRequests Action Documentation }
11041104 *
11051105 * @example
@@ -1120,67 +1120,75 @@ class LinkedApi {
11201120 public retrievePendingRequests : RetrievePendingRequests ;
11211121
11221122 /**
1123- * Retrieve incoming connection requests (invitations others have sent you) .
1123+ * Retrieve incoming connection, company-follow, and newsletter-subscription invitations .
11241124 *
1125- * This method fetches the list of received connection requests from your invitation manager.
1125+ * This method fetches the list of received invitations from your invitation manager.
11261126 *
1127- * @returns Promise resolving to an object containing an array of received requests
1127+ * @returns Promise resolving to an object containing an array of received invitations
11281128 *
1129- * @see {@link https://linkedapi.io/docs/working-with-connection-requests / Working with Connection Requests Documentation }
1130- * @see {@link https://linkedapi.io/docs/action-st-retrieve-connection-requests / st.retrieveConnectionRequests Action Documentation }
1129+ * @see {@link https://linkedapi.io/docs/working-with-invitations / Working with Invitations Documentation }
1130+ * @see {@link https://linkedapi.io/docs/action-st-retrieve-invitations / st.retrieveInvitations Action Documentation }
11311131 *
11321132 * @example
11331133 * ```typescript
1134- * const workflow = await linkedapi.retrieveConnectionRequests .execute();
1134+ * const workflow = await linkedapi.retrieveInvitations .execute();
11351135 *
1136- * const result = await linkedapi.retrieveConnectionRequests .result(workflow.workflowId);
1136+ * const result = await linkedapi.retrieveInvitations .result(workflow.workflowId);
11371137 * if (result.data) {
1138- * result.data.forEach(request => {
1139- * console.log(`${request.name}: ${request.headline}`);
1140- * console.log(`Profile: ${request.publicUrl}`);
1141- * });
1138+ * for (const invitation of result.data) {
1139+ * console.log(`${invitation.invitationType}: ${invitation.name}`);
1140+ * if (invitation.invitationType === "connect") {
1141+ * console.log(`Profile: ${invitation.publicUrl}`);
1142+ * } else if (invitation.invitationType === "companyFollow") {
1143+ * console.log(`Company: ${invitation.companyUrl}`);
1144+ * } else {
1145+ * console.log(`Newsletter: ${invitation.newsletterUrl}`);
1146+ * }
1147+ * }
11421148 * }
11431149 * ```
11441150 */
1145- public retrieveConnectionRequests : RetrieveConnectionRequests ;
1151+ public retrieveInvitations : RetrieveInvitations ;
11461152
11471153 /**
1148- * Accept an incoming connection request from a person's profile .
1154+ * Accept an incoming connection, company-follow, or newsletter-subscription invitation .
11491155 *
1150- * @param params - Parameters including the person's profile URL
1156+ * @param params - Invitation type and its matching target URL
11511157 *
1152- * @see {@link https://linkedapi.io/docs/working-with-connection-requests / Working with Connection Requests Documentation }
1153- * @see {@link https://linkedapi.io/docs/action-st-accept-connection-request / st.acceptConnectionRequest Action Documentation }
1158+ * @see {@link https://linkedapi.io/docs/working-with-invitations / Working with Invitations Documentation }
1159+ * @see {@link https://linkedapi.io/docs/action-st-accept-invitation / st.acceptInvitation Action Documentation }
11541160 *
11551161 * @example
11561162 * ```typescript
1157- * const workflow = await linkedapi.acceptConnectionRequest.execute({
1163+ * const workflow = await linkedapi.acceptInvitation.execute({
1164+ * invitationType: "connect",
11581165 * personUrl: "https://www.linkedin.com/in/john-doe",
11591166 * });
11601167 *
1161- * await linkedapi.acceptConnectionRequest .result(workflow.workflowId);
1168+ * await linkedapi.acceptInvitation .result(workflow.workflowId);
11621169 * ```
11631170 */
1164- public acceptConnectionRequest : AcceptConnectionRequest ;
1171+ public acceptInvitation : AcceptInvitation ;
11651172
11661173 /**
1167- * Ignore an incoming connection request from a person's profile .
1174+ * Ignore an incoming connection, company-follow, or newsletter-subscription invitation .
11681175 *
1169- * @param params - Parameters including the person's profile URL
1176+ * @param params - Invitation type and its matching target URL
11701177 *
1171- * @see {@link https://linkedapi.io/docs/working-with-connection-requests / Working with Connection Requests Documentation }
1172- * @see {@link https://linkedapi.io/docs/action-st-ignore-connection-request / st.ignoreConnectionRequest Action Documentation }
1178+ * @see {@link https://linkedapi.io/docs/working-with-invitations / Working with Invitations Documentation }
1179+ * @see {@link https://linkedapi.io/docs/action-st-ignore-invitation / st.ignoreInvitation Action Documentation }
11731180 *
11741181 * @example
11751182 * ```typescript
1176- * const workflow = await linkedapi.ignoreConnectionRequest.execute({
1177- * personUrl: "https://www.linkedin.com/in/john-doe",
1183+ * const workflow = await linkedapi.ignoreInvitation.execute({
1184+ * invitationType: "newsletterSubscribe",
1185+ * newsletterUrl: "https://www.linkedin.com/newsletters/example-1234567890/",
11781186 * });
11791187 *
1180- * await linkedapi.ignoreConnectionRequest .result(workflow.workflowId);
1188+ * await linkedapi.ignoreInvitation .result(workflow.workflowId);
11811189 * ```
11821190 */
1183- public ignoreConnectionRequest : IgnoreConnectionRequest ;
1191+ public ignoreInvitation : IgnoreInvitation ;
11841192
11851193 /**
11861194 * Retrieve your LinkedIn connections with optional filtering.
0 commit comments